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5wLwB,MAAxB9a,OAAmB,aAAWA,OAAmB,WAAS,CAAC,GAC/B,MAA5BA,OAAmB,WAAE4nC,MAAa5nC,OAAmB,WAAE4nC,IAAW,CAAC,GAEvE5nC,OAAmB,WAAE4nC,IAAIC,OAAS,C","sources":["webpack://ng-cli/webpack/bootstrap","webpack://ng-cli/webpack/runtime/define property getters","webpack://ng-cli/webpack/runtime/hasOwnProperty shorthand","webpack://ng-cli/webpack/runtime/make namespace object","webpack://ng-cli/./node_modules/tslib/tslib.es6.mjs","webpack://ng-cli/external var \"inversify\"","webpack://ng-cli/external var \"localforage\"","webpack://ng-cli/external var \"window[\\\"date-fns\\\"]\"","webpack://ng-cli/external var \"window[\\\"reflect-metadata\\\"]\"","webpack://ng-cli/external var \"window[\\\"oidc-client-ts\\\"]\"","webpack://ng-cli/external var \"window[\\\"i18next\\\"]\"","webpack://ng-cli/external var \"window[\\\"microsoft\\\"][\\\"signalr\\\"]\"","webpack://ng-cli/external var \"window[\\\"@elastic\\\"][\\\"apm-rum\\\"]\"","webpack://ng-cli/external var \"axios\"","webpack://ng-cli/./dist/@lvflanders/bar/fesm2022/lvflanders-bar.mjs","webpack://ng-cli/./cdn/lvflanders-bar.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = inversify;","const __WEBPACK_NAMESPACE_OBJECT__ = localforage;","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"date-fns\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"reflect-metadata\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"oidc-client-ts\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"i18next\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"microsoft\"][\"signalr\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"@elastic\"][\"apm-rum\"];","const __WEBPACK_NAMESPACE_OBJECT__ = axios;","import { __decorate, __metadata, __param } from 'tslib';\nimport { injectable, inject, named, tagged, multiInject, optional, Container } from 'inversify';\nimport localforage from 'localforage';\nimport 'reflect-metadata';\nimport { addSeconds, isBefore } from 'date-fns';\nimport { WebStorageStateStore, UserManager } from 'oidc-client-ts';\nimport i18next from 'i18next';\nimport * as signalR from '@microsoft/signalr';\nimport { init } from '@elastic/apm-rum';\nimport axios from 'axios';\n\n/**\n * Gets an object containing the parts of a given URL.\n */\nfunction extractUrlParts(url) {\n const a = document.createElement('a');\n a.href = url;\n return {\n url: a.href,\n host: a.host,\n hostname: a.hostname,\n port: a.port,\n pathname: a.pathname,\n protocol: a.protocol,\n hash: a.hash,\n search: a.search,\n // NOTE in IE the anchor gives undefined on origin, so we use a custom method\n origin: extractUrlOrigin(url)\n };\n}\n// https://stackoverflow.com/a/1420902/2174621\n/**\n * Extracts the origin from a given URL.\n * @param url\n */\nfunction extractUrlOrigin(url) {\n if (url == null || url.length == 0)\n return null;\n const pathArray = url.split('/');\n const protocol = pathArray[0];\n const host = pathArray[2];\n return protocol + '//' + host;\n}\n/**\n * Checks whether a given URL is absolute.\n * @param url\n */\n// https://stackoverflow.com/questions/10687099/how-to-test-if-a-url-string-is-absolute-or-relative\nfunction checkUrlAbsolute(url) {\n return new RegExp('^(?:[a-z]+:)?//', 'i').test(url);\n}\n// https://stackoverflow.com/a/901144/2174621\n/**\n * Gets a query string value.\n * @param name Query string key name.\n * @param url Optional URL.\n */\nfunction parseQueryStringValue(name, url = null) {\n if (url == null)\n url = window.location.href;\n name = name.replace(/[\\[\\]]/g, '\\\\$&');\n const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'), results = regex.exec(url);\n if (!results)\n return null;\n if (!results[2])\n return '';\n return decodeURIComponent(results[2].replace(/\\+/g, ' '));\n}\n/**\n * Resolves an url from the origin (domain) of the application.\n * @param url\n */\nfunction resolveUrlFromOrigin(url) {\n return checkUrlAbsolute(url) ? url : document.location.origin + url;\n}\n/**\n * Opens an URI.\n * @param uri\n */\nfunction openUrl(url, target = null) {\n const a = document.createElement('a');\n a.href = url;\n if (target != null)\n a.target = target;\n document.body.appendChild(a);\n a.click();\n a.parentNode.removeChild(a);\n}\n/** Checks whether we are in localhost modus. */\nfunction checkLocalhost() {\n return window.location.hostname === 'localhost';\n}\n/** Concats different pieces of an url with slashes. */\nfunction concatUrl(...urlSegments) {\n let result = null;\n if (urlSegments && urlSegments.length) {\n result = '';\n urlSegments.forEach((urlSegment) => {\n if (urlSegment && urlSegment.length) {\n if (result.length && !result.endsWith('/') && !urlSegment.startsWith('/'))\n result += '/';\n else if (result.endsWith('/') && urlSegment.startsWith('/'))\n result = result.substring(0, result.length - 1);\n result += urlSegment;\n }\n });\n }\n return result;\n}\nfunction _checkCompatibleOrigin(url, compatibleOrigins) {\n if (compatibleOrigins?.length) {\n const origin = new URL(url).origin.toLowerCase();\n return compatibleOrigins.some((compatibleOrigin) => {\n let value = compatibleOrigin.value.toLowerCase();\n if (value.endsWith('/'))\n value = value.substring(0, value.length - 1);\n if (compatibleOrigin.strategy === 'exact' && origin === value) {\n return true;\n }\n else if (compatibleOrigin.strategy === 'startsWith' && origin.startsWith(value)) {\n return true;\n }\n });\n }\n return false;\n}\n/** Clears query string params from a given url. */\nfunction clearQueryStringParams(uri, condition) {\n const url = new URL(uri);\n const keysToDelete = [];\n // Collect the keys that start with 'idp-' in an array\n url.searchParams.forEach((value, key) => {\n if (condition(key))\n keysToDelete.push(key);\n });\n // Delete the keys after collecting them\n keysToDelete.forEach((key) => url.searchParams.delete(key));\n return url.toString();\n}\n\n/** Public types. */\nconst BAAS_TYPES = {\n AxiosInstance: Symbol('AxiosInstance'),\n BaasAuthStrategy: Symbol('BaasAuthStrategy'),\n BaasContextProvider: Symbol('BaasContextProvider'),\n BaasLogOffHook: Symbol('BaasLogOffHook'),\n BaasLoggingApiClient: Symbol('BaasLoggingApiClient'),\n BaasMeldingApiClient: Symbol('BaasMeldingApiClient'),\n BaasSecurityApiClient: Symbol('BaasSecurityApiClient'),\n BaasAuditApiClient: Symbol('BaasAuditApiClient'),\n BaasConfigurationApiClient: Symbol('BaasConfigurationApiClient'),\n BaasMeetpuntApiClient: Symbol('BaasMeetpuntApiClient'),\n BaasCommonApiClient: Symbol('BaasCommonApiClient'),\n BarGvkRemoteStoreProvider: Symbol('BarGvkRemoteStoreProvider'),\n BarErrorDelegate: Symbol('BarErrorDelegate'),\n BaasTelemetry: Symbol('BaasTelemetry'),\n /** @internal @experimental Symbol for future LV OIDC auth service */\n _BaasLvOicdAuthService: Symbol('BaasLvOicdAuthService')\n};\nconst BAAS_AXIOS_INSTANCE_TYPES = {\n /** Default axios instance with interception. */\n Baas: Symbol('Baas'),\n _BaasSilent: Symbol('BaasSilent'),\n /** Plain axios instance (barebone). */\n Plain: Symbol('Plain')\n};\n\n/** Reads a cookie. */\nfunction readCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ')\n c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0)\n return decodeURIComponent(c.substring(nameEQ.length, c.length));\n }\n return null;\n}\n/** Deletes all cookies which can be deleted. */\nfunction deleteAllCookies() {\n const cookies = document.cookie.split(';');\n for (let i = 0; i < cookies.length; i++) {\n const cookie = cookies[i];\n const eqPos = cookie.indexOf('=');\n const name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;\n deleteCookie(name);\n }\n}\n/** Deletes a cookie. */\nfunction deleteCookie(name) {\n document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';\n}\n\nfunction checkDateObject(value) {\n return Object.prototype.toString.call(value) === '[object Date]';\n}\n// NOTE alternatief voor toISOString() omdat hierbij telkens een convertie gedaan wordt naar UTC + 0.\n/** Converts a given date as it to an ISO string without converting to UTC +0. */\nfunction convertToISOString(value) {\n if (!value)\n return value;\n return new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate(), value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds())).toISOString();\n}\n\n/** Deletes all indexed db databases. */\nfunction deleteAllIndexedDb() {\n return new Promise((resolve) => {\n window.indexedDB\n .databases()\n .then((r) => {\n for (let i = 0; i < r.length; i++)\n window.indexedDB.deleteDatabase(r[i].name);\n })\n .then(() => {\n resolve();\n });\n });\n}\n/** Deletes an entire indexed db. */\nfunction deleteIndexedDb(name) {\n window.indexedDB.deleteDatabase(name);\n}\n/** Gets the version of an indexed db. */\nfunction getIndexedDbVersion(name) {\n return new Promise((resolve) => {\n const request = window.indexedDB.open(name);\n request.onsuccess = (event) => {\n const db = event.target.result;\n // close db because we need to do an upgrade\n db.close();\n resolve(event.target.result.version);\n };\n });\n}\n/*** Gets information about a given indexed db. */\nfunction getIndexedDbInfo(name) {\n return new Promise((resolve) => {\n const request = window.indexedDB.open(name);\n request.onsuccess = (event) => {\n const db = event.target.result;\n // close db because we need to do an upgrade\n db.close();\n resolve({\n version: event.target.result.version,\n objectStoreNames: [...db.objectStoreNames]\n });\n };\n });\n}\n/** Internal method to delete all object stores in a given indexed db with the actual version. */\nfunction _deleteIndexedDbObjectStores(name, version, storeNames) {\n return new Promise((resolve) => {\n const request = indexedDB.open(name, version);\n request.onupgradeneeded = (event) => {\n const db = event.target.result;\n storeNames.forEach((storeName) => {\n db.deleteObjectStore(storeName);\n });\n db.close();\n resolve();\n };\n });\n}\n\n// http://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript\n/**\n * Generate universally unique identifier.\n */\nfunction generateUuid() {\n let d = Date.now(); // support from IE9 onwards\n if (window.performance && typeof window.performance.now === 'function') {\n d += performance.now(); //use high-precision timer if available\n }\n const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n const r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c == 'x' ? r : (r & 0x3) | 0x8).toString(16);\n });\n return uuid;\n}\n/**\n * Will get the value or execute the function to get the value.\n * @param value\n */\nfunction resolveValue(value) {\n if (typeof value === 'function') {\n return value();\n }\n else {\n return value;\n }\n}\n/**\n * Ensures the creation of a global variable with nesting and gives the reference to the last property.\n * @param nestedObject\n */\nfunction ensureGlobal(nestedObject) {\n let result = null;\n if (nestedObject != null && nestedObject.length > 0) {\n let global = window;\n const pieces = nestedObject.split('.');\n pieces.forEach((piece) => {\n if (global[piece] == null) {\n global[piece] = {};\n }\n global = global[piece];\n });\n result = global;\n }\n return result;\n}\n// https://www.geeksforgeeks.org/how-to-get-the-javascript-function-parameter-names-values-dynamically/\n/** Gets the parameters of a function. */\nfunction getParamNames(func) {\n // String representaation of the function code\n let str = func.toString();\n // Remove comments of the form /* ... */\n // Removing comments of the form //\n // Remove body of the function { ... }\n // removing '=>' if func is arrow function\n str = str\n .replace(/\\/\\*[\\s\\S]*?\\*\\//g, '')\n .replace(/\\/\\/(.)*/g, '')\n .replace(/{[\\s\\S]*}/, '')\n .replace(/=>/g, '')\n .trim();\n // Start parameter names after first '('\n const start = str.indexOf('(') + 1;\n // End parameter names is just before last ')'\n const end = str.length - 1;\n const result = str.substring(start, end).split(', ');\n const params = [];\n result.forEach((element) => {\n // Removing any default value\n element = element.replace(/=[\\s\\S]*/g, '').trim();\n if (element.length > 0)\n params.push(element);\n });\n return params;\n}\nfunction getStack() {\n try {\n throw new Error();\n }\n catch (e) {\n return e.stack.replace('Error\\n', '').trim();\n }\n}\n/** Compares 2 versions end returns 0 if equal, 1 if version 1 is higher than 2 and -1 if version 1 is lower than 2. */\nfunction versionCompare(v1, v2, options = undefined) {\n const lexicographical = options && options.lexicographical;\n const zeroExtend = options && options.zeroExtend;\n let v1parts = v1.split('.');\n let v2parts = v2.split('.');\n function isValidPart(x) {\n return (lexicographical ? /^\\d+[A-Za-z]*$/ : /^\\d+$/).test(x);\n }\n if (!v1parts.every(isValidPart) || !v2parts.every(isValidPart)) {\n return NaN;\n }\n if (zeroExtend) {\n while (v1parts.length < v2parts.length)\n v1parts.push('0');\n while (v2parts.length < v1parts.length)\n v2parts.push('0');\n }\n if (!lexicographical) {\n v1parts = v1parts.map(Number);\n v2parts = v2parts.map(Number);\n }\n for (let i = 0; i < v1parts.length; ++i) {\n if (v2parts.length == i) {\n return 1;\n }\n if (v1parts[i] == v2parts[i]) {\n continue;\n }\n else if (v1parts[i] > v2parts[i]) {\n return 1;\n }\n else {\n return -1;\n }\n }\n if (v1parts.length != v2parts.length) {\n return -1;\n }\n return 0;\n}\n// NOTE from BARVUY\nfunction generateRandomNumber(min, max) {\n // find diff\n const difference = max - min;\n // generate random number\n let rand = Math.random();\n // multiply with difference\n rand = Math.floor(rand * difference);\n // add with min value\n return rand + min;\n}\n\n/** Generic internal logger to start log based on a flag in localstorage. */\nclass BarLogger {\n get enabled() {\n if (this._enabled == null) {\n if (this.options?.category) {\n // if we have a flag to check by default it is not enabled.\n this._enabled = false;\n const item = window.localStorage.getItem(`lvflanders.bar.shared.log.enabled.${this.options.category}`);\n if (item != null && item.length > 0) {\n // parse the string value\n this._enabled = JSON.parse(item);\n }\n // if we don't pass on a flag to check in storage we just assume it is enabled\n }\n else\n this._enabled = true;\n }\n return this._enabled;\n }\n get format() {\n if (this._format == null) {\n const item = window.localStorage.getItem('lvflanders.bar.shared.log.format');\n if (item != null && item.length > 0) {\n switch (item.toLowerCase()) {\n case 'json':\n this._format = 'json';\n break;\n default:\n this._format = 'object';\n break;\n }\n }\n }\n return this._format;\n }\n constructor(options) {\n this.options = options;\n }\n /** Logs a message. */\n log(message) {\n if (this.enabled) {\n if (!message.category)\n message.category = this.options?.category;\n if (!message.context)\n message.context = this.options?.context;\n if (!message.stack)\n message.stack = getStack();\n if (this.options?.correlation) {\n // if we gave a correlation as global option we mark it as being the parent\n if (message.correlation)\n message.correlation.parent = this.options.correlation;\n // otherwise we just use it as the leaf correlation for the message\n else\n message.correlation = this.options.correlation;\n }\n switch (this.format) {\n case 'json':\n console.log(JSON.stringify(message));\n break;\n default:\n console.log(message);\n break;\n }\n }\n }\n}\n\nlet BaasAppState = class BaasAppState {\n};\nBaasAppState = __decorate([\n injectable()\n], BaasAppState);\n\n// NOTE wrapper around LocalForage to be able to swap underlying mechanism in an easy fashion\n/** Used to store data in an Indexed DB object store. */\nclass BarStore {\n /** Internally sets a correlation used for logging purposes. Not to be used outside this library. */\n set _correlation(value) {\n // define parent correlation (optionally)\n this.logger.options.correlation = value;\n }\n constructor(name, storeName) {\n this._localforage = localforage.createInstance({\n name: name,\n storeName: storeName,\n // force indexed db, we are not interested in other drivers\n driver: localforage.INDEXEDDB\n });\n this.logger = new BarLogger({\n category: 'cacheStorage',\n context: {\n name: name,\n storeName: storeName,\n type: 'BarStore (LocalForage)'\n }\n });\n }\n /**\n * Gets an item from the object store.\n * @param key Key.\n */\n getItem(key) {\n const correlation = { value: generateUuid() };\n this.logger.log({ message: `Begin getItem with key '${key}'`, correlation: correlation });\n return this._localforage.getItem(key).finally(() => {\n this.logger.log({ message: `End getItem with key '${key}'`, correlation: correlation });\n });\n }\n /**\n * Sets an item in the object store.\n * @param key Key.\n * @param value Object value.\n */\n setItem(key, value) {\n const correlation = { value: generateUuid() };\n this.logger.log({ message: `Begin setItem with key '${key}'`, correlation: correlation });\n return this._localforage.setItem(key, value).finally(() => {\n this.logger.log({ message: `End setItem with key '${key}'`, correlation: correlation });\n });\n }\n /**\n * Removes an item from the store.\n * @param key Key of item.\n */\n removeItem(key) {\n const correlation = { value: generateUuid() };\n this.logger.log({ message: `Begin removeItem with key '${key}'`, correlation: correlation });\n return this._localforage.removeItem(key).finally(() => {\n this.logger.log({ message: `End removeItem with key '${key}'`, correlation: correlation });\n });\n }\n /** Drops the entire store. */\n drop() {\n const correlation = { value: generateUuid() };\n this.logger.log({ message: 'Begin drop', correlation: correlation });\n return this._localforage.dropInstance().finally(() => {\n this.logger.log({ message: 'End drop', correlation: correlation });\n });\n }\n /** Clears the store but doesn't drop it (like it's hot). */\n clear() {\n const correlation = { value: generateUuid() };\n this.logger.log({ message: 'Begin clear', correlation: correlation });\n return this._localforage.clear().finally(() => {\n this.logger.log({ message: 'End clear', correlation: correlation });\n });\n }\n close() {\n const correlation = { value: generateUuid() };\n this.logger.log({ message: 'Begin close', correlation: correlation });\n const dbInfo = this._localforage._dbInfo;\n if (dbInfo) {\n const db = dbInfo.db;\n if (db)\n db.close();\n }\n this.logger.log({ message: 'End close', correlation: correlation });\n }\n /**\n * Iterates over all records in the store.\n * @param iteratee Iterator callback function.\n */\n iterate(iteratee) {\n const correlation = { value: generateUuid() };\n this.logger.log({ message: 'Begin iterate', correlation: correlation });\n return this._localforage.iterate(iteratee).finally(() => {\n this.logger.log({ message: 'End iterate', correlation: correlation });\n });\n }\n /** Gets all keys in the store. */\n keys() {\n const correlation = { value: generateUuid() };\n this.logger.log({ message: 'Begin get keys', correlation: correlation });\n return this._localforage.keys().finally(() => {\n this.logger.log({ message: 'End get keys', correlation: correlation });\n });\n }\n}\n\n/** Represents a cache entry stored into the cache which contains the data and the metadata. */\nclass BarCacheEntry {\n}\n\n// @dynamic\nclass BarCacheEntryOptions {\n constructor() {\n /** Whether to store for the lifecycle of a session */\n this.session = true;\n }\n /** Gets the default cache entry options */\n static get default() {\n return { session: true };\n }\n}\n\n/** Key-value wrapper around object store with caching. */\nclass BarCacheStore {\n // NOTE we use underscore because internal\n /** Sets the app state. */\n set _appState(value) {\n this.__appState = value;\n }\n /** Gets the app state. */\n get _appState() {\n return this.__appState;\n }\n /** Internally sets a correlation used for logging purposes. Not to be used outside this library. */\n set _correlation(value) {\n // define parent correlation (optionally)\n this.logger.options.correlation = value;\n }\n constructor(name, storeName) {\n this.name = name;\n this.storeName = storeName;\n // NOTE we use double underscore because the internal property already has an underscore.\n this.__appState = new BaasAppState();\n this.logger = new BarLogger({\n category: 'cacheStorage',\n context: {\n type: 'BarCacheStore',\n name: this.name,\n storeName: this.storeName\n }\n });\n }\n /**\n * Gets an item from the cache or executes a callback to set it if not in the cache.\n * @param key Key.\n * @param callback Callback to get the value in case the value is not in the cache.\n */\n async getOrSetItem(key, callback, options = BarCacheEntryOptions.default) {\n const correlation = { value: generateUuid() };\n this.logger.log({ message: `Begin getOrSetItem with key '${key}'`, correlation: correlation });\n const instance = this.getStoreInstance(correlation);\n try {\n const value = await this.getItemInternal(instance, key);\n if (value != null)\n return value;\n // execute the callback\n const data = await Promise.resolve(callback());\n // put it in the cache\n await this.setItemInternal(instance, key, data, options);\n return data;\n }\n finally {\n instance.close();\n this.logger.log({ message: `End getOrSetItem with key '${key}'`, correlation: correlation });\n }\n }\n /** Gets an item from the cache. */\n async getItem(key) {\n const correlation = { value: generateUuid() };\n this.logger.log({ message: `Begin getItem with key '${key}'`, correlation: correlation });\n const instance = this.getStoreInstance(correlation);\n try {\n return await this.getItemInternal(instance, key);\n }\n finally {\n instance.close();\n this.logger.log({ message: `End getItem with key '${key}'`, correlation: correlation });\n }\n }\n /** Sets an item in the cache with options. */\n async setItem(key, value, options = BarCacheEntryOptions.default) {\n const correlation = { value: generateUuid() };\n this.logger.log({ message: `Begin setItem with key '${key}'`, correlation: correlation });\n const instance = this.getStoreInstance(correlation);\n const entry = new BarCacheEntry();\n entry.value = value;\n entry.timestamp = new Date();\n // compute the expiration based on ttl\n entry.expiration = options != null && options.ttl != null ? addSeconds(entry.timestamp, options.ttl) : null;\n entry.options = options;\n entry.sessionId = this._appState?.sessionId;\n try {\n await instance.setItem(key, entry);\n }\n finally {\n instance.close();\n this.logger.log({ message: `End setItem with key '${key}'`, correlation: correlation });\n }\n }\n /** Removes an item from the cache. */\n async removeItem(key) {\n const correlation = { value: generateUuid() };\n this.logger.log({ message: `Begin removeItem with key '${key}'`, correlation: correlation });\n const instance = this.getStoreInstance(correlation);\n try {\n await instance.removeItem(key);\n }\n finally {\n instance.close();\n this.logger.log({ message: `End removeItem with key '${key}'`, correlation: correlation });\n }\n }\n /** Clears all items from the cache. */\n async clear() {\n const correlation = { value: generateUuid() };\n this.logger.log({ message: 'Begin clear', correlation: correlation });\n const instance = this.getStoreInstance(correlation);\n try {\n await instance.clear();\n }\n finally {\n instance.close();\n this.logger.log({ message: 'End clear', correlation: correlation });\n }\n }\n /** Drops the cache. */\n async drop() {\n const correlation = { value: generateUuid() };\n this.logger.log({ message: 'Begin drop', correlation: correlation });\n const instance = this.getStoreInstance(correlation);\n try {\n await instance.drop();\n }\n finally {\n instance.close();\n this.logger.log({ message: 'End drop', correlation: correlation });\n }\n }\n /**\n * Invalidates the store by removing expired cache entries.\n * @param clearSession Whether to clear the session cache entries.\n */\n async invalidate(clearSession = false) {\n const correlation = { value: generateUuid() };\n this.logger.log({ message: `Begin invalidate with clearSession = ${clearSession}`, correlation: correlation });\n const instance = this.getStoreInstance(correlation);\n try {\n await instance.iterate(async (entry, key) => {\n // now we check if the entry is expired or if the consumer wants to clear session entries\n if (this.checkExpired(entry) || (clearSession && entry.options != null && entry.options.session)) {\n await this.removeItem(key);\n }\n });\n const keys = await instance.keys();\n // no items anymore: drop the instance\n if (keys.length === 0)\n await instance.drop();\n }\n finally {\n instance.close();\n this.logger.log({ message: `End invalidate with clearSession = ${clearSession}`, correlation: correlation });\n }\n }\n checkExpired(entry) {\n return (\n // expiration expired\n (entry.expiration != null && isBefore(entry.expiration, new Date())) ||\n // or session expired (entry from previous session) in case we can check this\n (entry.options?.session && this._appState?.sessionId && entry.sessionId != this._appState.sessionId));\n }\n /* NOTE store used interally (LocalForage)\n Create new instance of the store on every occasion to avoid problems with newer versions of the database.\n Object stores with caching can be created and removed dynamically. Keeping an instance open would cause issues.\n */\n getStoreInstance(correlation) {\n const store = new BarStore(this.name, this.storeName);\n store._correlation = correlation;\n return store;\n }\n async getItemInternal(store, key) {\n const entry = await store.getItem(key);\n if (entry == null)\n return null;\n // check if expired\n if (this.checkExpired(entry)) {\n // if expired remove it\n await store.removeItem(key);\n // and return nothing\n return null;\n }\n else {\n // not expired value is valid\n entry.lastAccess = new Date();\n // update the entry again with last acess timestamp\n await store.setItem(key, entry);\n // finally return the value\n return entry.value;\n }\n }\n async setItemInternal(store, key, value, options) {\n const entry = new BarCacheEntry();\n entry.value = value;\n entry.timestamp = new Date();\n // compute the expiration based on ttl\n entry.expiration = options != null && options.ttl != null ? addSeconds(entry.timestamp, options.ttl) : null;\n entry.sessionId = this._appState?.sessionId;\n entry.options = options;\n await store.setItem(key, entry);\n }\n}\n\n/** Defines how to store a given item. */\nvar BarCacheStoreType;\n(function (BarCacheStoreType) {\n /** Cache store on application level */\n BarCacheStoreType[\"Application\"] = \"Application\";\n /** Cache store on user level. */\n BarCacheStoreType[\"User\"] = \"User\";\n /** Cache store on global level. */\n BarCacheStoreType[\"Global\"] = \"Global\";\n /** Cache store on application and user level. */\n BarCacheStoreType[\"ApplicationUser\"] = \"ApplicationUser\";\n})(BarCacheStoreType || (BarCacheStoreType = {}));\n\nconst DB_NAME_PREFIX = 'domain.lv.cache.';\nconst DB_NAME_APP = `${DB_NAME_PREFIX}app`;\nconst DB_NAME_USER = `${DB_NAME_PREFIX}user`;\nconst DB_NAME_APP_USER = `${DB_NAME_PREFIX}appUser`;\nconst DB_NAME_GLOBAL = `${DB_NAME_PREFIX}global`;\n// GVK gets its own database to avoid conflicts, but invalidation logic will be integrated\nconst DB_NAME_GVK = `${DB_NAME_PREFIX}gvk`;\nlet BarCacheManager = class BarCacheManager {\n constructor(appState = new BaasAppState()) {\n this.appState = appState;\n // TODO use logger factory and use ioc\n this.logger = new BarLogger({ category: 'cacheStorage', context: 'BarCacheManager' });\n }\n /**\n * Gets a cache store with given store options.\n * @param options\n */\n getStore(options) {\n let name = null;\n let storeName = null;\n switch (options.storeType) {\n case BarCacheStoreType.Application: {\n name = DB_NAME_APP;\n storeName = options.appCode;\n break;\n }\n case BarCacheStoreType.User: {\n name = DB_NAME_USER;\n storeName = options.userId;\n break;\n }\n case BarCacheStoreType.ApplicationUser: {\n name = DB_NAME_APP_USER;\n storeName = `${options.appCode}_${options.userId}`;\n break;\n }\n case BarCacheStoreType.Global: {\n name = DB_NAME_GLOBAL;\n storeName = 'main';\n break;\n }\n }\n if (options.store != null) {\n // check if consumer wants separate store in the database\n storeName += `_${options.store}`;\n }\n const result = new BarCacheStore(name, storeName);\n // define the app state context to use (which is the one from this class) by assigning internal property\n result._appState = this.appState;\n return result;\n }\n /**\n * Invalidates all caches.\n * @param clearSession Whether to clear all session cache entries.\n */\n async invalidate(clearSession = false) {\n // use a guid to correlate all actions together for logging purposes\n const correlation = { value: generateUuid() };\n this.logger.log({ message: `Starting cache invalidation with argument clearSession = ${clearSession}`, correlation: correlation });\n await this.invalidateDatabase(DB_NAME_APP, clearSession, correlation);\n await this.invalidateDatabase(DB_NAME_USER, clearSession, correlation);\n await this.invalidateDatabase(DB_NAME_APP_USER, clearSession, correlation);\n await this.invalidateDatabase(DB_NAME_GLOBAL, clearSession, correlation);\n await this.invalidateDatabase(DB_NAME_GVK, clearSession, correlation);\n this.logger.log({ message: 'Ending cache invalidation', correlation: correlation });\n }\n async invalidateDatabase(name, clearSession, correlation) {\n this.logger.log({ message: `Starting database invalidation with name '${name}'`, correlation: correlation });\n this.logger.log({ message: 'Getting objectStoreNames for invalidation purposes', correlation: correlation });\n const objectStoreNames = await this.getObjectStoreNames(name);\n this.logger.log({ message: 'Retrieved objectStoreNames for invalidation purposes', correlation: correlation });\n for (const storeName of objectStoreNames) {\n const store = new BarCacheStore(name, storeName);\n store._correlation = correlation;\n await store.invalidate(clearSession);\n }\n this.logger.log({ message: 'Getting objectStoreNames for dropping purposes', correlation: correlation });\n const remainingObjectStoreNames = await this.getObjectStoreNames(name);\n this.logger.log({ message: 'Retrieved objectStoreNames for dropping purposes', correlation: correlation });\n if (remainingObjectStoreNames.length === 0) {\n // drop database in case empty\n await localforage.dropInstance({ name: name });\n }\n else {\n this.logger.log({ message: `Ending database invalidation with name '${name}'`, correlation: correlation });\n }\n }\n getObjectStoreNames(name) {\n return new Promise((resolve) => {\n // open up a connection\n const openRequest = indexedDB.open(name);\n openRequest.onsuccess = () => {\n const db = openRequest.result;\n // to read all object store names\n const objectStoreNames = db.objectStoreNames;\n db.close();\n resolve(this.toArray(objectStoreNames));\n };\n });\n }\n // https://stackoverflow.com/a/2735133/2174621\n toArray(obj) {\n const array = [];\n // iterate backwards ensuring that length is an UInt32\n for (let i = obj.length >>> 0; i--;) {\n array[i] = obj[i];\n }\n return array;\n }\n};\nBarCacheManager = __decorate([\n injectable(),\n __metadata(\"design:paramtypes\", [BaasAppState])\n], BarCacheManager);\n\n/**\n * Represents a mechanism to add items to a queue and to read them out to execute something.\n */\nclass BarQueueProcessor {\n /**\n * Constructor.\n * @param storage Storage to use.\n * @param storageKey Key to use in the storage.\n */\n constructor(storage, storageKey) {\n this.storage = storage;\n this.storageKey = storageKey;\n this.started = false;\n }\n /**\n * Starts listening to the queue.\n * @param interval Interval in milliseconds to get items from the queue.\n * @param dequeueCount Number of items to get from the queue.\n */\n start(interval, dequeueCount) {\n this.intervalId = window.setInterval(() => this.dequeue(dequeueCount), interval);\n this.started = true;\n }\n /**\n * Stops listening to the queue.\n */\n stop() {\n if (this.started) {\n this.started = false;\n window.clearInterval(this.intervalId);\n this.intervalId = null;\n }\n }\n /**\n * Adds an item to the queue.\n * @param item\n */\n enqueue(item) {\n let queueStr = this.storage.getItem(this.storageKey);\n let queue = null;\n if (queueStr == null) {\n queue = [];\n }\n else {\n queue = JSON.parse(queueStr);\n }\n queue.push(item);\n queueStr = JSON.stringify(queue);\n this.storage.setItem(this.storageKey, queueStr);\n }\n dequeue(dequeueCount) {\n let queueStr = this.storage.getItem(this.storageKey);\n if (queueStr != null) {\n let queue = JSON.parse(queueStr);\n if (queue.length > 0) {\n const itemsToSend = queue.slice(0, dequeueCount);\n queue = queue.slice(dequeueCount);\n if (queue.length == 0) {\n this.storage.removeItem(this.storageKey);\n }\n else {\n queueStr = JSON.stringify(queue);\n this.storage.setItem(this.storageKey, queueStr);\n }\n this.onExecute(itemsToSend);\n }\n }\n }\n}\n\nclass BaasAuthOptions {\n constructor() {\n /** Whether authentication is enabled */\n this.enabled = true;\n /** Whether IDP validation is enabled. */\n this.validation = true;\n }\n}\n\nvar BaasBackendType;\n(function (BaasBackendType) {\n /** BaaS.NET in the backend. */\n BaasBackendType[\"Baas\"] = \"Baas\";\n /** BAR.NET in the backend. */\n BaasBackendType[\"Bar\"] = \"Bar\";\n /** Custom backend. */\n BaasBackendType[\"Custom\"] = \"Custom\";\n})(BaasBackendType || (BaasBackendType = {}));\n\nlet BaasBootstrapOptions = class BaasBootstrapOptions {\n constructor() {\n /** The authentication options */\n this.auth = new BaasAuthOptions();\n /** Backend type. */\n this.backendType = BaasBackendType.Baas;\n /** i18n options for translations/text resources. */\n this.i18n = {};\n }\n};\nBaasBootstrapOptions = __decorate([\n injectable()\n], BaasBootstrapOptions);\n/** Outcome of bootstrapping. */\nvar BaasBootstrapOutcome;\n(function (BaasBootstrapOutcome) {\n /** Bootstrap completed. */\n BaasBootstrapOutcome[\"Initialized\"] = \"Initialized\";\n /** Authentication failed. */\n BaasBootstrapOutcome[\"AuthFailed\"] = \"AuthFailed\";\n /** Still authenticating */\n BaasBootstrapOutcome[\"Authenticating\"] = \"Authenticating\";\n /** Bootstrap has stopped and further processing should be halted. */\n BaasBootstrapOutcome[\"Halted\"] = \"Halted\";\n})(BaasBootstrapOutcome || (BaasBootstrapOutcome = {}));\n\nconst APP_INFO_COOKIE_KEY = 'domain.basisarchitectuur.appinfo';\nconst PAGES_ROOT_PATH = 'bui/';\nconst STORAGE_KEY_PREFIX = 'lvflanders.bar.shared.';\nconst OIDC_CALLBACK_PATH = '/auth/oidc/callback/';\nconst _BAAS_SHARED_CONSTANTS = {\n STORAGE_KEY_PREFIX,\n TEMP_STORAGE_STATE_KEY: STORAGE_KEY_PREFIX + 'temp-state',\n DEFAULT_MEETPUNT_TYPE: 'NG',\n STORAGE_KEY: {\n SESSION_ID: 'sessionId',\n IDP_IMPERSONATE: STORAGE_KEY_PREFIX + 'idpImpersonate',\n BAAS_STATE_CONTEXT: STORAGE_KEY_PREFIX + 'baas-state-context',\n BAR_APPINFO_CONTEXT: STORAGE_KEY_PREFIX + 'bar-appinfo-context'\n },\n URL_SEGMENT: {\n BAR_WEB: '/basisarchitectuur/domain.basisarchitectuur.web/',\n BAAS_STATIC: '/{segment}/baas-static/web/',\n BAAS_WEB: '/{segment}/baasweb/web/',\n IDP_OIDC: '/{segment}/idp-oidc/web/'\n },\n AUDIT: {\n HTML_ATTRIBUTE_AUDIT_ID: 'data-bar-audit-id',\n HTML_ATTRIBUTE_AUDIT_TYPE: 'data-bar-audit-type'\n },\n COOKIE: {\n APP_INFO: {\n MAIN: APP_INFO_COOKIE_KEY,\n SESSION: APP_INFO_COOKIE_KEY + '.session',\n SECURE: APP_INFO_COOKIE_KEY + '.secure'\n }\n },\n HEADER: {\n BAAS_BACKEND_HEADER: 'baas.context.backend',\n BAAS_BROWSER_CALLSTACK: 'baas.browser.callstack'\n },\n PAGE: {\n LOG_OFF: PAGES_ROOT_PATH + 'log-off',\n INSUFFICIENT_PRIVILEGES: PAGES_ROOT_PATH + 'insufficient-privileges'\n },\n AUTH: {\n OIDC: {\n CALLBACK: {\n LV: OIDC_CALLBACK_PATH + 'lv',\n SPOTFIRE: OIDC_CALLBACK_PATH + 'spotfire'\n }\n }\n }\n};\n\nvar BaasLogLevel;\n(function (BaasLogLevel) {\n BaasLogLevel[BaasLogLevel[\"Debug\"] = 0] = \"Debug\";\n BaasLogLevel[BaasLogLevel[\"Audit\"] = 1] = \"Audit\";\n BaasLogLevel[BaasLogLevel[\"Info\"] = 2] = \"Info\";\n BaasLogLevel[BaasLogLevel[\"Warn\"] = 3] = \"Warn\";\n BaasLogLevel[BaasLogLevel[\"Error\"] = 4] = \"Error\";\n BaasLogLevel[BaasLogLevel[\"Critical\"] = 5] = \"Critical\";\n})(BaasLogLevel || (BaasLogLevel = {}));\n\nlet BaasLoggingService = class BaasLoggingService {\n constructor(loggingApiClient, options, state) {\n this.loggingApiClient = loggingApiClient;\n this.options = options;\n this.state = state;\n // instantiate the queue with session storage\n this.queueProcessor = new BarQueueProcessor(window.sessionStorage, `${_BAAS_SHARED_CONSTANTS.STORAGE_KEY_PREFIX}logQueue`);\n }\n error(log) {\n this.post(log, BaasLogLevel.Error);\n }\n warn(log) {\n this.post(log, BaasLogLevel.Warn);\n }\n critical(log) {\n this.post(log, BaasLogLevel.Critical);\n }\n info(log) {\n this.post(log, BaasLogLevel.Info);\n }\n /**\n * Inits logging logic (init != start).\n */\n init() {\n const global = ensureGlobal('lvflanders.bar.shared.logging');\n Object.defineProperty(global, 'failedLogs', {\n get() {\n const failedLogsStr = window.localStorage.getItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY_PREFIX + 'failedLogs');\n return failedLogsStr != null ? JSON.parse(failedLogsStr) : null;\n },\n configurable: true\n });\n }\n /**\n * Start to listen to the log queue.\n */\n async start() {\n // post items to back-end with interval\n this.queueProcessor.onExecute = async (logs) => {\n try {\n await this.loggingApiClient.save(logs);\n }\n catch (error) {\n console.error(error);\n // In case of failure, store the logs in local storage with a timestamp\n const failedLogsStr = window.localStorage.getItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY_PREFIX + 'failedLogs');\n const failedLogs = failedLogsStr != null ? JSON.parse(failedLogsStr) : [];\n logs.forEach((log) => {\n log.timestamp = new Date();\n failedLogs.push(log);\n });\n window.localStorage.setItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY_PREFIX + 'failedLogs', JSON.stringify(failedLogs));\n }\n };\n // start listening to the queue\n this.queueProcessor.start(this.state.config.log.interval, this.state.config.log.itemCount);\n }\n post(log, level) {\n if (!this.state.config?.log.enabled)\n return;\n const model = {\n logLevel: level,\n message: log.message,\n appCode: undefined,\n appVersion: undefined\n };\n if (log.error != null) {\n if (typeof log.error === 'string') {\n model.exception = log.error;\n if (model.message == null) {\n model.message = log.error;\n }\n }\n else {\n model.exception = log.error.message;\n model.stackTrace = log.error.stack;\n if (model.message == null) {\n model.message = log.error.message;\n }\n }\n }\n // toepassing informatie meegeven om te loggen in context van die toepassing (use config if null)\n if (this.state.toepassing != null) {\n model.appCode = this.state.toepassing.code;\n model.appVersion = this.state.toepassing.versie;\n }\n else {\n model.appCode = this.options.appCode;\n model.appVersion = this.options.appVersion;\n }\n if (!model.message)\n model.message = '';\n // append the current URL for extra information purposes\n model.message += `\\r\\n\\r\\nURL: ${window.location.href}`;\n this.queueProcessor.enqueue(model);\n }\n};\nBaasLoggingService = __decorate([\n injectable(),\n __param(0, inject(BAAS_TYPES.BaasLoggingApiClient)),\n __metadata(\"design:paramtypes\", [Object, BaasBootstrapOptions,\n BaasAppState])\n], BaasLoggingService);\n\nconst CACHE_STORE = 'baas-static';\nconst CONFIGURATION_KEY = 'configuration';\nlet _BaasStaticConfigurationApiClient = class _BaasStaticConfigurationApiClient {\n constructor(axios, axiosSilent, appState, logging, cacheManager) {\n this.axios = axios;\n this.axiosSilent = axiosSilent;\n this.appState = appState;\n this.logging = logging;\n this.cacheManager = cacheManager;\n }\n /** Gets the BaaS static configuration */\n async getConfiguration() {\n const cacheStore = this.cacheManager.getStore({ storeType: BarCacheStoreType.Global, store: CACHE_STORE });\n return cacheStore.getOrSetItem(CONFIGURATION_KEY, () => this.#executeGetConfiguration());\n }\n /** Checks whether the chatbot is enabled. */\n checkChatbotEnabled() {\n return Promise.resolve(this.appState.config?.baasStatic?.chatbot?.enabled);\n }\n /** Enables or disables the chatbot. */\n async enableChatbot(enabled) {\n const url = concatUrl(this.appState.location.apiRoot.url, 'api/configuration/chat-bot/enabled');\n await this.axios.put(url, enabled, { headers: { 'Content-Type': 'application/json' } });\n if (this.appState.config?.baasStatic?.chatbot) {\n // change in memory value\n this.appState.config.baasStatic.chatbot.enabled = enabled;\n // remove the configuration from the cache store\n await this.#invalidateConfiguration();\n }\n }\n async #executeGetConfiguration() {\n const url = concatUrl(this.appState.location.baasStatic.url, 'api/configuration');\n try {\n // NOTE use silent instance to not cause a crash in case it fails\n const response = await this.axiosSilent.get(url);\n return response.data;\n }\n catch (err) {\n console.error(err);\n this.logging.error(err);\n // NOTE do not crash the application in case something happens here\n return undefined;\n }\n }\n async #invalidateConfiguration() {\n const cacheStore = this.cacheManager.getStore({ storeType: BarCacheStoreType.Global, store: CACHE_STORE });\n // remove the configuration from the cache store\n await cacheStore.removeItem(CONFIGURATION_KEY);\n }\n};\n_BaasStaticConfigurationApiClient = __decorate([\n injectable(),\n __param(0, inject(BAAS_TYPES.AxiosInstance)),\n __param(0, named(BAAS_AXIOS_INSTANCE_TYPES.Baas)),\n __param(1, inject(BAAS_TYPES.AxiosInstance)),\n __param(1, named(BAAS_AXIOS_INSTANCE_TYPES._BaasSilent)),\n __metadata(\"design:paramtypes\", [Function, Function, BaasAppState,\n BaasLoggingService,\n BarCacheManager])\n], _BaasStaticConfigurationApiClient);\n\nclass BarStopwatch {\n constructor() {\n this.id = null;\n /** Duration of the watch */\n this.duration = null;\n }\n /** Starts the stopwatch */\n start() {\n this.reset();\n if (window.performance && window.performance.timing) {\n this.id = generateUuid();\n window.performance.mark(this.id + '_start');\n }\n }\n /** Ends the stopwatch and defines the duration */\n stop() {\n if (window.performance && window.performance.timing && this.id != null) {\n window.performance.mark(this.id + '_end');\n window.performance.measure(this.id, this.id + '_start', this.id + '_end');\n const entries = window.performance.getEntriesByName(this.id);\n window.performance.clearMarks(this.id + '_end');\n window.performance.clearMeasures(this.id);\n // cleanup\n this.reset();\n this.duration = entries[0].duration;\n }\n }\n /** Resets the stopwatch */\n reset() {\n if (this.id != null) {\n window.performance.clearMarks(this.id + '_start');\n this.id = null;\n this.duration = null;\n }\n }\n}\n\n// Based on https://stackoverflow.com/a/4460624/2174621 + added circular dependency safety check\n/**\n * Deep clones an object.\n * @param item The item to clone.\n */\nfunction deepClone(item) {\n // we need to keep track of what we cloned\n const traversed = [];\n return deepCloneInternal(item, traversed);\n}\nfunction deepCloneInternal(item, traversed) {\n if (!item) {\n return item;\n } // null, undefined values check\n const types = [Number, String, Boolean];\n let result;\n // normalizing primitives if someone did new String('aaa'), or new Number('444');\n types.forEach(function (type) {\n if (item instanceof type) {\n result = type(item);\n }\n });\n if (typeof result == 'undefined') {\n if (Object.prototype.toString.call(item) === '[object Array]') {\n result = [];\n item.forEach(function (child, index, array) {\n result[index] = deepClone(child);\n });\n }\n else if (typeof item == 'object') {\n // testing that this is DOM\n if (item.nodeType && typeof item.cloneNode == 'function') {\n result = item.cloneNode(true);\n }\n else if (!item.prototype) {\n // check that this is a literal\n if (item instanceof Date) {\n result = new Date(item);\n }\n else {\n // check if we already handled this object\n const traversedItem = traversed.find((t) => t.originalItem == item);\n if (traversedItem != null) {\n // return the already cloned item\n result = traversedItem.clonedItem;\n }\n else {\n // it is an object literal\n result = {};\n // keep track of the clone\n traversed.push({\n originalItem: item,\n clonedItem: result\n });\n for (const i in item) {\n result[i] = deepCloneInternal(item[i], traversed);\n }\n }\n }\n }\n else {\n // depending what you would like here,\n // just keep the reference, or create new object\n if (item.constructor) {\n // would not advice to do that, reason? Read below\n result = new item.constructor();\n }\n else {\n result = item;\n }\n }\n }\n else {\n result = item;\n }\n }\n return result;\n}\n\nfunction _addAuditInfoOnDocument(audit) {\n if (document && audit) {\n const htmlEl = document.getElementsByTagName('html');\n if (htmlEl.length > 0) {\n htmlEl[0].setAttribute(_BAAS_SHARED_CONSTANTS.AUDIT.HTML_ATTRIBUTE_AUDIT_ID, audit.auditId);\n htmlEl[0].setAttribute(_BAAS_SHARED_CONSTANTS.AUDIT.HTML_ATTRIBUTE_AUDIT_TYPE, audit.auditType);\n }\n }\n}\n\nlet BaasAuditService = class BaasAuditService {\n constructor(logging, state, auditApiClient) {\n this.logging = logging;\n this.state = state;\n this.auditApiClient = auditApiClient;\n // instantiate the queue with session storage\n this.queueProcessor = new BarQueueProcessor(window.sessionStorage, _BAAS_SHARED_CONSTANTS.STORAGE_KEY_PREFIX + 'auditQueue');\n }\n /**\n * Puts an audit record on the queue.\n * @param audit Audit information.\n */\n log(audit) {\n // do not log if disabled or if audit type is excluded\n if (this.state.config.audit.enabled !== true ||\n (this.state.config.audit.excludedAuditTypes != null && this.state.config.audit.excludedAuditTypes.indexOf(audit.auditType) > -1)) {\n return;\n }\n if (audit.timestamp == null) {\n audit.timestamp = new Date();\n }\n if (audit.sessionId == null) {\n audit.sessionId = this.state.sessionId;\n }\n if (audit.appCode == null && this.state.toepassing != null) {\n audit.appCode = this.state.toepassing.code;\n }\n if (this.state.basiscontext != null) {\n audit.hoedanigheid = this.state.basiscontext.hoedanigheid;\n audit.hoedanigheidRolcode = this.state.basiscontext.hoedanigheidRolcode;\n audit.voorwie = this.state.basiscontext.voorwie;\n audit.voorwieRolcode = this.state.basiscontext.voorwieRolcode;\n audit.userId = this.state.basiscontext.userId;\n }\n audit.hostName = location.hostname;\n if (!audit.details)\n audit.details = {};\n if (!audit.details['PGID']) {\n audit.details['PGID'] = this.state.pageId;\n }\n this.queueProcessor.enqueue(audit);\n }\n /**\n * Start to listen to the queue.\n */\n start() {\n // post items to back-end with interval\n this.queueProcessor.onExecute = async (auditItems) => {\n try {\n await this.auditApiClient.save(auditItems);\n }\n catch (error) {\n // in case an error occurs just handle in background\n console.error(error);\n this.logging.error({ error });\n }\n };\n // start listening to the audit queue\n this.queueProcessor.start(this.state.config.audit.interval, this.state.config.audit.itemCount);\n }\n};\nBaasAuditService = __decorate([\n injectable(),\n __param(2, inject(BAAS_TYPES.BaasAuditApiClient)),\n __metadata(\"design:paramtypes\", [BaasLoggingService,\n BaasAppState, Object])\n], BaasAuditService);\n\nvar BaasAuditType;\n(function (BaasAuditType) {\n BaasAuditType[\"Session\"] = \"BROWSERSESSIONSTART\";\n BaasAuditType[\"Page\"] = \"BROWSERPAGE\";\n BaasAuditType[\"Route\"] = \"BROWSERROUTE\";\n BaasAuditType[\"Dependencies\"] = \"BROWSERDEPENDENCIES\";\n})(BaasAuditType || (BaasAuditType = {}));\n\n/** Configuration service. */\nlet BaasConfigurationService = class BaasConfigurationService {\n constructor(state, cacheManager, apiClient) {\n this.state = state;\n this.cacheManager = cacheManager;\n this.apiClient = apiClient;\n }\n get store() {\n return this.cacheManager.getStore({\n storeType: BarCacheStoreType.User,\n store: 'configuration',\n userId: this.state.basiscontext.userId\n });\n }\n /** Reads the value with given options. */\n readValue(options) {\n if (!options)\n throw new Error('The options argument is required.');\n if (!options.pathAndKey)\n throw new Error('The pathAndKey property is required.');\n let key = options.pathAndKey;\n if (key && key.indexOf('/') > -1) {\n console.warn('BaaS configuration keys should contain backslashes (\\\\) instead of slashes (/). The key was automatically transformed.');\n // apparently replace func replaces only the first occurrence\n do\n key = key.replace('/', '\\\\');\n while (key.indexOf('/') > -1);\n }\n const httpCallback = () => {\n const model = {\n key: key,\n appCode: options.appCode || this.state.toepassing.code,\n // NOTE that version is only used with BAR backend and not with BaaS backend\n appVersion: options.appVersion || this.state.toepassing.versie\n };\n // for now we just use the existing profiel http service\n return this.apiClient.read(model);\n };\n return this.store.getOrSetItem(key, httpCallback, {\n session: true\n });\n }\n /**\n * Flushes the security browser cache.\n */\n flush() {\n return this.store.clear();\n }\n};\nBaasConfigurationService = __decorate([\n injectable(),\n __param(2, inject(BAAS_TYPES.BaasConfigurationApiClient)),\n __metadata(\"design:paramtypes\", [BaasAppState,\n BarCacheManager, Object])\n], BaasConfigurationService);\n\nconst LOCALE = {\n FLEMISH: 'nl-be',\n DUTCH: 'nl'\n};\nconst BAAS_METADATA_KEY = {\n CACHE_STORE_TYPE_TAG: 'cacheStoreType'\n};\nconst BAAS_CUSTOM_EVENT = {\n BASISCONTEXT_CHANGED: 'basisContextChanged',\n CUSTOM_HUB_MESSAGE: 'customHubMessage'\n};\n\nfunction clearFromStorage(storage, condition) {\n for (let i = storage.length - 1; i >= 0; i--) {\n const key = storage.key(i);\n if (key && condition(key)) {\n storage.removeItem(key);\n }\n }\n}\n\nclass BaasActie {\n constructor(actie) {\n if (actie != null) {\n this.actie = actie.actie;\n this.voorwie = actie.voorwie;\n this.voorwieRolcode = actie.voorwieRolcode;\n this.hoedanigheid = actie.hoedanigheid;\n this.hoedanigheidRolcode = actie.hoedanigheidRolcode;\n }\n }\n}\n\nconst TEMP_STATE_ROOT_KEY = `${_BAAS_SHARED_CONSTANTS.TEMP_STORAGE_STATE_KEY}.actie-allowed`;\n/**\n * Security service to perform BAR security tasks.\n */\nlet BaasSecurityService = class BaasSecurityService {\n get #tempStateKey() {\n let result = TEMP_STATE_ROOT_KEY;\n if (this.state.basiscontext?.userId)\n result += `.${this.state.basiscontext.userId}`;\n return result;\n }\n constructor(securityApiClient, state) {\n this.securityApiClient = securityApiClient;\n this.state = state;\n }\n /**\n * Checks whether the actie is allowed and returns an observable with the result.\n */\n async checkActieAllowed(actie) {\n let storageObj = this.#getActieAllowedStorageObj();\n const key = JSON.stringify(actie);\n if (storageObj[key] != null) {\n return storageObj[key];\n }\n else {\n // make call only once\n const result = await this.securityApiClient.checkActieAllowed(actie);\n // get object again in case request was still going on\n storageObj = this.#getActieAllowedStorageObj();\n storageObj[key] = result;\n // store it into session storage\n localStorage.setItem(this.#tempStateKey, JSON.stringify(storageObj));\n return result;\n }\n }\n // NOTE equivalent of isActieAllowedFromSession but using basiscontext from page state\n /**\n * Checks whether the actie is allowed by checking the basiscontext and returns an observable with the result.\n * @param actie\n * @param includeVoorwie\n * @param includeHoedanigheid\n */\n checkActieAllowedFromContext(actie) {\n const actieObj = new BaasActie();\n actieObj.actie = actie.actie;\n if (actie.includeVoorwie) {\n actieObj.voorwie = this.state.basiscontext.voorwie;\n actieObj.voorwieRolcode = this.state.basiscontext.voorwieRolcode;\n }\n if (actie.includeHoedanigheid) {\n actieObj.hoedanigheid = this.state.basiscontext.hoedanigheid;\n actieObj.hoedanigheidRolcode = this.state.basiscontext.hoedanigheidRolcode;\n }\n return this.checkActieAllowed(actieObj);\n }\n /**\n * Flushes the security browser cache.\n */\n flush() {\n clearFromStorage(localStorage, (key) => key.startsWith(TEMP_STATE_ROOT_KEY));\n return Promise.resolve();\n }\n #getActieAllowedStorageObj() {\n const storageObjStr = localStorage.getItem(this.#tempStateKey);\n return storageObjStr ? JSON.parse(storageObjStr) : {};\n }\n};\nBaasSecurityService = __decorate([\n injectable(),\n __param(0, inject(BAAS_TYPES.BaasSecurityApiClient)),\n __metadata(\"design:paramtypes\", [Object, BaasAppState])\n], BaasSecurityService);\n\nconst STORAGE_KEY = _BAAS_SHARED_CONSTANTS.STORAGE_KEY_PREFIX + 'requestLogOff';\n/** Internal log off utility. */\nlet BaasLogOffUtility = class BaasLogOffUtility {\n constructor(options, state, configuration, security, globalStore, logOffHooks) {\n this.options = options;\n this.state = state;\n this.configuration = configuration;\n this.security = security;\n this.globalStore = globalStore;\n this.logOffHooks = logOffHooks;\n }\n /** Start to listen for log off request. */\n startListening() {\n window.onstorage = () => {\n if (this.requestLogOff)\n this.navigateLogOff();\n };\n }\n get requestLogOff() {\n return localStorage.getItem(STORAGE_KEY) === 'true';\n }\n set requestLogOff(value) {\n if (value == null)\n localStorage.removeItem(STORAGE_KEY);\n else\n localStorage.setItem(STORAGE_KEY, value.toString());\n }\n async invokePreLogOffHooks() {\n if (!this.logOffHooks || this.logOffHooks.length == 0)\n return;\n this.logOffHooks.forEach(async (logOffHook) => {\n await logOffHook.run();\n });\n }\n /** Performs some pre-log off logic. */\n async cleanup() {\n await this.globalStore.clear();\n if (this.state.basiscontext?.userId) {\n await this.configuration.flush();\n await this.security.flush();\n }\n }\n navigateLogOff() {\n // redirect to log off page\n window.location.href = this.options.auth?.logOffUrl || this.state.location.baasStatic.url + _BAAS_SHARED_CONSTANTS.PAGE.LOG_OFF;\n }\n};\nBaasLogOffUtility = __decorate([\n injectable(),\n __param(4, inject(BarCacheStore)),\n __param(4, tagged(BAAS_METADATA_KEY.CACHE_STORE_TYPE_TAG, BarCacheStoreType.Global)),\n __param(5, multiInject(BAAS_TYPES.BaasLogOffHook)),\n __param(5, optional()),\n __metadata(\"design:paramtypes\", [BaasBootstrapOptions,\n BaasAppState,\n BaasConfigurationService,\n BaasSecurityService,\n BarCacheStore, Array])\n], BaasLogOffUtility);\n\n/** BaaS authentication service.*/\nlet BaasAuthService = class BaasAuthService {\n /** Gets whether authenticated. */\n get authenticated() {\n return this.strategy.authenticated;\n }\n /** Gets whether we are in the process of authenticating. */\n get authenticating() {\n return this.strategy.authenticating === true;\n }\n constructor(logOffService, strategy) {\n this.logOffService = logOffService;\n this.strategy = strategy;\n }\n /** Performs authentication. */\n authenticate() {\n return this.strategy.authenticate();\n }\n /** Processing that occurs after the authentication. Meaning we are authenticated. */\n async postProcessing() {\n if (this.strategy.postProcessing)\n await this.strategy.postProcessing();\n }\n /** Performs the log off. */\n async logOff() {\n // first do some cleanup (state)\n await this.logOffService.cleanup();\n // invoke external hookds\n await this.logOffService.invokePreLogOffHooks();\n // notify other tabs about fact that we are logging off\n this.logOffService.requestLogOff = true;\n // do the log off (e.g. in idp this is a redirect)\n await this.strategy.performLogOff();\n }\n};\nBaasAuthService = __decorate([\n injectable(),\n __param(1, inject(BAAS_TYPES.BaasAuthStrategy)),\n __metadata(\"design:paramtypes\", [BaasLogOffUtility, Object])\n], BaasAuthService);\n\nvar TokenType;\n(function (TokenType) {\n TokenType[TokenType[\"BarSecTicket\"] = 0] = \"BarSecTicket\";\n TokenType[TokenType[\"OidcLinkId\"] = 1] = \"OidcLinkId\";\n})(TokenType || (TokenType = {}));\n\nclass BarAppInfo {\n}\n\n/** Stores/retrieves baaS context header to window.sessionStorage\n * This header is being used as the alternative for cookies\n */\nlet _BaasContextManager = class _BaasContextManager {\n /** saves the baas state context as a structure in sessiondata (for re-use in headers). Will only save when key does not exist */\n saveBaasContextToStorage(baasPersistentStateObject) {\n // Q&D enums from backend can become strings due to following setting:\n // o.SerializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter());\n // here we parse it back to a numeric enum (which is expected by the backend header parsing logic)\n if (typeof baasPersistentStateObject.tokenType === 'string') {\n const strTokenType = baasPersistentStateObject.tokenType;\n switch (strTokenType.toUpperCase()) {\n case 'BARSECTICKET':\n baasPersistentStateObject.tokenType = TokenType.BarSecTicket;\n break;\n case 'OIDCLINKID':\n baasPersistentStateObject.tokenType = TokenType.OidcLinkId;\n break;\n default:\n baasPersistentStateObject.tokenType = undefined;\n break;\n }\n }\n const jsonObj = JSON.stringify(baasPersistentStateObject);\n window.sessionStorage.setItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.BAAS_STATE_CONTEXT, jsonObj);\n /*Session storage is boss here, but localstorage also serves as a \"backup\" for other apps that run on different browser windows (in Hybrid and Headeronly modus without cookies)*/\n window.localStorage.setItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.BAAS_STATE_CONTEXT, jsonObj);\n }\n /** Updates the baas context (when it exists in storage) with altered voorwie + hoedanigheid */\n updateAppInfoToStorage(appInfo) {\n if (!this.checkBaasContextInStorage())\n return;\n const data = this.getBaasContextFromStorage();\n //only certain fields are allowed to be altered\n const vw = appInfo.ToepVoorwie ?? '';\n const vwrc = appInfo.ToepVoorwieRolcode ?? '';\n const hd = appInfo.ToepHoedanigheid ?? '';\n const hdrc = appInfo.ToepHoedanigheidRolcode ?? '';\n data.userVoorwie = `${vw};${vwrc}`;\n data.userHoedanigheid = `${hd};${hdrc}`;\n //choosing a(nother) testprofiel can also alter the user here!!\n data.userID = appInfo?.ToepUser ?? data.userID; //do not alter this when no other guid available (in case of external auth provider)\n data.userTicketGuid = appInfo?.SecurityTicketGuid ?? data.userTicketGuid;\n if (data.userTicketInfo == null)\n data.userTicketInfo = {};\n data.userTicketInfo.userCbiUserID = appInfo.CbiUserId;\n //save changed object in session state\n window.sessionStorage.setItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.BAAS_STATE_CONTEXT, JSON.stringify(data));\n window.sessionStorage.removeItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.BAR_APPINFO_CONTEXT); //(cache cleared) needs to be recreated next time appinfo is retrieved\n window.localStorage.setItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.BAAS_STATE_CONTEXT, JSON.stringify(data)); //keep localstorage in sync\n }\n /** returns stored baas context object in stringified format (used for baas.context.backend header)*/\n getBaasContextAsHeaderString() {\n const data = this.#getBaasContextString();\n if (data == null)\n return '';\n return data;\n }\n /** detects if baaS context state is available in storage (alternative for cookies)*/\n checkBaasContextInStorage() {\n return this.#getBaasContextString() !== null;\n }\n /** retrieves baaS context from storage and converts it into appinfo object */\n getAppInfoFromStorage() {\n //this method is requested many times, so needs to be fast!\n const appInfoDataFromStorage = window.sessionStorage.getItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.BAR_APPINFO_CONTEXT);\n if (appInfoDataFromStorage !== null)\n return JSON.parse(appInfoDataFromStorage);\n //no appinfo in session store.. retrieve baas state insead, then convert it to appinfo, and store + return appinfo\n const data = this.getBaasContextFromStorage();\n const appinfo = this.#convertFromBaasState(data);\n window.sessionStorage.setItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.BAR_APPINFO_CONTEXT, JSON.stringify(appinfo)); //save for fast retrieval\n return appinfo;\n }\n removeContextFromSession() {\n window.sessionStorage.removeItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.BAAS_STATE_CONTEXT);\n window.sessionStorage.removeItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.BAR_APPINFO_CONTEXT);\n window.localStorage.removeItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.BAAS_STATE_CONTEXT); //keep localstore in sync\n }\n /** Retrieves the baasPersistentStateObject from storage if it exists */\n getBaasContextFromStorage() {\n const data = this.#getBaasContextString();\n if (data === null)\n return null;\n return JSON.parse(data);\n }\n #convertFromBaasState(baas) {\n const resp = new BarAppInfo();\n resp.AuditId = baas.auditID;\n resp.CbiUserId = baas.userTicketInfo?.userCbiUserID;\n resp.SecurityTicketGuid = baas.userTicketGuid;\n resp.UserZone = baas.userTicketInfo?.userZone;\n //old stuff that does not exist in BaaS\n resp.ForcePerformanceLog = false;\n resp.AllowCookieAuth = false;\n //old stuff ends\n resp.ExpireTicks = this.#generateDatum2DaysInFutureInticks(); //set dotnet ticks, 48 hrs in future\n resp.Timestamp = new Date().toString();\n resp.ToepVoorwie = this.#getPart(true, baas?.userVoorwie);\n resp.ToepVoorwieRolcode = this.#getPart(false, baas?.userVoorwie);\n resp.ToepHoedanigheid = this.#getPart(true, baas?.userHoedanigheid);\n resp.ToepHoedanigheidRolcode = this.#getPart(false, baas?.userHoedanigheid);\n resp.ToepUser = baas?.userID;\n return resp;\n }\n #generateDatum2DaysInFutureInticks() {\n const date = new Date();\n date.setTime(date.getTime() + 50 * 60 * 60 * 1000); //add 2 days + 2 hours time-zone compensation\n const ticks = date.getTime() * 10000 + 621355968000000000; //ticks from epoch (1970) to this date\n return ticks;\n }\n #getPart(getfirstPart, input) {\n if (input == null)\n return '';\n if (input.indexOf(';') == -1)\n return '';\n const segments = input.split(';');\n if (segments.length != 2)\n return '';\n return getfirstPart ? segments[0]?.trim() : segments[1]?.trim();\n }\n /** get raw string from session or local storage */\n #getBaasContextString() {\n let data = window.sessionStorage.getItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.BAAS_STATE_CONTEXT);\n if (data === null) {\n data = window.localStorage.getItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.BAAS_STATE_CONTEXT); //get it from local storage backup (and copy in sessionstorage) instead!\n if (data !== null)\n window.sessionStorage.setItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.BAAS_STATE_CONTEXT, data);\n }\n return data;\n }\n};\n_BaasContextManager = __decorate([\n injectable()\n], _BaasContextManager);\n\nvar BaasContextTransportModus;\n(function (BaasContextTransportModus) {\n /** App info cookie is used to transport context data. */\n BaasContextTransportModus[\"Cookie\"] = \"Cookie\";\n /** BaaS Backend header is used to transport data. */\n BaasContextTransportModus[\"Header\"] = \"Header\";\n})(BaasContextTransportModus || (BaasContextTransportModus = {}));\n\nlet BaasOidcAuthService = class BaasOidcAuthService {\n #options;\n #_userManager;\n get #userManager() {\n if (this.#_userManager === undefined)\n throw new Error('Oidc auth service has not been initialized. Call init() first.');\n return this.#_userManager;\n }\n /** Initializes the Oidc auth service with the given options. */\n init(options) {\n if (!options)\n throw new Error('Options are required to initialize the Oidc auth service.');\n if (this.#_userManager !== undefined)\n throw new Error('Oidc auth service is already initialized.');\n this.#options = options;\n const settings = {\n authority: options.authority,\n client_id: options.clientId,\n redirect_uri: options.callbackUri,\n response_type: 'code',\n scope: options.clientScope,\n userStore: new WebStorageStateStore({ store: window.localStorage }),\n fetchRequestCredentials: 'include',\n automaticSilentRenew: true,\n metadataUrl: options.metadataUrl\n };\n this.#_userManager = new UserManager(settings);\n this.#_userManager.events.addUserLoaded((user) => {\n if (options.userAddedCallback) {\n options.userAddedCallback(user);\n }\n });\n }\n getUser() {\n return this.#userManager.getUser();\n }\n login(identityType = 'windows') {\n return this.#userManager.signinRedirect({\n extraQueryParams: {\n identitytype: identityType\n },\n state: { targetUrl: window.location.href }\n });\n }\n logout() {\n return this.#userManager.signoutSilent();\n }\n renewToken(identityType = 'windows') {\n return this.#userManager.signinSilent({\n extraQueryParams: {\n identitytype: identityType\n }\n });\n }\n async callback() {\n const user = (await this.#userManager.signinCallback());\n const state = user?.state;\n if (state?.targetUrl) {\n window.location.href = state.targetUrl; // Redirect to the original URL\n }\n else {\n // Fallback if no targetUrl is available\n window.location.href = this.#options.defaultLandingPage;\n }\n }\n};\nBaasOidcAuthService = __decorate([\n injectable()\n], BaasOidcAuthService);\n\nvar BaasSecurityLevel;\n(function (BaasSecurityLevel) {\n BaasSecurityLevel[BaasSecurityLevel[\"Development\"] = 0] = \"Development\";\n BaasSecurityLevel[BaasSecurityLevel[\"Test\"] = 1] = \"Test\";\n BaasSecurityLevel[BaasSecurityLevel[\"Production\"] = 2] = \"Production\";\n BaasSecurityLevel[BaasSecurityLevel[\"Unknown\"] = 3] = \"Unknown\";\n})(BaasSecurityLevel || (BaasSecurityLevel = {}));\n\nclass BarAppInfoSecure {\n}\n\n// NOTE this service is not exposed to consumers\n// NOTE partially copied from legacy bwcCookieUpdater.ts and util.ts\n/**\n * This service will perform manipulations on the app info cookie or BaaS persistentstateobject (wrapper around cookie).\n */\nlet _BarAppInfoManager = class _BarAppInfoManager {\n #data;\n get sessionId() {\n return this.#readCookie(_BAAS_SHARED_CONSTANTS.COOKIE.APP_INFO.SESSION);\n }\n set sessionId(sessionId) {\n this.#createCookie(_BAAS_SHARED_CONSTANTS.COOKIE.APP_INFO.SESSION, sessionId);\n }\n get #secureCookieMissing() {\n return this.#readCookie(_BAAS_SHARED_CONSTANTS.COOKIE.APP_INFO.SECURE) === null;\n }\n constructor(state, baasContextService, options) {\n this.state = state;\n this.baasContextService = baasContextService;\n this.options = options;\n }\n /**\n * Passes initialization data.\n * @param data\n */\n init(data) {\n this.#data = data;\n }\n /**\n * Gets the app info data from the cookie or from stored BaaS persist object\n */\n get() {\n if (this.options.auth.contextTransportModus === BaasContextTransportModus.Header) {\n //do NOT get state from cookie but from session when that object is available\n if (this.baasContextService.checkBaasContextInStorage())\n return this.baasContextService.getAppInfoFromStorage();\n return null; //WARNING THIS MODUS IGNORES COOKIES\n }\n const koek = this.#readCookie(_BAAS_SHARED_CONSTANTS.COOKIE.APP_INFO.MAIN);\n if (koek == null)\n return null;\n // decode again because it is possible the cookie is double encoded (iframe...)\n const appInfo = JSON.parse(decodeURIComponent(koek));\n // dit zit normaal in secure cookie\n if (!appInfo.SecurityTicketGuid)\n appInfo.SecurityTicketGuid = this.#data?.state?.userTicketGuid;\n return appInfo;\n }\n /** Deletes the app info cookie and the secure cookie (if possible). */\n delete() {\n this.baasContextService.removeContextFromSession(); //equal to logoff\n if (this.options.auth.contextTransportModus === BaasContextTransportModus.Header)\n return; //WARNING THIS MODUS IGNORES COOKIES\n deleteCookie(_BAAS_SHARED_CONSTANTS.COOKIE.APP_INFO.MAIN);\n deleteCookie(_BAAS_SHARED_CONSTANTS.COOKIE.APP_INFO.SECURE);\n }\n /**\n * Saves the app info data\n * @param appInfo\n */\n async save(appInfo, createGuidCookie = false, setTimestamp = true, emit = true, syncContext = null) {\n if (setTimestamp) {\n appInfo.Timestamp = new Date().toISOString();\n }\n if (this.options.auth.contextTransportModus === BaasContextTransportModus.Header) {\n this.baasContextService.updateAppInfoToStorage(appInfo);\n return;\n }\n // save cookie (writes new cookie)\n this.#createCookie(_BAAS_SHARED_CONSTANTS.COOKIE.APP_INFO.MAIN, JSON.stringify(appInfo));\n if (createGuidCookie || this.#secureCookieMissing) {\n //also make guid cookie when missing\n const secureContent = new BarAppInfoSecure();\n secureContent.SecurityTicketGuid = appInfo.SecurityTicketGuid;\n secureContent.ExpireTicks = appInfo.ExpireTicks;\n this.#createCookie(_BAAS_SHARED_CONSTANTS.COOKIE.APP_INFO.SECURE, JSON.stringify(secureContent));\n }\n if (emit) {\n await this.#sync({ caller: 'Save', innerContext: syncContext });\n }\n }\n /**\n * Persists the modifiable data of the basiscontext into the app info cookie.\n This is used when having to make a request to the back-end.\n * @param basiscontext\n */\n async persistBasiscontext(syncContext) {\n if (this.state.basiscontext == null)\n return;\n const context = {\n caller: 'PersistBasiscontext',\n innerContext: syncContext\n };\n // first we sync cookies (or auto resolve in case not localhost)\n await this.#sync(context);\n const appInfo = this.get();\n if (appInfo != null) {\n // make sure not to put value null because this will lead to a null string after uri encode\n appInfo.ToepVoorwie = this.state.basiscontext.voorwie == null ? '' : this.state.basiscontext.voorwie;\n appInfo.ToepVoorwieRolcode = this.state.basiscontext.voorwieRolcode == null ? '' : this.state.basiscontext.voorwieRolcode;\n appInfo.ToepHoedanigheid = this.state.basiscontext.hoedanigheid == null ? '' : this.state.basiscontext.hoedanigheid;\n appInfo.ToepHoedanigheidRolcode = this.state.basiscontext.hoedanigheidRolcode == null ? '' : this.state.basiscontext.hoedanigheidRolcode;\n // save it\n await this.save(appInfo, false, true, true, context);\n }\n }\n /**\n * Derives the basis context from the app info cookie.\n */\n getBasiscontext() {\n const appInfo = this.get();\n return this.#toBasiscontext(appInfo);\n }\n #sync(context) {\n if (this.options.auth.contextTransportModus === BaasContextTransportModus.Header)\n //no not sync\n return Promise.resolve();\n // emit the event and pass the resolve reject\n return new Promise((resolve, reject) => {\n if (this.onSyncRequired) {\n this.onSyncRequired({ resolve, reject, context });\n }\n });\n }\n #toBasiscontext(appInfo) {\n let result = null;\n if (appInfo != null) {\n result = {};\n // assign values with trick for readonly values\n const hoedanigheidKey = 'hoedanigheid';\n result[hoedanigheidKey] = appInfo.ToepHoedanigheid;\n const hoedanigheidRolcodeKey = 'hoedanigheidRolcode';\n result[hoedanigheidRolcodeKey] = appInfo.ToepHoedanigheidRolcode;\n const voorwieKey = 'voorwie';\n result[voorwieKey] = appInfo.ToepVoorwie;\n const voorwieRolcodeKey = 'voorwieRolcode';\n result[voorwieRolcodeKey] = appInfo.ToepVoorwieRolcode;\n const userIdKey = 'userId';\n result[userIdKey] = appInfo.ToepUser;\n const securityTicketIdKey = 'securityTicketId';\n result[securityTicketIdKey] = appInfo.SecurityTicketGuid || '';\n const zoneKey = 'zone';\n result[zoneKey] = appInfo.UserZone || appInfo.ToepZone;\n // assign extra initialization data which does not exist in the cookie\n if (this.#data != null) {\n const fullUsernameKey = 'fullUsername';\n result[fullUsernameKey] = this.#data.fullUsername;\n const klantnummerKey = 'klantnummer';\n result[klantnummerKey] = this.#data.klantnummer;\n // define test profiel\n // if the user starts with DUMMY we know it is a test profiel\n if (result.userId != null && result.userId.toString().startsWith('DUMMY')) {\n // now we need to substract the test profiel name\n const testProfielKey = 'testProfiel';\n try {\n result[testProfielKey] = result.fullUsername.substr(result.fullUsername.indexOf('\\\\') + 1, result.fullUsername.indexOf('#') - 6);\n }\n catch (error) {\n console.warn('BarAppInfoService: ', error);\n }\n }\n }\n // assign extra data which exists outside the cookie\n const impersonateStrStorage = window.localStorage.getItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.IDP_IMPERSONATE);\n let impersonate = false;\n if (impersonateStrStorage != null && impersonateStrStorage.length) {\n impersonate = impersonateStrStorage.toLowerCase() === true.toString();\n }\n const impersonateKey = 'impersonate';\n result[impersonateKey] = impersonate;\n }\n return result;\n }\n #readCookie(name) {\n const nameEQ = name + '=';\n const ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ')\n c = c.substring(1, c.length);\n if (c.indexOf(nameEQ) === 0) {\n const cookieValue = decodeURIComponent(c.substring(nameEQ.length, c.length));\n return cookieValue === 'null' ? null : cookieValue;\n }\n }\n return null;\n }\n #createCookie(name, value) {\n let str = name + '=' + encodeURIComponent(value) + ';path=/;'; //wimfra\n if (this.state.toepassing != null && this.state.toepassing.securityLevel != BaasSecurityLevel.Production)\n str = str + 'SameSite=None;Secure=true;';\n document.cookie = str;\n }\n};\n_BarAppInfoManager = __decorate([\n injectable(),\n __metadata(\"design:paramtypes\", [BaasAppState,\n _BaasContextManager,\n BaasBootstrapOptions])\n], _BarAppInfoManager);\n\nclass BarIdpError extends Error {\n constructor(message) {\n super(message); // (1)\n this.name = this.constructor.name;\n if (arguments.length > 1) {\n this.status = arguments[1]; // we houden de httpStatus bij\n }\n }\n}\nclass BarIdpServerError extends BarIdpError {\n}\nclass BarIdpClientError extends BarIdpError {\n}\n\n/** Options for idp client. */\nclass BarIdpClientOptions {\n}\nclass BarAuthValues {\n}\nclass BarIdentity {\n}\nclass BarKlant {\n}\nvar BarIdentityType;\n(function (BarIdentityType) {\n BarIdentityType[\"Anoniem\"] = \"ANONIEM\";\n BarIdentityType[\"CID\"] = \"CID\";\n BarIdentityType[\"Windows\"] = \"WINDOWS\";\n BarIdentityType[\"Cryptokey\"] = \"CRYPTOKEY\";\n BarIdentityType[\"Klantnummer\"] = \"ALVNUMMER\";\n BarIdentityType[\"Testprofiel\"] = \"TESTPROFIEL\";\n BarIdentityType[\"Fas\"] = \"FAS\";\n})(BarIdentityType || (BarIdentityType = {}));\n\n/*\n * De WebWorker Orchestrator zorgt voor het opstarten van de webworker.\n * Deze webworker zal om de 10 minuten (default waarde) de Idp validatie functie oproepen\n * Deze kan een config object ontvangen met de baseUrl en initiele Timeout setting\n */\nclass BarIdpWebworkerOrchestrator {\n constructor(idpUrl, wwUrl) {\n this.idpUrl = idpUrl;\n this.wwUrl = wwUrl;\n /* afhandelen van binnenkomende webworker messages */\n this.processMessage = function (event) {\n if (event) {\n const parsedData = JSON.parse(event.data);\n switch (Object.keys(parsedData)[0]) {\n case 'INFO':\n if (parsedData.INFO) {\n console.info(`webworker INFO message : ${parsedData.INFO.message}`);\n }\n break;\n case 'WARNING':\n console.warn(`webworker WARNING message: ${parsedData.WARNING.message}`);\n break;\n case 'ERROR':\n console.error(parsedData.ERROR);\n break;\n }\n }\n };\n /* afhandelen van binnenkomende webworker errors */\n this.processError = function (errorEvent) {\n console.error(errorEvent);\n // bij catastrophale fout gaan we webworker stoppen (de webworker kan dit ook zelf door self.close() aan te roepen, maar wij doen het in de orchestrator via terminate()\n if (window.Worker && typeof this.idpww != 'undefined' && typeof this.idpww.terminate == 'function')\n this.idpww.terminate();\n };\n }\n // deze functie zorgt voor aanmaak van een idp webworker indien deze nog niet bestaat en initialiseert deze met ticketId, baseUrl, idpUrl, timeout\n init(timeout) {\n try {\n if (window.Worker) {\n if (typeof this.idpww == 'undefined') {\n // in localhost we just point to the same origin because we cannot add workers from other domains (we can use a proxy)\n let workerUrl = checkLocalhost() ? window.location.origin : this.wwUrl;\n if (!workerUrl.endsWith('/'))\n workerUrl += '/';\n workerUrl += 'scripts/idp-validation-worker/main.js';\n this.idpww = new Worker(workerUrl);\n if (typeof this.idpww.postMessage == 'function') {\n if (timeout != null) {\n this.idpww.postMessage(JSON.stringify({ SETTIMEOUT: timeout }));\n }\n this.idpww.postMessage(JSON.stringify({\n INIT: {\n idpUrl: this.idpUrl,\n timeout: timeout\n }\n }));\n }\n else {\n console.warn('initWebworker : Er kon geen message verstuurd worden naar de webworker');\n }\n this.idpww.onmessage = (ev) => this.processMessage(ev);\n this.idpww.onerror = (ev) => this.processError(ev);\n }\n else {\n console.warn('initWebworker : initialisatie niet uitgevoerd, we hebben reeds een webworker');\n }\n }\n else {\n document.getElementById('result').innerHTML = 'Sorry, uw browser ondersteunt geen Web Workers...';\n console.error('Sorry, uw browser ondersteunt geen Web Workers...');\n }\n }\n catch (error) {\n console.error(error);\n }\n }\n setTimeout(timeout) {\n try {\n if (window.Worker && typeof this.idpww != 'undefined' && typeof this.idpww.postMessage == 'function')\n this.idpww.postMessage(JSON.stringify({ SETTIMEOUT: timeout }));\n else\n console.warn('setTimeout : Er kon geen message verstuurd worden naar de webworker');\n }\n catch (Error) {\n console.error('er ging iets mis voor setTimeout ' + timeout);\n }\n }\n getTimeout() {\n try {\n if (window.Worker && typeof this.idpww != 'undefined' && typeof this.idpww.postMessage == 'function')\n this.idpww.postMessage(JSON.stringify({ GETTIMEOUT: true }));\n else\n console.warn('getTimeout : Er kon geen message verstuurd worden naar de webworker');\n }\n catch (error) {\n console.error(error);\n }\n }\n}\n\n// https://stackoverflow.com/questions/15035473/destroying-webworkers\n/* De authProviderclient is een security browser Relying party met volgende functies :\n- Authenticate(authValues);\n - redirect naar IdP (de redirect terug vanuit de IdP moet je niet opvangen, dit wordt afgehandeld door @BAR (ander backlog item))\n - het authValues object bevat alles values om de IdP aan te roepen (Authenticatie via url met querystring parameters)\n- Validate(guid);\n - deze zal web worker starten die om de 10 minuten de IdP validatie functie oproept (web api oproep)\n - een andere timeout kan meegegeven worden (in minuten)\n\n*/\nlet BarIdpClient = class BarIdpClient {\n get authenticated() {\n return this.appInfoCookie != null;\n }\n get authUrl() {\n if (this.options.idpUrl.endsWith('/'))\n return this.options.idpUrl + 'auth/token';\n else\n return this.options.idpUrl + '/auth/token';\n }\n get logoutUrl() {\n if (this.options.idpUrl.endsWith('/'))\n return this.options.idpUrl + 'auth/logout';\n else\n return this.options.idpUrl + '/auth/logout';\n }\n get appInfoCookie() {\n return this.appInfoMgr.get();\n }\n constructor(options = new BarIdpClientOptions(), appInfoMgr) {\n this.options = options;\n this.appInfoMgr = appInfoMgr;\n }\n /* Authenticatie voert een redirect uit naar de IdP en geeft de via config doorgegeven authenticatie waardes op\n (zoals identitytype, hoedanigheid, voorwie)\n Technische 'demonstratie' pagina : https://alv-dotnet4-d/a/idp/wui/auth/token?target=https://alv-dotnet4-d/a/idp/wui/tech\n Voorbeeld url 1 : https://alv-dotnet4-d/a/idp/wui/auth/token?target=https://alv-dotnet4-d/a/idp/wui/tech&identityType=ALVNUMMER&identityValue=00010001407&vw=00015782102&vwrc=LB\n Voorbeeld url 2 : https://alv-dotnet4-d/a/idp/wui/auth/token?target=https://alv-dotnet4-d/a/idp/wui/tech&identityType=WINDOWS&identityValue=GUNDAM\n */\n async authenticate(config = {\n identity: undefined,\n target: this.options.targetUrl\n }) {\n // Als er geen identity\n if (!config.identity) {\n if (this.options.zone === 'E') {\n config.identity = { type: BarIdentityType.Fas };\n }\n else {\n config.identity = { type: BarIdentityType.Windows };\n }\n }\n if (!this.options.idpUrl)\n throw new BarIdpClientError('De idpUrl is niet gedefinieerd.');\n let authUrl = this.authUrl;\n /* target of default */\n authUrl = this.appendQuerystring(authUrl, 'target', config.target || window.location.href);\n /* Identity is required */\n if (!config || !config.identity || !config.identity.type)\n throw Error('Fatale fout : er werd geen identiteitstype meegegeven');\n else\n authUrl = this.appendQuerystring(authUrl, 'identityType', config.identity.type);\n /* identityvalue */\n if (config && config.identity && config.identity.value)\n authUrl = this.appendQuerystring(authUrl, 'identityValue', config.identity.value);\n /* voorwie values */\n if (config && config.voorwie && config.voorwie.rolcode)\n authUrl = this.appendQuerystring(authUrl, 'vw', config.voorwie.klantnummer);\n if (config && config.voorwie && config.voorwie.rolcode)\n authUrl = this.appendQuerystring(authUrl, 'vwrc', config.voorwie.rolcode);\n /* hoedanigheid values */\n if (config && config.voorwie && config.hoedanigheid.klantnummer)\n authUrl = this.appendQuerystring(authUrl, 'vw', config.hoedanigheid.klantnummer);\n if (config && config.voorwie && config.hoedanigheid.rolcode)\n authUrl = this.appendQuerystring(authUrl, 'vwrc', config.hoedanigheid.rolcode);\n if (this.options.formatToken)\n authUrl = this.appendQuerystring(authUrl, 'formattoken', this.options.formatToken);\n window.sessionStorage?.removeItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.BAAS_STATE_CONTEXT); //idp service is cookie-first, so state in session storage must be cleared\n window.localStorage?.removeItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.BAAS_STATE_CONTEXT); //idp service is cookie-first, so state in session storage must be cleared\n // NOTE use timeout to avoid problems in async pipe line\n window.location.replace(authUrl); // Redirect to the specified URL\n }\n authenticateWithAlvnr(identityValue) {\n return this.authenticate({\n identity: {\n type: BarIdentityType.Klantnummer,\n value: identityValue\n },\n target: this.options.targetUrl\n });\n }\n authenticateWithAnoniem() {\n return this.authenticate({\n identity: { type: BarIdentityType.Anoniem },\n target: this.options.targetUrl\n });\n }\n authenticateWithCBIuserId(identityValue) {\n return this.authenticate({\n identity: { type: BarIdentityType.CID, value: identityValue },\n target: this.options.targetUrl\n });\n }\n authenticateWithCryptoKey(identityValue) {\n return this.authenticate({\n identity: { type: BarIdentityType.Cryptokey, value: identityValue },\n target: this.options.targetUrl\n });\n }\n authenticateWithWindows(identityValue) {\n return this.authenticate({\n identity: { type: BarIdentityType.Windows, value: identityValue },\n target: this.options.targetUrl\n });\n }\n authenticateWithFas() {\n return this.authenticate({\n identity: { type: BarIdentityType.Fas },\n target: this.options.targetUrl\n });\n }\n authenticateWithTestProfiel(identityValue) {\n return this.authenticate({\n identity: {\n type: BarIdentityType.Testprofiel,\n value: identityValue\n },\n target: this.options.targetUrl\n });\n }\n // NOTE ticketid as an argument is obsolete and fixed with ng 18\n /* Deze functie start een webworker op die om de x minuten een validate functie zal aanroepen */\n validate(timeout) {\n if (!this.options.wwUrl)\n throw new BarIdpClientError('De web worker URL is niet gedefinieerd.');\n this.wwMgr = new BarIdpWebworkerOrchestrator(this.options.idpUrl, this.options.wwUrl);\n if (timeout != null) {\n this.wwMgr.init(timeout);\n }\n else {\n this.wwMgr.init();\n }\n }\n logout(target) {\n let logoutUrl = this.logoutUrl;\n if (target) {\n if (!checkUrlAbsolute(target))\n target = concatUrl(window.location.origin, target);\n logoutUrl += `?target=${target}`;\n }\n // just perform redirect\n window.location.replace(logoutUrl);\n return Promise.resolve();\n }\n /*\n Voegt een querystring toe met de juiste separator\n */\n appendQuerystring(url, qsPrm, sqValue) {\n const separator = url.indexOf('?') > 0 ? '&' : '?';\n return url + separator + qsPrm + '=' + sqValue;\n }\n};\nBarIdpClient = __decorate([\n injectable(),\n __metadata(\"design:paramtypes\", [Object, _BarAppInfoManager])\n], BarIdpClient);\n\n/**\n BaaS connectivity modus. In the future extra connectivities could be supported (no boolean).\n */\nvar BaasConnectivity;\n(function (BaasConnectivity) {\n /** The application is online -> connect to remote BAR */\n BaasConnectivity[\"Online\"] = \"Online\";\n /** The application is offline -> connect to local BAR (in the same process) */\n BaasConnectivity[\"Offline\"] = \"Offline\";\n})(BaasConnectivity || (BaasConnectivity = {}));\n\n// NOTE based on BarI18nService\nlet BaasI18n = class BaasI18n {\n constructor(options) {\n this.options = options;\n // NOTE injected as singleton\n this.init();\n }\n changeLanguage(lang) {\n return i18next.changeLanguage(lang);\n }\n addTranslations(namespace, translations, language = 'nl') {\n const fullBundle = {};\n fullBundle[namespace] = translations;\n i18next.addResourceBundle(language, 'LV', fullBundle, true, true);\n }\n get(key, params = {}) {\n if (!i18next.exists(key)) {\n console.warn(`Translation key \"${key}\" does not exist.`);\n return '';\n }\n return i18next.t(key, params);\n }\n init() {\n const options = {\n lng: 'nl',\n defaultNS: 'LV',\n debug: false,\n resources: {\n nl: {\n LV: {\n INITIALIZED: 'i18next has been initialized'\n }\n }\n }\n };\n if (this.options?.interpolation)\n options.interpolation = this.options.interpolation;\n i18next\n .init(options)\n .then(() => {\n console.log('i18next has been initialized');\n })\n .catch((error) => {\n console.error('Failed to initialize i18next:', error);\n });\n }\n};\nBaasI18n = __decorate([\n injectable(),\n __metadata(\"design:paramtypes\", [Object])\n], BaasI18n);\n\n/** Internal enum representing the RAP segment in the URL. */\nvar BarRapSegment;\n(function (BarRapSegment) {\n BarRapSegment[\"Applicative\"] = \"a\";\n BarRapSegment[\"ReverseProxy\"] = \"r\";\n BarRapSegment[\"Public\"] = \"p\";\n})(BarRapSegment || (BarRapSegment = {}));\n/** Internal url to assist with RAP related stuff. */\nlet BarRapUrlHelper = class BarRapUrlHelper {\n get baasStaticSegment() {\n return _BAAS_SHARED_CONSTANTS.URL_SEGMENT.BAAS_STATIC.replace('{segment}', this.rapSegment);\n }\n get baasWebSegment() {\n return _BAAS_SHARED_CONSTANTS.URL_SEGMENT.BAAS_WEB.replace('{segment}', this.rapSegment);\n }\n get idpOidcWebSegment() {\n return _BAAS_SHARED_CONSTANTS.URL_SEGMENT.IDP_OIDC.replace('{segment}', this.rapSegment);\n }\n get rapSegment() {\n return this.config.public ? BarRapSegment.Public : BarRapSegment.Applicative;\n }\n constructor(config) {\n this.config = config;\n }\n parseUrl(url) {\n if (this.config.public && url.toLowerCase().indexOf(`/${BarRapSegment.Applicative}/`) > -1) {\n // Q&D for now we just do a replace (short term)\n return url.toLowerCase().replace(`/${BarRapSegment.Applicative}/`, `/${BarRapSegment.Public}/`);\n }\n return url;\n }\n};\nBarRapUrlHelper = __decorate([\n injectable(),\n __metadata(\"design:paramtypes\", [BaasBootstrapOptions])\n], BarRapUrlHelper);\n\n/**\n * @deprecated Will be removed with next major version. Cookie based authentication will not work in favour of header based authenticatoin.\n * Provides cross domain cookie functionality.\n * creëert een iframe (indien toegestaan)\n * voorziet een sendMessage functie voor het versturen van strings naar de iframebron\n * luistert op het message event\n */\nlet _BarXdc = class _BarXdc {\n get enabled() {\n // enabled in release build with localhost client if security level is not production (if state.toepassing is not set yet we assume XDC might be on -> chicken or egg problem: we don't have this toepassing information yet in the beginning)\n // or enabled in local build if we force it for testing purposes\n // only enabled if online (never in offline or disconnected modus)\n return (this.options.localhost &&\n this.options.connectivity == BaasConnectivity.Online &&\n (!this.options._solution || this.options.auth?.forceRemote) &&\n this.options.auth.contextTransportModus === BaasContextTransportModus.Cookie &&\n (this.state.toepassing == null || this.state.toepassing.securityLevel != BaasSecurityLevel.Production));\n }\n constructor(translate, logging, options, appInfo, state, rapUrlHelper) {\n this.translate = translate;\n this.logging = logging;\n this.options = options;\n this.appInfo = appInfo;\n this.state = state;\n this.rapUrlHelper = rapUrlHelper;\n // holds all resolve and rejects for the synchronization with a guid as a key\n this.syncDefers = {};\n // defines whether sync has been disabled at runtime because of broken XDC, we need to do this to avoid syncen causing endless error loops\n this.syncDisabled = false;\n // assign callback function for syncing\n this.appInfo.onSyncRequired = (arg) => {\n this.sync(arg.context)\n .then(() => {\n arg.resolve();\n })\n .catch(() => {\n arg.reject();\n });\n };\n }\n /** Will sync the local cookie with the server cookie */\n // the sync is a chat between the main thread and an iframe using asynchronous communication\n // the main goal is to sync the local cookie and the server cookie by using a timestamp\n sync(context) {\n if (this.enabled && !this.syncDisabled) {\n return new Promise(async (resolve, reject) => {\n const id = generateUuid();\n this.syncDefers[id] = { resolve, reject };\n // get the server cookie first\n await this.sendMessage({ action: 'get', id: id, context: context });\n });\n }\n else {\n //disabled: auto resolve\n return Promise.resolve();\n }\n }\n /** Will clear the server cookies at the other end (iframe). */\n clear(context) {\n if (this.enabled && !this.syncDisabled) {\n return new Promise(async (resolve, reject) => {\n const id = generateUuid();\n this.syncDefers[id] = { resolve, reject };\n // get the server cookie first\n await this.sendMessage({ action: 'clear', id: id, context: context });\n });\n }\n else {\n //disabled: auto resolve\n return Promise.resolve();\n }\n }\n async handleMessage(e) {\n if (e == null || e.data == null || e.data.action == null)\n return;\n switch (e.data.action) {\n case 'ready': {\n // the iframe is ready\n // resolve the promise so that messages can be send\n this.resolveReady();\n break;\n }\n case 'get-response': {\n // if we don't have a local session we take over the remote session of the iframe\n if (this.appInfo.sessionId == null) {\n this.appInfo.sessionId = e.data.sessionId;\n }\n // we have the server cookie\n const localCookie = this.appInfo.get();\n if (localCookie == null && e.data.cookie != null) {\n // save without setting the timestamp + set guid cookie\n await this.appInfo.save(e.data.cookie, true, false, false);\n this.resolveSync(e.data.id);\n }\n else if (e.data.cookie == null && localCookie != null) {\n await this.sendMessage({\n action: 'set',\n cookie: localCookie,\n context: e.data.context,\n id: e.data.id\n });\n // do not resolve yet\n }\n else if (e.data.cookie != null && localCookie != null) {\n // convert timestamps to date time to be able to compare\n const localTimestamp = localCookie.Timestamp == null ? null : new Date(localCookie.Timestamp);\n const serverTimestamp = e.data.cookie.Timestamp == null ? null : new Date(e.data.cookie.Timestamp);\n if (localTimestamp == null && serverTimestamp != null) {\n // no timestamp locally -> take sever cookie as is and update main cookie\n await this.appInfo.save(e.data.cookie, true, false, false);\n this.resolveSync(e.data.id);\n }\n else if (localTimestamp != null && serverTimestamp == null) {\n // do an update on the local cookie\n await this.sendMessage({\n action: 'update',\n cookie: localCookie,\n context: e.data.context,\n id: e.data.id\n });\n // do not resolve yet\n }\n else if (localTimestamp != null && serverTimestamp != null) {\n if (localTimestamp > serverTimestamp) {\n // local cookie time is more recent -> update server cookie\n await this.sendMessage({\n action: 'update',\n cookie: localCookie,\n context: e.data.context,\n id: e.data.id\n });\n // do not resolve yet\n }\n else if (localTimestamp < serverTimestamp) {\n // server cookie time is more recent -> update local cookie\n await this.appInfo.save(e.data.cookie, true, false, false);\n this.resolveSync(e.data.id);\n }\n else {\n // times are equal just resolve\n this.resolveSync(e.data.id);\n }\n }\n else {\n // we cannot sync because times are null -> do nothing\n this.resolveSync(e.data.id);\n }\n }\n else {\n // nothing to sync\n this.resolveSync(e.data.id);\n }\n break;\n }\n case 'set-response':\n case 'update-response':\n case 'clear-response': {\n // end of response -> resolve the sync\n this.resolveSync(e.data.id);\n break;\n }\n }\n }\n ensureIFrame() {\n if (this.iframeEl != null)\n return;\n this.defineGlobal();\n // Create the iframe\n this.iframeEl = document.createElement('iframe');\n // if xdc is enabled in local solution this means we need to point to dev because of remote authentication\n const rootUrl = this.options._solution\n ? `${this.state.location.release.origin}${this.rapUrlHelper.baasStaticSegment}`\n : this.state.location.baasStatic.url;\n this.iframeEl.setAttribute('src', rootUrl + 'xdc');\n this.iframeEl.style.display = 'none';\n document.body.appendChild(this.iframeEl);\n this.bindEvent(window, 'message', async (e) => await this.handleMessage(e));\n // create the promise to be used when sending a message\n this.iframeReady = new Promise((resolve) => {\n // remember the resolve variable\n this.resolveReady = resolve;\n });\n }\n // addEventListener support for IE8\n bindEvent(element, eventName, eventHandler) {\n if (element.addEventListener) {\n element.addEventListener(eventName, eventHandler, false);\n }\n else if (element.attachEvent) {\n element.attachEvent('on' + eventName, eventHandler);\n }\n }\n // Send a message to the child iframe\n // Make sure you are sending a string, and to stringify JSON\n async sendMessage(msg) {\n this.ensureIFrame();\n // when the iframe is ready we send the message\n // we are dynamically adding the iframe to the DOM, this means it is not immediately ready (unless F12 is open)\n await this.iframeReady;\n try {\n this.iframeEl.contentWindow.postMessage(msg, '*');\n }\n catch (error) {\n const xdcErrorMsg = this.translate.get('DOMAIN_BAR_SHARED.XDC_ERROR');\n console.error(xdcErrorMsg);\n console.error(error);\n // keep the promise (avoid promise error cycle by not rejecting)\n this.resolveSync(msg.id);\n // disable xdc sync\n this.syncDisabled = true;\n console.warn(this.translate.get('DOMAIN_BAR_SHARED.XDC_SYNC_DISABLED'));\n this.logging.error({\n error: error,\n message: xdcErrorMsg\n });\n }\n }\n // define some global stuff\n defineGlobal() {\n // make sure the state is available globally for non Angular code\n const xdc = ensureGlobal('lvflanders.bar.shared.xdc');\n Object.defineProperty(xdc, 'loggingEnabled', {\n set: async (value) => {\n await this.sendMessage({\n action: 'set-logging-enabled',\n value: value\n });\n },\n configurable: true\n });\n }\n resolveSync(id) {\n if (this.syncDefers[id] != null) {\n this.syncDefers[id].resolve();\n delete this.syncDefers[id];\n }\n }\n};\n_BarXdc = __decorate([\n injectable(),\n __metadata(\"design:paramtypes\", [BaasI18n,\n BaasLoggingService,\n BaasBootstrapOptions,\n _BarAppInfoManager,\n BaasAppState,\n BarRapUrlHelper])\n], _BarXdc);\n\nvar _OopsType;\n(function (_OopsType) {\n _OopsType[_OopsType[\"Technical\"] = 0] = \"Technical\";\n _OopsType[_OopsType[\"Authentication\"] = 1] = \"Authentication\";\n _OopsType[_OopsType[\"NotFound\"] = 2] = \"NotFound\";\n})(_OopsType || (_OopsType = {}));\nconst ACTION_ICON_REFRESH = 'fa-solid fa-rotate';\nconst ACTION_CONTENT_REFRESH = 'Wis & herlaad';\nconst ACTION_INFO_REFRESH = 'Met de knop hieronder wordt uw sessie-data gewist en deze pagina opnieuw geladen.';\nlet _OopsDomService = class _OopsDomService {\n #mappings = {\n [_OopsType.Technical]: {\n title: 'Technische fout',\n content: 'Er heeft zich een technische fout voorgedaan.',\n action: this.#oopsActionRefresh.bind(this),\n actionIcon: ACTION_ICON_REFRESH,\n actionContent: ACTION_CONTENT_REFRESH,\n actionInfo: ACTION_INFO_REFRESH\n },\n [_OopsType.Authentication]: {\n title: 'Authenticatie mislukt',\n content: 'Er heeft zich een authenticatie fout voorgedaan.',\n action: this.#oopsActionRefresh.bind(this),\n actionIcon: ACTION_ICON_REFRESH,\n actionContent: ACTION_CONTENT_REFRESH,\n actionInfo: ACTION_INFO_REFRESH\n },\n [_OopsType.NotFound]: {\n title: 'Oeps',\n content: 'Deze pagina is vermist.',\n action: this.#oopsActionHome.bind(this),\n actionIcon: 'fa-regular fa-house',\n actionContent: 'Terug naar Startscherm'\n }\n };\n constructor(appState) {\n this.appState = appState;\n }\n checkOopsSupported() {\n return document.getElementById('oops') != null;\n }\n showOops(settings) {\n if (!settings)\n throw new Error('Oops settings are required.');\n if (!this.checkOopsSupported()) {\n console.warn('Oops DOM is not supported.');\n return;\n }\n const oopsElement = document.getElementById('oops');\n if (this.appState?.location?.baasStatic?.url) {\n let image;\n let imgElement = document.getElementById('oops-image');\n // @deprecated old img id wrong convention\n if (imgElement == null)\n imgElement = document.getElementById('oopsImg');\n if (settings.type === _OopsType.NotFound)\n image = 'lv-melding-error-404.png';\n else {\n const number = generateRandomNumber(1, 8);\n image = `lv-melding-circle-0${number}.png`;\n }\n imgElement.src = concatUrl(this.appState.location.baasStatic.url, '/images/all/', image);\n }\n // new mechanism with oops\n oopsElement.style.display = 'block';\n const appRoot = document.getElementById('app-root');\n appRoot.parentElement.removeChild(appRoot);\n const loader = document.getElementById('app-loading');\n loader.style.display = 'none';\n const config = this.#mappings[settings.type];\n const titleElement = document.getElementById('oops-title');\n if (titleElement)\n titleElement.innerText = config.title;\n const contentElement = document.getElementById('oops-content');\n if (contentElement)\n contentElement.innerText = config.content;\n const actionElement = document.getElementById('oops-action');\n if (actionElement)\n actionElement.addEventListener('click', config.action);\n const actionIconElement = document.getElementById('oops-action-icon');\n if (actionIconElement)\n actionIconElement.className = config.actionIcon;\n const actionContentElement = document.getElementById('oops-action-content');\n if (actionContentElement)\n actionContentElement.innerText = config.actionContent;\n const actionInfoElement = document.getElementById('oops-action-info');\n if (actionInfoElement) {\n actionInfoElement.style.display = config.actionInfo ? 'block' : 'none';\n actionInfoElement.innerText = config.actionInfo;\n }\n }\n async #oopsActionRefresh() {\n window.localStorage.clear();\n window.sessionStorage.clear();\n await deleteAllIndexedDb();\n deleteAllCookies();\n window.location.reload();\n }\n #oopsActionHome() {\n if (this.appState?.config?.homeUrl)\n window.location = this.appState.config.homeUrl;\n return Promise.resolve();\n }\n};\n_OopsDomService = __decorate([\n injectable(),\n __param(0, optional()),\n __metadata(\"design:paramtypes\", [BaasAppState])\n], _OopsDomService);\n\n// NOTE never expose this.\n/** Internal types. */\nconst _BAAS_TYPES = {\n BarGvkState: Symbol('BarGvkState'),\n BarHubMessageHandler: Symbol('BarHubMessageHandler'),\n BaasApm: Symbol('BaasApm')\n};\n\nlet BarHubClient = class BarHubClient {\n constructor(handlers) {\n this.handlers = handlers;\n this.retryCount = 1; // 1 as initial call always gets fired\n }\n /** Initializes the connection to the hub and starts it. */\n init(options) {\n const neededHeaders = {\n 'communication-app-code': options.appCode,\n 'communication-user-token': options.securityTicketId\n };\n const connUrl = options?.hubUrl + '?connectionIdentifier=' + generateUuid();\n this.connection = new signalR.HubConnectionBuilder()\n .withUrl(connUrl, { headers: neededHeaders })\n // NOTE we don't use a truthy check because 0 is a valid value (trace level)\n // by default log level none\n .configureLogging(options.logLevel == null ? signalR.LogLevel.None : options.logLevel)\n .build();\n this.connection.onclose(async () => {\n await this.start({ userId: options?.userId, appCode: options.appCode, securityTicketId: options.securityTicketId });\n });\n this.connection.on('ReceiveMessage', (message) => {\n const handlers = this.handlers.filter((h) => h.action === message.action);\n if (handlers.length)\n handlers.forEach((handler) => handler.handle(message.detail));\n else\n console.warn(`No handler found for hub messages of type ${message.action}.`, message);\n });\n this.start({ userId: options?.userId, appCode: options.appCode, securityTicketId: options.securityTicketId });\n }\n async start(registration) {\n try {\n await this.connection.start();\n console.info('Connected to Bar SignalR');\n }\n catch (e) {\n console.error(e);\n if (this.retryCount >= 5) {\n console.error('Exceeded maximum retry times for connecting SignalR Hub (5).');\n }\n else {\n this.retryCount++;\n setTimeout(() => this.start(registration), 2000);\n }\n }\n }\n};\nBarHubClient = __decorate([\n injectable(),\n __param(0, multiInject(_BAAS_TYPES.BarHubMessageHandler)),\n __metadata(\"design:paramtypes\", [Array])\n], BarHubClient);\n\nconst BAAS_SHARED_I18N = {\n STARTUP_ERROR: 'Er heeft zich een fout voorgedaan bij het opstarten.',\n INIT_LOCAL_FAILED: 'Local init has failed. The localhost web api server may not be running or a server-side error has occured.',\n PRE_INIT_LOCAL_FAILED: 'Local pre-init has failed. The localhost web api server may not be running or a server-side error has occured.',\n XDC_ERROR: 'Fout bij het synchroniseren (XDC).',\n XDC_SYNC_DISABLED: 'XDC synchronisatie uitgeschakeld.',\n TARGET_ORIGIN_OVERRIDE_WARNING: 'Target/release origin has been overridden by \"{{targetOrigin}}\". This can lead to undesired behavior.',\n AUTH_ERROR: 'An error occurred while authenticating during the bootstrapping of the application.'\n};\n\nlet BaasMeetpuntService = class BaasMeetpuntService {\n /** Whether performance logging is enabled:\n - must be enabled in config\n - must be enabled by cookie OR enabled in configuation for the toepassing\n */\n get loggingEnabled() {\n const appinfo = this.appInfo.get();\n // meetpunt must be enabled globally\n return (this.state.config?.meetpunt.enabled &&\n // we must be authenticated\n appinfo &&\n // must be enforced by cookie OR must be set on in configuration for the toepassing\n (appinfo.ForcePerformanceLog || this.state.meetpuntenAutomatischAanmaken) &&\n // must be supported by browser to perform measurements\n window.performance &&\n window.performance.timing != null);\n }\n constructor(state, appInfo, apiClient) {\n this.state = state;\n this.appInfo = appInfo;\n this.apiClient = apiClient;\n // instantiate the queue with session storage\n this.queueProcessor = new BarQueueProcessor(window.sessionStorage, _BAAS_SHARED_CONSTANTS.STORAGE_KEY_PREFIX + 'meetpuntQueue');\n }\n /**\n * Logs a meetpunt.\n * @param meetpunt\n */\n log(meetpunt) {\n if (!this.loggingEnabled)\n return;\n if (meetpunt.appCode == null) {\n meetpunt.appCode = this.state.toepassing.code;\n }\n if (meetpunt.meetpuntType == null) {\n meetpunt.meetpuntType = _BAAS_SHARED_CONSTANTS.DEFAULT_MEETPUNT_TYPE;\n }\n this.queueProcessor.enqueue(meetpunt);\n }\n /**\n * Start to listen to the meetpunten queue.\n */\n async start() {\n // post items to back-end with interval\n this.queueProcessor.onExecute = async (meetpunten) => {\n await this.apiClient.save(meetpunten);\n };\n // start listening to the queue\n this.queueProcessor.start(this.state.config.meetpunt.interval, this.state.config.meetpunt.itemCount);\n }\n};\nBaasMeetpuntService = __decorate([\n injectable(),\n __param(2, inject(BAAS_TYPES.BaasMeetpuntApiClient)),\n __metadata(\"design:paramtypes\", [BaasAppState,\n _BarAppInfoManager, Object])\n], BaasMeetpuntService);\n\n/** Manages browser notifications with service workers. */\nlet BarNotificationManager = class BarNotificationManager {\n /** Will init the notification system and ask for permissions. */\n async init() {\n const status = await Notification.requestPermission();\n console.info('Notification permission status:', status);\n }\n /** Shows a notification. */\n async show(notification) {\n if (Notification.permission === 'granted') {\n const reg = await navigator.serviceWorker.getRegistration();\n if (reg)\n await reg.showNotification(notification.title, notification.options);\n else {\n console.warn('No service worker registration retrieved to show notification.');\n }\n }\n }\n};\nBarNotificationManager = __decorate([\n injectable()\n], BarNotificationManager);\n\nconst INACTIVE_MESSAGE = 'APM is not active.';\n/** APM service. */\nlet _BaasApm = class _BaasApm {\n #alreadyWarnedInactive = false;\n constructor(bootstrapOptions, state) {\n this.bootstrapOptions = bootstrapOptions;\n this.state = state;\n }\n get active() {\n if (this.#config?.enabled === false)\n return false;\n let result = this.state.config?.apm?.active;\n if (result === null || result === undefined)\n result = false;\n return result;\n }\n get #apm() {\n if (!this.apm)\n throw new Error('APM is not initialized');\n return this.apm;\n }\n get #config() {\n return this.bootstrapOptions.telemetry;\n }\n get #serverUrl() {\n return this.state.config?.apm?.serverUrl;\n }\n /** Inits APM for BaaS. */\n init() {\n if (this.active) {\n this.apm = init({\n serverUrl: this.#serverUrl,\n serviceName: this.state.toepassing.code,\n serviceVersion: this.state.toepassing.versie,\n environment: this.state.toepassing.omgeving\n });\n if (this.state.basiscontext) {\n this.apm.setUserContext({\n username: this.state.basiscontext.fullUsername,\n id: this.state.basiscontext.userId\n });\n }\n return true;\n }\n this.#notActiveWarning();\n return false;\n }\n startTransaction(name, type) {\n if (!this.active)\n throw new Error(INACTIVE_MESSAGE);\n return this.#apm.startTransaction(name, type);\n }\n handleError(error) {\n if (this.active)\n this.#apm.captureError(error.originalError || error);\n else\n this.#notActiveWarning();\n }\n #notActiveWarning() {\n if (!this.#alreadyWarnedInactive) {\n console.warn(INACTIVE_MESSAGE);\n this.#alreadyWarnedInactive = true;\n }\n }\n};\n_BaasApm = __decorate([\n injectable(),\n __metadata(\"design:paramtypes\", [BaasBootstrapOptions,\n BaasAppState])\n], _BaasApm);\n\nconst STORAGE_KEY_USER_INFO_PREFIX = _BAAS_SHARED_CONSTANTS.STORAGE_KEY_PREFIX + 'userInfo_';\nlet BaasBootstrap = class BaasBootstrap {\n #stopwatch;\n #outcome;\n // holds the target origin\n #targetOrigin;\n // whether the configuration has been handled and assigned\n #configHandled = false;\n get #mustAuthenticate() {\n return this.options.auth != null ? this.options.auth.enabled : false;\n }\n get #authFailedUrl() {\n return this.state.config.auth.failedUrl;\n }\n get #targetOriginOverride() {\n return window.localStorage.getItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY_PREFIX + 'targetOrigin');\n }\n set #targetOriginOverride(value) {\n if (value == null) {\n window.localStorage.removeItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY_PREFIX + 'targetOrigin');\n }\n else {\n window.localStorage.setItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY_PREFIX + 'targetOrigin', value);\n }\n }\n constructor(state, options, idpClient, logOff, i18n, xdc, cacheManager, baasContextService, globalStore, rapUrlHelper, auth, appInfo, audit, commonApiClient, securityApiClient, _BaasStaticConfigurationApiClient, meetpunt, logging, hubClient, notificationManager, oopsDomService, apm, telemetry, oidcAuthService) {\n this.state = state;\n this.options = options;\n this.idpClient = idpClient;\n this.logOff = logOff;\n this.i18n = i18n;\n this.xdc = xdc;\n this.cacheManager = cacheManager;\n this.baasContextService = baasContextService;\n this.globalStore = globalStore;\n this.rapUrlHelper = rapUrlHelper;\n this.auth = auth;\n this.appInfo = appInfo;\n this.audit = audit;\n this.commonApiClient = commonApiClient;\n this.securityApiClient = securityApiClient;\n this._BaasStaticConfigurationApiClient = _BaasStaticConfigurationApiClient;\n this.meetpunt = meetpunt;\n this.logging = logging;\n this.hubClient = hubClient;\n this.notificationManager = notificationManager;\n this.oopsDomService = oopsDomService;\n this.apm = apm;\n this.telemetry = telemetry;\n this.oidcAuthService = oidcAuthService;\n }\n #startTime;\n async bootstrap(options) {\n this.#startTime = performance.now();\n this.#outcome = undefined;\n if (options.auth.contextTransportModus === BaasContextTransportModus.Cookie) {\n // persist basiscontext whenever tab gets focus or we are leaving the tab\n // basiscontext can be different per tab but there is only one cookie\n document.addEventListener('visibilitychange', (ev) => {\n this.appInfo.persistBasiscontext({\n caller: 'Bootstrap-VisibilityChange'\n });\n });\n }\n this.i18n.addTranslations('DOMAIN_BAR_SHARED', BAAS_SHARED_I18N);\n Object.assign(this.options, options);\n this.#configHandled = false;\n // clear out request log off\n this.logOff.requestLogOff = undefined;\n await this.#launchLifeCycle();\n return this.#outcome;\n }\n async #launchLifeCycle() {\n this.#defineLogging();\n this.idpClient.options.targetUrl = window.location.href;\n // generate the page id\n const pageIdKey = 'pageId';\n this.state[pageIdKey] = generateUuid();\n const connectivityKey = 'connectivity';\n this.state[connectivityKey] = this.options.connectivity || BaasConnectivity.Online;\n const locationKey = 'location';\n this.state[locationKey] = {};\n const appRootKey = 'appRoot';\n this.state.location[appRootKey] = extractUrlParts(this.#defineAppRootUrl());\n const appKey = 'app';\n this.state.location[appKey] = extractUrlParts(this.#defineAppUrl());\n const apiRootKey = 'apiRoot';\n this.state.location[apiRootKey] = extractUrlParts(this.#defineApiRootUrl());\n if (this.options.localhost) {\n //localhost needs pre-init-local call to function\n const core = ensureGlobal('lvflanders.bar.shared');\n // and here we make a hook to overide the targetOrigin through the console\n Object.defineProperty(core, 'targetOrigin', {\n get: () => {\n return this.#targetOriginOverride;\n },\n set: (value) => {\n this.#targetOriginOverride = value;\n },\n configurable: true\n });\n // use the target origin override (set via developer tools console if defined)\n this.#targetOrigin = this.#targetOriginOverride;\n // we don't have a target origin override check if we have it in session storage\n if (this.#targetOrigin == null) {\n // if xdc is enabled we need to define the target origin to which to connect to (BAR, basiscomponenten, iframe).\n // we remember this in the session storage to avoid performing the pre-init-local constantly\n this.#targetOrigin = window.sessionStorage.getItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY_PREFIX + 'targetOrigin');\n }\n else {\n const msg = this.i18n.get('DOMAIN_BAR_SHARED.PRE_INIT_LOCAL_FAILED', { targetOrigin: this.#targetOrigin });\n console.warn(msg);\n }\n if (!this.#targetOrigin) {\n try {\n // perform a local api call to get the target origin\n const data = await this.commonApiClient.preInitLocal();\n this.#targetOrigin = data.targetOrigin || data.TargetOrigin;\n if (this.#targetOrigin != null) {\n window.sessionStorage.setItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY_PREFIX + 'targetOrigin', this.#targetOrigin);\n }\n }\n catch (error) {\n const msg = this.i18n.get('DOMAIN_BAR_SHARED.PRE_INIT_LOCAL_FAILED');\n console.warn(msg);\n }\n }\n }\n // we can define the release state location here because a value depends on the pre-init-local (release domain aka target)\n const releaseKey = 'release';\n this.state.location[releaseKey] = extractUrlParts(this.#defineReleaseOrigin());\n const barWebKey = 'barWeb';\n this.state.location[barWebKey] = extractUrlParts(this.#defineBarWebRootUrl());\n const baasStaticKey = 'baasStatic';\n this.state.location[baasStaticKey] = extractUrlParts(this.#defineBaasStaticRootUrl());\n const baasWebKey = 'baasWeb';\n this.state.location[baasWebKey] = extractUrlParts(this.#defineBaasWebRootUrl());\n this.idpClient.options.wwUrl = this.state.location.baasStatic.url;\n // different steps (in case not authenticated):\n // 1-a) pre - init local (only in XDC modus)\n // 1-b) pre - init (if not authenticated)\n // 2) authenticate (if not authenticated)\n // 3-a) init\n // 3-b) init local (only in XDC modus)\n // if not authenticated we perform the pre-init to retrieve unauthenticated data\n if (!this.auth.authenticated)\n await this.#launchPreInit();\n // we are still in the process of authenticating (redirecting from idp)\n else if (this.auth.authenticating && this.#mustAuthenticate)\n await this.#launchAuth(true);\n else\n await this.#launchInit(true);\n }\n #getInitRequest(loadConfig) {\n // make request object needed for pre-init or init\n return {\n appCode: this.options.appCode,\n appVersion: this.options.appVersion,\n loadConfig,\n loadToepassing: false,\n meetpuntType: _BAAS_SHARED_CONSTANTS.DEFAULT_MEETPUNT_TYPE\n };\n }\n async #launchAuth(preInitSkipped) {\n // authenticate ! when successfull also initialize\n try {\n const authSuccess = await this.auth.authenticate();\n if (authSuccess === true) {\n await this.#launchInit(preInitSkipped);\n }\n else if (authSuccess === false) {\n window.location.href = this.#authFailedUrl;\n this.#handleAuthError();\n this.#outcome = BaasBootstrapOutcome.AuthFailed;\n }\n else if (authSuccess === undefined || authSuccess === null) {\n this.#outcome = BaasBootstrapOutcome.Authenticating;\n }\n // NOTE authSuccess null or undefined means a redirect has been done, no error should be thrown\n }\n catch (error) {\n console.error(error);\n window.location.href = this.#authFailedUrl;\n this.#handleAuthError(error);\n }\n }\n async #launchPreInit() {\n // try get config from session storage first to avoid having to retrieve it (can become larger and larger)\n const loadConfig = this.#tryLoadConfigFromStorage();\n const initRequest = this.#getInitRequest(loadConfig);\n try {\n // get the config from web api without authentication\n const data = await this.commonApiClient.preInit(initRequest);\n this.#handleConfig(data.config, true);\n this.#handleToepassing(data.toepassing);\n // load config from BaaS Static at an early stage\n await this.#defineBaasStaticConfiguration();\n // in case xdc is enabled we do a sync to see if we are already authenticated on the remote domain\n if (this.xdc.enabled)\n await this.xdc.sync({ caller: 'Startup', step: 'Auth' });\n // after the sync we check again if we are not authenticated\n if (this.#mustAuthenticate && !this.auth.authenticated) {\n //when session is filled during (offline modus), IDP call (launchauth) is bypassed!\n await this.#launchAuth(false);\n }\n else {\n // if we succeeded to authenticate we perform the init straight away\n await this.#launchInit(false);\n }\n }\n catch (error) {\n this.#handleStartupError(error);\n }\n }\n #tryLoadConfigFromStorage() {\n let notLoaded = true;\n const configStr = window.sessionStorage.getItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY_PREFIX + 'config');\n if (configStr != null && configStr.length > 0) {\n notLoaded = false;\n const config = JSON.parse(configStr);\n this.#handleConfig(config, false);\n }\n return notLoaded;\n }\n // handles the configuration object\n #handleConfig(config, putInStorage) {\n if (this.#configHandled)\n return;\n // configuration data\n const configKey = 'config';\n // trick to have assignment to readonly prop\n this.state[configKey] = config;\n if (putInStorage) {\n // store config in session storage to avoid retrieving it when switching application\n window.sessionStorage.setItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY_PREFIX + 'config', JSON.stringify(config));\n }\n const processIdpRootUrl = (origin) => {\n let idpRootUrl = origin;\n if (!config.idpRootUrl.startsWith('/')) {\n idpRootUrl += '/';\n }\n idpRootUrl += config.idpRootUrl;\n config.idpRootUrl = idpRootUrl;\n config.idpRootUrl = this.rapUrlHelper.parseUrl(config.idpRootUrl);\n };\n if (this.options.localhost) {\n // NOTE overschrijven van urls voor de lokale BAR omgeving (deze solution): localhost heeft geen profielbeheer notie\n if (this.options._solution && !this.options.auth.forceRemote) {\n // indien localhost client EN bundle build voor local : via lokale authprovider/IDP\n config.auth.url = 'https://localhost:44307/auth?noredirect=1';\n config.auth.failedUrl = 'https://localhost:44307/authenticate-failed';\n config.logoutUrl = 'https://localhost:44307/auth/logout';\n config.errorUrl = 'https://alv-dotnet4-d/startscherm/domain.startscherm.Web/probleemrapport/';\n config.idpRootUrl = 'https://alv-dotnet4-d/a/idp/wui';\n }\n else {\n // this will be used in XDC modus\n // this.state.location.release.origin;\n processIdpRootUrl(this.state.location.release.origin);\n }\n }\n else {\n processIdpRootUrl(window.location.origin);\n }\n // pass the idp root url to the idp client if used\n this.idpClient.options.idpUrl = config.idpRootUrl;\n this.#configHandled = true;\n }\n #defineLogging() {\n const log = ensureGlobal('lvflanders.bar.shared.log');\n log.enabled = {};\n Object.defineProperty(log.enabled, 'cacheStorage', {\n get() {\n const enabledStr = window.localStorage.getItem('lvflanders.bar.shared.log.enabled.cacheStorage');\n return enabledStr != null ? JSON.parse(enabledStr) : false;\n },\n set(newValue) {\n window.localStorage.setItem('lvflanders.bar.shared.log.enabled.cacheStorage', JSON.stringify(newValue));\n },\n configurable: true\n });\n Object.defineProperty(log, 'format', {\n get() {\n const enabledStr = window.localStorage.getItem('lvflanders.bar.shared.log.format');\n return enabledStr || 'object';\n },\n set(newValue) {\n if (newValue)\n newValue = newValue.toLowerCase();\n if (!newValue || newValue === 'json' || newValue === 'object')\n window.localStorage.setItem('lvflanders.bar.shared.log.format', newValue);\n else\n console.warn(\"can only set value to 'json', 'object' or nothing.\");\n },\n configurable: true\n });\n }\n /** The host url of the current application. This is for example used for defining api url's for the current application */\n #defineAppRootUrl() {\n let url = null;\n // if the application url is defined use this\n if (this.options.appRootUrl)\n url = this.options.appRootUrl;\n else if (this.options.appUrl)\n url = this.options.appUrl;\n else {\n // by default use the global base href tag\n const baseTag = document.getElementsByTagName('base');\n // no angular base href defined, use the html base href (set through angular.json baseHref or directly in index.html)\n if (baseTag.length && baseTag[0].href)\n url = baseTag[0].href;\n // if no base href just take the domain\n else\n url = location.origin;\n }\n if (!checkUrlAbsolute(url)) {\n if (!url.startsWith('/'))\n url = '/' + url;\n // we make the url absolute\n url = location.origin + url;\n }\n // make it end with a slash\n if (!url.endsWith('/'))\n url += '/';\n return url.toLowerCase();\n }\n #defineApiRootUrl() {\n if (this.options.apiRootUrl)\n return this.options.apiRootUrl;\n return this.#defineAppRootUrl();\n }\n #defineAppUrl() {\n if (this.options.appUrl) {\n if (checkUrlAbsolute(this.options.appUrl))\n return this.options.appUrl;\n const appUrl = this.options.appUrl.startsWith('/') ? this.options.appUrl : `/${this.options.appUrl}`;\n return `${this.state.location.appRoot.origin}${appUrl}`;\n }\n return this.state.location.appRoot.url;\n }\n // handles startup errors specially because there is no user interface yet\n #handleStartupError(err) {\n console.error(err);\n this.oopsDomService.showOops({ type: _OopsType.Technical });\n }\n #handleAuthError(error = undefined) {\n if (error) {\n console.error(error);\n }\n throw new Error(this.i18n.get('DOMAIN_BAR_SHARED.AUTH_ERROR'));\n }\n // following method is invoked after authenticating\n async #defineBrowserSession() {\n // get session id from cookie\n let cookieSessionId = this.appInfo.sessionId;\n if (!cookieSessionId) {\n // no session cookie, create session cookie and use new uuid\n cookieSessionId = generateUuid();\n this.appInfo.sessionId = cookieSessionId;\n }\n // get actual session id being used\n let sessionId = await this.globalStore.getItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.SESSION_ID);\n // this routing is called at the end\n const proceed = async (clearSession) => {\n // use session id in the temp storage generated after successfull authentication\n const sessionIdKey = 'sessionId';\n // save it in state\n this.state[sessionIdKey] = sessionId;\n if (!this.options.disableCacheInvalidation) {\n // invalidate the cache (if not disabled) and pass flag determining whether we must clear out all session cache entries\n await this.cacheManager.invalidate(clearSession);\n }\n if (clearSession)\n this.#clearTempState();\n };\n // if no session id yet or if there is a session but the app info cookie isn't equal we start a new browser session\n if (sessionId !== cookieSessionId) {\n sessionId = cookieSessionId;\n // put the new session id in the global cache store (and keep it there)\n await this.globalStore.setItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.SESSION_ID, sessionId, { session: false });\n proceed(true);\n }\n // re-use session\n else {\n proceed(false);\n }\n }\n #tryRunIdpValidation() {\n if (this.#mustAuthenticate && this.options.auth.validation !== false && this.options.auth.contextTransportModus === BaasContextTransportModus.Cookie) {\n // here we launch a web worker asynchronously bound to the idp client\n this.idpClient.validate();\n }\n }\n // following method is always invoked (after authenticating or if already authenticated)\n async #launchInit(preInitSkipped) {\n if (preInitSkipped && this.xdc.enabled) {\n await this.xdc.sync({ caller: 'Startup', step: 'Before Init' });\n }\n // check if we need to bypass the init in case not authenticated and the url being invoked is a no init path\n if (!this.auth.authenticated &&\n this.options._noInitPaths?.some((noInitPath) => {\n const fullPath = concatUrl(this.state.location.app.pathname, noInitPath).toLowerCase();\n return window.location.pathname.toLowerCase() === fullPath;\n })) {\n await this.#initializeFinal(undefined, preInitSkipped);\n return;\n }\n // try get config from session storage first to avoid having to retrieve it (can become larger and larger)\n const loadConfig = !this.#configHandled && this.#tryLoadConfigFromStorage();\n const initRequest = this.#getInitRequest(loadConfig);\n initRequest.loadToepassing = this.state.toepassing == null;\n try {\n const data = await this.commonApiClient.init(initRequest);\n if (data.config != null) {\n this.#handleConfig(data.config, true);\n }\n const baasVersionKey = 'baasVersion';\n this.state[baasVersionKey] = data.baasVersion;\n const requestTokenKey = 'requestToken';\n this.state[requestTokenKey] = data.requestToken;\n if (data.toepassing != null) {\n this.#handleToepassing(data.toepassing);\n }\n if (this.options.auth.contextTransportModus === BaasContextTransportModus.Header && data?.state !== null && typeof data.state !== 'undefined') {\n const currentContext = this.baasContextService.getBaasContextFromStorage();\n const updatedContext = { ...data.state, userTicketGuid: currentContext.userTicketGuid };\n //will save context of authenticated user in session storage\n this.baasContextService.saveBaasContextToStorage(updatedContext);\n }\n const meetpuntenAutomatischAanmakenKey = 'meetpuntenAutomatischAanmaken';\n this.state[meetpuntenAutomatischAanmakenKey] = data.meetpuntenAutomatischAanmaken == null ? false : data.meetpuntenAutomatischAanmaken;\n if (this.options.localhost) {\n // in case xdc is enabled we do an extra init on the localhost api\n if (this.xdc.enabled)\n await this.xdc.sync({ caller: 'Startup', step: 'After Init' });\n try {\n // extra localhost init for antiforgery\n const localData = await this.commonApiClient.initLocal();\n const localRequestTokenKey = 'localRequestToken';\n this.state[localRequestTokenKey] = localData.requestToken;\n }\n catch (error) {\n const msg = this.i18n.get('DOMAIN_BAR_SHARED.INIT_LOCAL_FAILED');\n console.error(msg);\n // NOTE this will throw an error to abort further processing\n this.#handleStartupError(error);\n }\n }\n // end the initialization\n await this.#initializeFinal(data, preInitSkipped);\n }\n catch (error) {\n this.#handleStartupError(error);\n }\n }\n #handleToepassing(toepassing) {\n if (this.options.appVersion) {\n // NOTE use the version from the config as the toepassing versie\n // ATM (17-01-2024) there is a bug where BaaS.NET gives a wrong version through the init\n const versieKey = 'versie';\n toepassing[versieKey] = this.options.appVersion;\n }\n const toepassingKey = 'toepassing';\n this.state[toepassingKey] = toepassing;\n // set zone for IDP based on state\n this.idpClient.options.zone = this.state.toepassing.zone;\n }\n async #initializeFinal(data, preInitSkipped) {\n await this.#defineBrowserSession();\n // audit page (make sure it is after session audit)\n const audit = {\n auditId: this.state.pageId,\n parentAuditId: this.state.sessionId,\n auditType: BaasAuditType.Page,\n appCode: this.options.appCode,\n details: {\n URL: document.location.href,\n 'APP-VERSION': this.options.appVersion\n }\n };\n this.audit.log(audit);\n _addAuditInfoOnDocument(audit);\n this.appInfo.init(data);\n // get basiscontext from cookie (cookie is the master)\n const basiscontext = this.appInfo.getBasiscontext();\n // also set the basiscontext regular variable (non observable)\n // trick to fill in readonly prop (will give compilation error if property name changes)\n // https://stackoverflow.com/questions/48992522/get-name-of-property-or-field-in-object-typed/48992694?noredirect=1#comment84991472_48992694\n const basiscontextKey = 'basiscontext';\n this.state[basiscontextKey] = basiscontext;\n this.apm.init();\n if (this.auth.postProcessing)\n await this.auth.postProcessing();\n if (preInitSkipped)\n await this.#defineBaasStaticConfiguration();\n await this.#initLvOidc();\n if (await this.#applyPreRoutingInterceptions()) {\n this.logOff.startListening();\n this.#tryRunIdpValidation();\n await this.#defineAuditMeetpunten();\n this.#auditDependencies();\n this.#defineHubClient();\n await this.#defineUserInfo();\n await this.#defineNotifications();\n this.#outcome = BaasBootstrapOutcome.Initialized;\n }\n // don't allow further processing in case already intercepted\n else\n this.#outcome = BaasBootstrapOutcome.Halted;\n if (this.telemetry.currentTransaction) {\n // log entire bootstrapping on parent transaction\n const span = this.telemetry.currentTransaction.startSpan('Bootstrap BaaS App', 'bootstrap-baas-app', { startTime: this.#startTime });\n span.end();\n }\n }\n // this is the domain where the @lvflanders/bar-ng script is released and from which it is referenced within the application\n // we guess this domain by checking the script tags (the localhost application has an absolute reference to the script file (cdn)\n // in case a localhost consumer outside BAR is using a script we use the domain of that script to determine where to do api calls or other stuff\n /** The domain where @lvflanders BAR is running */\n #defineReleaseOrigin() {\n let result = null;\n if (this.#targetOrigin != null) {\n // here we are in xdc modus and are using a target origin to define to which domain to connect to\n // for BAR & basiscomponenten and & XDC iframe\n result = this.#targetOrigin;\n }\n else {\n let src = null;\n // note that scripts property is not a regular array\n for (let i = 0; i < document.scripts.length; i++) {\n const script = document.scripts[i];\n // find script tag with bar-ng\n if (script.src != null && script.src.indexOf('lvflanders-bar-ng') > -1) {\n src = script.src;\n break;\n }\n }\n if (src != null) {\n result = extractUrlOrigin(src);\n }\n else {\n // no bar-core bundle meaning everything is probably bundled inline -> just take current origin\n result = window.location.origin;\n }\n }\n return result;\n }\n /** Root url to BAR web (api) (this is the domain + the bar web segment) */\n #defineBarWebRootUrl() {\n let url = null;\n if (this.options.connectivity === BaasConnectivity.Offline) {\n // local means BAR web is in process -> we need to point to url of current application\n url = this.state.location.appRoot.url + 'domain.basisarchitectuur.web/';\n }\n // remote modus (default)\n else if (this.options.localhost) {\n // check local: this means we are in the BAR solution: just use the URL of BAR web localhost\n url = this.state.location.release.origin + _BAAS_SHARED_CONSTANTS.URL_SEGMENT.BAR_WEB;\n }\n // we are on the deployed environment: just use current host name\n else {\n url = location.origin + _BAAS_SHARED_CONSTANTS.URL_SEGMENT.BAR_WEB;\n }\n return url;\n }\n #defineBaasWebRootUrl() {\n const origin = this.options.localhost ? this.state.location.release.origin : location.origin;\n return concatUrl(origin, this.rapUrlHelper.baasWebSegment);\n }\n #defineBaasStaticRootUrl() {\n let url = null;\n if (this.options.connectivity === BaasConnectivity.Offline) {\n // local means BaaS Static is in process -> we need to point to url of current application\n url = this.state.location.appRoot.url + 'domain.baas-static.web/';\n }\n // remote modus (default)\n else if (this.options.localhost) {\n // check local: this means we are in the BAR solution: just use the URL of BAR web localhost\n if (this.options._solution && this.options.staticRootUrl) {\n // NOTE that the bar web process is hosted somewhere else (other localhost) and this is passed through the forRoot options\n url = this.options.staticRootUrl;\n if (!url.endsWith('/')) {\n url += '/';\n }\n }\n // if localhost client and this bundle is build for DEV\n // this means we need to use the DEV url\n else {\n url = this.state.location.release.origin + this.rapUrlHelper.baasStaticSegment;\n }\n }\n // we are on the deployed environment: just use current host name\n else {\n url = location.origin + this.rapUrlHelper.baasStaticSegment;\n }\n return url;\n }\n async #defineBaasStaticConfiguration() {\n if (this.state.connectivity === BaasConnectivity.Online) {\n const config = await this._BaasStaticConfigurationApiClient.getConfiguration();\n this.#handleBaasStaticConfiguration(config);\n }\n }\n #handleBaasStaticConfiguration(config) {\n config?.appMenuItems?.forEach((ami) => {\n ami.url = this.#processAppMenuUrl(ami.url);\n if (this.options.localhost) {\n ami.urlLocalhost = this.#processAppMenuUrl(ami.urlLocalhost);\n }\n });\n const configKey = 'config';\n // assign it to sub property\n this.state[configKey].baasStatic = config;\n // override config in case public\n if (this.options.public === true && config.public?.homeUrl) {\n this.state.config.homeUrl = config.public.homeUrl;\n }\n }\n #processAppMenuUrl(url) {\n if (!url || checkUrlAbsolute(url))\n return url;\n return `${this.state.location.release.origin}${url}`;\n }\n async #defineAuditMeetpunten() {\n const perflog = parseQueryStringValue('perflog');\n if (perflog != null) {\n const appinfo = this.appInfo.get();\n if (appinfo != null) {\n switch (perflog.toLowerCase()) {\n case 'off':\n appinfo.ForcePerformanceLog = false;\n await this.appInfo.save(appinfo);\n break;\n case 'on':\n appinfo.ForcePerformanceLog = true;\n await this.appInfo.save(appinfo);\n break;\n }\n }\n }\n if (this.meetpunt.loggingEnabled) {\n // here we measure the page load time (duration of loading resources and parsing it)\n // https://stackoverflow.com/a/14878493/2174621\n const pageLoadTime = window.performance.timing.domContentLoadedEventEnd - window.performance.timing.navigationStart;\n this.meetpunt.log({\n meetpunt: 'DOM_CONTENT_LOADED_END',\n meetpuntDetail: document.location.pathname,\n waarde: pageLoadTime,\n meetpuntInfo: document.location.href,\n auditId: this.state.pageId\n });\n this.#stopwatch = new BarStopwatch();\n // navigation start event does not occur the first time\n // this means we need to start the stopwatch the frist time\n this.#stopwatch.start();\n }\n if (this.state.config?.audit?.enabled == true) {\n // start listening to the audit queue\n this.audit.start();\n }\n if (this.meetpunt.loggingEnabled) {\n // start listening to the meetpunt queue\n await this.meetpunt.start();\n }\n // intialize logging (global vars...)\n this.logging.init();\n if (this.state.config?.log?.enabled == true) {\n // start listening to the log queue\n await this.logging.start();\n }\n }\n #auditDependencies() {\n const scripts = [];\n const scriptTags = document.getElementsByTagName('script');\n for (let i = 0; i < scriptTags.length; i++) {\n const scriptTag = scriptTags[i];\n if (scriptTag.src != null && scriptTag.src.length > 0) {\n const script = {\n src: scriptTag.src,\n type: scriptTag.type\n };\n scripts.push(script);\n }\n }\n const links = [];\n const linkTags = document.getElementsByTagName('link');\n for (let i = 0; i < linkTags.length; i++) {\n const linkTag = linkTags[i];\n if (linkTag.href != null && linkTag.href.length > 0) {\n const link = {\n href: linkTag.href,\n rel: linkTag.rel,\n type: linkTag.type\n };\n links.push(link);\n }\n }\n this.audit.log({\n parentAuditId: this.state.pageId,\n auditType: BaasAuditType.Dependencies,\n appCode: this.options.appCode,\n details: {\n SCRIPTS: JSON.stringify(scripts),\n LINKS: JSON.stringify(links)\n }\n });\n }\n #defineHubClient() {\n if (this.options.hub?.enabled) {\n const hubUrl = concatUrl(this.state.location.baasWeb.url, '/baas/hubs/bui');\n this.hubClient.init({\n hubUrl,\n userId: this.state.basiscontext?.userId,\n appCode: this.state.toepassing.code,\n securityTicketId: this.state.basiscontext?.securityTicketId\n });\n }\n }\n async #defineUserInfo() {\n let userData;\n // don't do anything if not authenticated\n if (!this.auth.authenticated) {\n userData = {\n hoedanigheidInfoSet: []\n };\n }\n else {\n const cacheKey = STORAGE_KEY_USER_INFO_PREFIX + (this.state.basiscontext?.userId || 'UNDEFINED');\n let cachedItem = window.sessionStorage.getItem(cacheKey);\n if (cachedItem) {\n userData = JSON.parse(cachedItem);\n }\n else {\n userData = await this.securityApiClient.getUserInfo();\n cachedItem = JSON.stringify(userData);\n window.sessionStorage.setItem(cacheKey, cachedItem);\n }\n }\n const userInfoKey = 'userInfo';\n this.state[userInfoKey] = userData;\n }\n async #defineNotifications() {\n if (this.options.notifications === true)\n await this.notificationManager.init();\n }\n /** Checks if we need to intercept the current route before the routing.\n * Returns a flag defining whether the bootstrapping can proceed */\n async #applyPreRoutingInterceptions() {\n if (this.#checkRouteMatch(_BAAS_SHARED_CONSTANTS.AUTH.OIDC.CALLBACK.SPOTFIRE)) {\n // clear out page (used inside an spotfire web player which only cares for query string parameters)\n while (document.body.firstChild) {\n document.body.removeChild(document.body.firstChild);\n }\n if (typeof spotfire !== 'undefined')\n spotfire.webPlayer.oauthEnd();\n else\n console.error('Spotfire CDN JS api not loaded.');\n this.#clearDocument('Spotfire callback');\n return false;\n }\n if (this.options.auth?._experimentalOidcEnabled) {\n if (!this.#checkRouteMatch(_BAAS_SHARED_CONSTANTS.AUTH.OIDC.CALLBACK.LV)) {\n const user = await this.oidcAuthService.getUser();\n if (user)\n await this.oidcAuthService.renewToken();\n }\n else {\n // we are in the callback\n await this.oidcAuthService.callback();\n return false;\n }\n }\n return true;\n }\n /** @experimental Initializes the LV OICD service and hooks up the callback. */\n async #initLvOidc() {\n if (!this.options.auth?._experimentalOidcEnabled)\n return;\n const authority = concatUrl(this.state.location.release.url, this.rapUrlHelper.idpOidcWebSegment);\n const callbackRootUri = checkLocalhost() ? this.state.location.app.url : concatUrl(this.state.location.baasStatic.url, '/bui');\n const callbackUri = concatUrl(callbackRootUri, _BAAS_SHARED_CONSTANTS.AUTH.OIDC.CALLBACK.LV);\n const options = {\n authority,\n clientId: 'oidc_lv_public_test1',\n callbackUri,\n clientScope: 'openid offline_access',\n userAddedCallback: (user) => {\n // NOTE use this to register tokens in state\n }\n };\n this.oidcAuthService.init(options);\n }\n #checkRouteMatch(path) {\n const url = new URL(window.location.href);\n const pathname = url.pathname.split('?')[0]; // Exclude query string\n return pathname.endsWith(path);\n }\n #clearDocument(comment) {\n // Get the element\n const htmlElement = document.documentElement;\n // Remove all attributes\n while (htmlElement.attributes.length > 0) {\n htmlElement.removeAttribute(htmlElement.attributes[0].name);\n }\n const commentElement = document.createComment(comment);\n document.body.appendChild(commentElement);\n }\n #clearTempState() {\n clearFromStorage(localStorage, (key) => key.startsWith(`${_BAAS_SHARED_CONSTANTS.TEMP_STORAGE_STATE_KEY}.`));\n }\n};\nBaasBootstrap = __decorate([\n injectable(),\n __param(8, inject(BarCacheStore)),\n __param(8, tagged(BAAS_METADATA_KEY.CACHE_STORE_TYPE_TAG, BarCacheStoreType.Global)),\n __param(13, inject(BAAS_TYPES.BaasCommonApiClient)),\n __param(14, inject(BAAS_TYPES.BaasSecurityApiClient)),\n __param(22, inject(BAAS_TYPES.BaasTelemetry)),\n __param(23, inject(BAAS_TYPES._BaasLvOicdAuthService)),\n __metadata(\"design:paramtypes\", [BaasAppState,\n BaasBootstrapOptions,\n BarIdpClient,\n BaasLogOffUtility,\n BaasI18n,\n _BarXdc,\n BarCacheManager,\n _BaasContextManager,\n BarCacheStore,\n BarRapUrlHelper,\n BaasAuthService,\n _BarAppInfoManager,\n BaasAuditService, Object, Object, _BaasStaticConfigurationApiClient,\n BaasMeetpuntService,\n BaasLoggingService,\n BarHubClient,\n BarNotificationManager,\n _OopsDomService,\n _BaasApm, Object, BaasOidcAuthService])\n], BaasBootstrap);\n\n/** Global variable to access BaaS context. */\nconst baasContext = {\n container: undefined\n};\n\nlet BaasAuditDefaultApiClient = class BaasAuditDefaultApiClient {\n constructor(axios, state) {\n this.axios = axios;\n this.state = state;\n }\n async save(auditItems) {\n await this.axios.post(this.state.location.apiRoot.url + 'baas/audit/bui/messages', auditItems);\n }\n};\nBaasAuditDefaultApiClient = __decorate([\n injectable(),\n __param(0, inject(BAAS_TYPES.AxiosInstance)),\n __metadata(\"design:paramtypes\", [Function, BaasAppState])\n], BaasAuditDefaultApiClient);\n\nconst BAAS_VERSION_ENDPOINTS = '3.6.2.0';\nlet BaasCommonDefaultApiClient = class BaasCommonDefaultApiClient {\n constructor(state, axiosBaas, axiosPlain) {\n this.state = state;\n this.axiosBaas = axiosBaas;\n this.axiosPlain = axiosPlain;\n }\n async preInitLocal() {\n const response = await this.axiosPlain.post(this.state.location.apiRoot.url + 'baas/bootloader/pre-init-local', null, {\n // ommit interceptor for performing the pre-init-local\n // this is invoked in the very beginning before pre-init\n withCredentials: true\n });\n return response.data;\n }\n async preInit(request) {\n // this is invoked before authentication\n const response = await this.axiosPlain.post(this.state.location.apiRoot.url + 'baas/bootloader/pre-init', request, {\n withCredentials: true\n });\n if (response.data?.toepassing)\n this.parseToepassing(response.data.toepassing);\n return response.data;\n }\n async init(request) {\n // this is running after authentication\n const response = await this.axiosBaas.post(this.state.location.apiRoot.url + 'baas/bootloader/init', request);\n if (response.data?.toepassing)\n this.parseToepassing(response.data.toepassing);\n return response.data;\n }\n async initLocal() {\n const response = await this.axiosBaas.post(this.state.location.apiRoot.url + 'baas/bootloader/init-local', {});\n return response.data;\n }\n async saveEndpoints(appCode, appVersion, endpoints) {\n // @deprecated feature flagging not needed in long term\n const versionOk = this.state.baasVersion && versionCompare(this.state.baasVersion, BAAS_VERSION_ENDPOINTS) >= 0;\n if (!versionOk)\n console.warn(`Please upgrade Baas.NET to the latest stable version higher or equal to ${BAAS_VERSION_ENDPOINTS} for an optimal registration of route endpoints.`);\n const rootUrl = versionOk ? this.state.location.apiRoot.url : this.state.location.baasStatic.url;\n const url = `${rootUrl}baas/bootloader/endpoints/appcode/${appCode}/version/${appVersion}`;\n try {\n const response = await this.axiosBaas.post(url, endpoints);\n if (!response.data?.returnVal)\n console.error('An error occurred while saving the endpoints', response.data);\n }\n catch (err) {\n // application should not crash because of this\n console.error('An error occurred while saving the endpoints', err);\n }\n }\n parseToepassing(toepassing) {\n if (typeof toepassing.securityLevel === 'string') {\n const securityLevelKey = 'securityLevel';\n toepassing[securityLevelKey] = this.parseSecLevelFromString(toepassing.securityLevel);\n }\n }\n parseSecLevelFromString(securityLevel) {\n if (securityLevel == null)\n return null;\n switch (securityLevel.toUpperCase()) {\n case 'DEV':\n return BaasSecurityLevel.Development;\n case 'TST':\n return BaasSecurityLevel.Test;\n case 'PRD':\n return BaasSecurityLevel.Production;\n default:\n return BaasSecurityLevel.Unknown;\n }\n }\n};\nBaasCommonDefaultApiClient = __decorate([\n injectable(),\n __param(1, inject(BAAS_TYPES.AxiosInstance)),\n __param(2, inject(BAAS_TYPES.AxiosInstance)),\n __param(2, named(BAAS_AXIOS_INSTANCE_TYPES.Plain)),\n __metadata(\"design:paramtypes\", [BaasAppState, Function, Function])\n], BaasCommonDefaultApiClient);\n\nlet BaasConfigurationDefaultApiClient = class BaasConfigurationDefaultApiClient {\n constructor(axios, state) {\n this.axios = axios;\n this.state = state;\n }\n // de BaaS api werkt met GET voor ophalen van values\n async read(model) {\n const url = `${this.state.location.apiRoot.url}baas/configuration/value/appCode/${model.appCode}/path/${encodeURI(model.key)}`;\n const response = await this.axios.get(url);\n return response.data;\n }\n};\nBaasConfigurationDefaultApiClient = __decorate([\n injectable(),\n __param(0, inject(BAAS_TYPES.AxiosInstance)),\n __metadata(\"design:paramtypes\", [Function, BaasAppState])\n], BaasConfigurationDefaultApiClient);\n\nlet BaasLoggingDefaultApiClient = class BaasLoggingDefaultApiClient {\n constructor(axios, state) {\n this.axios = axios;\n this.state = state;\n }\n save(logs) {\n return this.axios.post(this.state.location.apiRoot.url + 'baas/logging/bui/messages', logs);\n }\n};\nBaasLoggingDefaultApiClient = __decorate([\n injectable(),\n __param(0, inject(BAAS_TYPES.AxiosInstance)),\n __metadata(\"design:paramtypes\", [Function, BaasAppState])\n], BaasLoggingDefaultApiClient);\n\nlet BaasMeetpuntDefaultApiClient = class BaasMeetpuntDefaultApiClient {\n constructor() {\n this.warnedNotAvailable = false;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n save(meetpunten) {\n this.warnNotAvailable();\n return Promise.resolve();\n }\n warnNotAvailable() {\n if (!this.warnedNotAvailable) {\n this.warnedNotAvailable = true;\n console.warn('Meetpunten zijn (nog) niet beschikbaar binnen BaaS.Net...');\n }\n }\n};\nBaasMeetpuntDefaultApiClient = __decorate([\n injectable()\n], BaasMeetpuntDefaultApiClient);\n\nlet BaasMeldingDefaultApiClient = class BaasMeldingDefaultApiClient {\n constructor(axios, state) {\n this.axios = axios;\n this.state = state;\n }\n /**\n * Get meldingen for requested url\n */\n async getMeldingen(urlPart) {\n const apiVersion = this.state.config?.baasStatic?.meldingen?.apiVersion;\n if (apiVersion === '2')\n return this.#getMeldingenV2(urlPart);\n return this.#getMeldingenV1(urlPart);\n }\n /**\n * Used by Melding Guard to check if a route has a blocking notification, if so it has to redirect to a specific page\n */\n async hasBlockingMelding(urlPart) {\n const url = this.state.location.apiRoot.url + `baas/melding/important-only/for-url?urlPart=${encodeURI(urlPart)}`;\n const response = await this.axios.get(url);\n return response.data;\n }\n async #getMeldingenV2(urlPart) {\n const url = concatUrl(this.state.location.apiRoot.url, `/baas/meldingv2/for-url?pattern=${encodeURI(urlPart)}`);\n const response = await this.axios.get(url);\n return response.data.map((melding) => {\n return {\n ...melding,\n baas: true,\n version: '2'\n };\n });\n }\n async #getMeldingenV1(urlPart) {\n const url = this.state.location.apiRoot.url + `baas/melding/all-types/for-url?urlPart=${encodeURI(urlPart)}`;\n const response = await this.axios.get(url);\n return response.data.map((melding) => {\n return {\n ...melding,\n baas: true,\n version: '1'\n };\n });\n }\n};\nBaasMeldingDefaultApiClient = __decorate([\n injectable(),\n __param(0, inject(BAAS_TYPES.AxiosInstance)),\n __metadata(\"design:paramtypes\", [Function, BaasAppState])\n], BaasMeldingDefaultApiClient);\n\nlet BaasSecurityDefaultApiClient = class BaasSecurityDefaultApiClient {\n constructor(axios, state) {\n this.axios = axios;\n this.state = state;\n }\n async checkActieAllowed(actie) {\n // indien checkActieAllowed vanuit checkActieAllowedFromContext wordt aangeroepen\n // zal voorwie / voorwierolcode en hoedanigheid / hoedanigheidrolcode ingevuld zijn\n // /baas/security/isactieallowed/actie/{actie}\n // /baas/security/isactieallowed/actie/{actie}/voorwie/{voorwie}/rolcode/{rolcode}\n // /baas/security/isactieallowed/actie/{actie}/hoedanigheid/{hoedanigheid}/rolcode/{rolcode}\n // /baas/security/isactieallowed/actie/{actie}/voorwie/{vw}/rolcode/{vwrc}/hoedanigheid/{hoed}/rolcode/{hdrc}\n let voorwieSegment = '';\n if (actie.voorwie && actie.voorwieRolcode)\n voorwieSegment = '/voorwie/' + actie.voorwie + '/rolcode/' + actie.voorwieRolcode;\n let hoedanigheidSegment = '';\n if (actie.hoedanigheid && actie.hoedanigheidRolcode)\n hoedanigheidSegment = '/hoedanigheid/' + actie.hoedanigheid + '/rolcode/' + actie.hoedanigheidRolcode;\n const url = this.state.location.apiRoot.url + 'baas/security/isactieallowed/actie/' + encodeURI(actie.actie) + voorwieSegment + hoedanigheidSegment;\n const response = await this.axios.get(url);\n return response.data;\n }\n async getUserInfo() {\n const rootUrl = this.state.location.apiRoot.url;\n try {\n const response = await this.axios.get(rootUrl + 'baas/security/user-info');\n const data = response.data;\n return {\n cbiUserId: data.cbiUserId,\n hoedanigheidInfoSet: data.hoedList,\n contactInfo: data.contactInfo != null\n ? {\n klantnummer: data.contactInfo.alvNr,\n firstname: data.contactInfo.firstName,\n lastname: data.contactInfo.lastname,\n fullName: data.contactInfo.fullname,\n phone: data.contactInfo.phoneNumber,\n mobile: data.contactInfo.mobileNumber,\n email: data.contactInfo.mailAddress\n }\n : undefined\n };\n }\n catch (error) {\n console.error(error);\n return {};\n }\n }\n};\nBaasSecurityDefaultApiClient = __decorate([\n injectable(),\n __param(0, inject(BAAS_TYPES.AxiosInstance)),\n __metadata(\"design:paramtypes\", [Function, BaasAppState])\n], BaasSecurityDefaultApiClient);\n\nlet BarAuditApiClient = class BarAuditApiClient {\n constructor(axios, state) {\n this.axios = axios;\n this.state = state;\n }\n async save(auditItems) {\n await this.axios.post(this.state.location.barWeb.url + 'api/audit', auditItems);\n }\n};\nBarAuditApiClient = __decorate([\n injectable(),\n __param(0, inject(BAAS_TYPES.AxiosInstance)),\n __metadata(\"design:paramtypes\", [Function, BaasAppState])\n], BarAuditApiClient);\n\nlet BarCommonApiClient = class BarCommonApiClient {\n constructor(state, axiosBaas, axiosPlain) {\n this.state = state;\n this.axiosBaas = axiosBaas;\n this.axiosPlain = axiosPlain;\n }\n async preInitLocal() {\n const response = await this.axiosPlain.post(this.state.location.apiRoot.url + 'api/pre-init-local', null, {\n // ommit interceptor for performing the pre-init-local\n // this is invoked in the very beginning before pre-init\n withCredentials: true\n });\n return response.data;\n }\n async preInit(request) {\n // this is invoked before authentication\n const response = await this.axiosPlain.post(this.state.location.baasStatic.url + 'baas/bootloader/pre-init', request, {\n withCredentials: true\n });\n if (response.data?.toepassing)\n this.parseToepassing(response.data.toepassing);\n return response.data;\n }\n async init(request) {\n // this is running after authentication\n const response = await this.axiosBaas.post(this.state.location.baasStatic.url + 'baas/bootloader/init', request);\n if (response.data?.toepassing)\n this.parseToepassing(response.data.toepassing);\n return response.data;\n }\n async initLocal() {\n const response = await axios.post(this.state.location.apiRoot.url + 'api/init-local', {}, {\n withCredentials: true,\n headers: { 'X-Requested-With': 'XMLHttpRequest' }\n });\n return response.data;\n }\n async saveEndpoints(appCode, appVersion, endpoints) {\n // NOTE just invoke baas static instead of BAR web\n const url = `${this.state.location.baasStatic.url}baas/bootloader/endpoints/appcode/${appCode}/version/${appVersion}`;\n try {\n const response = await this.axiosBaas.post(url, endpoints);\n if (!response.data?.returnVal)\n console.error('An error occurred while saving the endpoints', response.data);\n }\n catch (err) {\n // application should not crash because of this\n console.error('An error occurred while saving the endpoints', err);\n }\n }\n parseToepassing(toepassing) {\n if (typeof toepassing.securityLevel === 'string') {\n const securityLevelKey = 'securityLevel';\n toepassing[securityLevelKey] = this.parseSecLevelFromString(toepassing.securityLevel);\n }\n }\n parseSecLevelFromString(securityLevel) {\n if (securityLevel == null)\n return null;\n switch (securityLevel.toUpperCase()) {\n case 'DEV':\n return BaasSecurityLevel.Development;\n case 'TST':\n return BaasSecurityLevel.Test;\n case 'PRD':\n return BaasSecurityLevel.Production;\n default:\n return BaasSecurityLevel.Unknown;\n }\n }\n};\nBarCommonApiClient = __decorate([\n injectable(),\n __param(1, inject(BAAS_TYPES.AxiosInstance)),\n __param(2, inject(BAAS_TYPES.AxiosInstance)),\n __param(2, named(BAAS_AXIOS_INSTANCE_TYPES.Plain)),\n __metadata(\"design:paramtypes\", [BaasAppState, Function, Function])\n], BarCommonApiClient);\n\nlet BarLoggingApiClient = class BarLoggingApiClient {\n constructor(axios, state) {\n this.axios = axios;\n this.state = state;\n }\n async save(logs) {\n await this.axios.post(this.state.location.barWeb.url + 'api/logging', logs);\n }\n};\nBarLoggingApiClient = __decorate([\n injectable(),\n __param(0, inject(BAAS_TYPES.AxiosInstance)),\n __metadata(\"design:paramtypes\", [Function, BaasAppState])\n], BarLoggingApiClient);\n\nlet BarMeetpuntApiClient = class BarMeetpuntApiClient {\n constructor(axios, state) {\n this.axios = axios;\n this.state = state;\n }\n async save(meetpunten) {\n await this.axios.post(this.state.location.barWeb.url + 'api/meetpunt', meetpunten);\n }\n};\nBarMeetpuntApiClient = __decorate([\n injectable(),\n __param(0, inject(BAAS_TYPES.AxiosInstance)),\n __metadata(\"design:paramtypes\", [Function, BaasAppState])\n], BarMeetpuntApiClient);\n\nlet BarMeldingApiClient = class BarMeldingApiClient {\n constructor(axios, state) {\n this.axios = axios;\n this.state = state;\n }\n /**\n * Get meldingen for requested url\n */\n async getMeldingen(url) {\n const response = await this.axios.post(this.state.location.barWeb.url + 'api/meldingen', { url });\n return response.data.map((melding) => {\n return {\n ...melding,\n baas: false,\n version: '0'\n };\n });\n }\n /**\n *Used by Melding Guard to check if a route has a blocking notification, if so it has to redirect to a specific page\n */\n async hasBlockingMelding(url) {\n const response = await this.axios.post(this.state.location.barWeb.url + 'api/meldingen/get', { url });\n return response.data;\n }\n};\nBarMeldingApiClient = __decorate([\n injectable(),\n __param(0, inject(BAAS_TYPES.AxiosInstance)),\n __metadata(\"design:paramtypes\", [Function, BaasAppState])\n], BarMeldingApiClient);\n\nlet BarProfielApiClient = class BarProfielApiClient {\n constructor(axios, state) {\n this.axios = axios;\n this.state = state;\n }\n async read(model) {\n const response = await this.axios.post(this.state.location.barWeb.url + 'api/profiel/read', model);\n return response.data;\n }\n};\nBarProfielApiClient = __decorate([\n injectable(),\n __param(0, inject(BAAS_TYPES.AxiosInstance)),\n __metadata(\"design:paramtypes\", [Function, BaasAppState])\n], BarProfielApiClient);\n\nlet BarSecurityApiClient = class BarSecurityApiClient {\n constructor(axios, state) {\n this.axios = axios;\n this.state = state;\n }\n async checkActieAllowed(actie) {\n const url = this.state.location.barWeb.url + 'api/security/check-actie-allowed';\n const response = await this.axios.post(url, actie);\n return response.data;\n }\n async getUserInfo() {\n // ask baas static for the user data\n const url = this.state.location.baasStatic.url + 'baas/security/user-info';\n try {\n const response = await this.axios.get(url);\n const data = response.data;\n return {\n cbiUserId: data.cbiUserId,\n hoedanigheidInfoSet: data.hoedList,\n contactInfo: data.contactInfo != null\n ? {\n klantnummer: data.contactInfo.alvNr,\n firstname: data.contactInfo.firstName,\n lastname: data.contactInfo.lastname,\n fullName: data.contactInfo.fullname,\n phone: data.contactInfo.phoneNumber,\n mobile: data.contactInfo.mobileNumber,\n email: data.contactInfo.mailAddress\n }\n : undefined\n };\n }\n catch (error) {\n console.error(error);\n return {};\n }\n }\n};\nBarSecurityApiClient = __decorate([\n injectable(),\n __param(0, inject(BAAS_TYPES.AxiosInstance)),\n __metadata(\"design:paramtypes\", [Function, BaasAppState])\n], BarSecurityApiClient);\n\n/** Allows for external authentication to set their prefered user & context without using IDP service */\nlet BaasExternalAuthStrategy = class BaasExternalAuthStrategy {\n get authenticated() {\n return this.contextManager.checkBaasContextInStorage();\n }\n constructor(contextManager, contextProvider) {\n this.contextManager = contextManager;\n this.contextProvider = contextProvider;\n }\n async authenticate() {\n if (!this.contextProvider)\n throw 'BaasExternalAuthStrategy was called but the injected BaasContextProvider has not been defined.';\n try {\n const context = await this.contextProvider.provide();\n if (context) {\n const userVoorwie = context.voorwie && context.voorwieRolcode ? `${context.voorwie};${context.voorwieRolcode.toUpperCase()}` : undefined;\n const userHoedanigheid = context.hoedanigheid && context.hoedanigheidRolcode ? `${context.hoedanigheid};${context.hoedanigheidRolcode.toUpperCase()}` : undefined;\n const state = { userTicketGuid: context.securityTicketId, userVoorwie, userHoedanigheid };\n this.contextManager.saveBaasContextToStorage(state);\n return true;\n }\n else\n return null;\n }\n catch (error) {\n console.error(error);\n return false;\n }\n }\n performLogOff() {\n this.contextManager.removeContextFromSession();\n return Promise.resolve();\n }\n};\nBaasExternalAuthStrategy = __decorate([\n injectable(),\n __param(1, inject(BAAS_TYPES.BaasContextProvider)),\n __metadata(\"design:paramtypes\", [_BaasContextManager, Object])\n], BaasExternalAuthStrategy);\n\n/** Public BAR authentication service using IDP. */\nlet BaasIdpAuthStrategy = class BaasIdpAuthStrategy {\n get authenticated() {\n // being authenticated means having a bar-cookie (if we have the idp client we use this to check whether we are authenticated)\n return this.idpClient.authenticated;\n }\n constructor(appState, bootstrapOptions, idpClient, appInfo) {\n this.appState = appState;\n this.bootstrapOptions = bootstrapOptions;\n this.idpClient = idpClient;\n this.appInfo = appInfo;\n }\n async authenticate() {\n // make sure local storage value impersonate is removed before authentication\n window.localStorage.removeItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.IDP_IMPERSONATE);\n // NOTE we cannot use the route here because it is before routing takes place\n const idpStatus = parseQueryStringValue('idp-status');\n if (idpStatus === 'fail') {\n // idp returned a fail, just make sure we go to authenticate failed page (to avoid endless loop)\n return false;\n }\n else {\n // if we are using @lvflanders/bar we use the idp client\n await this.idpClient.authenticate(this.bootstrapOptions.auth.config);\n // make sure processing is stopped because we are doing a full page redirect\n return null;\n }\n }\n /** Processing that occurs after the authentication. Meaning we are authenticated. */\n async postProcessing() {\n if (!this.authenticated)\n return;\n const impersonateStrQuery = parseQueryStringValue('idp-impersonate');\n const impersonateStrStorage = window.localStorage.getItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.IDP_IMPERSONATE);\n let impersonate = false;\n if (impersonateStrQuery && (!impersonateStrStorage || impersonateStrStorage === false.toString())) {\n impersonate = impersonateStrQuery.toLowerCase() === true.toString();\n window.localStorage.setItem(_BAAS_SHARED_CONSTANTS.STORAGE_KEY.IDP_IMPERSONATE, impersonate.toString());\n }\n else\n impersonate = impersonateStrStorage === true.toString();\n const impersonateKey = 'impersonate';\n this.appState.basiscontext[impersonateKey] = impersonate;\n }\n async performLogOff() {\n if (this.bootstrapOptions.localhost) {\n // NOTE app info localhost xdc stuff is not yet in @lvflanders/bar\n this.appInfo.delete();\n }\n const target = concatUrl(this.appState.location.baasStatic.url, _BAAS_SHARED_CONSTANTS.PAGE.LOG_OFF);\n await this.idpClient.logout(target);\n }\n};\nBaasIdpAuthStrategy = __decorate([\n injectable(),\n __metadata(\"design:paramtypes\", [BaasAppState,\n BaasBootstrapOptions,\n BarIdpClient,\n _BarAppInfoManager])\n], BaasIdpAuthStrategy);\n\nlet BaasIdpHeaderAuthStrategy = class BaasIdpHeaderAuthStrategy {\n constructor(idpClient, contextManager, bootstrapOptions, state, logOff) {\n this.idpClient = idpClient;\n this.contextManager = contextManager;\n this.bootstrapOptions = bootstrapOptions;\n this.state = state;\n this.logOff = logOff;\n }\n get authenticated() {\n return this.contextManager.checkBaasContextInStorage();\n }\n get authenticating() {\n // we are coming from IDP meaning we still need to authenticate\n return parseQueryStringValue('idp-status') != null;\n }\n async authenticate() {\n const idpStatus = parseQueryStringValue('idp-status');\n switch (idpStatus) {\n case 'success': {\n // authentication success\n const idpUsr = parseQueryStringValue('idp-usr');\n const voorwie = parseQueryStringValue('idp-vw');\n const voorwieRolcode = parseQueryStringValue('idp-vwrc');\n // NOTE voorwie rolcode is niet verplicht\n const userVoorwie = voorwie ? `${voorwie};${voorwieRolcode ? voorwieRolcode.toUpperCase() : 'NULL'}` : undefined;\n const hoedanigheid = parseQueryStringValue('idp-hd');\n const hoedanigheidRolcode = parseQueryStringValue('idp-hdrc');\n // NOTE hoedanigheid rolcode is niet verplicht\n const userHoedanigheid = hoedanigheid ? `${hoedanigheid};${hoedanigheidRolcode ? hoedanigheidRolcode.toUpperCase() : 'NULL'}` : undefined;\n const state = { userTicketGuid: idpUsr, userVoorwie, userHoedanigheid };\n // opkuisen query string\n const url = clearQueryStringParams(window.location.href, (key) => key.startsWith('idp-'));\n window.history.replaceState({}, document.title, url.toString());\n this.contextManager.saveBaasContextToStorage(state);\n return true;\n }\n case 'fail': {\n // authentication failed\n return false;\n }\n default: {\n // authenticating\n // go to idp and pass this url as the target\n await this.idpClient.authenticate(this.bootstrapOptions.auth.config);\n return null;\n }\n }\n }\n async performLogOff() {\n this.contextManager.removeContextFromSession();\n this.logOff.navigateLogOff();\n }\n};\nBaasIdpHeaderAuthStrategy = __decorate([\n injectable(),\n __metadata(\"design:paramtypes\", [BarIdpClient,\n _BaasContextManager,\n BaasBootstrapOptions,\n BaasAppState,\n BaasLogOffUtility])\n], BaasIdpHeaderAuthStrategy);\n\n/** @deprecated use BaasConfigurationService. */\nlet _BaasProfielService = class _BaasProfielService {\n get store() {\n return this.cacheManager.getStore({\n storeType: BarCacheStoreType.User,\n store: 'profiel',\n userId: this.state.basiscontext.userId\n });\n }\n constructor(state, cacheManager, apiClient) {\n this.state = state;\n this.cacheManager = cacheManager;\n this.apiClient = apiClient;\n }\n /**\n * Reads a profiel key and returns an observable.\n * @param key\n */\n read(key) {\n const httpCallback = () => {\n const model = {\n key: key,\n appCode: this.state.toepassing.code,\n appVersion: this.state.toepassing.versie\n };\n // NOTE perform post to avoid query string\n return this.apiClient.read(model);\n };\n return this.store.getOrSetItem(key, httpCallback, {\n session: true\n });\n }\n async readNumber(key) {\n const value = await this.read(key);\n return value != null ? parseFloat(value) : null;\n }\n async readBoolean(key) {\n const value = await this.read(key);\n return value != null ? value.toLowerCase() == 'true' || value == '1' : null;\n }\n /**\n * Flushes the security browser cache.\n */\n flush() {\n return this.store.clear();\n }\n};\n_BaasProfielService = __decorate([\n injectable(),\n __param(2, inject(BAAS_TYPES.BaasConfigurationApiClient)),\n __metadata(\"design:paramtypes\", [BaasAppState,\n BarCacheManager, Object])\n], _BaasProfielService);\n\n/** Default state for GVK */\nlet BarGvkDefaultState = class BarGvkDefaultState {\n constructor(appState) {\n this.appState = appState;\n }\n get appCode() {\n // in case wired get app state from app state\n return this.appState.toepassing?.code;\n }\n get userId() {\n return this.appState.basiscontext?.userId;\n }\n get apiRootUrl() {\n return this.appState.location?.barWeb?.url;\n }\n};\nBarGvkDefaultState = __decorate([\n injectable(),\n __metadata(\"design:paramtypes\", [BaasAppState])\n], BarGvkDefaultState);\n\nvar BarGvkCompatibilityMode;\n(function (BarGvkCompatibilityMode) {\n // in version 1 we use Application storage and embed the user id in the key.\n /** Compatible with version 1 of Gebruikersvoorkeuren. */\n BarGvkCompatibilityMode[BarGvkCompatibilityMode[\"Version_1\"] = 0] = \"Version_1\";\n // in version 2 we use Application User storage where the key is kept proper (by default this is used).\n /** Compatible with version 2 of Gebruikersvoorkeuren. */\n BarGvkCompatibilityMode[BarGvkCompatibilityMode[\"Version_2\"] = 1] = \"Version_2\";\n})(BarGvkCompatibilityMode || (BarGvkCompatibilityMode = {}));\n\n/** GVK storage modus defining where state is persisted. */\nvar BarGvkStorageMode;\n(function (BarGvkStorageMode) {\n /** GVK will use browser storage and remote storage (if accessible) to persist the state. */\n BarGvkStorageMode[BarGvkStorageMode[\"Default\"] = 0] = \"Default\";\n /** GVK will only use browser storage and no remote storage to persist the state. */\n BarGvkStorageMode[BarGvkStorageMode[\"BrowserOnly\"] = 1] = \"BrowserOnly\";\n /** GVK will only use remote storage and no browser storage to persist the state. */\n BarGvkStorageMode[BarGvkStorageMode[\"RemoteOnly\"] = 2] = \"RemoteOnly\";\n})(BarGvkStorageMode || (BarGvkStorageMode = {}));\n\nclass BarGvkDefaultStore {\n constructor(appCode, userId) {\n this.store = new BarCacheStore(DB_NAME_GVK, `${appCode}_${userId}`);\n }\n getItem(key) {\n return this.store.getItem(key);\n }\n setItem(key, value) {\n // by default we set an item for indefinite time in the cache\n return this.store.setItem(key, value, { session: false });\n }\n removeItem(key) {\n return this.store.removeItem(key);\n }\n}\n\nconst DB_NAME_GVK_LEGACY = 'domain.gebruikersvoorkeuren';\nclass BarGvkLegacyStore {\n constructor(appCode, userId) {\n this.appCode = appCode;\n this.userId = userId;\n }\n getItem(key) {\n const realKey = this.generateRealKey(key);\n const store = this.getStoreInstance();\n return store.getItem(realKey).finally(() => {\n // always close the store to avoid IndexedDB locks\n store.close();\n });\n }\n setItem(key, value) {\n const realKey = this.generateRealKey(key);\n const store = this.getStoreInstance();\n return store.setItem(realKey, value).finally(() => {\n // always close the store to avoid IndexedDB locks\n store.close();\n });\n }\n removeItem(key) {\n const realKey = this.generateRealKey(key);\n const store = this.getStoreInstance();\n return store.removeItem(realKey).finally(() => {\n // always close the store to avoid IndexedDB locks\n store.close();\n });\n }\n generateRealKey(key) {\n // in legacy mode we integrate the user id into the key\n return `_${this.userId}_${key}`;\n }\n getStoreInstance() {\n return new BarStore(DB_NAME_GVK_LEGACY, this.appCode);\n }\n}\n\n// NOTE this is based on the original GVK and is not exposed to the outside world\n// API voor de 'storage' layer.\n// De storage layer maakt gebruikt van een lokale storage (BarStorage) en remote storage (ProfielBeheer met laagje er bovenop).\nlet BarGvkInternalManager = class BarGvkInternalManager {\n constructor(remoteStoreProvider) {\n this.remoteStoreProvider = remoteStoreProvider;\n this.disabled = false;\n }\n // Zijn de gebruikersvoorkeuren uitgeschakeld (via een 'master' switch in profielbeheer)?\n // Dit is van belang om voorkeuren te kunnen uitschakelen 'op afstand' indien er issues zijn.\n async checkDisabled(loadRemoteSettings, appCode, userId) {\n if (this.disabled) {\n // if globally disabled we just exit\n return true;\n }\n const uniqueKey = this.getUniqueKeyForSessionStorage(appCode, userId, '_disabled'), localSessionValue = window.sessionStorage.getItem(uniqueKey);\n if (localSessionValue === undefined || localSessionValue === null) {\n if (loadRemoteSettings) {\n const disabled = await this.getRemoteStore(appCode).checkDisabled();\n window.sessionStorage.setItem(uniqueKey, disabled.toString());\n return disabled;\n }\n else {\n sessionStorage.setItem(uniqueKey, 'false');\n return false;\n }\n }\n else\n return localSessionValue === 'true';\n }\n // Gets the gebruikersvoorkeuren.\n async getItem(appCode, userId, setName, storageMode, noSettingsAction, sets, forceGetFromRemoteStorage, compatibilityMode) {\n let value = undefined;\n // Remote storage heeft voorrang op local storage.\n // Let wel: remote storage wordt maar één keer bevraagd (bij start van sessie) en wordt dan ook lokaal bewaard.\n // Bij volgende 'loads' zal de resolve dus steeds een 'undefined' geven, maar dat is geen probleem omdat de settings\n // lokaal werden bewaard.\n if (storageMode !== BarGvkStorageMode.BrowserOnly) {\n const uniqueKey = this.getUniqueKeyForSessionStorage(appCode, userId, setName), localSessionValue = sessionStorage.getItem(uniqueKey);\n if (localSessionValue === undefined || localSessionValue === null || forceGetFromRemoteStorage) {\n // Onthouden dat we het al opgehaald hebben in deze sessie (of althans een poging gedaan hebben).\n // userId moet niet opgegeven want daar zorgt BAR voor (sessie).\n sessionStorage.setItem(uniqueKey, new Date().getTime().toString());\n value = await this.getRemoteStore(appCode).getItem(setName);\n if (value != null) {\n // Als profielbeheer voorkeuren heeft: lokaal bewaren.\n await this.setItem(appCode, userId, setName, BarGvkStorageMode.BrowserOnly, value, compatibilityMode);\n }\n else {\n // Profielbeheer heeft geen voorkeuren (meer): lokaal leegmaken.\n await this.removeItem(appCode, userId, setName, BarGvkStorageMode.BrowserOnly, compatibilityMode);\n }\n }\n }\n // Indien er remote geen settings zijn of werden opgehaald, dan wordt local storage gecontroleerd.\n if (storageMode !== BarGvkStorageMode.RemoteOnly && !value) {\n value = await this.getBrowserStore(appCode, userId, compatibilityMode).getItem(setName);\n }\n // En indien er remote en/of local niets gevonden werd: dan kunnen de voorkeuren eventueel 'berekend' worden door een callback.\n if (noSettingsAction.action === 'callback' && !value) {\n const ctx = {\n appCode: appCode,\n setName: setName,\n // TODO check concept of sets\n settings: sets != null && sets.get(setName) ? sets.get(setName).settings : this.createEmptySettings(setName)\n };\n const voorkeuren = await noSettingsAction.callback.apply(null, [ctx]);\n if (voorkeuren) {\n // Om gebruikers van deze API enigszins 'flexibiliteit' aan te bieden kunnen zij kiezen om een JSON string terug te geven of\n // een gewoon JavaScript object.\n let voorkeurenObject = null, voorkeurenString = null;\n if (typeof voorkeuren === 'string') {\n voorkeurenObject = JSON.parse(voorkeuren);\n voorkeurenString = voorkeuren;\n }\n else if (voorkeuren instanceof String) {\n voorkeurenObject = JSON.parse(voorkeuren.toString());\n voorkeurenString = voorkeuren;\n }\n else {\n voorkeurenObject = voorkeuren;\n voorkeurenString = JSON.stringify(voorkeuren);\n }\n // Controle op 'well-formedness' van het object.\n // Deze check zou nog doorgedrevener kunnen, maar dit is al goed genoeg.\n if (voorkeurenObject._gvk_setName && voorkeurenObject._gvk_timeStamp) {\n await this.setItem(appCode, userId, setName, storageMode, voorkeurenString, compatibilityMode);\n value = voorkeurenString;\n }\n }\n }\n return value;\n }\n // Bewaren van voorkeuren\n async setItem(appCode, userId, setName, storageMode, voorkeuren, compatibilityMode) {\n if (storageMode == BarGvkStorageMode.BrowserOnly) {\n await this.getBrowserStore(appCode, userId, compatibilityMode).setItem(setName, voorkeuren);\n }\n else {\n // TODO take into account localStorageMode === 'off' ??\n await this.getBrowserStore(appCode, userId, compatibilityMode).setItem(setName, voorkeuren);\n const uniqueKey = this.getUniqueKeyForSessionStorage(appCode, userId, setName);\n // Onthouden dat we het opgestuurd hebben (of althans een poging gedaan hebben).\n sessionStorage.setItem(uniqueKey, new Date().getTime().toString());\n await this.getRemoteStore(appCode).setItem(setName, JSON.parse(voorkeuren));\n }\n }\n // Opkuisen (clearen) van voorkeuren\n async removeItem(appCode, userId, setName, storageMode, compatibilityMode) {\n // clearen gebeurt in de 2 storage systemen. Eventueel zou localStorageMode kunnen uitgelezen worden.\n await this.getBrowserStore(appCode, userId, compatibilityMode).removeItem(setName);\n if (storageMode != BarGvkStorageMode.BrowserOnly) {\n // Sessie opkuisen\n const uniqueKey = this.getUniqueKeyForSessionStorage(appCode, userId, setName);\n if (appCode === null || userId === null || setName === null) {\n let i = 0;\n const keysToRemove = [];\n for (i = 0; i < sessionStorage.length; i++) {\n if (sessionStorage.key(i).indexOf(uniqueKey) == 0) {\n keysToRemove.push(sessionStorage.key(i));\n }\n }\n for (i = 0; i < keysToRemove.length; i++) {\n sessionStorage.removeItem(keysToRemove[i]);\n }\n }\n else {\n sessionStorage.removeItem(uniqueKey);\n }\n await this.getRemoteStore(appCode).removeItem(setName);\n }\n }\n createEmptySettings(setName) {\n const settings = {\n _gvk_setName: setName,\n _gvk_timeStamp: null // Wordt bij het saven opgevuld.\n };\n return settings;\n }\n // Helper functie voor het genereren van unieke key voor de sessionStorage.\n getUniqueKeyForSessionStorage(appCode, userId, setName) {\n let key = 'domain.gvk';\n if (appCode) {\n key = key + '_' + appCode;\n if (userId) {\n key = key + '_' + userId;\n if (setName) {\n key = key + '_' + setName;\n }\n }\n }\n return key;\n }\n getBrowserStore(appCode, userId, compatibilityMode) {\n if (compatibilityMode == BarGvkCompatibilityMode.Version_1) {\n return new BarGvkLegacyStore(appCode, userId);\n }\n else {\n return new BarGvkDefaultStore(appCode, userId);\n }\n }\n getRemoteStore(appCode) {\n return this.remoteStoreProvider.provide(appCode);\n }\n};\nBarGvkInternalManager = __decorate([\n injectable(),\n __param(0, inject(BAAS_TYPES.BarGvkRemoteStoreProvider)),\n __metadata(\"design:paramtypes\", [Object])\n], BarGvkInternalManager);\n\n/** BAR user storage service to get and set gebruikersvoorkeuren. */\nlet BarGvkManager = class BarGvkManager {\n /** Sets GVK as being disabled (globally). */\n set disabled(value) {\n this.storage.disabled = value;\n }\n /** Gets whether GVK is (globally). */\n get disabled() {\n return this.storage.disabled;\n }\n constructor(state, storage, bootstrapOptions) {\n this.state = state;\n this.storage = storage;\n this.bootstrapOptions = bootstrapOptions;\n // TODO [NG20] refactor way settings are defined\n // default settings used\n this.settings = {\n storageMode: BarGvkStorageMode.Default\n };\n if (this.bootstrapOptions.public || this.bootstrapOptions.connectivity === BaasConnectivity.Offline) {\n // NOTE in public or offline modus always use browser only\n this.settings.storageMode = BarGvkStorageMode.BrowserOnly;\n }\n }\n /**\n * Checks whether user storage is disabled for the application/user.\n */\n checkDisabled(appCode = this.state.appCode) {\n return this.storage.checkDisabled(true, appCode, this.state.userId);\n }\n /**\n * Loads an object from the storage.\n * @param key Key from the storage.\n */\n async getItem(key, settings = this.settings) {\n const strData = await this.storage.getItem(settings.appCode || this.state.appCode, this.state.userId, key, settings.storageMode, { action: 'none' }, null, settings.storageMode == BarGvkStorageMode.RemoteOnly, settings.compatibilityMode);\n return strData == null ? null : JSON.parse(strData);\n }\n /**\n * Saves an object to the storage.\n * @param key Key from the storage.\n * @param value The value to store in the storage.\n * @param settings Optional settings for the user storage.\n */\n setItem(key, value, settings = this.settings) {\n if (value && typeof value !== 'object')\n throw new Error('GVK item value must be a JS object.');\n return this.storage.setItem(settings.appCode || this.state.appCode, this.state.userId, key, settings.storageMode, value == null ? null : JSON.stringify(value), settings.compatibilityMode);\n }\n /**\n * Removes an object from the storage.\n * @param key Key from the storage.\n */\n removeItem(key, settings = this.settings) {\n return this.storage.removeItem(settings.appCode || this.state.appCode, this.state.userId, key, settings.storageMode, settings.compatibilityMode);\n }\n};\nBarGvkManager = __decorate([\n injectable(),\n __param(0, inject(_BAAS_TYPES.BarGvkState)),\n __metadata(\"design:paramtypes\", [Object, BarGvkInternalManager,\n BaasBootstrapOptions])\n], BarGvkManager);\n\nclass BarGvkRemoteStore {\n get urlRoot() {\n // we hebben de root URL nodig waarop we onze calls gaan doen (domain + segment)\n let result = this.state.apiRootUrl || '';\n if (!result.endsWith('/'))\n result += '/';\n // hier maken we een assumptie dat de web api er relatief als volgt eruit ziet\n result += 'api/gvk';\n return result;\n }\n constructor(state, axios, appCode) {\n this.state = state;\n this.axios = axios;\n this.appCode = appCode;\n }\n /** Checks whether the remote storage is disabled. */\n async checkDisabled() {\n try {\n // Opgelet: deze promise zal altijd 'resolven' en nooit rejecten.\n // Bij fouten wordt het zeker voor het onzeker genomen: de voorkeuren zullen niet geladen worden.\n const response = await this.axios.get(`${this.urlRoot}/${this.appCode}/settings`);\n return response.data?.disabled == null ? true : response.data.disabled;\n }\n catch (ex) {\n console.error(ex);\n return true;\n }\n }\n async getItem(key) {\n const response = await this.axios.get(`${this.urlRoot}/${this.appCode}?key=${encodeURIComponent(key)}`);\n return response.data.hasVoorkeuren ? response.data.voorkeuren : undefined;\n }\n async setItem(key, value) {\n try {\n await this.axios.put(`${this.urlRoot}/${this.appCode}?key=${encodeURIComponent(key)}`, value);\n }\n catch (error) {\n console.error('Server side fout bij wegschrijven voorkeuren', error);\n }\n }\n async removeItem(key) {\n // TODO: optimalisatie -> meerdere setNames in één keer doorgeven.\n let optionalSetName = '';\n // userId hoeft niet, want dat regelt BAR (sessie)\n if (key)\n optionalSetName = `?key=${encodeURIComponent(key)}`;\n await this.axios.delete(`${this.urlRoot}/${this.appCode}${optionalSetName}`);\n }\n}\n\nlet BarGvkDefaultRemoteStoreProvider = class BarGvkDefaultRemoteStoreProvider {\n constructor(state, axios) {\n this.state = state;\n this.axios = axios;\n }\n /** Provides a remote store for the given app code. */\n provide(appCode) {\n return new BarGvkRemoteStore(this.state, this.axios, appCode);\n }\n};\nBarGvkDefaultRemoteStoreProvider = __decorate([\n injectable(),\n __param(0, inject(_BAAS_TYPES.BarGvkState)),\n __param(1, inject(BAAS_TYPES.AxiosInstance)),\n __param(1, named(BAAS_AXIOS_INSTANCE_TYPES._BaasSilent)),\n __metadata(\"design:paramtypes\", [Object, Function])\n], BarGvkDefaultRemoteStoreProvider);\n\nvar BarClearStateTarget;\n(function (BarClearStateTarget) {\n /// \n /// Clear all known BaaS/BAR caches.\n /// \n BarClearStateTarget[BarClearStateTarget[\"Baas\"] = 0] = \"Baas\";\n /// \n /// Full cache clear.\n /// \n BarClearStateTarget[BarClearStateTarget[\"Full\"] = 1] = \"Full\";\n /// \n /// Only clear everything related to profiel/configuration.\n /// \n BarClearStateTarget[BarClearStateTarget[\"Configuration\"] = 2] = \"Configuration\";\n /// \n /// Clear everything concerning security (actie allowed).\n /// \n BarClearStateTarget[BarClearStateTarget[\"Security\"] = 3] = \"Security\";\n /// \n /// Clear everything regarding caching & storage (indexed db).\n /// \n BarClearStateTarget[BarClearStateTarget[\"CacheStorage\"] = 4] = \"CacheStorage\";\n /// \n /// Clear all application state in caching & storage (indexed db).\n /// \n BarClearStateTarget[BarClearStateTarget[\"CacheStorageApp\"] = 5] = \"CacheStorageApp\";\n /// \n /// Clear all application/user state in caching & storage (indexed db).\n /// \n BarClearStateTarget[BarClearStateTarget[\"CacheStorageAppUser\"] = 6] = \"CacheStorageAppUser\";\n /// \n /// Clear all user state in caching & storage (indexed db).\n /// \n BarClearStateTarget[BarClearStateTarget[\"CacheStorageUser\"] = 7] = \"CacheStorageUser\";\n /// \n /// Clear all global state in caching & storage (indexed db).\n /// \n BarClearStateTarget[BarClearStateTarget[\"CacheStorageGlobal\"] = 8] = \"CacheStorageGlobal\";\n /// \n /// Clear all state regarding gvk.\n /// \n BarClearStateTarget[BarClearStateTarget[\"Gvk\"] = 9] = \"Gvk\";\n /// \n /// Clear all local storage.\n /// \n BarClearStateTarget[BarClearStateTarget[\"LocalStorage\"] = 10] = \"LocalStorage\";\n /// \n /// Clear all session storage.\n /// \n BarClearStateTarget[BarClearStateTarget[\"SessionStorage\"] = 11] = \"SessionStorage\";\n // https://gist.github.com/rmehner/b9a41d9f659c9b1c3340\n /// \n /// Clear all indexed db.\n /// \n BarClearStateTarget[BarClearStateTarget[\"IndexedDb\"] = 12] = \"IndexedDb\";\n // https://stackoverflow.com/questions/179355/clearing-all-cookies-with-javascript\n /// \n /// Clear all cookies (except what cannot be removed due to security).\n /// \n BarClearStateTarget[BarClearStateTarget[\"Cookies\"] = 13] = \"Cookies\";\n})(BarClearStateTarget || (BarClearStateTarget = {}));\n\nlet BarClearStateHubMessageHandler = class BarClearStateHubMessageHandler {\n constructor() {\n this.action = 'ClearState';\n }\n async handle(target) {\n switch (target) {\n case BarClearStateTarget.Baas: {\n this.clearCacheStorage();\n this.clearGvk(false);\n this.clearStorageByPrefix(window.sessionStorage, 'domain.gvk_');\n this.clearStorageByPrefix(window.localStorage, 'lvflanders.bar.ng.core');\n this.clearStorageByPrefix(window.sessionStorage, 'lvflanders.bar.ng.core');\n this.clearStorageByPrefix(window.localStorage, _BAAS_SHARED_CONSTANTS.STORAGE_KEY_PREFIX);\n this.clearStorageByPrefix(window.sessionStorage, _BAAS_SHARED_CONSTANTS.STORAGE_KEY_PREFIX);\n break;\n }\n case BarClearStateTarget.Cookies: {\n deleteAllCookies();\n break;\n }\n case BarClearStateTarget.SessionStorage: {\n window.sessionStorage.clear();\n break;\n }\n case BarClearStateTarget.LocalStorage: {\n window.localStorage.clear();\n break;\n }\n case BarClearStateTarget.IndexedDb: {\n deleteAllIndexedDb();\n break;\n }\n case BarClearStateTarget.Full: {\n deleteAllCookies();\n window.sessionStorage.clear();\n window.localStorage.clear();\n deleteAllIndexedDb();\n break;\n }\n case BarClearStateTarget.Gvk: {\n this.clearGvk();\n break;\n }\n case BarClearStateTarget.CacheStorageGlobal: {\n deleteIndexedDb(DB_NAME_GLOBAL);\n break;\n }\n case BarClearStateTarget.CacheStorageUser: {\n deleteIndexedDb(DB_NAME_USER);\n break;\n }\n case BarClearStateTarget.CacheStorageApp: {\n deleteIndexedDb(DB_NAME_APP);\n break;\n }\n case BarClearStateTarget.CacheStorageAppUser: {\n deleteIndexedDb(DB_NAME_APP_USER);\n break;\n }\n case BarClearStateTarget.CacheStorage: {\n this.clearCacheStorage();\n break;\n }\n case BarClearStateTarget.Configuration: {\n await this.clearUserObjectStores('profiel', 'configuration');\n break;\n }\n case BarClearStateTarget.Security: {\n await this.clearUserObjectStores('actieAllowed');\n break;\n }\n }\n }\n async clearUserObjectStores(...objectStoreNameSuffixes) {\n const info = await getIndexedDbInfo(DB_NAME_USER);\n const objectStoresToDelete = info.objectStoreNames.filter((storeName) => {\n return objectStoreNameSuffixes.some((suffix) => storeName.endsWith(`_${suffix}`));\n });\n if (objectStoresToDelete.length) {\n await _deleteIndexedDbObjectStores(DB_NAME_USER, info.version + 1, objectStoresToDelete);\n }\n }\n clearCacheStorage() {\n deleteIndexedDb(DB_NAME_APP);\n deleteIndexedDb(DB_NAME_APP_USER);\n deleteIndexedDb(DB_NAME_USER);\n deleteIndexedDb(DB_NAME_GLOBAL);\n deleteIndexedDb(DB_NAME_GVK);\n }\n clearGvk(clearNonLegacy = true) {\n deleteIndexedDb(DB_NAME_GVK_LEGACY);\n if (clearNonLegacy)\n deleteIndexedDb(DB_NAME_GVK);\n this.clearStorageByPrefix(window.sessionStorage, 'domain.gvk_');\n }\n clearStorageByPrefix(storage, keyPrefix) {\n Object.keys(storage)\n .filter((key) => key.startsWith(keyPrefix))\n .forEach((key) => {\n storage.removeItem(key);\n });\n }\n};\nBarClearStateHubMessageHandler = __decorate([\n injectable()\n /*** Handles hub message to show a push notification. */\n], BarClearStateHubMessageHandler);\n\nlet BarCustomHubMessageHandler = class BarCustomHubMessageHandler {\n constructor() {\n this.action = 'CustomMessage';\n }\n handle(data) {\n const customEvent = new CustomEvent(BAAS_CUSTOM_EVENT.CUSTOM_HUB_MESSAGE, {\n detail: data\n });\n // Dispatch the custom event on a JavaScript object or DOM element\n window.dispatchEvent(customEvent);\n }\n};\nBarCustomHubMessageHandler = __decorate([\n injectable()\n], BarCustomHubMessageHandler);\n\nlet BarLogOffHubMessageHandler = class BarLogOffHubMessageHandler {\n constructor(auth) {\n this.auth = auth;\n this.action = 'LogOff';\n }\n async handle() {\n await this.auth.logOff();\n }\n};\nBarLogOffHubMessageHandler = __decorate([\n injectable()\n /*** Handles hub message to show a push notification. */\n ,\n __metadata(\"design:paramtypes\", [BaasAuthService])\n], BarLogOffHubMessageHandler);\n\nlet BarPushNotificationHubMessageHandler = class BarPushNotificationHubMessageHandler {\n constructor(notificationManager = new BarNotificationManager()) {\n this.notificationManager = notificationManager;\n this.action = 'PushNotification';\n }\n handle(data) {\n this.notificationManager.show(data);\n }\n};\nBarPushNotificationHubMessageHandler = __decorate([\n injectable()\n /*** Handles hub message to show a push notification. */\n ,\n __metadata(\"design:paramtypes\", [Object])\n], BarPushNotificationHubMessageHandler);\n\nlet BaasMeldingService = class BaasMeldingService {\n constructor(apiClient) {\n this.apiClient = apiClient;\n }\n /**\n * Get meldingen for requested url\n */\n getMeldingen(url) {\n return this.apiClient.getMeldingen(url);\n }\n /**\n *Used by Melding Guard to check if a route has a blocking notification, if so it has to redirect to a specific page\n */\n hasBlockingMelding(url) {\n return this.apiClient.hasBlockingMelding(url);\n }\n};\nBaasMeldingService = __decorate([\n injectable(),\n __param(0, inject(BAAS_TYPES.BaasMeldingApiClient)),\n __metadata(\"design:paramtypes\", [Object])\n], BaasMeldingService);\n\nclass BaasApmTransaction {\n constructor(transaction) {\n this.transaction = transaction;\n }\n startSpan(name, type, options) {\n const span = this.transaction.startSpan(name, type, { startTime: options?.startTime });\n return span ? new BaasApmSpan(span) : BaasNoopTelemetrySpan.INSTANCE;\n }\n end() {\n this.transaction.end();\n }\n}\n/*** No-op Transaction (used when telemetry is disabled) */\nclass BaasNoopTelemetryTransaction {\n static { this.INSTANCE = new BaasNoopTelemetryTransaction(); }\n startSpan(name, type, options) {\n return BaasNoopTelemetrySpan.INSTANCE;\n }\n end() {\n // No-op\n }\n}\n/*** No-op Span (used when telemetry is disabled) */\nclass BaasNoopTelemetrySpan {\n static { this.INSTANCE = new BaasNoopTelemetrySpan(); }\n end() {\n // No-op\n }\n addLabels() {\n // No-op\n }\n}\nclass BaasApmSpan {\n constructor(span) {\n this.span = span;\n }\n end() {\n this.span.end();\n }\n addLabels(labels) {\n this.span.addLabels(labels);\n }\n}\n/*** BaaS Telemetry service. */\nlet BaasApmTelemetry = class BaasApmTelemetry {\n constructor(baasApm) {\n this.baasApm = baasApm;\n }\n startTransaction(name, type) {\n if (this.#enabled) {\n const transaction = this.baasApm.startTransaction(name, type);\n return new BaasApmTransaction(transaction);\n }\n return BaasNoopTelemetryTransaction.INSTANCE;\n }\n get currentTransaction() {\n if (this.#enabled) {\n const transaction = this.baasApm.apm?.getCurrentTransaction();\n if (transaction)\n return new BaasApmTransaction(transaction);\n }\n return undefined;\n }\n startSpan(name, type) {\n const span = this.baasApm.apm.startSpan(name, type);\n return span ? new BaasApmSpan(span) : BaasNoopTelemetrySpan.INSTANCE;\n }\n get #enabled() {\n return this.baasApm.active && this.baasApm.apm !== undefined;\n }\n handleError(error) {\n this.baasApm.handleError(error);\n }\n};\nBaasApmTelemetry = __decorate([\n injectable(),\n __metadata(\"design:paramtypes\", [_BaasApm])\n], BaasApmTelemetry);\nfunction _registerTelemetryIoc(container) {\n container.bind(BAAS_TYPES.BaasTelemetry).to(BaasApmTelemetry).inSingletonScope();\n}\n\nlet BaasToepassingService = class BaasToepassingService {\n constructor(appInfo, state) {\n this.appInfo = appInfo;\n this.state = state;\n }\n /**\n * Sets the voorwie.\n * @param voorwie\n * @param voorwieRolcode\n */\n async setVoorwie(voorwie, voorwieRolcode) {\n // do not allow null because it can cause null to be written in de cookie as a string causing trouble in the neighbourhood\n if (voorwie == null)\n voorwie = '';\n if (voorwieRolcode == null)\n voorwieRolcode = '';\n await this.setBasiscontextData((basiscontext) => {\n basiscontext.voorwie = voorwie;\n basiscontext.voorwieRolcode = voorwieRolcode;\n }, 'Set-Voorwie');\n }\n /**\n * Resets the voorwie.\n */\n async resetVoorwie() {\n await this.setVoorwie('', '');\n }\n /**\n * Sets the hoedanigheid.\n * @param hoedanigheid\n * @param hoedanigheidRolcode\n */\n async setHoedanigheid(hoedanigheid, hoedanigheidRolcode) {\n // do not allow null because it can cause null to be written in de cookie as a string causing trouble in the neighbourhood\n if (hoedanigheid == null)\n hoedanigheid = '';\n if (hoedanigheidRolcode == null)\n hoedanigheidRolcode = '';\n await this.setBasiscontextData((basiscontext) => {\n basiscontext.hoedanigheid = hoedanigheid;\n basiscontext.hoedanigheidRolcode = hoedanigheidRolcode;\n }, 'Set-Hoedanigheid');\n }\n /**\n * Resets the hoedanigheid.\n */\n async resetHoedanigheid() {\n await this.setHoedanigheid('', '');\n }\n async setBasiscontextData(handler, method) {\n const basiscontext = this.state.basiscontext;\n if (basiscontext != null) {\n handler(basiscontext);\n // trick to fill in readonly prop (will give compilation error if property name changes)\n // https://stackoverflow.com/questions/48992522/get-name-of-property-or-field-in-object-typed/48992694?noredirect=1#comment84991472_48992694\n const basiscontextKey = 'basiscontext';\n this.state[basiscontextKey] = basiscontext;\n await this.appInfo.persistBasiscontext({ caller: `Toepassing-${method}` });\n const customEvent = new CustomEvent(BAAS_CUSTOM_EVENT.BASISCONTEXT_CHANGED, {\n detail: basiscontext\n });\n // Dispatch the custom event on a JavaScript object or DOM element\n window.dispatchEvent(customEvent);\n }\n }\n};\nBaasToepassingService = __decorate([\n injectable(),\n __metadata(\"design:paramtypes\", [_BarAppInfoManager,\n BaasAppState])\n], BaasToepassingService);\n\nconst ANTI_XSSI_TOKEN = \")]}',\";\nlet BaasInterceptor = class BaasInterceptor {\n // defines if we handle the forbidden status (combined means we check different parts of the afschakelplan)\n get handleAuthFailedStatus() {\n // we handle it if defined globally through configuration and if the user didn't turn it off (if we don't have the configuration yet we assume we want to handle: init call)\n return !this.appState.config || this.appState.config.interception?.handleAuthFailed;\n }\n // defines if we handle the forbidden status (combined means we check different parts of the afschakelplan)\n get handleForbiddenStatus() {\n // we handle it if defined globally through configuration and if the user didn't turn it off\n return this.appState.config?.interception != null && this.appState.config.interception?.handleForbidden;\n }\n constructor(options, appState, appInfo, xdc, baasContextService, oopsDomService, telemetry) {\n this.options = options;\n this.appState = appState;\n this.appInfo = appInfo;\n this.xdc = xdc;\n this.baasContextService = baasContextService;\n this.oopsDomService = oopsDomService;\n this.telemetry = telemetry;\n /** Whether the interception should be silent and not cause a crash. */\n this.silent = false;\n }\n async onRequest(config) {\n const stopwatch = new BarStopwatch();\n stopwatch.start();\n config.metadata = {\n stopwatch: stopwatch // Include the stopwatch instance in metadata\n };\n // determine whether this is a domain request\n const domainRequest = this.checkDomainRequest(config.url);\n const crossDomainRequest = this.checkCrossDomainRequest(config.url);\n if (domainRequest || crossDomainRequest) {\n if (this.appState.basiscontext != null) {\n // before we do the call we make sure the cookie is up to date for the request\n await this.appInfo.persistBasiscontext({\n caller: 'BaasInterceptor',\n url: config.url\n });\n }\n else if (crossDomainRequest && this.xdc.enabled) {\n await this.xdc.sync({\n caller: 'BaasInterceptor',\n url: config.url\n });\n }\n // needed for localhost cookie sharing\n config.withCredentials = true;\n }\n this.telemetryStart(config);\n this.defineHeaders(config, domainRequest, crossDomainRequest);\n // Modify the request config\n // You can access this.axiosInstance and other injected dependencies here\n return Promise.resolve(config);\n }\n async onResponse(response) {\n this.telemetryEnd(response.config);\n if (response.data && typeof response.data === 'string' && response.data.startsWith(ANTI_XSSI_TOKEN)) {\n // Remove the prefix before parsing the JSON\n const cleanData = response.data.substring(ANTI_XSSI_TOKEN.length);\n response.data = JSON.parse(cleanData);\n }\n const domainRequest = this.checkDomainRequest(response.request.url);\n const crossDomainRequest = this.checkCrossDomainRequest(response.request.url);\n if (crossDomainRequest) {\n await this.xdc.sync({\n caller: 'BaasInterceptor-End',\n url: response.request.url\n });\n }\n if (domainRequest) {\n // get the basiscontext based on cookie and update basiscontext in temp state and page state\n // a request can lead to changed basiscontext\n const basiscontext = this.appInfo.getBasiscontext();\n const basiscontextKey = 'basiscontext';\n this.appState[basiscontextKey] = basiscontext;\n }\n // Modify the response or perform actions\n return Promise.resolve(response);\n }\n async onError(error) {\n this.telemetryEnd(error.config);\n if (!this.silent) {\n // 455 custom code authentication engine or authentication handler (in localhost we also want redirect behavior)\n if (this.handleAuthFailedStatus && error.response?.status == 455) {\n await this.handleAuthFailed();\n }\n // 403 forbidden (e.g. actie allowed failed) handling, in localhost we don't want to get kicked out of application\n else if (this.handleForbiddenStatus && !this.options.localhost && error.response?.status == 403) {\n this.handleForbidden();\n }\n }\n // Handle errors or perform actions\n return Promise.reject(error);\n }\n checkDomainRequest(url) {\n return (!checkUrlAbsolute(url) ||\n url.indexOf('localhost') > -1 ||\n url.startsWith(document.location.origin) ||\n _checkCompatibleOrigin(url, this.options.compatibleOrigins));\n }\n /* check if this is a cross domain request\n rules:\n - xdc must be enabled (localhost, not production...)\n - we must be doing a call to the release domain (which is not localhost)\n */\n checkCrossDomainRequest(url) {\n const result = false;\n if (this.options.localhost) {\n // get the parts of the url being invoked by http\n const invokedUrlParts = extractUrlParts(url);\n // do the check if this is really a cross domain check (http call to origin of cross domain && cross domain is not localhost)\n return invokedUrlParts.origin == this.appState.location.release.origin && this.appState.location.release.hostname != 'localhost';\n }\n return result;\n }\n defineHeaders(config, domainRequest, crossDomainRequest) {\n config.headers = {\n ...config.headers,\n 'X-Requested-With': 'XMLHttpRequest'\n };\n let requestToken = null;\n if (domainRequest && !crossDomainRequest && this.appState.localRequestToken != null && this.xdc.enabled) {\n // local request cookie in case domain request && cross domain cookeis are enabled\n requestToken = this.appState.localRequestToken;\n }\n else if (this.appState.requestToken != null) {\n requestToken = this.appState.requestToken;\n }\n if (requestToken) {\n // Add headers to the request configuration\n config.headers = {\n ...config.headers, // Preserve existing headers\n 'X-XSRF-TOKEN': requestToken // Add your custom header\n };\n }\n let auditId = null;\n let auditType = null;\n if (this.appState.routeId != null) {\n auditId = this.appState.routeId;\n auditType = BaasAuditType.Route;\n }\n else if (this.appState.pageId != null) {\n auditId = this.appState.pageId;\n auditType = BaasAuditType.Page;\n }\n else if (this.appState.sessionId != null) {\n auditId = this.appState.sessionId;\n auditType = BaasAuditType.Session;\n }\n if (auditId) {\n // set audit id so that audit system can chain everything together\n // Add headers to the request configuration\n config.headers = {\n ...config.headers, // Preserve existing headers\n 'X-Audit-Id': auditType // Add your custom header\n };\n }\n this.addBaasHeaders(config);\n }\n /**pass headers from session storage to call */\n addBaasHeaders(config) {\n if (this.options.auth.contextTransportModus === BaasContextTransportModus.Header &&\n this.baasContextService.checkBaasContextInStorage() &&\n !config.headers[_BAAS_SHARED_CONSTANTS.HEADER.BAAS_BACKEND_HEADER]) {\n // (old BAR apps only accept baas.context.backend headers)\n config.headers[_BAAS_SHARED_CONSTANTS.HEADER.BAAS_BACKEND_HEADER] = this.baasContextService.getBaasContextAsHeaderString();\n }\n if (!config.headers[_BAAS_SHARED_CONSTANTS.HEADER.BAAS_BROWSER_CALLSTACK]) {\n const callStack = [\n {\n userId: this.appState.basiscontext?.userId,\n appCode: this.appState.toepassing?.code\n }\n ];\n const headerValue = JSON.stringify(callStack);\n config.headers[_BAAS_SHARED_CONSTANTS.HEADER.BAAS_BROWSER_CALLSTACK] = headerValue;\n }\n }\n handleAuthFailed() {\n this.oopsDomService.showOops({ type: _OopsType.Authentication });\n return Promise.resolve();\n }\n handleForbidden() {\n window.location.replace(this.appState.location.baasStatic.url + _BAAS_SHARED_CONSTANTS.PAGE.INSUFFICIENT_PRIVILEGES);\n }\n telemetryStart(config) {\n const name = `Axios HTTP ${config.method} ${config.url}`;\n const telemetry = {};\n if (this.telemetry.currentTransaction) {\n // span op op huidige transactie by default\n telemetry.span = this.telemetry.currentTransaction.startSpan(name, 'axios-http-request');\n }\n else {\n // Start telemetry transaction for the request if we don't have a current transaction\n telemetry.transaction = this.telemetry.startTransaction(name, 'axios-http-request');\n telemetry.span = telemetry.transaction.startSpan(name, 'axios-http-request');\n }\n config.telemetry = telemetry;\n }\n telemetryEnd(config) {\n if (config?.telemetry) {\n const span = config.telemetry.span;\n span?.end();\n if (config.telemetry.transaction) {\n const transaction = config.telemetry.transaction;\n transaction.end();\n }\n }\n }\n};\nBaasInterceptor = __decorate([\n injectable(),\n __param(6, inject(BAAS_TYPES.BaasTelemetry)),\n __metadata(\"design:paramtypes\", [BaasBootstrapOptions,\n BaasAppState,\n _BarAppInfoManager,\n _BarXdc,\n _BaasContextManager,\n _OopsDomService, Object])\n], BaasInterceptor);\n\n/** Internal method which bootstraps a IOC container for a BaaS browser application.*/\nfunction bootstrapBaasIoc(options) {\n const container = new Container();\n // global variable\n baasContext.container = container;\n // bindings\n container.bind(Container).toConstantValue(container);\n container.bind(BaasAppState).toSelf().inSingletonScope();\n container.bind(BaasBootstrap).toSelf().inSingletonScope();\n container.bind(BaasInterceptor).toSelf();\n container.bind(BaasToepassingService).toSelf().inSingletonScope();\n container.bind(BaasBootstrapOptions).toSelf().inSingletonScope();\n container.bind(BarRapUrlHelper).toSelf().inSingletonScope();\n container.bind(BaasLoggingService).toSelf().inSingletonScope();\n container.bind(BaasLogOffUtility).toSelf().inSingletonScope();\n container.bind(BaasSecurityService).toSelf().inSingletonScope();\n container.bind(BaasAuditService).toSelf().inSingletonScope();\n container.bind(BaasMeldingService).toSelf().inSingletonScope();\n container.bind(BaasConfigurationService).toSelf().inSingletonScope();\n container.bind(_BaasProfielService).toSelf().inSingletonScope();\n container.bind(BaasMeetpuntService).toSelf().inSingletonScope();\n container.bind(BarNotificationManager).toSelf().inSingletonScope();\n container.bind(_OopsDomService).toSelf().inSingletonScope();\n container.bind(_BaasApm).toSelf().inSingletonScope();\n _registerTelemetryIoc(container);\n defineGvk(container);\n defineAuth(container, options.auth);\n defineBackendApi(container, options.backendType);\n defineI18n(container, options.i18n);\n defineAxios(container);\n defineCaching(container, options.appCode);\n defineHubStuff(container);\n return container;\n}\nfunction defineGvk(container) {\n container.bind(BarGvkManager).toSelf().inSingletonScope();\n container.bind(BarGvkInternalManager).toSelf().inSingletonScope();\n container.bind(_BAAS_TYPES.BarGvkState).to(BarGvkDefaultState).inSingletonScope();\n container.bind(BAAS_TYPES.BarGvkRemoteStoreProvider).to(BarGvkDefaultRemoteStoreProvider).inSingletonScope();\n}\nfunction defineAuth(container, auth) {\n container.bind(_BaasContextManager).toSelf().inSingletonScope();\n container.bind(_BarAppInfoManager).toSelf().inSingletonScope();\n container.bind(_BarXdc).toSelf().inSingletonScope();\n container.bind(BaasExternalAuthStrategy).toSelf().inSingletonScope();\n container.bind(BaasIdpHeaderAuthStrategy).toSelf().inSingletonScope();\n container.bind(BaasIdpAuthStrategy).toSelf().inSingletonScope();\n // NOTE do dynamic value because the context provider is injected after the BaaS bootstrap (deferred execution)\n container\n .bind(BAAS_TYPES.BaasAuthStrategy)\n .toDynamicValue((context) => {\n switch (auth.contextTransportModus) {\n case BaasContextTransportModus.Header: {\n if (context.container.isBound(BAAS_TYPES.BaasContextProvider)) {\n return context.container.get(BaasExternalAuthStrategy);\n }\n return context.container.get(BaasIdpHeaderAuthStrategy);\n }\n default:\n case BaasContextTransportModus.Cookie: {\n return context.container.get(BaasIdpAuthStrategy);\n }\n }\n })\n .inSingletonScope();\n container.bind(BaasAuthService).toSelf().inSingletonScope();\n const appInfoManager = container.get(_BarAppInfoManager);\n const idpClientOptions = new BarIdpClientOptions();\n if (auth.contextTransportModus === BaasContextTransportModus.Header)\n idpClientOptions.formatToken = 'qs';\n const idpClient = new BarIdpClient(idpClientOptions, appInfoManager);\n container.bind(BarIdpClient).toConstantValue(idpClient);\n container.bind(BAAS_TYPES._BaasLvOicdAuthService).to(BaasOidcAuthService).inSingletonScope();\n}\nfunction defineCaching(container, appCode) {\n container.bind(BarCacheManager).toSelf().inSingletonScope();\n const cacheManager = container.get(BarCacheManager);\n container\n .bind(BarCacheStore)\n .toConstantValue(cacheManager.getStore({ storeType: BarCacheStoreType.Global }))\n .whenTargetTagged(BAAS_METADATA_KEY.CACHE_STORE_TYPE_TAG, BarCacheStoreType.Global);\n if (appCode) {\n const cacheManager = container.get(BarCacheManager);\n container\n .bind(BarCacheStore)\n .toConstantValue(cacheManager.getStore({ storeType: BarCacheStoreType.Application, appCode: appCode }))\n .whenTargetTagged(BAAS_METADATA_KEY.CACHE_STORE_TYPE_TAG, BarCacheStoreType.Application);\n }\n}\nfunction defineBackendApi(container, backendType) {\n container.bind(_BaasStaticConfigurationApiClient).toSelf().inSingletonScope();\n switch (backendType) {\n case BaasBackendType.Bar: {\n container.bind(BAAS_TYPES.BaasAuditApiClient).to(BarAuditApiClient);\n container.bind(BAAS_TYPES.BaasLoggingApiClient).to(BarLoggingApiClient);\n container.bind(BAAS_TYPES.BaasMeldingApiClient).to(BarMeldingApiClient);\n container.bind(BAAS_TYPES.BaasSecurityApiClient).to(BarSecurityApiClient);\n container.bind(BAAS_TYPES.BaasConfigurationApiClient).to(BarProfielApiClient);\n container.bind(BAAS_TYPES.BaasMeetpuntApiClient).to(BarMeetpuntApiClient);\n container.bind(BAAS_TYPES.BaasCommonApiClient).to(BarCommonApiClient);\n break;\n }\n case BaasBackendType.Baas: {\n container.bind(BAAS_TYPES.BaasAuditApiClient).to(BaasAuditDefaultApiClient);\n container.bind(BAAS_TYPES.BaasLoggingApiClient).to(BaasLoggingDefaultApiClient);\n container.bind(BAAS_TYPES.BaasMeldingApiClient).to(BaasMeldingDefaultApiClient);\n container.bind(BAAS_TYPES.BaasSecurityApiClient).to(BaasSecurityDefaultApiClient);\n container.bind(BAAS_TYPES.BaasConfigurationApiClient).to(BaasConfigurationDefaultApiClient);\n container.bind(BAAS_TYPES.BaasMeetpuntApiClient).to(BaasMeetpuntDefaultApiClient);\n container.bind(BAAS_TYPES.BaasCommonApiClient).to(BaasCommonDefaultApiClient);\n break;\n }\n }\n}\nfunction defineAxios(container) {\n const baasInstance = axios.create();\n // default BaaS instance\n container.bind(BAAS_TYPES.AxiosInstance).toConstantValue(baasInstance).whenTargetIsDefault();\n container.bind(BAAS_TYPES.AxiosInstance).toConstantValue(baasInstance).whenTargetNamed(BAAS_AXIOS_INSTANCE_TYPES.Baas);\n const interceptor = container.get(BaasInterceptor);\n baasInstance.interceptors.request.use((config) => interceptor.onRequest(config));\n baasInstance.interceptors.response.use((response) => interceptor.onResponse(response), (error) => interceptor.onError(error));\n const baasSilentInstance = axios.create();\n const silentInterceptor = container.get(BaasInterceptor);\n // make silent\n silentInterceptor.silent = true;\n baasSilentInstance.interceptors.request.use((config) => silentInterceptor.onRequest(config));\n baasSilentInstance.interceptors.response.use((response) => silentInterceptor.onResponse(response), (error) => silentInterceptor.onError(error));\n // silent instance\n container.bind(BAAS_TYPES.AxiosInstance).toConstantValue(baasSilentInstance).whenTargetNamed(BAAS_AXIOS_INSTANCE_TYPES._BaasSilent);\n // plain instance without interceptors\n const plainInstance = axios.create();\n container.bind(BAAS_TYPES.AxiosInstance).toConstantValue(plainInstance).whenTargetNamed(BAAS_AXIOS_INSTANCE_TYPES.Plain);\n}\nfunction defineI18n(container, options) {\n const i18n = new BaasI18n(options);\n container.bind(BaasI18n).toConstantValue(i18n);\n}\nfunction defineHubStuff(container) {\n container.bind(BarHubClient).toSelf().inSingletonScope();\n container.bind(_BAAS_TYPES.BarHubMessageHandler).to(BarClearStateHubMessageHandler).inSingletonScope();\n container.bind(_BAAS_TYPES.BarHubMessageHandler).to(BarCustomHubMessageHandler).inSingletonScope();\n container.bind(_BAAS_TYPES.BarHubMessageHandler).to(BarLogOffHubMessageHandler).inSingletonScope();\n container.bind(_BAAS_TYPES.BarHubMessageHandler).to(BarPushNotificationHubMessageHandler).inSingletonScope();\n}\n\n/** Bootstraps a BaaS browser DOM application. */\nasync function bootstrapBaasApp(options = {}, \n/** Callback to perform extra IOC injection after the container is generated and before the actual bootstrapping */\niocSetup = undefined) {\n if (!options)\n options = {};\n setDefaults(options);\n const container = bootstrapBaasIoc(options);\n if (iocSetup)\n iocSetup(container);\n const bootstrap = container.get(BaasBootstrap);\n const outcome = await bootstrap.bootstrap(options);\n return {\n success: outcome === BaasBootstrapOutcome.Initialized,\n outcome: outcome,\n appInstance: { container }\n };\n}\nfunction setDefaults(options) {\n if (options.localhost == null)\n options.localhost = checkLocalhost();\n if (!options.connectivity)\n options.connectivity = BaasConnectivity.Online;\n if (!options.backendType)\n options.backendType = BaasBackendType.Baas;\n if (!options.auth) {\n options.auth = new BaasAuthOptions();\n }\n options.auth._originalContextTransportModus = options.auth.contextTransportModus;\n if (!options.auth.contextTransportModus) {\n // in localhost use online headers instead of cookies (avoid third party cookie issues)\n options.auth.contextTransportModus = options.localhost ? BaasContextTransportModus.Header : BaasContextTransportModus.Cookie;\n }\n}\n\nclass BarCacheStoreOptions {\n}\n\n/** GVK call settings. */\nclass BarGvkSettings {\n constructor() {\n /** Defines how to store the state. */\n this.storageMode = BarGvkStorageMode.Default;\n /** Defines the compatibility */\n this.compatibilityMode = BarGvkCompatibilityMode.Version_2;\n }\n}\n\n/**\n * Actie object to check. This is needed by the BarActieAllowedGuard.\n */\nclass BaasActieFromContext {\n constructor(actie) {\n this.includeVoorwie = true;\n this.includeHoedanigheid = true;\n if (actie != null) {\n this.actie = actie.actie;\n this.includeVoorwie = actie.includeVoorwie === undefined ? true : actie.includeVoorwie;\n this.includeHoedanigheid = actie.includeHoedanigheid === undefined ? true : actie.includeHoedanigheid;\n }\n }\n}\n\n/*\n * Public API Surface of @lvflanders/bar\n */\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { BAAS_AXIOS_INSTANCE_TYPES, BAAS_CUSTOM_EVENT, BAAS_METADATA_KEY, BAAS_TYPES, BaasActie, BaasActieFromContext, BaasAppState, BaasAuditService, BaasAuditType, BaasAuthOptions, BaasAuthService, BaasBackendType, BaasBootstrap, BaasBootstrapOptions, BaasBootstrapOutcome, BaasConfigurationService, BaasConnectivity, BaasContextTransportModus, BaasI18n, BaasLogLevel, BaasLoggingService, BaasMeetpuntService, BaasMeldingService, BaasOidcAuthService, BaasSecurityLevel, BaasSecurityService, BaasToepassingService, BarAuthValues, BarCacheEntryOptions, BarCacheManager, BarCacheStore, BarCacheStoreOptions, BarCacheStoreType, BarGvkCompatibilityMode, BarGvkManager, BarGvkSettings, BarGvkStorageMode, BarHubClient, BarIdentity, BarIdentityType, BarIdpClient, BarIdpClientOptions, BarKlant, BarNotificationManager, BarStopwatch, BarStore, DB_NAME_APP, DB_NAME_APP_USER, DB_NAME_GLOBAL, DB_NAME_GVK, DB_NAME_USER, LOCALE, _BAAS_SHARED_CONSTANTS, _BaasApm, _BaasContextManager, _BaasProfielService, _BaasStaticConfigurationApiClient, _BarAppInfoManager, _BarXdc, _OopsDomService, _OopsType, _addAuditInfoOnDocument, _checkCompatibleOrigin, baasContext, bootstrapBaasApp, checkDateObject, checkLocalhost, checkUrlAbsolute, clearQueryStringParams, concatUrl, convertToISOString, deepClone, deleteAllCookies, deleteAllIndexedDb, deleteCookie, ensureGlobal, extractUrlOrigin, extractUrlParts, generateRandomNumber, generateUuid, getParamNames, getStack, openUrl, parseQueryStringValue, readCookie, resolveUrlFromOrigin, resolveValue, versionCompare };\n//# sourceMappingURL=lvflanders-bar.mjs.map\n","import * as lvFlandersBarShared from '../dist/@lvflanders/bar';\r\n\r\n// global glue variable for externals\r\nif (window['lvflanders'] == null) window['lvflanders'] = {};\r\nif (window['lvflanders'].bar == null) window['lvflanders'].bar = {};\r\n\r\nwindow['lvflanders'].bar.shared = lvFlandersBarShared;\r\n\r\nexport { lvFlandersBarShared };\r\n"],"names":["__webpack_require__","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","__decorate","decorators","target","desc","d","c","arguments","length","r","getOwnPropertyDescriptor","Reflect","decorate","i","__param","paramIndex","decorator","__metadata","metadataKey","metadataValue","metadata","create","SuppressedError","inversify","localforage","window","axios","extractUrlParts","url","a","document","createElement","href","host","hostname","port","pathname","protocol","hash","search","origin","extractUrlOrigin","pathArray","split","checkUrlAbsolute","RegExp","test","parseQueryStringValue","name","location","replace","results","exec","decodeURIComponent","resolveUrlFromOrigin","openUrl","body","appendChild","click","parentNode","removeChild","checkLocalhost","concatUrl","urlSegments","result","forEach","urlSegment","endsWith","startsWith","substring","_checkCompatibleOrigin","compatibleOrigins","URL","toLowerCase","some","compatibleOrigin","strategy","clearQueryStringParams","uri","condition","keysToDelete","searchParams","push","delete","toString","BAAS_TYPES","AxiosInstance","BaasAuthStrategy","BaasContextProvider","BaasLogOffHook","BaasLoggingApiClient","BaasMeldingApiClient","BaasSecurityApiClient","BaasAuditApiClient","BaasConfigurationApiClient","BaasMeetpuntApiClient","BaasCommonApiClient","BarGvkRemoteStoreProvider","BarErrorDelegate","BaasTelemetry","_BaasLvOicdAuthService","BAAS_AXIOS_INSTANCE_TYPES","Baas","_BaasSilent","Plain","readCookie","nameEQ","ca","cookie","charAt","indexOf","deleteAllCookies","cookies","eqPos","deleteCookie","substr","checkDateObject","convertToISOString","Date","UTC","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","toISOString","deleteAllIndexedDb","Promise","resolve","indexedDB","databases","then","deleteDatabase","deleteIndexedDb","generateUuid","now","performance","Math","random","floor","resolveValue","ensureGlobal","nestedObject","global","piece","getParamNames","func","str","trim","start","end","params","element","getStack","Error","e","stack","versionCompare","v1","v2","options","undefined","lexicographical","zeroExtend","v1parts","v2parts","isValidPart","x","every","NaN","map","Number","generateRandomNumber","min","max","difference","rand","BarLogger","enabled","this","_enabled","category","item","localStorage","getItem","JSON","parse","format","_format","constructor","log","message","context","correlation","parent","console","stringify","BaasAppState","injectable","BarStore","_correlation","logger","storeName","_localforage","driver","type","finally","setItem","removeItem","drop","dropInstance","clear","close","dbInfo","_dbInfo","db","iterate","iteratee","keys","BarCacheEntry","BarCacheEntryOptions","session","BarCacheStore","_appState","__appState","getOrSetItem","callback","default","instance","getStoreInstance","getItemInternal","data","setItemInternal","entry","timestamp","expiration","ttl","addSeconds","sessionId","invalidate","clearSession","async","checkExpired","isBefore","store","lastAccess","BarCacheStoreType","DB_NAME_PREFIX","DB_NAME_APP","DB_NAME_USER","DB_NAME_APP_USER","DB_NAME_GLOBAL","DB_NAME_GVK","BarCacheManager","appState","getStore","storeType","Application","appCode","User","userId","ApplicationUser","Global","invalidateDatabase","objectStoreNames","getObjectStoreNames","remainingObjectStoreNames","openRequest","open","onsuccess","toArray","array","BarQueueProcessor","storage","storageKey","started","interval","dequeueCount","intervalId","setInterval","dequeue","stop","clearInterval","enqueue","queueStr","queue","itemsToSend","slice","onExecute","BaasAuthOptions","validation","BaasBackendType","BaasBootstrapOptions","auth","backendType","i18n","BaasBootstrapOutcome","APP_INFO_COOKIE_KEY","PAGES_ROOT_PATH","STORAGE_KEY_PREFIX","OIDC_CALLBACK_PATH","_BAAS_SHARED_CONSTANTS","TEMP_STORAGE_STATE_KEY","DEFAULT_MEETPUNT_TYPE","STORAGE_KEY","SESSION_ID","IDP_IMPERSONATE","BAAS_STATE_CONTEXT","BAR_APPINFO_CONTEXT","URL_SEGMENT","BAR_WEB","BAAS_STATIC","BAAS_WEB","IDP_OIDC","AUDIT","HTML_ATTRIBUTE_AUDIT_ID","HTML_ATTRIBUTE_AUDIT_TYPE","COOKIE","APP_INFO","MAIN","SESSION","SECURE","HEADER","BAAS_BACKEND_HEADER","BAAS_BROWSER_CALLSTACK","PAGE","LOG_OFF","INSUFFICIENT_PRIVILEGES","AUTH","OIDC","CALLBACK","LV","SPOTFIRE","BaasLogLevel","BaasLoggingService","loggingApiClient","state","queueProcessor","sessionStorage","error","post","warn","Warn","critical","Critical","info","Info","init","failedLogsStr","configurable","logs","save","failedLogs","config","itemCount","level","model","logLevel","appVersion","exception","stackTrace","toepassing","code","versie","inject","CACHE_STORE","CONFIGURATION_KEY","_BaasStaticConfigurationApiClient","axiosSilent","logging","cacheManager","getConfiguration","checkChatbotEnabled","baasStatic","chatbot","enableChatbot","apiRoot","put","headers","err","cacheStore","named","Function","BarStopwatch","id","duration","reset","timing","mark","measure","entries","getEntriesByName","clearMarks","clearMeasures","deepClone","deepCloneInternal","traversed","String","Boolean","child","index","nodeType","cloneNode","traversedItem","find","t","originalItem","clonedItem","_addAuditInfoOnDocument","audit","htmlEl","getElementsByTagName","setAttribute","auditId","auditType","BaasAuditService","auditApiClient","excludedAuditTypes","basiscontext","hoedanigheid","hoedanigheidRolcode","voorwie","voorwieRolcode","hostName","details","pageId","auditItems","BaasAuditType","BaasConfigurationService","apiClient","readValue","pathAndKey","read","flush","LOCALE","FLEMISH","DUTCH","BAAS_METADATA_KEY","CACHE_STORE_TYPE_TAG","BAAS_CUSTOM_EVENT","BASISCONTEXT_CHANGED","CUSTOM_HUB_MESSAGE","clearFromStorage","BaasActie","actie","TEMP_STATE_ROOT_KEY","BaasSecurityService","securityApiClient","checkActieAllowed","storageObj","checkActieAllowedFromContext","actieObj","includeVoorwie","includeHoedanigheid","storageObjStr","BaasLogOffUtility","configuration","security","globalStore","logOffHooks","startListening","onstorage","requestLogOff","navigateLogOff","invokePreLogOffHooks","logOffHook","run","cleanup","logOffUrl","tagged","multiInject","optional","Array","BaasAuthService","authenticated","authenticating","logOffService","authenticate","postProcessing","logOff","performLogOff","TokenType","BarAppInfo","_BaasContextManager","saveBaasContextToStorage","baasPersistentStateObject","tokenType","toUpperCase","BarSecTicket","OidcLinkId","jsonObj","updateAppInfoToStorage","appInfo","checkBaasContextInStorage","getBaasContextFromStorage","vw","ToepVoorwie","vwrc","ToepVoorwieRolcode","hd","ToepHoedanigheid","hdrc","ToepHoedanigheidRolcode","userVoorwie","userHoedanigheid","userID","ToepUser","userTicketGuid","SecurityTicketGuid","userTicketInfo","userCbiUserID","CbiUserId","getBaasContextAsHeaderString","getAppInfoFromStorage","appInfoDataFromStorage","appinfo","removeContextFromSession","baas","resp","AuditId","auditID","UserZone","userZone","ForcePerformanceLog","AllowCookieAuth","ExpireTicks","Timestamp","date","setTime","getTime","getfirstPart","input","segments","BaasContextTransportModus","BaasOidcAuthService","settings","authority","client_id","clientId","redirect_uri","callbackUri","response_type","scope","clientScope","userStore","WebStorageStateStore","fetchRequestCredentials","automaticSilentRenew","metadataUrl","UserManager","events","addUserLoaded","user","userAddedCallback","getUser","login","identityType","signinRedirect","extraQueryParams","identitytype","targetUrl","logout","signoutSilent","renewToken","signinSilent","signinCallback","defaultLandingPage","BaasSecurityLevel","BarAppInfoSecure","_BarAppInfoManager","baasContextService","contextTransportModus","Header","koek","createGuidCookie","setTimestamp","emit","syncContext","secureContent","caller","innerContext","persistBasiscontext","getBasiscontext","reject","onSyncRequired","ToepZone","fullUsername","klantnummer","testProfielKey","impersonateStrStorage","impersonate","cookieValue","encodeURIComponent","securityLevel","Production","BarIdpError","super","status","BarIdpClientError","BarIdpClientOptions","BarAuthValues","BarIdentity","BarKlant","BarIdentityType","BarIdpWebworkerOrchestrator","idpUrl","wwUrl","processMessage","event","parsedData","INFO","WARNING","ERROR","processError","errorEvent","Worker","idpww","terminate","timeout","workerUrl","postMessage","SETTIMEOUT","INIT","onmessage","ev","onerror","getElementById","innerHTML","setTimeout","getTimeout","GETTIMEOUT","BarIdpClient","appInfoCookie","authUrl","logoutUrl","appInfoMgr","identity","zone","Fas","Windows","appendQuerystring","rolcode","formatToken","authenticateWithAlvnr","identityValue","Klantnummer","authenticateWithAnoniem","Anoniem","authenticateWithCBIuserId","CID","authenticateWithCryptoKey","Cryptokey","authenticateWithWindows","authenticateWithFas","authenticateWithTestProfiel","Testprofiel","validate","wwMgr","qsPrm","sqValue","separator","BaasConnectivity","BaasI18n","changeLanguage","lang","addTranslations","namespace","translations","language","fullBundle","lng","defaultNS","debug","resources","nl","INITIALIZED","interpolation","catch","BarRapSegment","BarRapUrlHelper","baasStaticSegment","rapSegment","baasWebSegment","idpOidcWebSegment","public","Public","Applicative","parseUrl","_BarXdc","localhost","connectivity","Online","_solution","forceRemote","Cookie","translate","rapUrlHelper","syncDefers","syncDisabled","arg","sync","sendMessage","action","handleMessage","resolveReady","localCookie","resolveSync","localTimestamp","serverTimestamp","ensureIFrame","iframeEl","defineGlobal","rootUrl","release","style","display","bindEvent","iframeReady","eventName","eventHandler","addEventListener","attachEvent","msg","contentWindow","xdcErrorMsg","xdc","set","_OopsType","ACTION_ICON_REFRESH","ACTION_CONTENT_REFRESH","ACTION_INFO_REFRESH","_OopsDomService","Technical","title","content","bind","actionIcon","actionContent","actionInfo","Authentication","NotFound","checkOopsSupported","showOops","oopsElement","image","imgElement","src","appRoot","parentElement","titleElement","innerText","contentElement","actionElement","actionIconElement","className","actionContentElement","actionInfoElement","reload","homeUrl","_BAAS_TYPES","BarGvkState","BarHubMessageHandler","BaasApm","BarHubClient","handlers","retryCount","neededHeaders","securityTicketId","connUrl","hubUrl","connection","withUrl","configureLogging","None","build","onclose","on","filter","h","handler","handle","detail","registration","BAAS_SHARED_I18N","STARTUP_ERROR","INIT_LOCAL_FAILED","PRE_INIT_LOCAL_FAILED","XDC_ERROR","XDC_SYNC_DISABLED","TARGET_ORIGIN_OVERRIDE_WARNING","AUTH_ERROR","BaasMeetpuntService","loggingEnabled","meetpunt","meetpuntenAutomatischAanmaken","meetpuntType","meetpunten","BarNotificationManager","Notification","requestPermission","show","notification","permission","reg","navigator","serviceWorker","getRegistration","showNotification","INACTIVE_MESSAGE","_BaasApm","bootstrapOptions","active","apm","telemetry","serverUrl","serviceName","serviceVersion","environment","omgeving","setUserContext","username","startTransaction","handleError","captureError","originalError","STORAGE_KEY_USER_INFO_PREFIX","BaasBootstrap","failedUrl","idpClient","commonApiClient","hubClient","notificationManager","oopsDomService","oidcAuthService","bootstrap","assign","core","targetOrigin","preInitLocal","TargetOrigin","loadConfig","loadToepassing","preInitSkipped","authSuccess","AuthFailed","Authenticating","initRequest","preInit","step","notLoaded","configStr","putInStorage","processIdpRootUrl","idpRootUrl","errorUrl","enabledStr","newValue","appRootUrl","appUrl","baseTag","apiRootUrl","cookieSessionId","proceed","disableCacheInvalidation","_noInitPaths","noInitPath","fullPath","app","baasVersionKey","baasVersion","requestTokenKey","requestToken","currentContext","updatedContext","meetpuntenAutomatischAanmakenKey","localData","initLocal","localRequestTokenKey","parentAuditId","Page","Initialized","Halted","currentTransaction","startSpan","startTime","scripts","script","Offline","staticRootUrl","appMenuItems","ami","urlLocalhost","perflog","pageLoadTime","domContentLoadedEventEnd","navigationStart","meetpuntDetail","waarde","meetpuntInfo","scriptTags","scriptTag","links","linkTags","linkTag","link","rel","Dependencies","SCRIPTS","LINKS","hub","baasWeb","userData","cacheKey","cachedItem","getUserInfo","hoedanigheidInfoSet","notifications","firstChild","spotfire","webPlayer","oauthEnd","_experimentalOidcEnabled","callbackRootUri","path","comment","htmlElement","documentElement","attributes","removeAttribute","commentElement","createComment","baasContext","container","BaasAuditDefaultApiClient","BAAS_VERSION_ENDPOINTS","BaasCommonDefaultApiClient","axiosBaas","axiosPlain","withCredentials","request","response","parseToepassing","saveEndpoints","endpoints","versionOk","returnVal","parseSecLevelFromString","Development","Test","Unknown","BaasConfigurationDefaultApiClient","encodeURI","BaasLoggingDefaultApiClient","BaasMeetpuntDefaultApiClient","warnedNotAvailable","warnNotAvailable","BaasMeldingDefaultApiClient","getMeldingen","urlPart","apiVersion","meldingen","hasBlockingMelding","melding","version","BaasSecurityDefaultApiClient","voorwieSegment","hoedanigheidSegment","cbiUserId","hoedList","contactInfo","alvNr","firstname","firstName","lastname","fullName","fullname","phone","phoneNumber","mobile","mobileNumber","email","mailAddress","BarAuditApiClient","barWeb","BarCommonApiClient","BarLoggingApiClient","BarMeetpuntApiClient","BarMeldingApiClient","BarProfielApiClient","BarSecurityApiClient","BaasExternalAuthStrategy","contextManager","contextProvider","provide","BaasIdpAuthStrategy","impersonateStrQuery","BaasIdpHeaderAuthStrategy","idpUsr","history","replaceState","_BaasProfielService","readNumber","parseFloat","readBoolean","BarGvkDefaultState","BarGvkCompatibilityMode","BarGvkStorageMode","BarGvkDefaultStore","DB_NAME_GVK_LEGACY","BarGvkLegacyStore","realKey","generateRealKey","BarGvkInternalManager","remoteStoreProvider","disabled","checkDisabled","loadRemoteSettings","uniqueKey","getUniqueKeyForSessionStorage","localSessionValue","getRemoteStore","setName","storageMode","noSettingsAction","sets","forceGetFromRemoteStorage","compatibilityMode","BrowserOnly","RemoteOnly","getBrowserStore","ctx","createEmptySettings","voorkeuren","apply","voorkeurenObject","voorkeurenString","_gvk_setName","_gvk_timeStamp","keysToRemove","Version_1","BarGvkManager","Default","strData","BarGvkRemoteStore","urlRoot","ex","hasVoorkeuren","optionalSetName","BarGvkDefaultRemoteStoreProvider","BarClearStateTarget","BarClearStateHubMessageHandler","clearCacheStorage","clearGvk","clearStorageByPrefix","Cookies","SessionStorage","LocalStorage","IndexedDb","Full","Gvk","CacheStorageGlobal","CacheStorageUser","CacheStorageApp","CacheStorageAppUser","CacheStorage","Configuration","clearUserObjectStores","Security","objectStoreNameSuffixes","objectStoresToDelete","suffix","storeNames","onupgradeneeded","deleteObjectStore","_deleteIndexedDbObjectStores","clearNonLegacy","keyPrefix","BarCustomHubMessageHandler","customEvent","CustomEvent","dispatchEvent","BarLogOffHubMessageHandler","BarPushNotificationHubMessageHandler","BaasMeldingService","BaasApmTransaction","transaction","span","BaasApmSpan","BaasNoopTelemetrySpan","INSTANCE","BaasNoopTelemetryTransaction","addLabels","labels","BaasApmTelemetry","baasApm","getCurrentTransaction","BaasToepassingService","setVoorwie","setBasiscontextData","resetVoorwie","setHoedanigheid","resetHoedanigheid","method","basiscontextKey","ANTI_XSSI_TOKEN","BaasInterceptor","handleAuthFailedStatus","interception","handleAuthFailed","handleForbiddenStatus","handleForbidden","silent","onRequest","stopwatch","domainRequest","checkDomainRequest","crossDomainRequest","checkCrossDomainRequest","telemetryStart","defineHeaders","onResponse","telemetryEnd","cleanData","onError","localRequestToken","routeId","Route","Session","addBaasHeaders","callStack","headerValue","bootstrapBaasIoc","Container","toConstantValue","toSelf","inSingletonScope","to","_registerTelemetryIoc","defineGvk","toDynamicValue","isBound","appInfoManager","idpClientOptions","defineAuth","Bar","defineBackendApi","defineI18n","baasInstance","whenTargetIsDefault","whenTargetNamed","interceptor","interceptors","use","baasSilentInstance","silentInterceptor","plainInstance","defineAxios","whenTargetTagged","defineCaching","defineHubStuff","bootstrapBaasApp","iocSetup","_originalContextTransportModus","setDefaults","outcome","success","appInstance","BarCacheStoreOptions","BarGvkSettings","Version_2","BaasActieFromContext","bar","shared"],"sourceRoot":""}