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,GAAmBtG,OAAOC,iBAAiB,ECjBtE0G,KACAjF,KAEA,SAASiF,KACDC,QAAS7C,SAASU,cAAsC,gBAC9D,GAAImC,EACE,UAAOA,EAAOC,uBAA2B,IAAa,CACxD,MAAMC,EAAyB,UACzB,IACKC,sBAAoB,sBAAuBD,GAClDF,EAAOC,uBAAuBtG,UACvBnS,EAAO,CACd+U,GAAc,kDAAmD/U,GAErE,EAEQ4Y,oBAAiB,sBAAuBF,EAAwB,CAAEG,KAAM,GAAK,MAEjF,KACFL,EAAOC,uBAAuBtG,UACvBnS,EAAO,CACd+U,GAAc,kDAAmD/U,GAIzE,CAEA4R,OAAOO,YAAcA,GAErB,GAAIA,GAAY0F,eAAgB,CAC9B,MAAMzC,EAAYxD,OAAOkH,wBAAwBC,QAAQC,uBAA4B,cACrF9C,GAAgBd,GACI/B,KACRX,gBAAe,EAC3BuG,GAAA,yCAAAC,CAAA,eAAO,oBAAqBhZ,qFAAK,CAAC,CAAEgZ,8BAA0B,CAC5DA,IACF,CACF,MAC6B/G,GAAYgH,sBAAqB,GAEtC9F,KACRrT,MAAM,gDAAiDmS,GAAYgH,uBAAqB,EACpGvC,MAEAzE,GAAY4F,qBAAoB","names":["s","n","a","d","e","p","o","c","l","t","y","r","f","u","b","i","E","m","M","T","v","x","S","g","h","k","I","module","require","_dereq_","exports","global","Mutation","scheduleDrain","called","observer","nextTick","element","channel","scriptEl","draining","queue","oldQueue","len","immediate","task","INTERNAL","handlers","REJECTED","FULFILLED","PENDING","Promise","resolver","safelyResolveThenable","onRejected","onFulfilled","promise","unwrap","QueueItem","value","func","returnValue","self","result","tryCatch","getThen","thenable","error","obj","then","onError","onSuccess","tryToUnwrap","out","resolve","reject","reason","all","iterable","values","resolved","allResolver","resolveFromAll","outValue","race","response","_typeof","_classCallCheck","instance","Constructor","getIDB","idb","isIndexedDBValid","isSafari","hasFetch","createBlob","parts","properties","Builder","builder","Promise$1","executeCallback","callback","executeTwoCallbacks","errorCallback","normalizeKey","key","getCallback","DETECT_BLOB_SUPPORT_STORE","supportsBlobs","dbContexts","toString","READ_ONLY","READ_WRITE","_binStringToArrayBuffer","bin","length","buf","arr","_checkBlobSupportWithoutCaching","txn","blob","matchedChrome","matchedEdge","_checkBlobSupport","_deferReadiness","dbInfo","dbContext","deferredOperation","_advanceReadiness","_rejectReadiness","err","_getConnection","upgradeNeeded","createDbContext","dbArgs","openreq","db","ex","_getOriginalConnection","_getUpgradedConnection","_isUpgradeNeeded","defaultVersion","isNewStore","isDowngrade","isUpgrade","incVersion","_encodeBlob","reader","base64","_decodeBlob","encodedBlob","arrayBuff","_isEncodedBlob","_fullyReady","_tryReconnect","forages","forage","createTransaction","mode","retries","tx","_initStorage","options","initPromises","ignoreErrors","j","getItem","transaction","store","req","iterate","iterator","iterationNumber","cursor","setItem","blobSupport","removeItem","clear","advanced","keys","dropInstance","currentConfig","isCurrentDb","dbPromise","newVersion","dropObjectPromise","_forage2","dropDBPromise","_forage","asyncStorage","isWebSQLValid","BASE_CHARS","BLOB_TYPE_PREFIX","BLOB_TYPE_PREFIX_REGEX","SERIALIZED_MARKER","SERIALIZED_MARKER_LENGTH","TYPE_ARRAYBUFFER","TYPE_BLOB","TYPE_INT8ARRAY","TYPE_UINT8ARRAY","TYPE_UINT8CLAMPEDARRAY","TYPE_INT16ARRAY","TYPE_INT32ARRAY","TYPE_UINT16ARRAY","TYPE_UINT32ARRAY","TYPE_FLOAT32ARRAY","TYPE_FLOAT64ARRAY","TYPE_SERIALIZED_MARKER_LENGTH","toString$1","stringToBuffer","serializedString","bufferLength","encoded1","encoded2","encoded3","encoded4","buffer","bytes","bufferToString","base64String","serialize","valueType","marker","fileReader","str","deserialize","type","blobType","matcher","localforageSerializer","createDbTable","_initStorage$1","dbInfoPromise","tryExecuteSql","sqlStatement","args","results","getItem$1","iterate$1","rows","item","_setItem","retriesLeft","originalValue","sqlError","setItem$1","removeItem$1","clear$1","length$1","key$1","keys$1","getAllStoreNames","storeNames","dropInstance$1","operationInfo","dropTable","storeName","operations","webSQLStorage","isLocalStorageValid","_getKeyPrefix","defaultConfig","keyPrefix","checkIfLocalStorageThrows","localStorageTestKey","_isLocalStorageUsable","_initStorage$2","clear$2","getItem$2","iterate$2","keyPrefixLength","key$2","keys$2","itemKey","length$2","removeItem$2","setItem$2","dropInstance$2","localStorageWrapper","sameValue","includes","array","searchElement","isArray","arg","DefinedDrivers","DriverSupport","DefaultDrivers","DefaultDriverOrder","OptionalDriverMethods","LibraryMethods","DefaultConfig","callWhenReady","localForageInstance","libraryMethod","_args","extend","_key","LocalForage","driverTypeKey","driver","driverName","driverObject","complianceError","driverMethods","driverMethodName","isRequired","configureMissingMethods","methodNotImplementedFactory","methodName","_i","_len","optionalDriverMethod","setDriverSupport","support","getDriverPromise","serializerPromise","drivers","supportedDrivers","setDriverToConfig","extendSelfWithDriver","initDriver","currentDriverIndex","driverPromiseLoop","oldDriverSetDone","libraryMethodsAndProperties","localforage_js","R","getRandomValues","rnds8","rng","REGEX","validate","uuid","byteToHex","stringify","offset","v4","rnds","L","front","endpoint","batchIntervalInMillis","FrontLogger","logger","constructor","config","logBuilder","LogBuilder","isDefined","window","sgmeConfiguration","enableServerLogs","url","spBridgeHost","prefix","setAuthTokenFactory","sgwtConnect","getAuthorizationHeader","undefined","setApplicationHeader","EnvName","enableConsole","build","startLogSession","resumeServerLogs","message","parameters","logError","warn","logWarning","info","logInformation","frontLogger","baseConfig","getFrontLogger","tryToLogContentSecurityViolationsForDebuggingPurpose","ReportingObserver","reports","forEach","body","toJSON","buffered","observe","B","O","G","A","C","w","F","D","P","_","Q","W","X","N","U","z","V","logFrontError","messageTemplate","unminifyError","defaultVariation","generateSgbsUrls","variation","cdnUrl","getCdnUrl","sgbs","aggrid","shepherd","updateThemeUrls","document","classList","remove","add","entries","id","appendUniqueLinkToDocument","initSgBootstrap","updateTheme","linkElement","querySelector","href","newLinkElement","createElement","rel","head","appendChild","redirectToRequestAccessPage","unauthorizedUrl","alreadyContainsARedirectUrl","endsWith","errorPageUrl","location","replace","extractFakeSsoFromQueryString","queryString","lowerCaseQueryString","toLowerCase","fakeSsoQueryString","split","pop","user","shift","mockedSgConnect","isAuthorized","on","requestAuthorization","getIdTokenClaims","sub","bootstrapSgConnect","Error","disableSgConnect","setupSGWTConnect","sgConnect","setupSgwtConnectWidget","widget","setSgwtConnectInstance","handleSgwtConnectReady","removeEventListener","addEventListener","once","SGWTWidgetConfiguration","context","getSgDesignSystemTheme","__vitePreload","onSgConnectAuthenticated","getAuthorizationError"],"ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,18],"sources":["../../../node_modules/.pnpm/@sgme+fp@3.4.4/node_modules/@sgme/fp/lib/predicates.js","../../../node_modules/.pnpm/@sgme+logger@5.3.4/node_modules/@sgme/logger/lib/configuration/configuration.js","../../../node_modules/.pnpm/@sgme+logger@5.3.4/node_modules/@sgme/logger/lib/output/server/post.js","../../../node_modules/.pnpm/@sgme+logger@5.3.4/node_modules/@sgme/logger/lib/output/server/server-log-scheduler.js","../../../node_modules/.pnpm/localforage@1.10.0/node_modules/localforage/dist/localforage.js","../../../node_modules/.pnpm/@sgme+logger@5.3.4/node_modules/@sgme/logger/lib/output/server/storage/storage-strategy.js","../../../node_modules/.pnpm/@sgme+logger@5.3.4/node_modules/@sgme/logger/lib/output/server/storage/browser-storage.js","../../../node_modules/.pnpm/@sgme+logger@5.3.4/node_modules/@sgme/logger/lib/input/log-event.js","../../../node_modules/.pnpm/@sgme+logger@5.3.4/node_modules/@sgme/logger/lib/output/create-console-logger.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/rng.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/regex.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/validate.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/stringify.js","../../../node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/v4.js","../../../node_modules/.pnpm/@sgme+logger@5.3.4/node_modules/@sgme/logger/lib/builder/log-builder.js","../../../src/configuration/loggers/front.ts","../../../src/utils/loggers/FrontLogger.ts","../../../src/bootstrapper/reportCsp.ts","../../../node_modules/.pnpm/@sgme+stacktrace@0.2.4/node_modules/@sgme/stacktrace/dist/unminify-stacktrace.js","../../../src/utils/errors/logFrontError.ts","../../../src/utils/theming.ts","../../../src/utils/url.ts","../../../src/api/connect.ts","../../../src/index.ts"],"sourcesContent":["function s(n) {\n return n != null;\n}\nfunction a(n) {\n return n == null;\n}\nfunction d(n) {\n return function(e) {\n return e?.[n] != null;\n };\n}\nfunction p(n) {\n return typeof n == \"string\";\n}\nfunction o(n) {\n return n == null || n.length === 0;\n}\nconst m = o;\nfunction c(n) {\n return n != null && n.length > 0;\n}\nconst k = c;\nfunction l(n) {\n if (n == null)\n return !0;\n for (const t in n)\n return !1;\n return !0;\n}\nfunction y(n) {\n return !l(n);\n}\nfunction r(n) {\n const t = {};\n for (const e of n)\n t[e] = !0;\n return t;\n}\nfunction f(n) {\n const t = r(n);\n return function(u) {\n return (u != null && t[u]) ?? !1;\n };\n}\nfunction b(n, t) {\n const e = r(t);\n return function(i) {\n return e[i[n]] ?? !1;\n };\n}\nconst D = f;\nfunction E(n) {\n return function(e) {\n return !n(e);\n };\n}\nexport {\n d as hasDefinedValue,\n s as isDefined,\n k as isDefinedAndNonEmpty,\n o as isEmpty,\n l as isEmptyObject,\n m as isEmptyOrNotDefined,\n c as isNonEmpty,\n y as isNonEmptyObject,\n a as isNotDefined,\n p as isString,\n b as makeDiscriminatedUnionPredicate,\n D as makeUnionLitteralPredicate,\n f as makeValuesPredicate,\n E as not\n};\n","const e = {\n defaultInterval: 5e3,\n range: {\n min: 500,\n max: 2e4\n },\n batchSize: 10,\n retryPolicy: \"dropOnFail\"\n}, a = {\n console: { enabled: !1 },\n authTokenFactory: void 0,\n serverLogConf: {\n enabled: !1\n },\n applicationHeaderFactory: void 0\n};\nexport {\n a as DefaultConfiguration,\n e as DefaultSchedulerConfiguration\n};\n","async function a(t, r, n, o, e) {\n return e(t, {\n method: \"post\",\n headers: f(n, o),\n body: c(r)\n });\n}\nfunction c(t) {\n return JSON.stringify(t, s());\n}\nfunction s() {\n const t = /* @__PURE__ */ new WeakSet();\n return (r, n) => {\n if (n instanceof Error) {\n const o = {};\n return Object.getOwnPropertyNames(n).forEach((e) => {\n const i = n[e];\n typeof i != \"function\" && (o[e] = i);\n }), o;\n } else if (typeof n == \"object\" && n !== null) {\n if (t.has(n))\n return \"\";\n t.add(n);\n }\n return n;\n };\n}\nfunction f(t, r) {\n const n = t?.(), o = r?.(), e = {};\n return n !== void 0 && (e.Authorization = n), o !== void 0 && (e.Application = o), e[\"Content-Type\"] = \"application/json\", e;\n}\nexport {\n s as makeReplacer,\n a as post\n};\n","import { DefaultSchedulerConfiguration as v } from \"../../configuration/configuration.js\";\nimport { post as S } from \"./post.js\";\nconst m = 2, b = {\n keys: [],\n values: []\n};\nfunction M({ url: t, prefix: n, scheduler: a }, o, p, T, d = globalThis.fetch?.bind(globalThis)) {\n const s = a ?? v;\n let i = s.defaultInterval, r, l = !1;\n async function y() {\n const c = await o?.batchGet(s.batchSize) ?? b;\n let e = c.keys.length;\n if (e > 0) {\n const u = x(n, c);\n try {\n (await S(t ?? \"api/log\", u, p, T, d)).ok || (e = 0);\n } catch {\n e = 0;\n }\n }\n (s.retryPolicy === \"dropOnFail\" || e > 0) && await o?.batchRemove(c.keys), g(e), h();\n }\n function g(c) {\n const { min: e, max: u } = s.range, k = c < s.batchSize ? i * m : i / m;\n i = I(k, e, u);\n }\n function h() {\n r = setTimeout(y, i);\n }\n return {\n isRunning() {\n return l;\n },\n suspend() {\n l && (l = !1, clearTimeout(r));\n },\n resume() {\n l || (l = !0, h());\n }\n };\n}\nfunction x(t, n) {\n return t == null ? n.values : n.values.map((a) => ({\n ...a,\n messageTemplate: t + a.messageTemplate\n }));\n}\nfunction I(t, n, a) {\n return Math.max(n, Math.min(t, a));\n}\nexport {\n M as makeScheduler\n};\n","/*!\n localForage -- Offline Storage, Improved\n Version 1.10.0\n https://localforage.github.io/localForage\n (c) 2013-2017 Mozilla, Apache License 2.0\n*/\n(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.localforage = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw (f.code=\"MODULE_NOT_FOUND\", f)}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o element; its readystatechange event will be fired asynchronously once it is inserted\n // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.\n var scriptEl = global.document.createElement('script');\n scriptEl.onreadystatechange = function () {\n nextTick();\n\n scriptEl.onreadystatechange = null;\n scriptEl.parentNode.removeChild(scriptEl);\n scriptEl = null;\n };\n global.document.documentElement.appendChild(scriptEl);\n };\n } else {\n scheduleDrain = function () {\n setTimeout(nextTick, 0);\n };\n }\n}\n\nvar draining;\nvar queue = [];\n//named nextTick for less confusing stack traces\nfunction nextTick() {\n draining = true;\n var i, oldQueue;\n var len = queue.length;\n while (len) {\n oldQueue = queue;\n queue = [];\n i = -1;\n while (++i < len) {\n oldQueue[i]();\n }\n len = queue.length;\n }\n draining = false;\n}\n\nmodule.exports = immediate;\nfunction immediate(task) {\n if (queue.push(task) === 1 && !draining) {\n scheduleDrain();\n }\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{}],2:[function(_dereq_,module,exports){\n'use strict';\nvar immediate = _dereq_(1);\n\n/* istanbul ignore next */\nfunction INTERNAL() {}\n\nvar handlers = {};\n\nvar REJECTED = ['REJECTED'];\nvar FULFILLED = ['FULFILLED'];\nvar PENDING = ['PENDING'];\n\nmodule.exports = Promise;\n\nfunction Promise(resolver) {\n if (typeof resolver !== 'function') {\n throw new TypeError('resolver must be a function');\n }\n this.state = PENDING;\n this.queue = [];\n this.outcome = void 0;\n if (resolver !== INTERNAL) {\n safelyResolveThenable(this, resolver);\n }\n}\n\nPromise.prototype[\"catch\"] = function (onRejected) {\n return this.then(null, onRejected);\n};\nPromise.prototype.then = function (onFulfilled, onRejected) {\n if (typeof onFulfilled !== 'function' && this.state === FULFILLED ||\n typeof onRejected !== 'function' && this.state === REJECTED) {\n return this;\n }\n var promise = new this.constructor(INTERNAL);\n if (this.state !== PENDING) {\n var resolver = this.state === FULFILLED ? onFulfilled : onRejected;\n unwrap(promise, resolver, this.outcome);\n } else {\n this.queue.push(new QueueItem(promise, onFulfilled, onRejected));\n }\n\n return promise;\n};\nfunction QueueItem(promise, onFulfilled, onRejected) {\n this.promise = promise;\n if (typeof onFulfilled === 'function') {\n this.onFulfilled = onFulfilled;\n this.callFulfilled = this.otherCallFulfilled;\n }\n if (typeof onRejected === 'function') {\n this.onRejected = onRejected;\n this.callRejected = this.otherCallRejected;\n }\n}\nQueueItem.prototype.callFulfilled = function (value) {\n handlers.resolve(this.promise, value);\n};\nQueueItem.prototype.otherCallFulfilled = function (value) {\n unwrap(this.promise, this.onFulfilled, value);\n};\nQueueItem.prototype.callRejected = function (value) {\n handlers.reject(this.promise, value);\n};\nQueueItem.prototype.otherCallRejected = function (value) {\n unwrap(this.promise, this.onRejected, value);\n};\n\nfunction unwrap(promise, func, value) {\n immediate(function () {\n var returnValue;\n try {\n returnValue = func(value);\n } catch (e) {\n return handlers.reject(promise, e);\n }\n if (returnValue === promise) {\n handlers.reject(promise, new TypeError('Cannot resolve promise with itself'));\n } else {\n handlers.resolve(promise, returnValue);\n }\n });\n}\n\nhandlers.resolve = function (self, value) {\n var result = tryCatch(getThen, value);\n if (result.status === 'error') {\n return handlers.reject(self, result.value);\n }\n var thenable = result.value;\n\n if (thenable) {\n safelyResolveThenable(self, thenable);\n } else {\n self.state = FULFILLED;\n self.outcome = value;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callFulfilled(value);\n }\n }\n return self;\n};\nhandlers.reject = function (self, error) {\n self.state = REJECTED;\n self.outcome = error;\n var i = -1;\n var len = self.queue.length;\n while (++i < len) {\n self.queue[i].callRejected(error);\n }\n return self;\n};\n\nfunction getThen(obj) {\n // Make sure we only access the accessor once as required by the spec\n var then = obj && obj.then;\n if (obj && (typeof obj === 'object' || typeof obj === 'function') && typeof then === 'function') {\n return function appyThen() {\n then.apply(obj, arguments);\n };\n }\n}\n\nfunction safelyResolveThenable(self, thenable) {\n // Either fulfill, reject or reject with error\n var called = false;\n function onError(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.reject(self, value);\n }\n\n function onSuccess(value) {\n if (called) {\n return;\n }\n called = true;\n handlers.resolve(self, value);\n }\n\n function tryToUnwrap() {\n thenable(onSuccess, onError);\n }\n\n var result = tryCatch(tryToUnwrap);\n if (result.status === 'error') {\n onError(result.value);\n }\n}\n\nfunction tryCatch(func, value) {\n var out = {};\n try {\n out.value = func(value);\n out.status = 'success';\n } catch (e) {\n out.status = 'error';\n out.value = e;\n }\n return out;\n}\n\nPromise.resolve = resolve;\nfunction resolve(value) {\n if (value instanceof this) {\n return value;\n }\n return handlers.resolve(new this(INTERNAL), value);\n}\n\nPromise.reject = reject;\nfunction reject(reason) {\n var promise = new this(INTERNAL);\n return handlers.reject(promise, reason);\n}\n\nPromise.all = all;\nfunction all(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var values = new Array(len);\n var resolved = 0;\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n allResolver(iterable[i], i);\n }\n return promise;\n function allResolver(value, i) {\n self.resolve(value).then(resolveFromAll, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n function resolveFromAll(outValue) {\n values[i] = outValue;\n if (++resolved === len && !called) {\n called = true;\n handlers.resolve(promise, values);\n }\n }\n }\n}\n\nPromise.race = race;\nfunction race(iterable) {\n var self = this;\n if (Object.prototype.toString.call(iterable) !== '[object Array]') {\n return this.reject(new TypeError('must be an array'));\n }\n\n var len = iterable.length;\n var called = false;\n if (!len) {\n return this.resolve([]);\n }\n\n var i = -1;\n var promise = new this(INTERNAL);\n\n while (++i < len) {\n resolver(iterable[i]);\n }\n return promise;\n function resolver(value) {\n self.resolve(value).then(function (response) {\n if (!called) {\n called = true;\n handlers.resolve(promise, response);\n }\n }, function (error) {\n if (!called) {\n called = true;\n handlers.reject(promise, error);\n }\n });\n }\n}\n\n},{\"1\":1}],3:[function(_dereq_,module,exports){\n(function (global){\n'use strict';\nif (typeof global.Promise !== 'function') {\n global.Promise = _dereq_(2);\n}\n\n}).call(this,typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : {})\n},{\"2\":2}],4:[function(_dereq_,module,exports){\n'use strict';\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction getIDB() {\n /* global indexedDB,webkitIndexedDB,mozIndexedDB,OIndexedDB,msIndexedDB */\n try {\n if (typeof indexedDB !== 'undefined') {\n return indexedDB;\n }\n if (typeof webkitIndexedDB !== 'undefined') {\n return webkitIndexedDB;\n }\n if (typeof mozIndexedDB !== 'undefined') {\n return mozIndexedDB;\n }\n if (typeof OIndexedDB !== 'undefined') {\n return OIndexedDB;\n }\n if (typeof msIndexedDB !== 'undefined') {\n return msIndexedDB;\n }\n } catch (e) {\n return;\n }\n}\n\nvar idb = getIDB();\n\nfunction isIndexedDBValid() {\n try {\n // Initialize IndexedDB; fall back to vendor-prefixed versions\n // if needed.\n if (!idb || !idb.open) {\n return false;\n }\n // We mimic PouchDB here;\n //\n // We test for openDatabase because IE Mobile identifies itself\n // as Safari. Oh the lulz...\n var isSafari = typeof openDatabase !== 'undefined' && /(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent) && !/BlackBerry/.test(navigator.platform);\n\n var hasFetch = typeof fetch === 'function' && fetch.toString().indexOf('[native code') !== -1;\n\n // Safari <10.1 does not meet our requirements for IDB support\n // (see: https://github.com/pouchdb/pouchdb/issues/5572).\n // Safari 10.1 shipped with fetch, we can use that to detect it.\n // Note: this creates issues with `window.fetch` polyfills and\n // overrides; see:\n // https://github.com/localForage/localForage/issues/856\n return (!isSafari || hasFetch) && typeof indexedDB !== 'undefined' &&\n // some outdated implementations of IDB that appear on Samsung\n // and HTC Android devices <4.4 are missing IDBKeyRange\n // See: https://github.com/mozilla/localForage/issues/128\n // See: https://github.com/mozilla/localForage/issues/272\n typeof IDBKeyRange !== 'undefined';\n } catch (e) {\n return false;\n }\n}\n\n// Abstracts constructing a Blob object, so it also works in older\n// browsers that don't support the native Blob constructor. (i.e.\n// old QtWebKit versions, at least).\n// Abstracts constructing a Blob object, so it also works in older\n// browsers that don't support the native Blob constructor. (i.e.\n// old QtWebKit versions, at least).\nfunction createBlob(parts, properties) {\n /* global BlobBuilder,MSBlobBuilder,MozBlobBuilder,WebKitBlobBuilder */\n parts = parts || [];\n properties = properties || {};\n try {\n return new Blob(parts, properties);\n } catch (e) {\n if (e.name !== 'TypeError') {\n throw e;\n }\n var Builder = typeof BlobBuilder !== 'undefined' ? BlobBuilder : typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder : typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : WebKitBlobBuilder;\n var builder = new Builder();\n for (var i = 0; i < parts.length; i += 1) {\n builder.append(parts[i]);\n }\n return builder.getBlob(properties.type);\n }\n}\n\n// This is CommonJS because lie is an external dependency, so Rollup\n// can just ignore it.\nif (typeof Promise === 'undefined') {\n // In the \"nopromises\" build this will just throw if you don't have\n // a global promise object, but it would throw anyway later.\n _dereq_(3);\n}\nvar Promise$1 = Promise;\n\nfunction executeCallback(promise, callback) {\n if (callback) {\n promise.then(function (result) {\n callback(null, result);\n }, function (error) {\n callback(error);\n });\n }\n}\n\nfunction executeTwoCallbacks(promise, callback, errorCallback) {\n if (typeof callback === 'function') {\n promise.then(callback);\n }\n\n if (typeof errorCallback === 'function') {\n promise[\"catch\"](errorCallback);\n }\n}\n\nfunction normalizeKey(key) {\n // Cast the key to a string, as that's all we can set as a key.\n if (typeof key !== 'string') {\n console.warn(key + ' used as a key, but it is not a string.');\n key = String(key);\n }\n\n return key;\n}\n\nfunction getCallback() {\n if (arguments.length && typeof arguments[arguments.length - 1] === 'function') {\n return arguments[arguments.length - 1];\n }\n}\n\n// Some code originally from async_storage.js in\n// [Gaia](https://github.com/mozilla-b2g/gaia).\n\nvar DETECT_BLOB_SUPPORT_STORE = 'local-forage-detect-blob-support';\nvar supportsBlobs = void 0;\nvar dbContexts = {};\nvar toString = Object.prototype.toString;\n\n// Transaction Modes\nvar READ_ONLY = 'readonly';\nvar READ_WRITE = 'readwrite';\n\n// Transform a binary string to an array buffer, because otherwise\n// weird stuff happens when you try to work with the binary string directly.\n// It is known.\n// From http://stackoverflow.com/questions/14967647/ (continues on next line)\n// encode-decode-image-with-base64-breaks-image (2013-04-21)\nfunction _binStringToArrayBuffer(bin) {\n var length = bin.length;\n var buf = new ArrayBuffer(length);\n var arr = new Uint8Array(buf);\n for (var i = 0; i < length; i++) {\n arr[i] = bin.charCodeAt(i);\n }\n return buf;\n}\n\n//\n// Blobs are not supported in all versions of IndexedDB, notably\n// Chrome <37 and Android <5. In those versions, storing a blob will throw.\n//\n// Various other blob bugs exist in Chrome v37-42 (inclusive).\n// Detecting them is expensive and confusing to users, and Chrome 37-42\n// is at very low usage worldwide, so we do a hacky userAgent check instead.\n//\n// content-type bug: https://code.google.com/p/chromium/issues/detail?id=408120\n// 404 bug: https://code.google.com/p/chromium/issues/detail?id=447916\n// FileReader bug: https://code.google.com/p/chromium/issues/detail?id=447836\n//\n// Code borrowed from PouchDB. See:\n// https://github.com/pouchdb/pouchdb/blob/master/packages/node_modules/pouchdb-adapter-idb/src/blobSupport.js\n//\nfunction _checkBlobSupportWithoutCaching(idb) {\n return new Promise$1(function (resolve) {\n var txn = idb.transaction(DETECT_BLOB_SUPPORT_STORE, READ_WRITE);\n var blob = createBlob(['']);\n txn.objectStore(DETECT_BLOB_SUPPORT_STORE).put(blob, 'key');\n\n txn.onabort = function (e) {\n // If the transaction aborts now its due to not being able to\n // write to the database, likely due to the disk being full\n e.preventDefault();\n e.stopPropagation();\n resolve(false);\n };\n\n txn.oncomplete = function () {\n var matchedChrome = navigator.userAgent.match(/Chrome\\/(\\d+)/);\n var matchedEdge = navigator.userAgent.match(/Edge\\//);\n // MS Edge pretends to be Chrome 42:\n // https://msdn.microsoft.com/en-us/library/hh869301%28v=vs.85%29.aspx\n resolve(matchedEdge || !matchedChrome || parseInt(matchedChrome[1], 10) >= 43);\n };\n })[\"catch\"](function () {\n return false; // error, so assume unsupported\n });\n}\n\nfunction _checkBlobSupport(idb) {\n if (typeof supportsBlobs === 'boolean') {\n return Promise$1.resolve(supportsBlobs);\n }\n return _checkBlobSupportWithoutCaching(idb).then(function (value) {\n supportsBlobs = value;\n return supportsBlobs;\n });\n}\n\nfunction _deferReadiness(dbInfo) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Create a deferred object representing the current database operation.\n var deferredOperation = {};\n\n deferredOperation.promise = new Promise$1(function (resolve, reject) {\n deferredOperation.resolve = resolve;\n deferredOperation.reject = reject;\n });\n\n // Enqueue the deferred operation.\n dbContext.deferredOperations.push(deferredOperation);\n\n // Chain its promise to the database readiness.\n if (!dbContext.dbReady) {\n dbContext.dbReady = deferredOperation.promise;\n } else {\n dbContext.dbReady = dbContext.dbReady.then(function () {\n return deferredOperation.promise;\n });\n }\n}\n\nfunction _advanceReadiness(dbInfo) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Dequeue a deferred operation.\n var deferredOperation = dbContext.deferredOperations.pop();\n\n // Resolve its promise (which is part of the database readiness\n // chain of promises).\n if (deferredOperation) {\n deferredOperation.resolve();\n return deferredOperation.promise;\n }\n}\n\nfunction _rejectReadiness(dbInfo, err) {\n var dbContext = dbContexts[dbInfo.name];\n\n // Dequeue a deferred operation.\n var deferredOperation = dbContext.deferredOperations.pop();\n\n // Reject its promise (which is part of the database readiness\n // chain of promises).\n if (deferredOperation) {\n deferredOperation.reject(err);\n return deferredOperation.promise;\n }\n}\n\nfunction _getConnection(dbInfo, upgradeNeeded) {\n return new Promise$1(function (resolve, reject) {\n dbContexts[dbInfo.name] = dbContexts[dbInfo.name] || createDbContext();\n\n if (dbInfo.db) {\n if (upgradeNeeded) {\n _deferReadiness(dbInfo);\n dbInfo.db.close();\n } else {\n return resolve(dbInfo.db);\n }\n }\n\n var dbArgs = [dbInfo.name];\n\n if (upgradeNeeded) {\n dbArgs.push(dbInfo.version);\n }\n\n var openreq = idb.open.apply(idb, dbArgs);\n\n if (upgradeNeeded) {\n openreq.onupgradeneeded = function (e) {\n var db = openreq.result;\n try {\n db.createObjectStore(dbInfo.storeName);\n if (e.oldVersion <= 1) {\n // Added when support for blob shims was added\n db.createObjectStore(DETECT_BLOB_SUPPORT_STORE);\n }\n } catch (ex) {\n if (ex.name === 'ConstraintError') {\n console.warn('The database \"' + dbInfo.name + '\"' + ' has been upgraded from version ' + e.oldVersion + ' to version ' + e.newVersion + ', but the storage \"' + dbInfo.storeName + '\" already exists.');\n } else {\n throw ex;\n }\n }\n };\n }\n\n openreq.onerror = function (e) {\n e.preventDefault();\n reject(openreq.error);\n };\n\n openreq.onsuccess = function () {\n var db = openreq.result;\n db.onversionchange = function (e) {\n // Triggered when the database is modified (e.g. adding an objectStore) or\n // deleted (even when initiated by other sessions in different tabs).\n // Closing the connection here prevents those operations from being blocked.\n // If the database is accessed again later by this instance, the connection\n // will be reopened or the database recreated as needed.\n e.target.close();\n };\n resolve(db);\n _advanceReadiness(dbInfo);\n };\n });\n}\n\nfunction _getOriginalConnection(dbInfo) {\n return _getConnection(dbInfo, false);\n}\n\nfunction _getUpgradedConnection(dbInfo) {\n return _getConnection(dbInfo, true);\n}\n\nfunction _isUpgradeNeeded(dbInfo, defaultVersion) {\n if (!dbInfo.db) {\n return true;\n }\n\n var isNewStore = !dbInfo.db.objectStoreNames.contains(dbInfo.storeName);\n var isDowngrade = dbInfo.version < dbInfo.db.version;\n var isUpgrade = dbInfo.version > dbInfo.db.version;\n\n if (isDowngrade) {\n // If the version is not the default one\n // then warn for impossible downgrade.\n if (dbInfo.version !== defaultVersion) {\n console.warn('The database \"' + dbInfo.name + '\"' + \" can't be downgraded from version \" + dbInfo.db.version + ' to version ' + dbInfo.version + '.');\n }\n // Align the versions to prevent errors.\n dbInfo.version = dbInfo.db.version;\n }\n\n if (isUpgrade || isNewStore) {\n // If the store is new then increment the version (if needed).\n // This will trigger an \"upgradeneeded\" event which is required\n // for creating a store.\n if (isNewStore) {\n var incVersion = dbInfo.db.version + 1;\n if (incVersion > dbInfo.version) {\n dbInfo.version = incVersion;\n }\n }\n\n return true;\n }\n\n return false;\n}\n\n// encode a blob for indexeddb engines that don't support blobs\nfunction _encodeBlob(blob) {\n return new Promise$1(function (resolve, reject) {\n var reader = new FileReader();\n reader.onerror = reject;\n reader.onloadend = function (e) {\n var base64 = btoa(e.target.result || '');\n resolve({\n __local_forage_encoded_blob: true,\n data: base64,\n type: blob.type\n });\n };\n reader.readAsBinaryString(blob);\n });\n}\n\n// decode an encoded blob\nfunction _decodeBlob(encodedBlob) {\n var arrayBuff = _binStringToArrayBuffer(atob(encodedBlob.data));\n return createBlob([arrayBuff], { type: encodedBlob.type });\n}\n\n// is this one of our fancy encoded blobs?\nfunction _isEncodedBlob(value) {\n return value && value.__local_forage_encoded_blob;\n}\n\n// Specialize the default `ready()` function by making it dependent\n// on the current database operations. Thus, the driver will be actually\n// ready when it's been initialized (default) *and* there are no pending\n// operations on the database (initiated by some other instances).\nfunction _fullyReady(callback) {\n var self = this;\n\n var promise = self._initReady().then(function () {\n var dbContext = dbContexts[self._dbInfo.name];\n\n if (dbContext && dbContext.dbReady) {\n return dbContext.dbReady;\n }\n });\n\n executeTwoCallbacks(promise, callback, callback);\n return promise;\n}\n\n// Try to establish a new db connection to replace the\n// current one which is broken (i.e. experiencing\n// InvalidStateError while creating a transaction).\nfunction _tryReconnect(dbInfo) {\n _deferReadiness(dbInfo);\n\n var dbContext = dbContexts[dbInfo.name];\n var forages = dbContext.forages;\n\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n if (forage._dbInfo.db) {\n forage._dbInfo.db.close();\n forage._dbInfo.db = null;\n }\n }\n dbInfo.db = null;\n\n return _getOriginalConnection(dbInfo).then(function (db) {\n dbInfo.db = db;\n if (_isUpgradeNeeded(dbInfo)) {\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n return db;\n }).then(function (db) {\n // store the latest db reference\n // in case the db was upgraded\n dbInfo.db = dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n forages[i]._dbInfo.db = db;\n }\n })[\"catch\"](function (err) {\n _rejectReadiness(dbInfo, err);\n throw err;\n });\n}\n\n// FF doesn't like Promises (micro-tasks) and IDDB store operations,\n// so we have to do it with callbacks\nfunction createTransaction(dbInfo, mode, callback, retries) {\n if (retries === undefined) {\n retries = 1;\n }\n\n try {\n var tx = dbInfo.db.transaction(dbInfo.storeName, mode);\n callback(null, tx);\n } catch (err) {\n if (retries > 0 && (!dbInfo.db || err.name === 'InvalidStateError' || err.name === 'NotFoundError')) {\n return Promise$1.resolve().then(function () {\n if (!dbInfo.db || err.name === 'NotFoundError' && !dbInfo.db.objectStoreNames.contains(dbInfo.storeName) && dbInfo.version <= dbInfo.db.version) {\n // increase the db version, to create the new ObjectStore\n if (dbInfo.db) {\n dbInfo.version = dbInfo.db.version + 1;\n }\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n }).then(function () {\n return _tryReconnect(dbInfo).then(function () {\n createTransaction(dbInfo, mode, callback, retries - 1);\n });\n })[\"catch\"](callback);\n }\n\n callback(err);\n }\n}\n\nfunction createDbContext() {\n return {\n // Running localForages sharing a database.\n forages: [],\n // Shared database.\n db: null,\n // Database readiness (promise).\n dbReady: null,\n // Deferred operations on the database.\n deferredOperations: []\n };\n}\n\n// Open the IndexedDB database (automatically creates one if one didn't\n// previously exist), using any options set in the config.\nfunction _initStorage(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n // Get the current context of the database;\n var dbContext = dbContexts[dbInfo.name];\n\n // ...or create a new context.\n if (!dbContext) {\n dbContext = createDbContext();\n // Register the new context in the global container.\n dbContexts[dbInfo.name] = dbContext;\n }\n\n // Register itself as a running localForage in the current context.\n dbContext.forages.push(self);\n\n // Replace the default `ready()` function with the specialized one.\n if (!self._initReady) {\n self._initReady = self.ready;\n self.ready = _fullyReady;\n }\n\n // Create an array of initialization states of the related localForages.\n var initPromises = [];\n\n function ignoreErrors() {\n // Don't handle errors here,\n // just makes sure related localForages aren't pending.\n return Promise$1.resolve();\n }\n\n for (var j = 0; j < dbContext.forages.length; j++) {\n var forage = dbContext.forages[j];\n if (forage !== self) {\n // Don't wait for itself...\n initPromises.push(forage._initReady()[\"catch\"](ignoreErrors));\n }\n }\n\n // Take a snapshot of the related localForages.\n var forages = dbContext.forages.slice(0);\n\n // Initialize the connection process only when\n // all the related localForages aren't pending.\n return Promise$1.all(initPromises).then(function () {\n dbInfo.db = dbContext.db;\n // Get the connection or open a new one without upgrade.\n return _getOriginalConnection(dbInfo);\n }).then(function (db) {\n dbInfo.db = db;\n if (_isUpgradeNeeded(dbInfo, self._defaultConfig.version)) {\n // Reopen the database for upgrading.\n return _getUpgradedConnection(dbInfo);\n }\n return db;\n }).then(function (db) {\n dbInfo.db = dbContext.db = db;\n self._dbInfo = dbInfo;\n // Share the final connection amongst related localForages.\n for (var k = 0; k < forages.length; k++) {\n var forage = forages[k];\n if (forage !== self) {\n // Self is already up-to-date.\n forage._dbInfo.db = dbInfo.db;\n forage._dbInfo.version = dbInfo.version;\n }\n }\n });\n}\n\nfunction getItem(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.get(key);\n\n req.onsuccess = function () {\n var value = req.result;\n if (value === undefined) {\n value = null;\n }\n if (_isEncodedBlob(value)) {\n value = _decodeBlob(value);\n }\n resolve(value);\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Iterate over all items stored in database.\nfunction iterate(iterator, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.openCursor();\n var iterationNumber = 1;\n\n req.onsuccess = function () {\n var cursor = req.result;\n\n if (cursor) {\n var value = cursor.value;\n if (_isEncodedBlob(value)) {\n value = _decodeBlob(value);\n }\n var result = iterator(value, cursor.key, iterationNumber++);\n\n // when the iterator callback returns any\n // (non-`undefined`) value, then we stop\n // the iteration immediately\n if (result !== void 0) {\n resolve(result);\n } else {\n cursor[\"continue\"]();\n }\n } else {\n resolve();\n }\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n\n return promise;\n}\n\nfunction setItem(key, value, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n var dbInfo;\n self.ready().then(function () {\n dbInfo = self._dbInfo;\n if (toString.call(value) === '[object Blob]') {\n return _checkBlobSupport(dbInfo.db).then(function (blobSupport) {\n if (blobSupport) {\n return value;\n }\n return _encodeBlob(value);\n });\n }\n return value;\n }).then(function (value) {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n\n // The reason we don't _save_ null is because IE 10 does\n // not support saving the `null` type in IndexedDB. How\n // ironic, given the bug below!\n // See: https://github.com/mozilla/localForage/issues/161\n if (value === null) {\n value = undefined;\n }\n\n var req = store.put(value, key);\n\n transaction.oncomplete = function () {\n // Cast to undefined so the value passed to\n // callback/promise is the same as what one would get out\n // of `getItem()` later. This leads to some weirdness\n // (setItem('foo', undefined) will return `null`), but\n // it's not my fault localStorage is our baseline and that\n // it's weird.\n if (value === undefined) {\n value = null;\n }\n\n resolve(value);\n };\n transaction.onabort = transaction.onerror = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction removeItem(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n // We use a Grunt task to make this safe for IE and some\n // versions of Android (including those used by Cordova).\n // Normally IE won't like `.delete()` and will insist on\n // using `['delete']()`, but we have a build step that\n // fixes this for us now.\n var req = store[\"delete\"](key);\n transaction.oncomplete = function () {\n resolve();\n };\n\n transaction.onerror = function () {\n reject(req.error);\n };\n\n // The request will be also be aborted if we've exceeded our storage\n // space.\n transaction.onabort = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction clear(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_WRITE, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.clear();\n\n transaction.oncomplete = function () {\n resolve();\n };\n\n transaction.onabort = transaction.onerror = function () {\n var err = req.error ? req.error : req.transaction.error;\n reject(err);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction length(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.count();\n\n req.onsuccess = function () {\n resolve(req.result);\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction key(n, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n if (n < 0) {\n resolve(null);\n\n return;\n }\n\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var advanced = false;\n var req = store.openKeyCursor();\n\n req.onsuccess = function () {\n var cursor = req.result;\n if (!cursor) {\n // this means there weren't enough keys\n resolve(null);\n\n return;\n }\n\n if (n === 0) {\n // We have the first key, return it if that's what they\n // wanted.\n resolve(cursor.key);\n } else {\n if (!advanced) {\n // Otherwise, ask the cursor to skip ahead n\n // records.\n advanced = true;\n cursor.advance(n);\n } else {\n // When we get here, we've got the nth key.\n resolve(cursor.key);\n }\n }\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n createTransaction(self._dbInfo, READ_ONLY, function (err, transaction) {\n if (err) {\n return reject(err);\n }\n\n try {\n var store = transaction.objectStore(self._dbInfo.storeName);\n var req = store.openKeyCursor();\n var keys = [];\n\n req.onsuccess = function () {\n var cursor = req.result;\n\n if (!cursor) {\n resolve(keys);\n return;\n }\n\n keys.push(cursor.key);\n cursor[\"continue\"]();\n };\n\n req.onerror = function () {\n reject(req.error);\n };\n } catch (e) {\n reject(e);\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction dropInstance(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n var currentConfig = this.config();\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n var isCurrentDb = options.name === currentConfig.name && self._dbInfo.db;\n\n var dbPromise = isCurrentDb ? Promise$1.resolve(self._dbInfo.db) : _getOriginalConnection(options).then(function (db) {\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n forages[i]._dbInfo.db = db;\n }\n return db;\n });\n\n if (!options.storeName) {\n promise = dbPromise.then(function (db) {\n _deferReadiness(options);\n\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n\n db.close();\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n forage._dbInfo.db = null;\n }\n\n var dropDBPromise = new Promise$1(function (resolve, reject) {\n var req = idb.deleteDatabase(options.name);\n\n req.onerror = function () {\n var db = req.result;\n if (db) {\n db.close();\n }\n reject(req.error);\n };\n\n req.onblocked = function () {\n // Closing all open connections in onversionchange handler should prevent this situation, but if\n // we do get here, it just means the request remains pending - eventually it will succeed or error\n console.warn('dropInstance blocked for database \"' + options.name + '\" until all open connections are closed');\n };\n\n req.onsuccess = function () {\n var db = req.result;\n if (db) {\n db.close();\n }\n resolve(db);\n };\n });\n\n return dropDBPromise.then(function (db) {\n dbContext.db = db;\n for (var i = 0; i < forages.length; i++) {\n var _forage = forages[i];\n _advanceReadiness(_forage._dbInfo);\n }\n })[\"catch\"](function (err) {\n (_rejectReadiness(options, err) || Promise$1.resolve())[\"catch\"](function () {});\n throw err;\n });\n });\n } else {\n promise = dbPromise.then(function (db) {\n if (!db.objectStoreNames.contains(options.storeName)) {\n return;\n }\n\n var newVersion = db.version + 1;\n\n _deferReadiness(options);\n\n var dbContext = dbContexts[options.name];\n var forages = dbContext.forages;\n\n db.close();\n for (var i = 0; i < forages.length; i++) {\n var forage = forages[i];\n forage._dbInfo.db = null;\n forage._dbInfo.version = newVersion;\n }\n\n var dropObjectPromise = new Promise$1(function (resolve, reject) {\n var req = idb.open(options.name, newVersion);\n\n req.onerror = function (err) {\n var db = req.result;\n db.close();\n reject(err);\n };\n\n req.onupgradeneeded = function () {\n var db = req.result;\n db.deleteObjectStore(options.storeName);\n };\n\n req.onsuccess = function () {\n var db = req.result;\n db.close();\n resolve(db);\n };\n });\n\n return dropObjectPromise.then(function (db) {\n dbContext.db = db;\n for (var j = 0; j < forages.length; j++) {\n var _forage2 = forages[j];\n _forage2._dbInfo.db = db;\n _advanceReadiness(_forage2._dbInfo);\n }\n })[\"catch\"](function (err) {\n (_rejectReadiness(options, err) || Promise$1.resolve())[\"catch\"](function () {});\n throw err;\n });\n });\n }\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar asyncStorage = {\n _driver: 'asyncStorage',\n _initStorage: _initStorage,\n _support: isIndexedDBValid(),\n iterate: iterate,\n getItem: getItem,\n setItem: setItem,\n removeItem: removeItem,\n clear: clear,\n length: length,\n key: key,\n keys: keys,\n dropInstance: dropInstance\n};\n\nfunction isWebSQLValid() {\n return typeof openDatabase === 'function';\n}\n\n// Sadly, the best way to save binary data in WebSQL/localStorage is serializing\n// it to Base64, so this is how we store it to prevent very strange errors with less\n// verbose ways of binary <-> string data storage.\nvar BASE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\nvar BLOB_TYPE_PREFIX = '~~local_forage_type~';\nvar BLOB_TYPE_PREFIX_REGEX = /^~~local_forage_type~([^~]+)~/;\n\nvar SERIALIZED_MARKER = '__lfsc__:';\nvar SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER.length;\n\n// OMG the serializations!\nvar TYPE_ARRAYBUFFER = 'arbf';\nvar TYPE_BLOB = 'blob';\nvar TYPE_INT8ARRAY = 'si08';\nvar TYPE_UINT8ARRAY = 'ui08';\nvar TYPE_UINT8CLAMPEDARRAY = 'uic8';\nvar TYPE_INT16ARRAY = 'si16';\nvar TYPE_INT32ARRAY = 'si32';\nvar TYPE_UINT16ARRAY = 'ur16';\nvar TYPE_UINT32ARRAY = 'ui32';\nvar TYPE_FLOAT32ARRAY = 'fl32';\nvar TYPE_FLOAT64ARRAY = 'fl64';\nvar TYPE_SERIALIZED_MARKER_LENGTH = SERIALIZED_MARKER_LENGTH + TYPE_ARRAYBUFFER.length;\n\nvar toString$1 = Object.prototype.toString;\n\nfunction stringToBuffer(serializedString) {\n // Fill the string into a ArrayBuffer.\n var bufferLength = serializedString.length * 0.75;\n var len = serializedString.length;\n var i;\n var p = 0;\n var encoded1, encoded2, encoded3, encoded4;\n\n if (serializedString[serializedString.length - 1] === '=') {\n bufferLength--;\n if (serializedString[serializedString.length - 2] === '=') {\n bufferLength--;\n }\n }\n\n var buffer = new ArrayBuffer(bufferLength);\n var bytes = new Uint8Array(buffer);\n\n for (i = 0; i < len; i += 4) {\n encoded1 = BASE_CHARS.indexOf(serializedString[i]);\n encoded2 = BASE_CHARS.indexOf(serializedString[i + 1]);\n encoded3 = BASE_CHARS.indexOf(serializedString[i + 2]);\n encoded4 = BASE_CHARS.indexOf(serializedString[i + 3]);\n\n /*jslint bitwise: true */\n bytes[p++] = encoded1 << 2 | encoded2 >> 4;\n bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;\n bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;\n }\n return buffer;\n}\n\n// Converts a buffer to a string to store, serialized, in the backend\n// storage library.\nfunction bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}\n\n// Serialize a value, afterwards executing a callback (which usually\n// instructs the `setItem()` callback/promise to be executed). This is how\n// we store binary data with localStorage.\nfunction serialize(value, callback) {\n var valueType = '';\n if (value) {\n valueType = toString$1.call(value);\n }\n\n // Cannot use `value instanceof ArrayBuffer` or such here, as these\n // checks fail when running the tests using casper.js...\n //\n // TODO: See why those tests fail and use a better solution.\n if (value && (valueType === '[object ArrayBuffer]' || value.buffer && toString$1.call(value.buffer) === '[object ArrayBuffer]')) {\n // Convert binary arrays to a string and prefix the string with\n // a special marker.\n var buffer;\n var marker = SERIALIZED_MARKER;\n\n if (value instanceof ArrayBuffer) {\n buffer = value;\n marker += TYPE_ARRAYBUFFER;\n } else {\n buffer = value.buffer;\n\n if (valueType === '[object Int8Array]') {\n marker += TYPE_INT8ARRAY;\n } else if (valueType === '[object Uint8Array]') {\n marker += TYPE_UINT8ARRAY;\n } else if (valueType === '[object Uint8ClampedArray]') {\n marker += TYPE_UINT8CLAMPEDARRAY;\n } else if (valueType === '[object Int16Array]') {\n marker += TYPE_INT16ARRAY;\n } else if (valueType === '[object Uint16Array]') {\n marker += TYPE_UINT16ARRAY;\n } else if (valueType === '[object Int32Array]') {\n marker += TYPE_INT32ARRAY;\n } else if (valueType === '[object Uint32Array]') {\n marker += TYPE_UINT32ARRAY;\n } else if (valueType === '[object Float32Array]') {\n marker += TYPE_FLOAT32ARRAY;\n } else if (valueType === '[object Float64Array]') {\n marker += TYPE_FLOAT64ARRAY;\n } else {\n callback(new Error('Failed to get type for BinaryArray'));\n }\n }\n\n callback(marker + bufferToString(buffer));\n } else if (valueType === '[object Blob]') {\n // Conver the blob to a binaryArray and then to a string.\n var fileReader = new FileReader();\n\n fileReader.onload = function () {\n // Backwards-compatible prefix for the blob type.\n var str = BLOB_TYPE_PREFIX + value.type + '~' + bufferToString(this.result);\n\n callback(SERIALIZED_MARKER + TYPE_BLOB + str);\n };\n\n fileReader.readAsArrayBuffer(value);\n } else {\n try {\n callback(JSON.stringify(value));\n } catch (e) {\n console.error(\"Couldn't convert value into a JSON string: \", value);\n\n callback(null, e);\n }\n }\n}\n\n// Deserialize data we've inserted into a value column/field. We place\n// special markers into our strings to mark them as encoded; this isn't\n// as nice as a meta field, but it's the only sane thing we can do whilst\n// keeping localStorage support intact.\n//\n// Oftentimes this will just deserialize JSON content, but if we have a\n// special marker (SERIALIZED_MARKER, defined above), we will extract\n// some kind of arraybuffer/binary data/typed array out of the string.\nfunction deserialize(value) {\n // If we haven't marked this string as being specially serialized (i.e.\n // something other than serialized JSON), we can just return it and be\n // done with it.\n if (value.substring(0, SERIALIZED_MARKER_LENGTH) !== SERIALIZED_MARKER) {\n return JSON.parse(value);\n }\n\n // The following code deals with deserializing some kind of Blob or\n // TypedArray. First we separate out the type of data we're dealing\n // with from the data itself.\n var serializedString = value.substring(TYPE_SERIALIZED_MARKER_LENGTH);\n var type = value.substring(SERIALIZED_MARKER_LENGTH, TYPE_SERIALIZED_MARKER_LENGTH);\n\n var blobType;\n // Backwards-compatible blob type serialization strategy.\n // DBs created with older versions of localForage will simply not have the blob type.\n if (type === TYPE_BLOB && BLOB_TYPE_PREFIX_REGEX.test(serializedString)) {\n var matcher = serializedString.match(BLOB_TYPE_PREFIX_REGEX);\n blobType = matcher[1];\n serializedString = serializedString.substring(matcher[0].length);\n }\n var buffer = stringToBuffer(serializedString);\n\n // Return the right type based on the code/type set during\n // serialization.\n switch (type) {\n case TYPE_ARRAYBUFFER:\n return buffer;\n case TYPE_BLOB:\n return createBlob([buffer], { type: blobType });\n case TYPE_INT8ARRAY:\n return new Int8Array(buffer);\n case TYPE_UINT8ARRAY:\n return new Uint8Array(buffer);\n case TYPE_UINT8CLAMPEDARRAY:\n return new Uint8ClampedArray(buffer);\n case TYPE_INT16ARRAY:\n return new Int16Array(buffer);\n case TYPE_UINT16ARRAY:\n return new Uint16Array(buffer);\n case TYPE_INT32ARRAY:\n return new Int32Array(buffer);\n case TYPE_UINT32ARRAY:\n return new Uint32Array(buffer);\n case TYPE_FLOAT32ARRAY:\n return new Float32Array(buffer);\n case TYPE_FLOAT64ARRAY:\n return new Float64Array(buffer);\n default:\n throw new Error('Unkown type: ' + type);\n }\n}\n\nvar localforageSerializer = {\n serialize: serialize,\n deserialize: deserialize,\n stringToBuffer: stringToBuffer,\n bufferToString: bufferToString\n};\n\n/*\n * Includes code from:\n *\n * base64-arraybuffer\n * https://github.com/niklasvh/base64-arraybuffer\n *\n * Copyright (c) 2012 Niklas von Hertzen\n * Licensed under the MIT license.\n */\n\nfunction createDbTable(t, dbInfo, callback, errorCallback) {\n t.executeSql('CREATE TABLE IF NOT EXISTS ' + dbInfo.storeName + ' ' + '(id INTEGER PRIMARY KEY, key unique, value)', [], callback, errorCallback);\n}\n\n// Open the WebSQL database (automatically creates one if one didn't\n// previously exist), using any options set in the config.\nfunction _initStorage$1(options) {\n var self = this;\n var dbInfo = {\n db: null\n };\n\n if (options) {\n for (var i in options) {\n dbInfo[i] = typeof options[i] !== 'string' ? options[i].toString() : options[i];\n }\n }\n\n var dbInfoPromise = new Promise$1(function (resolve, reject) {\n // Open the database; the openDatabase API will automatically\n // create it for us if it doesn't exist.\n try {\n dbInfo.db = openDatabase(dbInfo.name, String(dbInfo.version), dbInfo.description, dbInfo.size);\n } catch (e) {\n return reject(e);\n }\n\n // Create our key/value table if it doesn't exist.\n dbInfo.db.transaction(function (t) {\n createDbTable(t, dbInfo, function () {\n self._dbInfo = dbInfo;\n resolve();\n }, function (t, error) {\n reject(error);\n });\n }, reject);\n });\n\n dbInfo.serializer = localforageSerializer;\n return dbInfoPromise;\n}\n\nfunction tryExecuteSql(t, dbInfo, sqlStatement, args, callback, errorCallback) {\n t.executeSql(sqlStatement, args, callback, function (t, error) {\n if (error.code === error.SYNTAX_ERR) {\n t.executeSql('SELECT name FROM sqlite_master ' + \"WHERE type='table' AND name = ?\", [dbInfo.storeName], function (t, results) {\n if (!results.rows.length) {\n // if the table is missing (was deleted)\n // re-create it table and retry\n createDbTable(t, dbInfo, function () {\n t.executeSql(sqlStatement, args, callback, errorCallback);\n }, errorCallback);\n } else {\n errorCallback(t, error);\n }\n }, errorCallback);\n } else {\n errorCallback(t, error);\n }\n }, errorCallback);\n}\n\nfunction getItem$1(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName + ' WHERE key = ? LIMIT 1', [key], function (t, results) {\n var result = results.rows.length ? results.rows.item(0).value : null;\n\n // Check to see if this is serialized content we need to\n // unpack.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction iterate$1(iterator, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT * FROM ' + dbInfo.storeName, [], function (t, results) {\n var rows = results.rows;\n var length = rows.length;\n\n for (var i = 0; i < length; i++) {\n var item = rows.item(i);\n var result = item.value;\n\n // Check to see if this is serialized content\n // we need to unpack.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n result = iterator(result, item.key, i + 1);\n\n // void(0) prevents problems with redefinition\n // of `undefined`.\n if (result !== void 0) {\n resolve(result);\n return;\n }\n }\n\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction _setItem(key, value, callback, retriesLeft) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n // The localStorage API doesn't return undefined values in an\n // \"expected\" way, so undefined is always cast to null in all\n // drivers. See: https://github.com/mozilla/localForage/pull/42\n if (value === undefined) {\n value = null;\n }\n\n // Save the original value to pass to the callback.\n var originalValue = value;\n\n var dbInfo = self._dbInfo;\n dbInfo.serializer.serialize(value, function (value, error) {\n if (error) {\n reject(error);\n } else {\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'INSERT OR REPLACE INTO ' + dbInfo.storeName + ' ' + '(key, value) VALUES (?, ?)', [key, value], function () {\n resolve(originalValue);\n }, function (t, error) {\n reject(error);\n });\n }, function (sqlError) {\n // The transaction failed; check\n // to see if it's a quota error.\n if (sqlError.code === sqlError.QUOTA_ERR) {\n // We reject the callback outright for now, but\n // it's worth trying to re-run the transaction.\n // Even if the user accepts the prompt to use\n // more storage on Safari, this error will\n // be called.\n //\n // Try to re-run the transaction.\n if (retriesLeft > 0) {\n resolve(_setItem.apply(self, [key, originalValue, callback, retriesLeft - 1]));\n return;\n }\n reject(sqlError);\n }\n });\n }\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction setItem$1(key, value, callback) {\n return _setItem.apply(this, [key, value, callback, 1]);\n}\n\nfunction removeItem$1(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName + ' WHERE key = ?', [key], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Deletes every item in the table.\n// TODO: Find out if this resets the AUTO_INCREMENT number.\nfunction clear$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'DELETE FROM ' + dbInfo.storeName, [], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Does a simple `COUNT(key)` to get the number of items stored in\n// localForage.\nfunction length$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n // Ahhh, SQL makes this one soooooo easy.\n tryExecuteSql(t, dbInfo, 'SELECT COUNT(key) as c FROM ' + dbInfo.storeName, [], function (t, results) {\n var result = results.rows.item(0).c;\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Return the key located at key index X; essentially gets the key from a\n// `WHERE id = ?`. This is the most efficient way I can think to implement\n// this rarely-used (in my experience) part of the API, but it can seem\n// inconsistent, because we do `INSERT OR REPLACE INTO` on `setItem()`, so\n// the ID of each key will change every time it's updated. Perhaps a stored\n// procedure for the `setItem()` SQL would solve this problem?\n// TODO: Don't change ID on `setItem()`.\nfunction key$1(n, callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName + ' WHERE id = ? LIMIT 1', [n + 1], function (t, results) {\n var result = results.rows.length ? results.rows.item(0).key : null;\n resolve(result);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys$1(callback) {\n var self = this;\n\n var promise = new Promise$1(function (resolve, reject) {\n self.ready().then(function () {\n var dbInfo = self._dbInfo;\n dbInfo.db.transaction(function (t) {\n tryExecuteSql(t, dbInfo, 'SELECT key FROM ' + dbInfo.storeName, [], function (t, results) {\n var keys = [];\n\n for (var i = 0; i < results.rows.length; i++) {\n keys.push(results.rows.item(i).key);\n }\n\n resolve(keys);\n }, function (t, error) {\n reject(error);\n });\n });\n })[\"catch\"](reject);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// https://www.w3.org/TR/webdatabase/#databases\n// > There is no way to enumerate or delete the databases available for an origin from this API.\nfunction getAllStoreNames(db) {\n return new Promise$1(function (resolve, reject) {\n db.transaction(function (t) {\n t.executeSql('SELECT name FROM sqlite_master ' + \"WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'\", [], function (t, results) {\n var storeNames = [];\n\n for (var i = 0; i < results.rows.length; i++) {\n storeNames.push(results.rows.item(i).name);\n }\n\n resolve({\n db: db,\n storeNames: storeNames\n });\n }, function (t, error) {\n reject(error);\n });\n }, function (sqlError) {\n reject(sqlError);\n });\n });\n}\n\nfunction dropInstance$1(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n var currentConfig = this.config();\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n promise = new Promise$1(function (resolve) {\n var db;\n if (options.name === currentConfig.name) {\n // use the db reference of the current instance\n db = self._dbInfo.db;\n } else {\n db = openDatabase(options.name, '', '', 0);\n }\n\n if (!options.storeName) {\n // drop all database tables\n resolve(getAllStoreNames(db));\n } else {\n resolve({\n db: db,\n storeNames: [options.storeName]\n });\n }\n }).then(function (operationInfo) {\n return new Promise$1(function (resolve, reject) {\n operationInfo.db.transaction(function (t) {\n function dropTable(storeName) {\n return new Promise$1(function (resolve, reject) {\n t.executeSql('DROP TABLE IF EXISTS ' + storeName, [], function () {\n resolve();\n }, function (t, error) {\n reject(error);\n });\n });\n }\n\n var operations = [];\n for (var i = 0, len = operationInfo.storeNames.length; i < len; i++) {\n operations.push(dropTable(operationInfo.storeNames[i]));\n }\n\n Promise$1.all(operations).then(function () {\n resolve();\n })[\"catch\"](function (e) {\n reject(e);\n });\n }, function (sqlError) {\n reject(sqlError);\n });\n });\n });\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar webSQLStorage = {\n _driver: 'webSQLStorage',\n _initStorage: _initStorage$1,\n _support: isWebSQLValid(),\n iterate: iterate$1,\n getItem: getItem$1,\n setItem: setItem$1,\n removeItem: removeItem$1,\n clear: clear$1,\n length: length$1,\n key: key$1,\n keys: keys$1,\n dropInstance: dropInstance$1\n};\n\nfunction isLocalStorageValid() {\n try {\n return typeof localStorage !== 'undefined' && 'setItem' in localStorage &&\n // in IE8 typeof localStorage.setItem === 'object'\n !!localStorage.setItem;\n } catch (e) {\n return false;\n }\n}\n\nfunction _getKeyPrefix(options, defaultConfig) {\n var keyPrefix = options.name + '/';\n\n if (options.storeName !== defaultConfig.storeName) {\n keyPrefix += options.storeName + '/';\n }\n return keyPrefix;\n}\n\n// Check if localStorage throws when saving an item\nfunction checkIfLocalStorageThrows() {\n var localStorageTestKey = '_localforage_support_test';\n\n try {\n localStorage.setItem(localStorageTestKey, true);\n localStorage.removeItem(localStorageTestKey);\n\n return false;\n } catch (e) {\n return true;\n }\n}\n\n// Check if localStorage is usable and allows to save an item\n// This method checks if localStorage is usable in Safari Private Browsing\n// mode, or in any other case where the available quota for localStorage\n// is 0 and there wasn't any saved items yet.\nfunction _isLocalStorageUsable() {\n return !checkIfLocalStorageThrows() || localStorage.length > 0;\n}\n\n// Config the localStorage backend, using options set in the config.\nfunction _initStorage$2(options) {\n var self = this;\n var dbInfo = {};\n if (options) {\n for (var i in options) {\n dbInfo[i] = options[i];\n }\n }\n\n dbInfo.keyPrefix = _getKeyPrefix(options, self._defaultConfig);\n\n if (!_isLocalStorageUsable()) {\n return Promise$1.reject();\n }\n\n self._dbInfo = dbInfo;\n dbInfo.serializer = localforageSerializer;\n\n return Promise$1.resolve();\n}\n\n// Remove all keys from the datastore, effectively destroying all data in\n// the app's key/value store!\nfunction clear$2(callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var keyPrefix = self._dbInfo.keyPrefix;\n\n for (var i = localStorage.length - 1; i >= 0; i--) {\n var key = localStorage.key(i);\n\n if (key.indexOf(keyPrefix) === 0) {\n localStorage.removeItem(key);\n }\n }\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Retrieve an item from the store. Unlike the original async_storage\n// library in Gaia, we don't modify return values at all. If a key's value\n// is `undefined`, we pass that value to the callback function.\nfunction getItem$2(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var result = localStorage.getItem(dbInfo.keyPrefix + key);\n\n // If a result was found, parse it from the serialized\n // string into a JS object. If result isn't truthy, the key\n // is likely undefined and we'll pass it straight to the\n // callback.\n if (result) {\n result = dbInfo.serializer.deserialize(result);\n }\n\n return result;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Iterate over all items in the store.\nfunction iterate$2(iterator, callback) {\n var self = this;\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var keyPrefix = dbInfo.keyPrefix;\n var keyPrefixLength = keyPrefix.length;\n var length = localStorage.length;\n\n // We use a dedicated iterator instead of the `i` variable below\n // so other keys we fetch in localStorage aren't counted in\n // the `iterationNumber` argument passed to the `iterate()`\n // callback.\n //\n // See: github.com/mozilla/localForage/pull/435#discussion_r38061530\n var iterationNumber = 1;\n\n for (var i = 0; i < length; i++) {\n var key = localStorage.key(i);\n if (key.indexOf(keyPrefix) !== 0) {\n continue;\n }\n var value = localStorage.getItem(key);\n\n // If a result was found, parse it from the serialized\n // string into a JS object. If result isn't truthy, the\n // key is likely undefined and we'll pass it straight\n // to the iterator.\n if (value) {\n value = dbInfo.serializer.deserialize(value);\n }\n\n value = iterator(value, key.substring(keyPrefixLength), iterationNumber++);\n\n if (value !== void 0) {\n return value;\n }\n }\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Same as localStorage's key() method, except takes a callback.\nfunction key$2(n, callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var result;\n try {\n result = localStorage.key(n);\n } catch (error) {\n result = null;\n }\n\n // Remove the prefix from the key, if a key is found.\n if (result) {\n result = result.substring(dbInfo.keyPrefix.length);\n }\n\n return result;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction keys$2(callback) {\n var self = this;\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n var length = localStorage.length;\n var keys = [];\n\n for (var i = 0; i < length; i++) {\n var itemKey = localStorage.key(i);\n if (itemKey.indexOf(dbInfo.keyPrefix) === 0) {\n keys.push(itemKey.substring(dbInfo.keyPrefix.length));\n }\n }\n\n return keys;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Supply the number of keys in the datastore to the callback function.\nfunction length$2(callback) {\n var self = this;\n var promise = self.keys().then(function (keys) {\n return keys.length;\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Remove an item from the store, nice and simple.\nfunction removeItem$2(key, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n var dbInfo = self._dbInfo;\n localStorage.removeItem(dbInfo.keyPrefix + key);\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\n// Set a key's value and run an optional callback once the value is set.\n// Unlike Gaia's implementation, the callback function is passed the value,\n// in case you want to operate on that value only after you're sure it\n// saved, or something like that.\nfunction setItem$2(key, value, callback) {\n var self = this;\n\n key = normalizeKey(key);\n\n var promise = self.ready().then(function () {\n // Convert undefined values to null.\n // https://github.com/mozilla/localForage/pull/42\n if (value === undefined) {\n value = null;\n }\n\n // Save the original value to pass to the callback.\n var originalValue = value;\n\n return new Promise$1(function (resolve, reject) {\n var dbInfo = self._dbInfo;\n dbInfo.serializer.serialize(value, function (value, error) {\n if (error) {\n reject(error);\n } else {\n try {\n localStorage.setItem(dbInfo.keyPrefix + key, value);\n resolve(originalValue);\n } catch (e) {\n // localStorage capacity exceeded.\n // TODO: Make this a specific error/event.\n if (e.name === 'QuotaExceededError' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED') {\n reject(e);\n }\n reject(e);\n }\n }\n });\n });\n });\n\n executeCallback(promise, callback);\n return promise;\n}\n\nfunction dropInstance$2(options, callback) {\n callback = getCallback.apply(this, arguments);\n\n options = typeof options !== 'function' && options || {};\n if (!options.name) {\n var currentConfig = this.config();\n options.name = options.name || currentConfig.name;\n options.storeName = options.storeName || currentConfig.storeName;\n }\n\n var self = this;\n var promise;\n if (!options.name) {\n promise = Promise$1.reject('Invalid arguments');\n } else {\n promise = new Promise$1(function (resolve) {\n if (!options.storeName) {\n resolve(options.name + '/');\n } else {\n resolve(_getKeyPrefix(options, self._defaultConfig));\n }\n }).then(function (keyPrefix) {\n for (var i = localStorage.length - 1; i >= 0; i--) {\n var key = localStorage.key(i);\n\n if (key.indexOf(keyPrefix) === 0) {\n localStorage.removeItem(key);\n }\n }\n });\n }\n\n executeCallback(promise, callback);\n return promise;\n}\n\nvar localStorageWrapper = {\n _driver: 'localStorageWrapper',\n _initStorage: _initStorage$2,\n _support: isLocalStorageValid(),\n iterate: iterate$2,\n getItem: getItem$2,\n setItem: setItem$2,\n removeItem: removeItem$2,\n clear: clear$2,\n length: length$2,\n key: key$2,\n keys: keys$2,\n dropInstance: dropInstance$2\n};\n\nvar sameValue = function sameValue(x, y) {\n return x === y || typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y);\n};\n\nvar includes = function includes(array, searchElement) {\n var len = array.length;\n var i = 0;\n while (i < len) {\n if (sameValue(array[i], searchElement)) {\n return true;\n }\n i++;\n }\n\n return false;\n};\n\nvar isArray = Array.isArray || function (arg) {\n return Object.prototype.toString.call(arg) === '[object Array]';\n};\n\n// Drivers are stored here when `defineDriver()` is called.\n// They are shared across all instances of localForage.\nvar DefinedDrivers = {};\n\nvar DriverSupport = {};\n\nvar DefaultDrivers = {\n INDEXEDDB: asyncStorage,\n WEBSQL: webSQLStorage,\n LOCALSTORAGE: localStorageWrapper\n};\n\nvar DefaultDriverOrder = [DefaultDrivers.INDEXEDDB._driver, DefaultDrivers.WEBSQL._driver, DefaultDrivers.LOCALSTORAGE._driver];\n\nvar OptionalDriverMethods = ['dropInstance'];\n\nvar LibraryMethods = ['clear', 'getItem', 'iterate', 'key', 'keys', 'length', 'removeItem', 'setItem'].concat(OptionalDriverMethods);\n\nvar DefaultConfig = {\n description: '',\n driver: DefaultDriverOrder.slice(),\n name: 'localforage',\n // Default DB size is _JUST UNDER_ 5MB, as it's the highest size\n // we can use without a prompt.\n size: 4980736,\n storeName: 'keyvaluepairs',\n version: 1.0\n};\n\nfunction callWhenReady(localForageInstance, libraryMethod) {\n localForageInstance[libraryMethod] = function () {\n var _args = arguments;\n return localForageInstance.ready().then(function () {\n return localForageInstance[libraryMethod].apply(localForageInstance, _args);\n });\n };\n}\n\nfunction extend() {\n for (var i = 1; i < arguments.length; i++) {\n var arg = arguments[i];\n\n if (arg) {\n for (var _key in arg) {\n if (arg.hasOwnProperty(_key)) {\n if (isArray(arg[_key])) {\n arguments[0][_key] = arg[_key].slice();\n } else {\n arguments[0][_key] = arg[_key];\n }\n }\n }\n }\n }\n\n return arguments[0];\n}\n\nvar LocalForage = function () {\n function LocalForage(options) {\n _classCallCheck(this, LocalForage);\n\n for (var driverTypeKey in DefaultDrivers) {\n if (DefaultDrivers.hasOwnProperty(driverTypeKey)) {\n var driver = DefaultDrivers[driverTypeKey];\n var driverName = driver._driver;\n this[driverTypeKey] = driverName;\n\n if (!DefinedDrivers[driverName]) {\n // we don't need to wait for the promise,\n // since the default drivers can be defined\n // in a blocking manner\n this.defineDriver(driver);\n }\n }\n }\n\n this._defaultConfig = extend({}, DefaultConfig);\n this._config = extend({}, this._defaultConfig, options);\n this._driverSet = null;\n this._initDriver = null;\n this._ready = false;\n this._dbInfo = null;\n\n this._wrapLibraryMethodsWithReady();\n this.setDriver(this._config.driver)[\"catch\"](function () {});\n }\n\n // Set any config values for localForage; can be called anytime before\n // the first API call (e.g. `getItem`, `setItem`).\n // We loop through options so we don't overwrite existing config\n // values.\n\n\n LocalForage.prototype.config = function config(options) {\n // If the options argument is an object, we use it to set values.\n // Otherwise, we return either a specified config value or all\n // config values.\n if ((typeof options === 'undefined' ? 'undefined' : _typeof(options)) === 'object') {\n // If localforage is ready and fully initialized, we can't set\n // any new configuration values. Instead, we return an error.\n if (this._ready) {\n return new Error(\"Can't call config() after localforage \" + 'has been used.');\n }\n\n for (var i in options) {\n if (i === 'storeName') {\n options[i] = options[i].replace(/\\W/g, '_');\n }\n\n if (i === 'version' && typeof options[i] !== 'number') {\n return new Error('Database version must be a number.');\n }\n\n this._config[i] = options[i];\n }\n\n // after all config options are set and\n // the driver option is used, try setting it\n if ('driver' in options && options.driver) {\n return this.setDriver(this._config.driver);\n }\n\n return true;\n } else if (typeof options === 'string') {\n return this._config[options];\n } else {\n return this._config;\n }\n };\n\n // Used to define a custom driver, shared across all instances of\n // localForage.\n\n\n LocalForage.prototype.defineDriver = function defineDriver(driverObject, callback, errorCallback) {\n var promise = new Promise$1(function (resolve, reject) {\n try {\n var driverName = driverObject._driver;\n var complianceError = new Error('Custom driver not compliant; see ' + 'https://mozilla.github.io/localForage/#definedriver');\n\n // A driver name should be defined and not overlap with the\n // library-defined, default drivers.\n if (!driverObject._driver) {\n reject(complianceError);\n return;\n }\n\n var driverMethods = LibraryMethods.concat('_initStorage');\n for (var i = 0, len = driverMethods.length; i < len; i++) {\n var driverMethodName = driverMethods[i];\n\n // when the property is there,\n // it should be a method even when optional\n var isRequired = !includes(OptionalDriverMethods, driverMethodName);\n if ((isRequired || driverObject[driverMethodName]) && typeof driverObject[driverMethodName] !== 'function') {\n reject(complianceError);\n return;\n }\n }\n\n var configureMissingMethods = function configureMissingMethods() {\n var methodNotImplementedFactory = function methodNotImplementedFactory(methodName) {\n return function () {\n var error = new Error('Method ' + methodName + ' is not implemented by the current driver');\n var promise = Promise$1.reject(error);\n executeCallback(promise, arguments[arguments.length - 1]);\n return promise;\n };\n };\n\n for (var _i = 0, _len = OptionalDriverMethods.length; _i < _len; _i++) {\n var optionalDriverMethod = OptionalDriverMethods[_i];\n if (!driverObject[optionalDriverMethod]) {\n driverObject[optionalDriverMethod] = methodNotImplementedFactory(optionalDriverMethod);\n }\n }\n };\n\n configureMissingMethods();\n\n var setDriverSupport = function setDriverSupport(support) {\n if (DefinedDrivers[driverName]) {\n console.info('Redefining LocalForage driver: ' + driverName);\n }\n DefinedDrivers[driverName] = driverObject;\n DriverSupport[driverName] = support;\n // don't use a then, so that we can define\n // drivers that have simple _support methods\n // in a blocking manner\n resolve();\n };\n\n if ('_support' in driverObject) {\n if (driverObject._support && typeof driverObject._support === 'function') {\n driverObject._support().then(setDriverSupport, reject);\n } else {\n setDriverSupport(!!driverObject._support);\n }\n } else {\n setDriverSupport(true);\n }\n } catch (e) {\n reject(e);\n }\n });\n\n executeTwoCallbacks(promise, callback, errorCallback);\n return promise;\n };\n\n LocalForage.prototype.driver = function driver() {\n return this._driver || null;\n };\n\n LocalForage.prototype.getDriver = function getDriver(driverName, callback, errorCallback) {\n var getDriverPromise = DefinedDrivers[driverName] ? Promise$1.resolve(DefinedDrivers[driverName]) : Promise$1.reject(new Error('Driver not found.'));\n\n executeTwoCallbacks(getDriverPromise, callback, errorCallback);\n return getDriverPromise;\n };\n\n LocalForage.prototype.getSerializer = function getSerializer(callback) {\n var serializerPromise = Promise$1.resolve(localforageSerializer);\n executeTwoCallbacks(serializerPromise, callback);\n return serializerPromise;\n };\n\n LocalForage.prototype.ready = function ready(callback) {\n var self = this;\n\n var promise = self._driverSet.then(function () {\n if (self._ready === null) {\n self._ready = self._initDriver();\n }\n\n return self._ready;\n });\n\n executeTwoCallbacks(promise, callback, callback);\n return promise;\n };\n\n LocalForage.prototype.setDriver = function setDriver(drivers, callback, errorCallback) {\n var self = this;\n\n if (!isArray(drivers)) {\n drivers = [drivers];\n }\n\n var supportedDrivers = this._getSupportedDrivers(drivers);\n\n function setDriverToConfig() {\n self._config.driver = self.driver();\n }\n\n function extendSelfWithDriver(driver) {\n self._extend(driver);\n setDriverToConfig();\n\n self._ready = self._initStorage(self._config);\n return self._ready;\n }\n\n function initDriver(supportedDrivers) {\n return function () {\n var currentDriverIndex = 0;\n\n function driverPromiseLoop() {\n while (currentDriverIndex < supportedDrivers.length) {\n var driverName = supportedDrivers[currentDriverIndex];\n currentDriverIndex++;\n\n self._dbInfo = null;\n self._ready = null;\n\n return self.getDriver(driverName).then(extendSelfWithDriver)[\"catch\"](driverPromiseLoop);\n }\n\n setDriverToConfig();\n var error = new Error('No available storage method found.');\n self._driverSet = Promise$1.reject(error);\n return self._driverSet;\n }\n\n return driverPromiseLoop();\n };\n }\n\n // There might be a driver initialization in progress\n // so wait for it to finish in order to avoid a possible\n // race condition to set _dbInfo\n var oldDriverSetDone = this._driverSet !== null ? this._driverSet[\"catch\"](function () {\n return Promise$1.resolve();\n }) : Promise$1.resolve();\n\n this._driverSet = oldDriverSetDone.then(function () {\n var driverName = supportedDrivers[0];\n self._dbInfo = null;\n self._ready = null;\n\n return self.getDriver(driverName).then(function (driver) {\n self._driver = driver._driver;\n setDriverToConfig();\n self._wrapLibraryMethodsWithReady();\n self._initDriver = initDriver(supportedDrivers);\n });\n })[\"catch\"](function () {\n setDriverToConfig();\n var error = new Error('No available storage method found.');\n self._driverSet = Promise$1.reject(error);\n return self._driverSet;\n });\n\n executeTwoCallbacks(this._driverSet, callback, errorCallback);\n return this._driverSet;\n };\n\n LocalForage.prototype.supports = function supports(driverName) {\n return !!DriverSupport[driverName];\n };\n\n LocalForage.prototype._extend = function _extend(libraryMethodsAndProperties) {\n extend(this, libraryMethodsAndProperties);\n };\n\n LocalForage.prototype._getSupportedDrivers = function _getSupportedDrivers(drivers) {\n var supportedDrivers = [];\n for (var i = 0, len = drivers.length; i < len; i++) {\n var driverName = drivers[i];\n if (this.supports(driverName)) {\n supportedDrivers.push(driverName);\n }\n }\n return supportedDrivers;\n };\n\n LocalForage.prototype._wrapLibraryMethodsWithReady = function _wrapLibraryMethodsWithReady() {\n // Add a stub for each driver API method that delays the call to the\n // corresponding driver method until localForage is ready. These stubs\n // will be replaced by the driver methods as soon as the driver is\n // loaded, so there is no performance impact.\n for (var i = 0, len = LibraryMethods.length; i < len; i++) {\n callWhenReady(this, LibraryMethods[i]);\n }\n };\n\n LocalForage.prototype.createInstance = function createInstance(options) {\n return new LocalForage(options);\n };\n\n return LocalForage;\n}();\n\n// The actual localForage object that we expose as a module or via a\n// global. It's extended by pulling in one of our other libraries.\n\n\nvar localforage_js = new LocalForage();\n\nmodule.exports = localforage_js;\n\n},{\"3\":3}]},{},[4])(4)\n});\n","function t() {\n return (/* @__PURE__ */ new Date()).toISOString() + \"/\" + Math.random();\n}\nexport {\n t as createKey\n};\n","import o from \"localforage\";\nimport { createKey as l } from \"./storage-strategy.js\";\nclass u {\n store;\n constructor(t) {\n this.store = o.createInstance({\n driver: [o.INDEXEDDB, o.LOCALSTORAGE],\n name: \"sgme_logger\",\n storeName: t\n });\n }\n async add(t) {\n const e = l();\n try {\n return await this.store.setItem(e, t), e;\n } catch (r) {\n console.error(\"@SGME-Logger Failed to serialize event to browser storage. Retrying...\", e, r);\n }\n try {\n const r = {\n ...t,\n parameters: [\"Could not serialize data\"]\n };\n return await this.store.setItem(e, r), e;\n } catch (r) {\n console.error(\"@SGME-Logger Could not serialize event to browser storage\", e, r);\n }\n }\n batchGet(t) {\n return new Promise((e, r) => {\n const s = [], a = [];\n this.store.iterate((i, n, c) => {\n c > t || (s.push(i), a.push(n));\n }).then(() => e({ values: s, keys: a })).catch(r);\n });\n }\n async batchRemove(t) {\n await Promise.all(t.map((e) => this.store.removeItem(e)));\n }\n}\nexport {\n u as BrowserStorage\n};\n","var r = /* @__PURE__ */ ((R) => (R[R.DEBUG = 0] = \"DEBUG\", R[R.INFO = 1] = \"INFO\", R[R.WARN = 2] = \"WARN\", R[R.ERROR = 3] = \"ERROR\", R))(r || {});\nexport {\n r as LogLevels\n};\n","import { LogLevels as u } from \"../input/log-event.js\";\nfunction s(e, r = console) {\n return function(n) {\n if (!e.enabled)\n return;\n const { level: t } = n;\n if (i(e.minLevel) > i(t))\n return;\n a(r, t)(n.messageTemplate, ...n.parameters);\n };\n}\nfunction i(e) {\n return u[e ?? \"DEBUG\"];\n}\nfunction a(e, r) {\n switch (r) {\n case \"INFO\":\n return e.info.bind(e);\n case \"WARN\":\n return e.warn.bind(e);\n case \"ERROR\":\n return e.error.bind(e);\n case \"DEBUG\":\n default:\n return e.debug.bind(e);\n }\n}\nexport {\n s as createConsoleLogger,\n i as getLevel\n};\n","// Unique ID creation requires a high quality random # generator. In the browser we therefore\n// require the crypto API and do not support built-in fallback to lower quality random number\n// generators (like Math.random()).\nvar getRandomValues;\nvar rnds8 = new Uint8Array(16);\nexport default function rng() {\n // lazy load so that environments that need to polyfill have a chance to do so\n if (!getRandomValues) {\n // getRandomValues needs to be invoked in a context where \"this\" is a Crypto implementation. Also,\n // find the complete implementation of crypto (msCrypto) on IE11.\n getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);\n\n if (!getRandomValues) {\n throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');\n }\n }\n\n return getRandomValues(rnds8);\n}","export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;","import REGEX from './regex.js';\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && REGEX.test(uuid);\n}\n\nexport default validate;","import validate from './validate.js';\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\n\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr) {\n var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!validate(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nexport default stringify;","import rng from './rng.js';\nimport stringify from './stringify.js';\n\nfunction v4(options, buf, offset) {\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (var i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return stringify(rnds);\n}\n\nexport default v4;","import { DefaultConfiguration as f } from \"../configuration/configuration.js\";\nimport { makeScheduler as L } from \"../output/server/server-log-scheduler.js\";\nimport { BrowserStorage as v } from \"../output/server/storage/browser-storage.js\";\nimport { createConsoleLogger as S } from \"../output/create-console-logger.js\";\nimport { v4 as b } from \"uuid\";\nfunction R() {\n const n = f;\n let l;\n const t = {\n enableConsole(e) {\n return n.console = {\n enabled: !0,\n minLevel: e?.minLevel\n }, t;\n },\n setAuthTokenFactory(e) {\n return n.authTokenFactory = e, t;\n },\n setApplicationHeader(e) {\n return n.applicationHeaderFactory = e, t;\n },\n enableServerLogs(e) {\n return n.serverLogConf = { enabled: !0, ...e }, l = new v(e.storeName), t;\n },\n build() {\n const { authTokenFactory: e, serverLogConf: i, console: c, applicationHeaderFactory: g } = n, m = S(c), d = b(), a = i.enabled ? L(i, l, e, g) : null;\n function s(o, r, p) {\n const u = {\n messageTemplate: r,\n parameters: p,\n level: o,\n \"@timestamp\": (/* @__PURE__ */ new Date()).toISOString(),\n loggingSessionId: d\n };\n m(u), u.level != \"DEBUG\" && a?.isRunning() && l?.add(u);\n }\n return a?.resume(), {\n logDebug(o, ...r) {\n s(\"DEBUG\", o, r);\n },\n logInformation(o, ...r) {\n s(\"INFO\", o, r);\n },\n logWarning(o, ...r) {\n s(\"WARN\", o, r);\n },\n logError(o, ...r) {\n s(\"ERROR\", o, r);\n },\n resumeServerLogs() {\n a?.resume();\n },\n pauseServerLogs() {\n a?.suspend();\n }\n };\n }\n };\n return t;\n}\nexport {\n R as LogBuilder\n};\n","export const front = {\n endpoint: 'api/log',\n batchIntervalInMillis: 5000,\n};\n","import { isDefined } from '@sgme/fp';\nimport { LogBuilder, type Logger } from '@sgme/logger';\nimport { front as baseConfig } from 'configuration/loggers/front';\n\ntype BaseConfig = typeof baseConfig;\n\nexport interface IFrontLogger {\n error(message: string, ...parameters: unknown[]): void;\n warn(message: string, ...parameters: unknown[]): void;\n info(message: string, ...parameters: unknown[]): void;\n}\n\nconst isTest = typeof process === 'object' && process.env.NODE_ENV === 'test';\n\nclass FrontLogger implements IFrontLogger {\n private logger: Logger;\n\n constructor(config: BaseConfig) {\n const logBuilder = LogBuilder();\n if (!isTest && isDefined(window.sgmeConfiguration)) {\n logBuilder\n .enableServerLogs({\n url: window.sgmeConfiguration.spBridgeHost + config.endpoint,\n prefix: 'SP ',\n storeName: 'SP',\n })\n .setAuthTokenFactory(() => window.sgwtConnect.getAuthorizationHeader() ?? undefined)\n .setApplicationHeader(() => 'SP');\n }\n if (window.sgmeConfiguration?.EnvName === 'dev') {\n logBuilder.enableConsole();\n }\n this.logger = logBuilder.build();\n }\n\n public startLogSession() {\n this.logger.resumeServerLogs();\n }\n\n public error(message: string, ...parameters: unknown[]) {\n this.logger.logError(message, ...parameters);\n }\n\n public warn(message: string, ...parameters: unknown[]) {\n this.logger.logWarning(message, ...parameters);\n }\n\n public info(message: string, ...parameters: unknown[]) {\n this.logger.logInformation(message, ...parameters);\n }\n}\n\nconst frontLogger = new FrontLogger(baseConfig);\n\nexport const getFrontLogger = (): FrontLogger => {\n return frontLogger;\n};\n","import { getFrontLogger } from 'utils/loggers/FrontLogger';\n\nexport function tryToLogContentSecurityViolationsForDebuggingPurpose() {\n if (typeof window.ReportingObserver === 'function') {\n // supported on Chrome only for now\n const observer = new ReportingObserver(\n reports => {\n reports.forEach(({ type, url, body }) => {\n getFrontLogger().warn(\n 'Browser report a violation of type {reportType} for {reportUrl}: {reportBody}',\n type,\n url,\n body?.toJSON(),\n );\n });\n },\n { buffered: true },\n );\n observer.observe();\n }\n}\n","var B = typeof globalThis < \"u\" ? globalThis : typeof window < \"u\" ? window : typeof global < \"u\" ? global : typeof self < \"u\" ? self : {}, I = { exports: {} };\n(function(O, G) {\n (function(p, A) {\n O.exports = A();\n })(B, function() {\n return (\n /******/\n function(T) {\n var p = {};\n function A(t) {\n if (p[t])\n return p[t].exports;\n var C = p[t] = {\n /******/\n exports: {},\n /******/\n id: t,\n /******/\n loaded: !1\n /******/\n };\n return T[t].call(C.exports, C, C.exports, A), C.loaded = !0, C.exports;\n }\n return A.m = T, A.c = p, A.p = \"\", A(0);\n }([\n /* 0 */\n /***/\n function(T, p, A) {\n var t, C;\n t = [A(1)], C = (function(f) {\n var m = {}, d = function(i, o, v) {\n var S, E, b = {}, M, R, w, F, D, P = new r(v), x = v && v.traceFormat;\n if (x !== \"chrome\" && x !== \"firefox\") {\n if (x)\n throw new Error('unknown traceFormat \"' + x + '\" :(');\n if (u() || L())\n x = \"chrome\";\n else if (_() || y())\n x = \"firefox\";\n else\n throw new Error(\"unknown browser :(\");\n }\n x === \"chrome\" ? (F = /^ +at.+\\((.*):([0-9]+):([0-9]+)/, w = 4, D = 1) : (F = /@(.*):([0-9]+):([0-9]+)/, w = 4, D = 0), S = i.split(`\n`).slice(D);\n for (var j = 0; j < S.length; j++)\n E = S[j], !(v && v.filter && !v.filter(E)) && (M = E.match(F), M && M.length === w && (b[j] = M, R = M[1], R.match(//) || P.fetchScript(R)));\n P.sem.whenReady(function() {\n var k = l(S, b, P.mapForUri, x);\n o(k);\n });\n }, u = function() {\n return navigator.userAgent.toLowerCase().indexOf(\"chrome\") > -1;\n }, _ = function() {\n return navigator.userAgent.toLowerCase().indexOf(\"firefox\") > -1;\n }, y = function() {\n return navigator.userAgent.toLowerCase().indexOf(\"safari\") > -1;\n }, L = function() {\n return document.documentMode && document.documentMode >= 11;\n }, a = function() {\n this.count = 0, this.pending = [];\n };\n a.prototype.incr = function() {\n this.count++;\n }, a.prototype.decr = function() {\n this.count--, this.flush();\n }, a.prototype.whenReady = function(i) {\n this.pending.push(i), this.flush();\n }, a.prototype.flush = function() {\n this.count === 0 && (this.pending.forEach(function(i) {\n i();\n }), this.pending = []);\n };\n var r = function(i) {\n this.sem = new a(), this.sync = i && i.sync, this.mapForUri = i && i.cacheGlobally ? m : {};\n };\n r.prototype.ajax = function(i, o) {\n var v = n(), S = this;\n v.onreadystatechange = function() {\n v.readyState == 4 && o.call(S, v, i);\n }, v.open(\"GET\", i, !this.sync), v.send();\n }, r.prototype.fetchScript = function(i) {\n if (!(i in this.mapForUri))\n this.sem.incr(), this.mapForUri[i] = null;\n else\n return;\n this.ajax(i, this.onScriptLoad);\n };\n var s = new RegExp(\"^(?:[a-z]+:)?//\", \"i\");\n r.prototype.onScriptLoad = function(i, o) {\n if (i.status === 200 || o.slice(0, 7) === \"file://\" && i.status === 0) {\n var v = i.responseText.match(\"//# [s]ourceMappingURL=(.*)[\\\\s]*$\", \"m\");\n if (v && v.length === 2) {\n var S = v[1], E = S.match(\"data:application/json;(charset=[^;]+;)?base64,(.*)\");\n if (E && E[2])\n this.mapForUri[o] = new f.SourceMapConsumer(atob(E[2])), this.sem.decr();\n else {\n if (!s.test(S)) {\n var b, M = o.lastIndexOf(\"/\");\n M !== -1 && (b = o.slice(0, M + 1), S = b + S);\n }\n this.ajax(S, function(R) {\n (R.status === 200 || S.slice(0, 7) === \"file://\" && R.status === 0) && (this.mapForUri[o] = new f.SourceMapConsumer(R.responseText)), this.sem.decr();\n });\n }\n } else\n this.sem.decr();\n } else\n this.sem.decr();\n };\n var l = function(i, o, v, S) {\n for (var E = [], b, M = S === \"chrome\" ? c : h, R = 0; R < i.length; R++) {\n var w = o[R];\n if (w) {\n var F = w[1], D = parseInt(w[2], 10), P = parseInt(w[3], 10);\n if (b = v[F], b) {\n var x = b.originalPositionFor(\n { line: D, column: P }\n );\n E.push(g(\n x.source,\n x.line,\n x.column,\n x.name || M(i[R])\n ));\n } else\n E.push(g(F, D, P, M(i[R])));\n } else\n E.push(i[R]);\n }\n return E;\n };\n function c(i) {\n var o = / +at +([^ ]*).*/.exec(i);\n return o && o[1];\n }\n function h(i) {\n var o = /([^@]*)@.*/.exec(i);\n return o && o[1];\n }\n var g = function(i, o, v, S) {\n return \" at \" + (S || \"(unknown)\") + \" (\" + i + \":\" + o + \":\" + v + \")\";\n }, e = [\n function() {\n return new XMLHttpRequest();\n },\n function() {\n return new ActiveXObject(\"Msxml2.XMLHTTP\");\n },\n function() {\n return new ActiveXObject(\"Msxml3.XMLHTTP\");\n },\n function() {\n return new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n ];\n function n() {\n for (var i = !1, o = 0; o < e.length; o++) {\n try {\n i = e[o]();\n } catch {\n continue;\n }\n break;\n }\n return i;\n }\n return {\n mapStackTrace: d\n };\n }).apply(p, t), C !== void 0 && (T.exports = C);\n },\n /* 1 */\n /***/\n function(T, p, A) {\n var t = A(2), C = A(3), f = A(4).ArraySet, m = A(5), d = A(7).quickSort;\n function u(a) {\n var r = a;\n return typeof a == \"string\" && (r = JSON.parse(a.replace(/^\\)\\]\\}'/, \"\"))), r.sections != null ? new L(r) : new _(r);\n }\n u.fromSourceMap = function(a) {\n return _.fromSourceMap(a);\n }, u.prototype._version = 3, u.prototype.__generatedMappings = null, Object.defineProperty(u.prototype, \"_generatedMappings\", {\n get: function() {\n return this.__generatedMappings || this._parseMappings(this._mappings, this.sourceRoot), this.__generatedMappings;\n }\n }), u.prototype.__originalMappings = null, Object.defineProperty(u.prototype, \"_originalMappings\", {\n get: function() {\n return this.__originalMappings || this._parseMappings(this._mappings, this.sourceRoot), this.__originalMappings;\n }\n }), u.prototype._charIsMappingSeparator = function(r, s) {\n var l = r.charAt(s);\n return l === \";\" || l === \",\";\n }, u.prototype._parseMappings = function(r, s) {\n throw new Error(\"Subclasses must implement _parseMappings\");\n }, u.GENERATED_ORDER = 1, u.ORIGINAL_ORDER = 2, u.GREATEST_LOWER_BOUND = 1, u.LEAST_UPPER_BOUND = 2, u.prototype.eachMapping = function(r, s, l) {\n var c = s || null, h = l || u.GENERATED_ORDER, g;\n switch (h) {\n case u.GENERATED_ORDER:\n g = this._generatedMappings;\n break;\n case u.ORIGINAL_ORDER:\n g = this._originalMappings;\n break;\n default:\n throw new Error(\"Unknown order of iteration.\");\n }\n var e = this.sourceRoot;\n g.map(function(n) {\n var i = n.source === null ? null : this._sources.at(n.source);\n return i != null && e != null && (i = t.join(e, i)), {\n source: i,\n generatedLine: n.generatedLine,\n generatedColumn: n.generatedColumn,\n originalLine: n.originalLine,\n originalColumn: n.originalColumn,\n name: n.name === null ? null : this._names.at(n.name)\n };\n }, this).forEach(r, c);\n }, u.prototype.allGeneratedPositionsFor = function(r) {\n var s = t.getArg(r, \"line\"), l = {\n source: t.getArg(r, \"source\"),\n originalLine: s,\n originalColumn: t.getArg(r, \"column\", 0)\n };\n if (this.sourceRoot != null && (l.source = t.relative(this.sourceRoot, l.source)), !this._sources.has(l.source))\n return [];\n l.source = this._sources.indexOf(l.source);\n var c = [], h = this._findMapping(\n l,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n t.compareByOriginalPositions,\n C.LEAST_UPPER_BOUND\n );\n if (h >= 0) {\n var g = this._originalMappings[h];\n if (r.column === void 0)\n for (var e = g.originalLine; g && g.originalLine === e; )\n c.push({\n line: t.getArg(g, \"generatedLine\", null),\n column: t.getArg(g, \"generatedColumn\", null),\n lastColumn: t.getArg(g, \"lastGeneratedColumn\", null)\n }), g = this._originalMappings[++h];\n else\n for (var n = g.originalColumn; g && g.originalLine === s && g.originalColumn == n; )\n c.push({\n line: t.getArg(g, \"generatedLine\", null),\n column: t.getArg(g, \"generatedColumn\", null),\n lastColumn: t.getArg(g, \"lastGeneratedColumn\", null)\n }), g = this._originalMappings[++h];\n }\n return c;\n }, p.SourceMapConsumer = u;\n function _(a) {\n var r = a;\n typeof a == \"string\" && (r = JSON.parse(a.replace(/^\\)\\]\\}'/, \"\")));\n var s = t.getArg(r, \"version\"), l = t.getArg(r, \"sources\"), c = t.getArg(r, \"names\", []), h = t.getArg(r, \"sourceRoot\", null), g = t.getArg(r, \"sourcesContent\", null), e = t.getArg(r, \"mappings\"), n = t.getArg(r, \"file\", null);\n if (s != this._version)\n throw new Error(\"Unsupported version: \" + s);\n l = l.map(String).map(t.normalize).map(function(i) {\n return h && t.isAbsolute(h) && t.isAbsolute(i) ? t.relative(h, i) : i;\n }), this._names = f.fromArray(c.map(String), !0), this._sources = f.fromArray(l, !0), this.sourceRoot = h, this.sourcesContent = g, this._mappings = e, this.file = n;\n }\n _.prototype = Object.create(u.prototype), _.prototype.consumer = u, _.fromSourceMap = function(r) {\n var s = Object.create(_.prototype), l = s._names = f.fromArray(r._names.toArray(), !0), c = s._sources = f.fromArray(r._sources.toArray(), !0);\n s.sourceRoot = r._sourceRoot, s.sourcesContent = r._generateSourcesContent(\n s._sources.toArray(),\n s.sourceRoot\n ), s.file = r._file;\n for (var h = r._mappings.toArray().slice(), g = s.__generatedMappings = [], e = s.__originalMappings = [], n = 0, i = h.length; n < i; n++) {\n var o = h[n], v = new y();\n v.generatedLine = o.generatedLine, v.generatedColumn = o.generatedColumn, o.source && (v.source = c.indexOf(o.source), v.originalLine = o.originalLine, v.originalColumn = o.originalColumn, o.name && (v.name = l.indexOf(o.name)), e.push(v)), g.push(v);\n }\n return d(s.__originalMappings, t.compareByOriginalPositions), s;\n }, _.prototype._version = 3, Object.defineProperty(_.prototype, \"sources\", {\n get: function() {\n return this._sources.toArray().map(function(a) {\n return this.sourceRoot != null ? t.join(this.sourceRoot, a) : a;\n }, this);\n }\n });\n function y() {\n this.generatedLine = 0, this.generatedColumn = 0, this.source = null, this.originalLine = null, this.originalColumn = null, this.name = null;\n }\n _.prototype._parseMappings = function(r, s) {\n for (var l = 1, c = 0, h = 0, g = 0, e = 0, n = 0, i = r.length, o = 0, v = {}, S = {}, E = [], b = [], M, R, w, F, D; o < i; )\n if (r.charAt(o) === \";\")\n l++, o++, c = 0;\n else if (r.charAt(o) === \",\")\n o++;\n else {\n for (M = new y(), M.generatedLine = l, F = o; F < i && !this._charIsMappingSeparator(r, F); F++)\n ;\n if (R = r.slice(o, F), w = v[R], w)\n o += R.length;\n else {\n for (w = []; o < F; )\n m.decode(r, o, S), D = S.value, o = S.rest, w.push(D);\n if (w.length === 2)\n throw new Error(\"Found a source, but no line and column\");\n if (w.length === 3)\n throw new Error(\"Found a source and line, but no column\");\n v[R] = w;\n }\n M.generatedColumn = c + w[0], c = M.generatedColumn, w.length > 1 && (M.source = e + w[1], e += w[1], M.originalLine = h + w[2], h = M.originalLine, M.originalLine += 1, M.originalColumn = g + w[3], g = M.originalColumn, w.length > 4 && (M.name = n + w[4], n += w[4])), b.push(M), typeof M.originalLine == \"number\" && E.push(M);\n }\n d(b, t.compareByGeneratedPositionsDeflated), this.__generatedMappings = b, d(E, t.compareByOriginalPositions), this.__originalMappings = E;\n }, _.prototype._findMapping = function(r, s, l, c, h, g) {\n if (r[l] <= 0)\n throw new TypeError(\"Line must be greater than or equal to 1, got \" + r[l]);\n if (r[c] < 0)\n throw new TypeError(\"Column must be greater than or equal to 0, got \" + r[c]);\n return C.search(r, s, h, g);\n }, _.prototype.computeColumnSpans = function() {\n for (var r = 0; r < this._generatedMappings.length; ++r) {\n var s = this._generatedMappings[r];\n if (r + 1 < this._generatedMappings.length) {\n var l = this._generatedMappings[r + 1];\n if (s.generatedLine === l.generatedLine) {\n s.lastGeneratedColumn = l.generatedColumn - 1;\n continue;\n }\n }\n s.lastGeneratedColumn = 1 / 0;\n }\n }, _.prototype.originalPositionFor = function(r) {\n var s = {\n generatedLine: t.getArg(r, \"line\"),\n generatedColumn: t.getArg(r, \"column\")\n }, l = this._findMapping(\n s,\n this._generatedMappings,\n \"generatedLine\",\n \"generatedColumn\",\n t.compareByGeneratedPositionsDeflated,\n t.getArg(r, \"bias\", u.GREATEST_LOWER_BOUND)\n );\n if (l >= 0) {\n var c = this._generatedMappings[l];\n if (c.generatedLine === s.generatedLine) {\n var h = t.getArg(c, \"source\", null);\n h !== null && (h = this._sources.at(h), this.sourceRoot != null && (h = t.join(this.sourceRoot, h)));\n var g = t.getArg(c, \"name\", null);\n return g !== null && (g = this._names.at(g)), {\n source: h,\n line: t.getArg(c, \"originalLine\", null),\n column: t.getArg(c, \"originalColumn\", null),\n name: g\n };\n }\n }\n return {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }, _.prototype.hasContentsOfAllSources = function() {\n return this.sourcesContent ? this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(r) {\n return r == null;\n }) : !1;\n }, _.prototype.sourceContentFor = function(r, s) {\n if (!this.sourcesContent)\n return null;\n if (this.sourceRoot != null && (r = t.relative(this.sourceRoot, r)), this._sources.has(r))\n return this.sourcesContent[this._sources.indexOf(r)];\n var l;\n if (this.sourceRoot != null && (l = t.urlParse(this.sourceRoot))) {\n var c = r.replace(/^file:\\/\\//, \"\");\n if (l.scheme == \"file\" && this._sources.has(c))\n return this.sourcesContent[this._sources.indexOf(c)];\n if ((!l.path || l.path == \"/\") && this._sources.has(\"/\" + r))\n return this.sourcesContent[this._sources.indexOf(\"/\" + r)];\n }\n if (s)\n return null;\n throw new Error('\"' + r + '\" is not in the SourceMap.');\n }, _.prototype.generatedPositionFor = function(r) {\n var s = t.getArg(r, \"source\");\n if (this.sourceRoot != null && (s = t.relative(this.sourceRoot, s)), !this._sources.has(s))\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n s = this._sources.indexOf(s);\n var l = {\n source: s,\n originalLine: t.getArg(r, \"line\"),\n originalColumn: t.getArg(r, \"column\")\n }, c = this._findMapping(\n l,\n this._originalMappings,\n \"originalLine\",\n \"originalColumn\",\n t.compareByOriginalPositions,\n t.getArg(r, \"bias\", u.GREATEST_LOWER_BOUND)\n );\n if (c >= 0) {\n var h = this._originalMappings[c];\n if (h.source === l.source)\n return {\n line: t.getArg(h, \"generatedLine\", null),\n column: t.getArg(h, \"generatedColumn\", null),\n lastColumn: t.getArg(h, \"lastGeneratedColumn\", null)\n };\n }\n return {\n line: null,\n column: null,\n lastColumn: null\n };\n }, p.BasicSourceMapConsumer = _;\n function L(a) {\n var r = a;\n typeof a == \"string\" && (r = JSON.parse(a.replace(/^\\)\\]\\}'/, \"\")));\n var s = t.getArg(r, \"version\"), l = t.getArg(r, \"sections\");\n if (s != this._version)\n throw new Error(\"Unsupported version: \" + s);\n this._sources = new f(), this._names = new f();\n var c = {\n line: -1,\n column: 0\n };\n this._sections = l.map(function(h) {\n if (h.url)\n throw new Error(\"Support for url field in sections not implemented.\");\n var g = t.getArg(h, \"offset\"), e = t.getArg(g, \"line\"), n = t.getArg(g, \"column\");\n if (e < c.line || e === c.line && n < c.column)\n throw new Error(\"Section offsets must be ordered and non-overlapping.\");\n return c = g, {\n generatedOffset: {\n // The offset fields are 0-based, but we use 1-based indices when\n // encoding/decoding from VLQ.\n generatedLine: e + 1,\n generatedColumn: n + 1\n },\n consumer: new u(t.getArg(h, \"map\"))\n };\n });\n }\n L.prototype = Object.create(u.prototype), L.prototype.constructor = u, L.prototype._version = 3, Object.defineProperty(L.prototype, \"sources\", {\n get: function() {\n for (var a = [], r = 0; r < this._sections.length; r++)\n for (var s = 0; s < this._sections[r].consumer.sources.length; s++)\n a.push(this._sections[r].consumer.sources[s]);\n return a;\n }\n }), L.prototype.originalPositionFor = function(r) {\n var s = {\n generatedLine: t.getArg(r, \"line\"),\n generatedColumn: t.getArg(r, \"column\")\n }, l = C.search(\n s,\n this._sections,\n function(h, g) {\n var e = h.generatedLine - g.generatedOffset.generatedLine;\n return e || h.generatedColumn - g.generatedOffset.generatedColumn;\n }\n ), c = this._sections[l];\n return c ? c.consumer.originalPositionFor({\n line: s.generatedLine - (c.generatedOffset.generatedLine - 1),\n column: s.generatedColumn - (c.generatedOffset.generatedLine === s.generatedLine ? c.generatedOffset.generatedColumn - 1 : 0),\n bias: r.bias\n }) : {\n source: null,\n line: null,\n column: null,\n name: null\n };\n }, L.prototype.hasContentsOfAllSources = function() {\n return this._sections.every(function(r) {\n return r.consumer.hasContentsOfAllSources();\n });\n }, L.prototype.sourceContentFor = function(r, s) {\n for (var l = 0; l < this._sections.length; l++) {\n var c = this._sections[l], h = c.consumer.sourceContentFor(r, !0);\n if (h)\n return h;\n }\n if (s)\n return null;\n throw new Error('\"' + r + '\" is not in the SourceMap.');\n }, L.prototype.generatedPositionFor = function(r) {\n for (var s = 0; s < this._sections.length; s++) {\n var l = this._sections[s];\n if (l.consumer.sources.indexOf(t.getArg(r, \"source\")) !== -1) {\n var c = l.consumer.generatedPositionFor(r);\n if (c) {\n var h = {\n line: c.line + (l.generatedOffset.generatedLine - 1),\n column: c.column + (l.generatedOffset.generatedLine === c.line ? l.generatedOffset.generatedColumn - 1 : 0)\n };\n return h;\n }\n }\n }\n return {\n line: null,\n column: null\n };\n }, L.prototype._parseMappings = function(r, s) {\n this.__generatedMappings = [], this.__originalMappings = [];\n for (var l = 0; l < this._sections.length; l++)\n for (var c = this._sections[l], h = c.consumer._generatedMappings, g = 0; g < h.length; g++) {\n var e = h[g], n = c.consumer._sources.at(e.source);\n c.consumer.sourceRoot !== null && (n = t.join(c.consumer.sourceRoot, n)), this._sources.add(n), n = this._sources.indexOf(n);\n var i = c.consumer._names.at(e.name);\n this._names.add(i), i = this._names.indexOf(i);\n var o = {\n source: n,\n generatedLine: e.generatedLine + (c.generatedOffset.generatedLine - 1),\n generatedColumn: e.generatedColumn + (c.generatedOffset.generatedLine === e.generatedLine ? c.generatedOffset.generatedColumn - 1 : 0),\n originalLine: e.originalLine,\n originalColumn: e.originalColumn,\n name: i\n };\n this.__generatedMappings.push(o), typeof o.originalLine == \"number\" && this.__originalMappings.push(o);\n }\n d(this.__generatedMappings, t.compareByGeneratedPositionsDeflated), d(this.__originalMappings, t.compareByOriginalPositions);\n }, p.IndexedSourceMapConsumer = L;\n },\n /* 2 */\n /***/\n function(T, p) {\n function A(e, n, i) {\n if (n in e)\n return e[n];\n if (arguments.length === 3)\n return i;\n throw new Error('\"' + n + '\" is a required argument.');\n }\n p.getArg = A;\n var t = /^(?:([\\w+\\-.]+):)?\\/\\/(?:(\\w+:\\w+)@)?([\\w.]*)(?::(\\d+))?(\\S*)$/, C = /^data:.+\\,.+$/;\n function f(e) {\n var n = e.match(t);\n return n ? {\n scheme: n[1],\n auth: n[2],\n host: n[3],\n port: n[4],\n path: n[5]\n } : null;\n }\n p.urlParse = f;\n function m(e) {\n var n = \"\";\n return e.scheme && (n += e.scheme + \":\"), n += \"//\", e.auth && (n += e.auth + \"@\"), e.host && (n += e.host), e.port && (n += \":\" + e.port), e.path && (n += e.path), n;\n }\n p.urlGenerate = m;\n function d(e) {\n var n = e, i = f(e);\n if (i) {\n if (!i.path)\n return e;\n n = i.path;\n }\n for (var o = p.isAbsolute(n), v = n.split(/\\/+/), S, E = 0, b = v.length - 1; b >= 0; b--)\n S = v[b], S === \".\" ? v.splice(b, 1) : S === \"..\" ? E++ : E > 0 && (S === \"\" ? (v.splice(b + 1, E), E = 0) : (v.splice(b, 2), E--));\n return n = v.join(\"/\"), n === \"\" && (n = o ? \"/\" : \".\"), i ? (i.path = n, m(i)) : n;\n }\n p.normalize = d;\n function u(e, n) {\n e === \"\" && (e = \".\"), n === \"\" && (n = \".\");\n var i = f(n), o = f(e);\n if (o && (e = o.path || \"/\"), i && !i.scheme)\n return o && (i.scheme = o.scheme), m(i);\n if (i || n.match(C))\n return n;\n if (o && !o.host && !o.path)\n return o.host = n, m(o);\n var v = n.charAt(0) === \"/\" ? n : d(e.replace(/\\/+$/, \"\") + \"/\" + n);\n return o ? (o.path = v, m(o)) : v;\n }\n p.join = u, p.isAbsolute = function(e) {\n return e.charAt(0) === \"/\" || !!e.match(t);\n };\n function _(e, n) {\n e === \"\" && (e = \".\"), e = e.replace(/\\/$/, \"\");\n for (var i = 0; n.indexOf(e + \"/\") !== 0; ) {\n var o = e.lastIndexOf(\"/\");\n if (o < 0 || (e = e.slice(0, o), e.match(/^([^\\/]+:\\/)?\\/*$/)))\n return n;\n ++i;\n }\n return Array(i + 1).join(\"../\") + n.substr(e.length + 1);\n }\n p.relative = _;\n var y = function() {\n var e = /* @__PURE__ */ Object.create(null);\n return !(\"__proto__\" in e);\n }();\n function L(e) {\n return e;\n }\n function a(e) {\n return s(e) ? \"$\" + e : e;\n }\n p.toSetString = y ? L : a;\n function r(e) {\n return s(e) ? e.slice(1) : e;\n }\n p.fromSetString = y ? L : r;\n function s(e) {\n if (!e)\n return !1;\n var n = e.length;\n if (n < 9 || e.charCodeAt(n - 1) !== 95 || e.charCodeAt(n - 2) !== 95 || e.charCodeAt(n - 3) !== 111 || e.charCodeAt(n - 4) !== 116 || e.charCodeAt(n - 5) !== 111 || e.charCodeAt(n - 6) !== 114 || e.charCodeAt(n - 7) !== 112 || e.charCodeAt(n - 8) !== 95 || e.charCodeAt(n - 9) !== 95)\n return !1;\n for (var i = n - 10; i >= 0; i--)\n if (e.charCodeAt(i) !== 36)\n return !1;\n return !0;\n }\n function l(e, n, i) {\n var o = e.source - n.source;\n return o !== 0 || (o = e.originalLine - n.originalLine, o !== 0) || (o = e.originalColumn - n.originalColumn, o !== 0 || i) || (o = e.generatedColumn - n.generatedColumn, o !== 0) || (o = e.generatedLine - n.generatedLine, o !== 0) ? o : e.name - n.name;\n }\n p.compareByOriginalPositions = l;\n function c(e, n, i) {\n var o = e.generatedLine - n.generatedLine;\n return o !== 0 || (o = e.generatedColumn - n.generatedColumn, o !== 0 || i) || (o = e.source - n.source, o !== 0) || (o = e.originalLine - n.originalLine, o !== 0) || (o = e.originalColumn - n.originalColumn, o !== 0) ? o : e.name - n.name;\n }\n p.compareByGeneratedPositionsDeflated = c;\n function h(e, n) {\n return e === n ? 0 : e > n ? 1 : -1;\n }\n function g(e, n) {\n var i = e.generatedLine - n.generatedLine;\n return i !== 0 || (i = e.generatedColumn - n.generatedColumn, i !== 0) || (i = h(e.source, n.source), i !== 0) || (i = e.originalLine - n.originalLine, i !== 0) || (i = e.originalColumn - n.originalColumn, i !== 0) ? i : h(e.name, n.name);\n }\n p.compareByGeneratedPositionsInflated = g;\n },\n /* 3 */\n /***/\n function(T, p) {\n p.GREATEST_LOWER_BOUND = 1, p.LEAST_UPPER_BOUND = 2;\n function A(t, C, f, m, d, u) {\n var _ = Math.floor((C - t) / 2) + t, y = d(f, m[_], !0);\n return y === 0 ? _ : y > 0 ? C - _ > 1 ? A(_, C, f, m, d, u) : u == p.LEAST_UPPER_BOUND ? C < m.length ? C : -1 : _ : _ - t > 1 ? A(t, _, f, m, d, u) : u == p.LEAST_UPPER_BOUND ? _ : t < 0 ? -1 : t;\n }\n p.search = function(C, f, m, d) {\n if (f.length === 0)\n return -1;\n var u = A(\n -1,\n f.length,\n C,\n f,\n m,\n d || p.GREATEST_LOWER_BOUND\n );\n if (u < 0)\n return -1;\n for (; u - 1 >= 0 && m(f[u], f[u - 1], !0) === 0; )\n --u;\n return u;\n };\n },\n /* 4 */\n /***/\n function(T, p, A) {\n var t = A(2), C = Object.prototype.hasOwnProperty;\n function f() {\n this._array = [], this._set = /* @__PURE__ */ Object.create(null);\n }\n f.fromArray = function(d, u) {\n for (var _ = new f(), y = 0, L = d.length; y < L; y++)\n _.add(d[y], u);\n return _;\n }, f.prototype.size = function() {\n return Object.getOwnPropertyNames(this._set).length;\n }, f.prototype.add = function(d, u) {\n var _ = t.toSetString(d), y = C.call(this._set, _), L = this._array.length;\n (!y || u) && this._array.push(d), y || (this._set[_] = L);\n }, f.prototype.has = function(d) {\n var u = t.toSetString(d);\n return C.call(this._set, u);\n }, f.prototype.indexOf = function(d) {\n var u = t.toSetString(d);\n if (C.call(this._set, u))\n return this._set[u];\n throw new Error('\"' + d + '\" is not in the set.');\n }, f.prototype.at = function(d) {\n if (d >= 0 && d < this._array.length)\n return this._array[d];\n throw new Error(\"No element indexed by \" + d);\n }, f.prototype.toArray = function() {\n return this._array.slice();\n }, p.ArraySet = f;\n },\n /* 5 */\n /***/\n function(T, p, A) {\n var t = A(6), C = 5, f = 1 << C, m = f - 1, d = f;\n function u(y) {\n return y < 0 ? (-y << 1) + 1 : (y << 1) + 0;\n }\n function _(y) {\n var L = (y & 1) === 1, a = y >> 1;\n return L ? -a : a;\n }\n p.encode = function(L) {\n var a = \"\", r, s = u(L);\n do\n r = s & m, s >>>= C, s > 0 && (r |= d), a += t.encode(r);\n while (s > 0);\n return a;\n }, p.decode = function(L, a, r) {\n var s = L.length, l = 0, c = 0, h, g;\n do {\n if (a >= s)\n throw new Error(\"Expected more digits in base 64 VLQ value.\");\n if (g = t.decode(L.charCodeAt(a++)), g === -1)\n throw new Error(\"Invalid base64 digit: \" + L.charAt(a - 1));\n h = !!(g & d), g &= m, l = l + (g << c), c += C;\n } while (h);\n r.value = _(l), r.rest = a;\n };\n },\n /* 6 */\n /***/\n function(T, p) {\n var A = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\".split(\"\");\n p.encode = function(t) {\n if (0 <= t && t < A.length)\n return A[t];\n throw new TypeError(\"Must be between 0 and 63: \" + t);\n }, p.decode = function(t) {\n var C = 65, f = 90, m = 97, d = 122, u = 48, _ = 57, y = 43, L = 47, a = 26, r = 52;\n return C <= t && t <= f ? t - C : m <= t && t <= d ? t - m + a : u <= t && t <= _ ? t - u + r : t == y ? 62 : t == L ? 63 : -1;\n };\n },\n /* 7 */\n /***/\n function(T, p) {\n function A(f, m, d) {\n var u = f[m];\n f[m] = f[d], f[d] = u;\n }\n function t(f, m) {\n return Math.round(f + Math.random() * (m - f));\n }\n function C(f, m, d, u) {\n if (d < u) {\n var _ = t(d, u), y = d - 1;\n A(f, _, u);\n for (var L = f[u], a = d; a < u; a++)\n m(f[a], L) <= 0 && (y += 1, A(f, y, a));\n A(f, y + 1, a);\n var r = y + 1;\n C(f, m, d, r - 1), C(f, m, r + 1, u);\n }\n }\n p.quickSort = function(f, m) {\n C(f, m, 0, f.length - 1);\n };\n }\n /******/\n ])\n );\n });\n})(I);\nvar Q = I.exports;\nasync function W(O) {\n return O == null ? O : new Promise((G) => {\n try {\n Q.mapStackTrace(O, (T) => {\n G(T.join(`\n`));\n });\n } catch {\n G(O);\n }\n });\n}\nfunction X(O) {\n if (O == null || typeof O != \"object\")\n return { message: O };\n const G = {};\n for (const T of Object.getOwnPropertyNames(O))\n G[T] = O[T];\n return G;\n}\nfunction N(O) {\n return O != null && typeof O == \"object\";\n}\nfunction U(O) {\n return O instanceof Error || N(O) && \"stack\" in O && typeof O.stack == \"string\";\n}\nfunction z(O) {\n return (O instanceof Error || N(O) && \"cause\" in O) && U(O.cause);\n}\nasync function V(O) {\n const G = X(O);\n return U(O) && (G.stack = await W(O.stack)), z(O) && (G.cause = await V(O.cause)), G;\n}\nexport {\n V as unminifyError,\n W as unminifyStackTrace\n};\n","import { unminifyError } from '@sgme/stacktrace';\nimport { getFrontLogger } from 'utils/loggers/FrontLogger';\n\n/**\n * Log an error from the front to the back, unminifying the error in the process\n * @param messageTemplate\n * @param error\n */\nexport async function logFrontError(messageTemplate: string, error: unknown) {\n const err = await unminifyError(error);\n getFrontLogger().error(messageTemplate, err);\n}\n","import type { SgBootstrapTheme } from '@sgwt/sgwt-widgets-react';\n\nconst defaultVariation = import.meta.env.VITE_SGBS_THEME;\n\nfunction generateSgbsUrls(variation = defaultVariation) {\n const cdnUrl = getCdnUrl();\n return {\n sgbs: `${cdnUrl}/core/css/sg-bootstrap-${variation}.min.css`,\n aggrid: `${cdnUrl}/ag-grid-theme/31-${variation}.min.css`,\n shepherd: `${cdnUrl}/shepherd/theme-${variation}.min.css`,\n };\n}\n\nfunction getCdnUrl() {\n const cdn = import.meta.env.VITE_SGBS_CDN;\n const version = import.meta.env.VITE_SGBS_VERSION;\n return `${cdn}/${version}`;\n}\n\nfunction updateThemeUrls(variation: SgBootstrapTheme) {\n document.body.classList.remove(variation === 'dark' ? 'light-theme' : 'dark-theme');\n document.body.classList.add(variation === 'dark' ? 'dark-theme' : 'light-theme');\n\n Object.entries(generateSgbsUrls(variation)).forEach(([id, url]) => {\n appendUniqueLinkToDocument(id, url);\n });\n}\n\nexport function initSgBootstrap(variation = defaultVariation) {\n updateThemeUrls(variation);\n appendUniqueLinkToDocument('icons', `${getCdnUrl()}/icons/index.min.css`);\n}\n\nexport function updateTheme(variation: SgBootstrapTheme) {\n updateThemeUrls(variation);\n}\n\nfunction appendUniqueLinkToDocument(id: string, url: string) {\n const linkElement = document.querySelector(`link[id=\"${id}\"]`);\n if (linkElement) {\n linkElement.href = url;\n } else {\n const newLinkElement = document.createElement('link');\n newLinkElement.rel = 'stylesheet';\n newLinkElement.id = id;\n newLinkElement.href = url;\n document.head.appendChild(newLinkElement);\n }\n}\n","import { getFrontLogger } from './loggers/FrontLogger';\n\nexport function redirectToRequestAccessPage() {\n getFrontLogger().info('Redirecting to REQUEST_ACCESS_PAGE');\n const unauthorizedUrl: string = window.sgmeConfiguration.unauthorizedUrl;\n const alreadyContainsARedirectUrl = !unauthorizedUrl.endsWith('redirectUri=');\n const errorPageUrl = unauthorizedUrl + (alreadyContainsARedirectUrl ? '' : location.href);\n window.location.replace(errorPageUrl);\n}\nexport function extractFakeSsoFromQueryString(queryString: string): string | null {\n try {\n const lowerCaseQueryString = queryString.toLowerCase();\n if (!lowerCaseQueryString.includes('fakesso=')) {\n return null;\n }\n\n const fakeSsoQueryString = lowerCaseQueryString.split('fakesso=').pop();\n if (!fakeSsoQueryString) {\n return null;\n }\n\n if (!fakeSsoQueryString.includes('@sgcib.com')) {\n return null;\n }\n\n const user = fakeSsoQueryString.split('@sgcib.com').shift();\n\n if (!user) {\n return null;\n }\n\n return `${user}@sgcib.com`;\n } catch (error) {\n return null;\n }\n}\n","import { setupSGWTConnect } from '@sgwt/connect-core';\nimport type { ISGWTConnectIdTokenClaims, SGWTConnectCore } from '@sgwt/connect-core';\n\nconst mockedSgConnect = {\n getAuthorizationHeader: () => 'mocked-bearer-token',\n isAuthorized: () => true,\n on: () => mockedSgConnect,\n requestAuthorization: () => {\n return mockedSgConnect;\n },\n getIdTokenClaims: () => {\n return { sub: 'fake.user@sgcib.com' } as ISGWTConnectIdTokenClaims;\n },\n} as Partial as SGWTConnectCore;\n\nfunction bootstrapSgConnect(sgmeConfiguration: SgmeConfiguration): SGWTConnectCore {\n if (!sgmeConfiguration) {\n throw new Error('sgmeConfiguration is not provided on Window');\n }\n if (sgmeConfiguration.disableSgConnect === true) {\n return mockedSgConnect; // for integration test only\n }\n return setupSGWTConnect(sgmeConfiguration.sgConnect);\n}\n\nexport const sgwtConnect = bootstrapSgConnect(window.sgmeConfiguration);\n","import type { SgwtConnectHTMLElement } from '@sgwt/sgwt-widgets-react';\nimport { tryToLogContentSecurityViolationsForDebuggingPurpose } from 'bootstrapper/reportCsp';\nimport { logFrontError } from 'utils/errors/logFrontError';\nimport { getFrontLogger } from 'utils/loggers/FrontLogger';\nimport { initSgBootstrap } from 'utils/theming';\nimport { redirectToRequestAccessPage } from 'utils/url';\nimport { sgwtConnect } from './api/connect';\n\nsetupSgwtConnectWidget();\ntryToLogContentSecurityViolationsForDebuggingPurpose();\n\nfunction setupSgwtConnectWidget() {\n const widget = document.querySelector('sgwt-connect');\n if (widget) {\n if (typeof widget.setSgwtConnectInstance === 'undefined') {\n const handleSgwtConnectReady = async () => {\n try {\n widget.removeEventListener('sgwt-connect--ready', handleSgwtConnectReady);\n widget.setSgwtConnectInstance(sgwtConnect);\n } catch (error) {\n logFrontError('Error while setting sgwt-connect: {@FrontError}', error);\n }\n };\n\n widget?.addEventListener('sgwt-connect--ready', handleSgwtConnectReady, { once: true });\n } else {\n try {\n widget.setSgwtConnectInstance(sgwtConnect);\n } catch (error) {\n logFrontError('Error while setting sgwt-connect: {@FrontError}', error);\n }\n }\n }\n}\n\nwindow.sgwtConnect = sgwtConnect;\n\nif (sgwtConnect.isAuthorized()) {\n const variation = window.SGWTWidgetConfiguration.context.getSgDesignSystemTheme() ?? 'standard';\n initSgBootstrap(variation);\n const frontLogger = getFrontLogger();\n frontLogger.startLogSession();\n import('bootstrapper/main').then(({ onSgConnectAuthenticated }) => {\n onSgConnectAuthenticated();\n });\n} else {\n const authorizationError = sgwtConnect.getAuthorizationError();\n if (authorizationError) {\n const frontLogger = getFrontLogger();\n frontLogger.error('Authorization failed with error {@FrontError}', sgwtConnect.getAuthorizationError());\n redirectToRequestAccessPage();\n } else {\n sgwtConnect.requestAuthorization();\n }\n}\nexport { getRootUrl } from 'utils/browser/browser';\n"],"file":"assets/main-Ciclf5zt.js"}