ok
Direktori : /home2/selectio/public_html/fms-worksuite/public/vendor/onesignal/ |
Current File : /home2/selectio/public_html/fms-worksuite/public/vendor/onesignal/OneSignalSDK.js.map |
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///../../OneSignal/OneSignal-Website-SDK/build/ts-to-es6/src/utils/OneSignalStub.js","webpack:///../../OneSignal/OneSignal-Website-SDK/build/ts-to-es6/src/libraries/Log.js","webpack:///../../OneSignal/OneSignal-Website-SDK/build/ts-to-es6/src/errors/OneSignalError.js","webpack:///../../OneSignal/OneSignal-Website-SDK/build/ts-to-es6/src/utils/ProcessOneSignalPushCalls.js","webpack:///../../OneSignal/OneSignal-Website-SDK/build/ts-to-es6/src/utils/OneSignalStubES5.js","webpack:///../../OneSignal/OneSignal-Website-SDK/build/ts-to-es6/src/utils/OneSignalStubES6.js","webpack:///../../OneSignal/OneSignal-Website-SDK/build/ts-to-es6/src/context/browser/utils/BrowserSupportsPush.js","webpack:///../../OneSignal/OneSignal-Website-SDK/build/ts-to-es6/src/utils/OneSignalShimLoader.js","webpack:///../../OneSignal/OneSignal-Website-SDK/build/ts-to-es6/src/entries/sdk.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","r","value","n","__esModule","object","property","prototype","hasOwnProperty","p","s","OneSignalStub","omitStubsFor","_this","this","VERSION","Number","log","setLevel","level","currentLogLevel","setupStubFunctions","FUNCTION_LIST_TO_STUB","stubFunction","FUNCTION_LIST_WITH_PROMISE_TO_STUB","stubPromiseFunction","stubList","functionName","indexOf","this_1","args","_i","arguments","length","stubList_1","Log","shouldLog","window","localStorage","getItem","toLowerCase","e","setItem","proxyMethodsCreated","undefined","createProxyMethods","methods","trace","info","warn","error","_a","keys","nativeMethod","nativeMethodExists","console","methodToMapTo","shouldMap","bind","OneSignalError","_super","message","writable","constructor","Error","captureStackTrace","stack","setPrototypeOf","__extends","OneSignalError_1","__importDefault","ProcessOneSignalPushCalls","processItem","oneSignalInstance","item","Array","isArray","default","shift","oneSignalFunction","toString","apply","OneSignalStub_1","ProcessOneSignalPushCalls_1","Log_1","OneSignalStubES5","stubOneSignal","getOwnPropertyNames","OneSignal","playPushes","isPushNotificationsSupported","isPushNotificationsEnabled","newPromiseIfDefined","resolve","push","_thisObj","_functionName","_args","_resolve","_reject","executor","Promise","toProcessArray","toProcessArray_1","OneSignalStubES6","preExistingArray","directFunctionCallsArray","thisObj","delayedPromise","promise","reject","isMacOSSafariInIframe","top","navigator","vendor","platform","PushSubscriptionOptions","safari","pushNotification","BrowserSupportsPush_1","OneSignalStubES6_1","OneSignalStubES5_1","OneSignalShimLoader","addScriptToPage","url","scriptElement","document","createElement","src","async","head","appendChild","getPathAndPrefix","isServiceWorkerRuntime","addOneSignalPageES6SDKStub","predefinedOneSignal","oneSignalIsArray","addOneSignalPageES5SDKStub","start","self","importScripts"],"mappings":"aACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAZ,EAAAmB,EAAA,SAAAjB,GACAY,OAAAC,eAAAb,EAAA,cAAiDkB,OAAA,KAIjDpB,EAAAqB,EAAA,SAAAlB,GACA,IAAAS,EAAAT,KAAAmB,WACA,WAA2B,OAAAnB,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAH,EAAAU,EAAAE,EAAA,IAAAA,GACAA,GAIAZ,EAAAa,EA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VA,wBAAwB7G,UAAUC,eAAe,yBAN7C6B,OAAOgF,aAAoD,IAAnChF,OAAOgF,OAAOC,kBAC1CP,KARR/H,EAAA+H,oICPA,IAAAQ,EAAAzI,EAAA,GACA0I,EAAA1I,EAAA,GACA2I,EAAA3I,EAAA,GAGA4I,EAAA,oBAAAA,KAkEA,OAhEWA,EAAAC,gBAAP,SAAuBC,GACnB,IAAMC,EAAgBC,SAASC,cAAc,UAC7CF,EAAcG,IAAMJ,EACpBC,EAAcI,OAAQ,EACtBH,SAASI,KAAKC,YAAYN,IAGvBH,EAAAU,iBAAP,WAeY,MAbiB,mCAgBtBV,EAAAW,uBAAP,WACI,MAA0B,oBAAXhG,QAEZqF,EAAAY,2BAAP,WACI,IAAMC,EAAsBlG,OAAOmD,UAC7BgD,EAAmB7D,MAAMC,QAAQ2D,IAEjCA,GAAwBC,EAS9BnG,OAAOmD,UAAY,IAAIgC,EAAAhB,iBAAiB+B,GARpChF,QAAQL,MAAM,+CAA+CsC,UAAS,0FACIA,YAW3EkC,EAAAe,2BAAP,WACIlF,QAAQtC,IAAI,mEACZ,IAAMsH,EAAsBlG,OAAOmD,UACnCnD,OAAOmD,UAAY,IAAIiC,EAAApC,iBAAiBkD,IAErCb,EAAAgB,MAAP,WAGQhB,EAAoBW,yBACpBM,KAAKC,cAAiBlB,EAAoBU,mBAAkB,2BAA2BV,EAAoB3G,SAEtGwG,EAAA7B,gCACLgC,EAAoBC,gBAAmBD,EAAoBU,mBAAkB,4BAA4BV,EAAoB3G,SAC7H2G,EAAoBY,8BAGpBZ,EAAoBe,8BAGhCf,EAlEA,GAAa1I,EAAA0I,sBAmEbA,EAAoB3G,QAAqDC,OAAO,uFC7DhFlC,EAAA,GACA4I,oBAAoBgB","file":"OneSignalSDK.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 8);\n","// NOTE: This is used with the OneSignalSDK.js shim\n// Careful if adding imports, ES5 targets can't clean up functions never called.\nexport class OneSignalStub {\n constructor(omitStubsFor) {\n this.VERSION = (typeof __VERSION__) === \"undefined\" ? 1 : Number(__VERSION__);\n this.log = {\n setLevel: (level) => {\n this.currentLogLevel = level;\n }\n };\n this.setupStubFunctions(OneSignalStub.FUNCTION_LIST_TO_STUB, this.stubFunction, omitStubsFor);\n this.setupStubFunctions(OneSignalStub.FUNCTION_LIST_WITH_PROMISE_TO_STUB, this.stubPromiseFunction, omitStubsFor);\n }\n setupStubFunctions(stubList, stubFunction, omitStubsFor) {\n for (const functionName of stubList) {\n if (omitStubsFor.indexOf(functionName) > -1)\n continue;\n const functionNameWithStub = (...args) => {\n return stubFunction(this, functionName, args);\n };\n Object.defineProperty(this, functionName, { value: functionNameWithStub });\n }\n }\n}\nOneSignalStub.FUNCTION_LIST_TO_STUB = [\n \"on\",\n \"off\",\n \"once\",\n \"push\"\n];\nOneSignalStub.FUNCTION_LIST_WITH_PROMISE_TO_STUB = [\n \"init\",\n \"_initHttp\",\n \"isPushNotificationsEnabled\",\n \"showHttpPrompt\",\n \"registerForPushNotifications\",\n \"setDefaultNotificationUrl\",\n \"setDefaultTitle\",\n \"syncHashedEmail\",\n \"getTags\",\n \"sendTag\",\n \"sendTags\",\n \"deleteTag\",\n \"deleteTags\",\n \"addListenerForNotificationOpened\",\n \"getIdsAvailable\",\n \"setSubscription\",\n \"showHttpPermissionRequest\",\n \"showNativePrompt\",\n \"showSlidedownPrompt\",\n \"showCategorySlidedown\",\n \"showSmsSlidedown\",\n \"showEmailSlidedown\",\n \"showSmsAndEmailSlidedown\",\n \"getNotificationPermission\",\n \"getUserId\",\n \"getRegistrationId\",\n \"getSubscription\",\n \"sendSelfNotification\",\n \"setEmail\",\n \"setSMSNumber\",\n \"logoutEmail\",\n \"logoutSMS\",\n \"setExternalUserId\",\n \"removeExternalUserId\",\n \"getExternalUserId\",\n \"provideUserConsent\",\n \"isOptedOut\",\n \"getEmailId\",\n \"getSMSId\",\n \"sendOutcome\"\n];\n//# sourceMappingURL=OneSignalStub.js.map","export default class Log {\n static shouldLog() {\n try {\n if (typeof window === \"undefined\" ||\n typeof window.localStorage === \"undefined\") {\n return false;\n }\n const level = window.localStorage.getItem(\"loglevel\");\n if (level && level.toLowerCase() === \"trace\") {\n return true;\n }\n else {\n return false;\n }\n }\n catch (e) {\n /* LocalStorage may not be accessible on browser profiles that restrict 3rd party cookies */\n return false;\n }\n }\n static setLevel(level) {\n if (typeof window === \"undefined\" ||\n typeof window.localStorage === \"undefined\") {\n return;\n }\n try {\n window.localStorage.setItem(\"loglevel\", level);\n Log.proxyMethodsCreated = undefined;\n Log.createProxyMethods();\n }\n catch (e) {\n /* LocalStorage may not be accessible on browser profiles that restrict 3rd party cookies */\n return;\n }\n }\n static createProxyMethods() {\n if (typeof Log.proxyMethodsCreated !== \"undefined\") {\n return;\n }\n else {\n Log.proxyMethodsCreated = true;\n }\n const methods = {\n log: \"debug\",\n trace: \"trace\",\n info: \"info\",\n warn: \"warn\",\n error: \"error\"\n };\n for (const nativeMethod of Object.keys(methods)) {\n const nativeMethodExists = typeof console[nativeMethod] !== \"undefined\";\n const methodToMapTo = methods[nativeMethod];\n const shouldMap = nativeMethodExists &&\n ((typeof __LOGGING__ !== \"undefined\" && __LOGGING__ === true) ||\n (Log.shouldLog()) ||\n methodToMapTo === \"error\");\n if (shouldMap) {\n Log[methodToMapTo] = console[nativeMethod].bind(console);\n }\n else {\n Log[methodToMapTo] = function () { };\n }\n }\n }\n}\nLog.createProxyMethods();\n//# sourceMappingURL=Log.js.map","export default class OneSignalError extends Error {\n constructor(message = '') {\n super(message);\n // extending Error is weird and does not propagate `message`\n Object.defineProperty(this, 'message', {\n configurable: true,\n enumerable: false,\n value: message,\n writable: true,\n });\n Object.defineProperty(this, 'name', {\n configurable: true,\n enumerable: false,\n value: this.constructor.name,\n writable: true,\n });\n if (Error.hasOwnProperty('captureStackTrace')) {\n Error.captureStackTrace(this, this.constructor);\n return;\n }\n Object.defineProperty(this, 'stack', {\n configurable: true,\n enumerable: false,\n value: (new Error(message)).stack,\n writable: true,\n });\n /**\n * Important! Required to make sure the correct error type is detected during instanceof checks.\n * Same applies to all derived classes.\n * https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work\n */\n Object.setPrototypeOf(this, OneSignalError.prototype);\n }\n}\n//# sourceMappingURL=OneSignalError.js.map","import OneSignalError from \"../errors/OneSignalError\";\nexport class ProcessOneSignalPushCalls {\n static processItem(oneSignalInstance, item) {\n if (typeof (item) === \"function\")\n item();\n else if (Array.isArray(item)) {\n if (item.length == 0)\n throw new OneSignalError(\"Empty array is not valid!\");\n const functionName = item.shift();\n if (functionName == null || typeof (functionName) === \"undefined\")\n throw new OneSignalError(\"First element in array must be the OneSignal function name\");\n const oneSignalFunction = oneSignalInstance[functionName.toString()];\n if (typeof (oneSignalFunction) !== \"function\")\n throw new OneSignalError(`No OneSignal function with the name '${functionName}'`);\n oneSignalFunction.apply(oneSignalInstance, item);\n }\n else\n throw new OneSignalError(\"Only accepts function and Array types!\");\n }\n}\n//# sourceMappingURL=ProcessOneSignalPushCalls.js.map","// NOTE: This is used with the OneSignalSDK.js shim\n// Careful if adding imports, ES5 targets can't clean up functions never called.\nimport { OneSignalStub } from \"./OneSignalStub\";\nimport { ProcessOneSignalPushCalls } from \"./ProcessOneSignalPushCalls\";\nimport Log from \"../libraries/Log\";\nexport class OneSignalStubES5 extends OneSignalStub {\n constructor(stubOneSignal) {\n super(Object.getOwnPropertyNames(OneSignalStubES5.prototype));\n window.OneSignal = this;\n this.playPushes(stubOneSignal);\n }\n // @Override\n isPushNotificationsSupported() {\n return false;\n }\n // @Override\n isPushNotificationsEnabled() {\n return OneSignalStubES5.newPromiseIfDefined((resolve) => { resolve(false); });\n }\n // Implementation here so the passed in function is run and does not get dropped.\n // @Override\n push(item) {\n ProcessOneSignalPushCalls.processItem(this, item);\n }\n // By default do nothing unless the function is listed above.\n // @Override\n stubFunction(_thisObj, _functionName, _args) { }\n // Never resolve promises as no logic will be run from this ES5 stub for them.\n // @Override\n stubPromiseFunction(_thisObj, _functionName, _args) {\n return OneSignalStubES5.newPromiseIfDefined((_resolve, _reject) => { });\n }\n // Safely does NOT create a Promise if running on old ES5 browsers and it wasn't polyfilled.\n static newPromiseIfDefined(executor) {\n if (typeof (Promise) === \"undefined\")\n return undefined;\n else\n return new Promise(executor);\n }\n playPushes(toProcessArray) {\n if (!toProcessArray)\n return;\n for (const item of toProcessArray) {\n try {\n this.push(item);\n }\n catch (e) {\n Log.error(e);\n }\n }\n }\n}\n//# sourceMappingURL=OneSignalStubES5.js.map","// NOTE: This is used with the OneSignalSDK.js shim\n// Careful if adding imports, ES5 targets can't clean up functions never called.\nimport { OneSignalStub } from \"./OneSignalStub\";\nexport class OneSignalStubES6 extends OneSignalStub {\n constructor(preExistingArray) {\n super(Object.getOwnPropertyNames(OneSignalStubES6.prototype));\n // This array will contain calls made on windows.OneSignal (w/ push or direct method calls)\n // AFTER OneSignalSDK.js was loaded, BUT before OneSignalPageSDKES6.js was loaded.\n this.directFunctionCallsArray = new Array();\n this.preExistingArray = preExistingArray;\n }\n // @Override\n isPushNotificationsSupported() {\n return true;\n }\n // @Override\n // Save function name and params to be called later when the full SDK loads\n stubFunction(thisObj, functionName, args) {\n thisObj.directFunctionCallsArray.push({ functionName, args, delayedPromise: undefined });\n }\n // @Override\n // Save function name, params, and a delayed Promise to be called later when the full SDK loads\n stubPromiseFunction(thisObj, functionName, args) {\n let delayedPromise = undefined;\n const promise = new Promise((resolve, reject) => {\n delayedPromise = { resolve, reject };\n });\n thisObj.directFunctionCallsArray.push({ functionName, delayedPromise, args });\n return promise;\n }\n}\n//# sourceMappingURL=OneSignalStubES6.js.map","// This is used by the OneSignalSDK.js shim\n// DO NOT add other imports since it is an ES5 target and dead code imports can't be clean up.\n// Checks if the browser supports push notifications by checking if specific\n// classes and properties on them exist\nexport function isPushNotificationsSupported() {\n return supportsVapidPush() || supportsSafariPush();\n}\nexport function isMacOSSafariInIframe() {\n // Fallback detection for Safari on macOS in an iframe context\n return window.top !== window && // isContextIframe\n navigator.vendor === \"Apple Computer, Inc.\" && // isSafari\n navigator.platform === \"MacIntel\"; // isMacOS\n}\nfunction supportsSafariPush() {\n return (window.safari && typeof window.safari.pushNotification !== \"undefined\") ||\n isMacOSSafariInIframe();\n}\n// Does the browser support the standard Push API\nfunction supportsVapidPush() {\n return typeof PushSubscriptionOptions !== \"undefined\" &&\n PushSubscriptionOptions.prototype.hasOwnProperty(\"applicationServerKey\");\n}\n/* Notes on browser results which lead the logic of the functions above */\n// Safari\n// macOS - typeof safari.pushNotification == \"object\"\n// - iframe context - typeof safari == \"undefined\"\n// iOS - typeof safari == \"undefined\"\n// Chrome\n// HTTP & HTTPS - typeof PushSubscriptionOptions == \"function\"\n// HTTP - navigator.serviceWorker == \"undefined\"\n// Firefox\n// Normal - typeof PushSubscriptionOptions == \"function\"\n// HTTP & HTTPS - typeof PushSubscriptionOptions == \"function\"\n// ESR - typeof PushSubscriptionOptions == \"undefined\"\n//# sourceMappingURL=BrowserSupportsPush.js.map","import { isPushNotificationsSupported } from \"../context/browser/utils/BrowserSupportsPush\";\nimport { OneSignalStubES6 } from \"./OneSignalStubES6\";\nimport { OneSignalStubES5 } from \"./OneSignalStubES5\";\n// NOTE: Careful if adding imports, ES5 targets can't clean up functions never called.\n// See sdk.ts for what entry points this handles\nexport class OneSignalShimLoader {\n // NOTE: scripts added won't start executing until\n static addScriptToPage(url) {\n const scriptElement = document.createElement('script');\n scriptElement.src = url;\n scriptElement.async = true;\n document.head.appendChild(scriptElement);\n }\n // Same logic from SdkEnvironment\n static getPathAndPrefix() {\n const buildOrigin = (typeof __BUILD_ORIGIN__ !== \"undefined\") ? __BUILD_ORIGIN__ || \"localhost\" : \"localhost\";\n const productionOrigin = \"https://cdn.onesignal.com/sdks/\";\n if (typeof __BUILD_TYPE__ === \"undefined\") {\n return productionOrigin;\n }\n const isHttps = (typeof __IS_HTTPS__ !== \"undefined\") ? __IS_HTTPS__ : true;\n const protocol = isHttps ? \"https\" : \"http\";\n const port = isHttps ? 4001 : 4000;\n switch (__BUILD_TYPE__) {\n case \"development\":\n return `${protocol}://${buildOrigin}:${port}/sdks/Dev-`;\n case \"staging\":\n return `https://${buildOrigin}/sdks/Staging-`;\n default:\n return productionOrigin;\n }\n }\n static isServiceWorkerRuntime() {\n return (typeof window === \"undefined\");\n }\n static addOneSignalPageES6SDKStub() {\n const predefinedOneSignal = window.OneSignal;\n const oneSignalIsArray = Array.isArray(predefinedOneSignal);\n // Do NOT replace window.OneSignal if it's something else other than an Array.\n if (!!predefinedOneSignal && !oneSignalIsArray) {\n console.error(`window.OneSignal already defined as '${typeof OneSignal}'!\n Please make sure to define as 'window.OneSignal = window.OneSignal || [];'`, OneSignal);\n return;\n }\n // Stub out all OneSignal functions with an implementation that save all params.\n // OneSignalPageSDKES6.js will load soon and the function calls will be replayed from pageSdkInit.ts\n // This is done regardless if document.currentScript.async is true as window.OneSignal needs to be available\n // for those who use script.onload = function() { } to add OneSignalSDK.js\n window.OneSignal = new OneSignalStubES6(predefinedOneSignal);\n }\n // Stub out all functions with default values.\n // OneSignalStubES5 class is bundled into the production OneSignalSDK.js so other .js files are loaded.\n static addOneSignalPageES5SDKStub() {\n console.log(\"OneSignal: Using fallback ES5 Stub for backwards compatibility.\");\n const predefinedOneSignal = window.OneSignal;\n window.OneSignal = new OneSignalStubES5(predefinedOneSignal);\n }\n static start() {\n // Check if someone setup OneSignal before we instructed them to use \"OneSignalSDKWorker.js\"\n // instead of \"OneSignal.js\" for importScripts();\n if (OneSignalShimLoader.isServiceWorkerRuntime()) {\n self.importScripts(`${OneSignalShimLoader.getPathAndPrefix()}OneSignalSDKWorker.js?v=${OneSignalShimLoader.VERSION}`);\n }\n else if (isPushNotificationsSupported()) {\n OneSignalShimLoader.addScriptToPage(`${OneSignalShimLoader.getPathAndPrefix()}OneSignalPageSDKES6.js?v=${OneSignalShimLoader.VERSION}`);\n OneSignalShimLoader.addOneSignalPageES6SDKStub();\n }\n else {\n OneSignalShimLoader.addOneSignalPageES5SDKStub();\n }\n }\n}\nOneSignalShimLoader.VERSION = (typeof __VERSION__) === \"undefined\" ? 1 : Number(__VERSION__);\n//# sourceMappingURL=OneSignalShimLoader.js.map","/**\n * This is OneSignalSDK.js (ES5)\n * * This is an entry point for pages and older service workers.\n * - Developers are now instructed to use OneSignalSDKWorker.js directly for service workers\n * * Also we define a ES5 Stub for OneSignal for browsers that do not support push.\n * This is a shim to detect and load either;\n * * ServiceWorkerSDK (ES6) - OneSignalSDKWorker.js\n * * PageSDK (ES6) - OneSignalPageSDKES6.js\n * * Stub-PageSDK (ES5) - OneSignalSDK.js (This File)\n */\n// NOTE: Careful if adding imports, ES5 targets can't clean up functions never called.\nimport { OneSignalShimLoader } from \"../utils/OneSignalShimLoader\";\nOneSignalShimLoader.start();\n//# sourceMappingURL=sdk.js.map"],"sourceRoot":""}