UNPKG

one

Version:

One is a React framework for web, iOS, and Android apps.

48 lines (47 loc) • 1.72 kB
var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var device_exports = {}; __export(device_exports, { Device: () => Device }); module.exports = __toCommonJS(device_exports); var import_unavailable = require("./unavailable.cjs"); const Device = Object.freeze({ getInfo: async () => { if (typeof window === "undefined") return import_unavailable.Device.getInfo(); return { model: "", systemName: navigator.platform, systemVersion: "", interfaceIdiom: "unspecified", isSimulator: false }; }, getLocalizationInfo: async () => { if (typeof window === "undefined") return import_unavailable.Device.getLocalizationInfo(); const options = new Intl.DateTimeFormat(navigator.language).resolvedOptions(); return { localeIdentifier: options.locale, preferredLanguages: [...navigator.languages], calendarIdentifier: options.calendar, timeZoneIdentifier: options.timeZone, timeZoneOffsetSeconds: -(/* @__PURE__ */ new Date()).getTimezoneOffset() * 60 }; } });