@acrobits/ipc-sdk 0.8.1-alpha.8 → 0.8.1-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"ipc-sdk.umd.cjs","sources":["../src/lib/events.ts","../../../node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.es6.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/isFunction.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/Subscription.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/config.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/noop.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/errorContext.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/Subscriber.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/symbol/observable.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/identity.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/pipe.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/Observable.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/lift.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/Subject.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/scheduler/dateTimestampProvider.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/scheduler/Action.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/scheduler/intervalProvider.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/scheduler/AsyncAction.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/Scheduler.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/scheduler/AsyncScheduler.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/scheduler/async.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/isScheduler.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/EmptyError.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/firstValueFrom.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/isDate.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/map.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/timer.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/tap.js","../../ipc-protocol/lib/ipc-protocol.js","../src/lib/sdk.ts"],"sourcesContent":["/**\n * A collection of Events that are used by the `IPC` SDK.\n *\n * @public\n */\nexport const enum IPCEvents {\n /**\n * Event that is fired when the `Host` app requests a badge count update.\n */\n BadgeQuery = 'BADGE QUERY',\n\n /**\n * Event that is fired when the `Host` app sends a LIFECYCLE event.\n */\n Lifecycle = 'LIFECYCLE',\n\n /**\n * Event that is fired when the `Host` app sends a new PUSH TOKEN.\n */\n PushToken = 'PUSH TOKEN'\n}\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\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;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.push(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.push(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\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;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\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; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\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);\r\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); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\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\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\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\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","export function isFunction(value) {\n return typeof value === 'function';\n}\n//# sourceMappingURL=isFunction.js.map","export function createErrorClass(createImpl) {\n var _super = function (instance) {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n var ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n//# sourceMappingURL=createErrorClass.js.map","import { createErrorClass } from './createErrorClass';\nexport var UnsubscriptionError = createErrorClass(function (_super) {\n return function UnsubscriptionErrorImpl(errors) {\n _super(this);\n this.message = errors\n ? errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ')\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n };\n});\n//# sourceMappingURL=UnsubscriptionError.js.map","export function arrRemove(arr, item) {\n if (arr) {\n var index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n//# sourceMappingURL=arrRemove.js.map","import { __read, __spreadArray, __values } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { arrRemove } from './util/arrRemove';\nvar Subscription = (function () {\n function Subscription(initialTeardown) {\n this.initialTeardown = initialTeardown;\n this.closed = false;\n this._parentage = null;\n this._finalizers = null;\n }\n Subscription.prototype.unsubscribe = function () {\n var e_1, _a, e_2, _b;\n var errors;\n if (!this.closed) {\n this.closed = true;\n var _parentage = this._parentage;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n try {\n for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {\n var parent_1 = _parentage_1_1.value;\n parent_1.remove(this);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n else {\n _parentage.remove(this);\n }\n }\n var initialFinalizer = this.initialTeardown;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n var _finalizers = this._finalizers;\n if (_finalizers) {\n this._finalizers = null;\n try {\n for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {\n var finalizer = _finalizers_1_1.value;\n try {\n execFinalizer(finalizer);\n }\n catch (err) {\n errors = errors !== null && errors !== void 0 ? errors : [];\n if (err instanceof UnsubscriptionError) {\n errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));\n }\n else {\n errors.push(err);\n }\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n };\n Subscription.prototype.add = function (teardown) {\n var _a;\n if (teardown && teardown !== this) {\n if (this.closed) {\n execFinalizer(teardown);\n }\n else {\n if (teardown instanceof Subscription) {\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);\n }\n }\n };\n Subscription.prototype._hasParent = function (parent) {\n var _parentage = this._parentage;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n };\n Subscription.prototype._addParent = function (parent) {\n var _parentage = this._parentage;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n };\n Subscription.prototype._removeParent = function (parent) {\n var _parentage = this._parentage;\n if (_parentage === parent) {\n this._parentage = null;\n }\n else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n };\n Subscription.prototype.remove = function (teardown) {\n var _finalizers = this._finalizers;\n _finalizers && arrRemove(_finalizers, teardown);\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n };\n Subscription.EMPTY = (function () {\n var empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n return Subscription;\n}());\nexport { Subscription };\nexport var EMPTY_SUBSCRIPTION = Subscription.EMPTY;\nexport function isSubscription(value) {\n return (value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));\n}\nfunction execFinalizer(finalizer) {\n if (isFunction(finalizer)) {\n finalizer();\n }\n else {\n finalizer.unsubscribe();\n }\n}\n//# sourceMappingURL=Subscription.js.map","export var config = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n//# sourceMappingURL=config.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var timeoutProvider = {\n setTimeout: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = timeoutProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {\n return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearTimeout: function (handle) {\n var delegate = timeoutProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=timeoutProvider.js.map","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\nexport function reportUnhandledError(err) {\n timeoutProvider.setTimeout(function () {\n var onUnhandledError = config.onUnhandledError;\n if (onUnhandledError) {\n onUnhandledError(err);\n }\n else {\n throw err;\n }\n });\n}\n//# sourceMappingURL=reportUnhandledError.js.map","export function noop() { }\n//# sourceMappingURL=noop.js.map","import { config } from '../config';\nvar context = null;\nexport function errorContext(cb) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n var isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n var _a = context, errorThrown = _a.errorThrown, error = _a.error;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n }\n else {\n cb();\n }\n}\nexport function captureError(err) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n//# sourceMappingURL=errorContext.js.map","import { __extends } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\nvar Subscriber = (function (_super) {\n __extends(Subscriber, _super);\n function Subscriber(destination) {\n var _this = _super.call(this) || this;\n _this.isStopped = false;\n if (destination) {\n _this.destination = destination;\n if (isSubscription(destination)) {\n destination.add(_this);\n }\n }\n else {\n _this.destination = EMPTY_OBSERVER;\n }\n return _this;\n }\n Subscriber.create = function (next, error, complete) {\n return new SafeSubscriber(next, error, complete);\n };\n Subscriber.prototype.next = function (value) {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n }\n else {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n }\n else {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n }\n else {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (!this.closed) {\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n this.destination = null;\n }\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n try {\n this.destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n };\n Subscriber.prototype._complete = function () {\n try {\n this.destination.complete();\n }\n finally {\n this.unsubscribe();\n }\n };\n return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar _bind = Function.prototype.bind;\nfunction bind(fn, thisArg) {\n return _bind.call(fn, thisArg);\n}\nvar ConsumerObserver = (function () {\n function ConsumerObserver(partialObserver) {\n this.partialObserver = partialObserver;\n }\n ConsumerObserver.prototype.next = function (value) {\n var partialObserver = this.partialObserver;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n ConsumerObserver.prototype.error = function (err) {\n var partialObserver = this.partialObserver;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n else {\n handleUnhandledError(err);\n }\n };\n ConsumerObserver.prototype.complete = function () {\n var partialObserver = this.partialObserver;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n return ConsumerObserver;\n}());\nvar SafeSubscriber = (function (_super) {\n __extends(SafeSubscriber, _super);\n function SafeSubscriber(observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n var partialObserver;\n if (isFunction(observerOrNext) || !observerOrNext) {\n partialObserver = {\n next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),\n error: error !== null && error !== void 0 ? error : undefined,\n complete: complete !== null && complete !== void 0 ? complete : undefined,\n };\n }\n else {\n var context_1;\n if (_this && config.useDeprecatedNextContext) {\n context_1 = Object.create(observerOrNext);\n context_1.unsubscribe = function () { return _this.unsubscribe(); };\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context_1),\n error: observerOrNext.error && bind(observerOrNext.error, context_1),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),\n };\n }\n else {\n partialObserver = observerOrNext;\n }\n }\n _this.destination = new ConsumerObserver(partialObserver);\n return _this;\n }\n return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\nfunction handleUnhandledError(error) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n }\n else {\n reportUnhandledError(error);\n }\n}\nfunction defaultErrorHandler(err) {\n throw err;\n}\nfunction handleStoppedNotification(notification, subscriber) {\n var onStoppedNotification = config.onStoppedNotification;\n onStoppedNotification && timeoutProvider.setTimeout(function () { return onStoppedNotification(notification, subscriber); });\n}\nexport var EMPTY_OBSERVER = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n//# sourceMappingURL=Subscriber.js.map","export var observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();\n//# sourceMappingURL=observable.js.map","export function identity(x) {\n return x;\n}\n//# sourceMappingURL=identity.js.map","import { identity } from './identity';\nexport function pipe() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i] = arguments[_i];\n }\n return pipeFromArray(fns);\n}\nexport function pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) { return fn(prev); }, input);\n };\n}\n//# sourceMappingURL=pipe.js.map","import { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription } from './Subscription';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\nvar Observable = (function () {\n function Observable(subscribe) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var _this = this;\n var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n errorContext(function () {\n var _a = _this, operator = _a.operator, source = _a.source;\n subscriber.add(operator\n ?\n operator.call(subscriber, source)\n : source\n ?\n _this._subscribe(subscriber)\n :\n _this._trySubscribe(subscriber));\n });\n return subscriber;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n sink.error(err);\n }\n };\n Observable.prototype.forEach = function (next, promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var subscriber = new SafeSubscriber({\n next: function (value) {\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n _this.subscribe(subscriber);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n var _a;\n return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);\n };\n Observable.prototype[Symbol_observable] = function () {\n return this;\n };\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i] = arguments[_i];\n }\n return pipeFromArray(operations)(this);\n };\n Observable.prototype.toPromise = function (promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });\n });\n };\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}());\nexport { Observable };\nfunction getPromiseCtor(promiseCtor) {\n var _a;\n return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;\n}\nfunction isObserver(value) {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\nfunction isSubscriber(value) {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n//# sourceMappingURL=Observable.js.map","import { isFunction } from './isFunction';\nexport function hasLift(source) {\n return isFunction(source === null || source === void 0 ? void 0 : source.lift);\n}\nexport function operate(init) {\n return function (source) {\n if (hasLift(source)) {\n return source.lift(function (liftedSource) {\n try {\n return init(liftedSource, this);\n }\n catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n//# sourceMappingURL=lift.js.map","import { __extends } from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\nvar OperatorSubscriber = (function (_super) {\n __extends(OperatorSubscriber, _super);\n function OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {\n var _this = _super.call(this, destination) || this;\n _this.onFinalize = onFinalize;\n _this.shouldUnsubscribe = shouldUnsubscribe;\n _this._next = onNext\n ? function (value) {\n try {\n onNext(value);\n }\n catch (err) {\n destination.error(err);\n }\n }\n : _super.prototype._next;\n _this._error = onError\n ? function (err) {\n try {\n onError(err);\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._error;\n _this._complete = onComplete\n ? function () {\n try {\n onComplete();\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._complete;\n return _this;\n }\n OperatorSubscriber.prototype.unsubscribe = function () {\n var _a;\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n var closed_1 = this.closed;\n _super.prototype.unsubscribe.call(this);\n !closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));\n }\n };\n return OperatorSubscriber;\n}(Subscriber));\nexport { OperatorSubscriber };\n//# sourceMappingURL=OperatorSubscriber.js.map","import { createErrorClass } from './createErrorClass';\nexport var ObjectUnsubscribedError = createErrorClass(function (_super) {\n return function ObjectUnsubscribedErrorImpl() {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n };\n});\n//# sourceMappingURL=ObjectUnsubscribedError.js.map","import { __extends, __values } from \"tslib\";\nimport { Observable } from './Observable';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\nvar Subject = (function (_super) {\n __extends(Subject, _super);\n function Subject() {\n var _this = _super.call(this) || this;\n _this.closed = false;\n _this.currentObservers = null;\n _this.observers = [];\n _this.isStopped = false;\n _this.hasError = false;\n _this.thrownError = null;\n return _this;\n }\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype._throwIfClosed = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n };\n Subject.prototype.next = function (value) {\n var _this = this;\n errorContext(function () {\n var e_1, _a;\n _this._throwIfClosed();\n if (!_this.isStopped) {\n if (!_this.currentObservers) {\n _this.currentObservers = Array.from(_this.observers);\n }\n try {\n for (var _b = __values(_this.currentObservers), _c = _b.next(); !_c.done; _c = _b.next()) {\n var observer = _c.value;\n observer.next(value);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n });\n };\n Subject.prototype.error = function (err) {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.hasError = _this.isStopped = true;\n _this.thrownError = err;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().error(err);\n }\n }\n });\n };\n Subject.prototype.complete = function () {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.isStopped = true;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().complete();\n }\n }\n });\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null;\n };\n Object.defineProperty(Subject.prototype, \"observed\", {\n get: function () {\n var _a;\n return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;\n },\n enumerable: false,\n configurable: true\n });\n Subject.prototype._trySubscribe = function (subscriber) {\n this._throwIfClosed();\n return _super.prototype._trySubscribe.call(this, subscriber);\n };\n Subject.prototype._subscribe = function (subscriber) {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n };\n Subject.prototype._innerSubscribe = function (subscriber) {\n var _this = this;\n var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(function () {\n _this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n };\n Subject.prototype._checkFinalizedStatuses = function (subscriber) {\n var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;\n if (hasError) {\n subscriber.error(thrownError);\n }\n else if (isStopped) {\n subscriber.complete();\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable));\nexport { Subject };\nvar AnonymousSubject = (function (_super) {\n __extends(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n var _this = _super.call(this) || this;\n _this.destination = destination;\n _this.source = source;\n return _this;\n }\n AnonymousSubject.prototype.next = function (value) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);\n };\n AnonymousSubject.prototype.error = function (err) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);\n };\n AnonymousSubject.prototype.complete = function () {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);\n };\n AnonymousSubject.prototype._subscribe = function (subscriber) {\n var _a, _b;\n return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;\n };\n return AnonymousSubject;\n}(Subject));\nexport { AnonymousSubject };\n//# sourceMappingURL=Subject.js.map","export var dateTimestampProvider = {\n now: function () {\n return (dateTimestampProvider.delegate || Date).now();\n },\n delegate: undefined,\n};\n//# sourceMappingURL=dateTimestampProvider.js.map","import { __extends } from \"tslib\";\nimport { Subscription } from '../Subscription';\nvar Action = (function (_super) {\n __extends(Action, _super);\n function Action(scheduler, work) {\n return _super.call(this) || this;\n }\n Action.prototype.schedule = function (state, delay) {\n if (delay === void 0) { delay = 0; }\n return this;\n };\n return Action;\n}(Subscription));\nexport { Action };\n//# sourceMappingURL=Action.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var intervalProvider = {\n setInterval: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = intervalProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) {\n return delegate.setInterval.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setInterval.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearInterval: function (handle) {\n var delegate = intervalProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=intervalProvider.js.map","import { __extends } from \"tslib\";\nimport { Action } from './Action';\nimport { intervalProvider } from './intervalProvider';\nimport { arrRemove } from '../util/arrRemove';\nvar AsyncAction = (function (_super) {\n __extends(AsyncAction, _super);\n function AsyncAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n _this.pending = false;\n return _this;\n }\n AsyncAction.prototype.schedule = function (state, delay) {\n var _a;\n if (delay === void 0) { delay = 0; }\n if (this.closed) {\n return this;\n }\n this.state = state;\n var id = this.id;\n var scheduler = this.scheduler;\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n this.pending = true;\n this.delay = delay;\n this.id = (_a = this.id) !== null && _a !== void 0 ? _a : this.requestAsyncId(scheduler, this.id, delay);\n return this;\n };\n AsyncAction.prototype.requestAsyncId = function (scheduler, _id, delay) {\n if (delay === void 0) { delay = 0; }\n return intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);\n };\n AsyncAction.prototype.recycleAsyncId = function (_scheduler, id, delay) {\n if (delay === void 0) { delay = 0; }\n if (delay != null && this.delay === delay && this.pending === false) {\n return id;\n }\n if (id != null) {\n intervalProvider.clearInterval(id);\n }\n return undefined;\n };\n AsyncAction.prototype.execute = function (state, delay) {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n this.pending = false;\n var error = this._execute(state, delay);\n if (error) {\n return error;\n }\n else if (this.pending === false && this.id != null) {\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n };\n AsyncAction.prototype._execute = function (state, _delay) {\n var errored = false;\n var errorValue;\n try {\n this.work(state);\n }\n catch (e) {\n errored = true;\n errorValue = e ? e : new Error('Scheduled action threw falsy error');\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n };\n AsyncAction.prototype.unsubscribe = function () {\n if (!this.closed) {\n var _a = this, id = _a.id, scheduler = _a.scheduler;\n var actions = scheduler.actions;\n this.work = this.state = this.scheduler = null;\n this.pending = false;\n arrRemove(actions, this);\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n this.delay = null;\n _super.prototype.unsubscribe.call(this);\n }\n };\n return AsyncAction;\n}(Action));\nexport { AsyncAction };\n//# sourceMappingURL=AsyncAction.js.map","import { dateTimestampProvider } from './scheduler/dateTimestampProvider';\nvar Scheduler = (function () {\n function Scheduler(schedulerActionCtor, now) {\n if (now === void 0) { now = Scheduler.now; }\n this.schedulerActionCtor = schedulerActionCtor;\n this.now = now;\n }\n Scheduler.prototype.schedule = function (work, delay, state) {\n if (delay === void 0) { delay = 0; }\n return new this.schedulerActionCtor(this, work).schedule(state, delay);\n };\n Scheduler.now = dateTimestampProvider.now;\n return Scheduler;\n}());\nexport { Scheduler };\n//# sourceMappingURL=Scheduler.js.map","import { __extends } from \"tslib\";\nimport { Scheduler } from '../Scheduler';\nvar AsyncScheduler = (function (_super) {\n __extends(AsyncScheduler, _super);\n function AsyncScheduler(SchedulerAction, now) {\n if (now === void 0) { now = Scheduler.now; }\n var _this = _super.call(this, SchedulerAction, now) || this;\n _this.actions = [];\n _this._active = false;\n return _this;\n }\n AsyncScheduler.prototype.flush = function (action) {\n var actions = this.actions;\n if (this._active) {\n actions.push(action);\n return;\n }\n var error;\n this._active = true;\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions.shift()));\n this._active = false;\n if (error) {\n while ((action = actions.shift())) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n return AsyncScheduler;\n}(Scheduler));\nexport { AsyncScheduler };\n//# sourceMappingURL=AsyncScheduler.js.map","import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\nexport var asyncScheduler = new AsyncScheduler(AsyncAction);\nexport var async = asyncScheduler;\n//# sourceMappingURL=async.js.map","import { isFunction } from './isFunction';\nexport function isScheduler(value) {\n return value && isFunction(value.schedule);\n}\n//# sourceMappingURL=isScheduler.js.map","import { createErrorClass } from './createErrorClass';\nexport var EmptyError = createErrorClass(function (_super) { return function EmptyErrorImpl() {\n _super(this);\n this.name = 'EmptyError';\n this.message = 'no elements in sequence';\n}; });\n//# sourceMappingURL=EmptyError.js.map","import { EmptyError } from './util/EmptyError';\nimport { SafeSubscriber } from './Subscriber';\nexport function firstValueFrom(source, config) {\n var hasConfig = typeof config === 'object';\n return new Promise(function (resolve, reject) {\n var subscriber = new SafeSubscriber({\n next: function (value) {\n resolve(value);\n subscriber.unsubscribe();\n },\n error: reject,\n complete: function () {\n if (hasConfig) {\n resolve(config.defaultValue);\n }\n else {\n reject(new EmptyError());\n }\n },\n });\n source.subscribe(subscriber);\n });\n}\n//# sourceMappingURL=firstValueFrom.js.map","export function isValidDate(value) {\n return value instanceof Date && !isNaN(value);\n}\n//# sourceMappingURL=isDate.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function map(project, thisArg) {\n return operate(function (source, subscriber) {\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n subscriber.next(project.call(thisArg, value, index++));\n }));\n });\n}\n//# sourceMappingURL=map.js.map","import { Observable } from '../Observable';\nimport { async as asyncScheduler } from '../scheduler/async';\nimport { isScheduler } from '../util/isScheduler';\nimport { isValidDate } from '../util/isDate';\nexport function timer(dueTime, intervalOrScheduler, scheduler) {\n if (dueTime === void 0) { dueTime = 0; }\n if (scheduler === void 0) { scheduler = asyncScheduler; }\n var intervalDuration = -1;\n if (intervalOrScheduler != null) {\n if (isScheduler(intervalOrScheduler)) {\n scheduler = intervalOrScheduler;\n }\n else {\n intervalDuration = intervalOrScheduler;\n }\n }\n return new Observable(function (subscriber) {\n var due = isValidDate(dueTime) ? +dueTime - scheduler.now() : dueTime;\n if (due < 0) {\n due = 0;\n }\n var n = 0;\n return scheduler.schedule(function () {\n if (!subscriber.closed) {\n subscriber.next(n++);\n if (0 <= intervalDuration) {\n this.schedule(undefined, intervalDuration);\n }\n else {\n subscriber.complete();\n }\n }\n }, due);\n });\n}\n//# sourceMappingURL=timer.js.map","import { isFunction } from '../util/isFunction';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { identity } from '../util/identity';\nexport function tap(observerOrNext, error, complete) {\n var tapObserver = isFunction(observerOrNext) || error || complete\n ?\n { next: observerOrNext, error: error, complete: complete }\n : observerOrNext;\n return tapObserver\n ? operate(function (source, subscriber) {\n var _a;\n (_a = tapObserver.subscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n var isUnsub = true;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n var _a;\n (_a = tapObserver.next) === null || _a === void 0 ? void 0 : _a.call(tapObserver, value);\n subscriber.next(value);\n }, function () {\n var _a;\n isUnsub = false;\n (_a = tapObserver.complete) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n subscriber.complete();\n }, function (err) {\n var _a;\n isUnsub = false;\n (_a = tapObserver.error) === null || _a === void 0 ? void 0 : _a.call(tapObserver, err);\n subscriber.error(err);\n }, function () {\n var _a, _b;\n if (isUnsub) {\n (_a = tapObserver.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n }\n (_b = tapObserver.finalize) === null || _b === void 0 ? void 0 : _b.call(tapObserver);\n }));\n })\n :\n identity;\n}\n//# sourceMappingURL=tap.js.map","var J = Object.defineProperty;\nvar K = (i, t, e) => t in i ? J(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;\nvar m = (i, t, e) => (K(i, typeof t != \"symbol\" ? t + \"\" : t, e), e);\nimport { Subject as X, timer as Z } from \"rxjs\";\nclass h extends Error {\n constructor(e) {\n super(`Incorrect context (${e}). Cannot perform the requested operation.`);\n m(this, \"context\");\n this.context = e;\n }\n}\nclass w extends Error {\n constructor(t, e, r) {\n super(`Invalid parameter (${t}). ${r}`), this.param = t, this.value = e, this.reason = r;\n }\n}\nclass ee extends Error {\n constructor(t, e) {\n super(\n `'streamId' value of \"${t}\" is different from what we expected (\"${e}\")`\n ), this.streamId = t, this.expectedStreamId = e;\n }\n}\nclass te extends Error {\n constructor(t) {\n super(`Invalid version format: ${t}`);\n }\n}\nclass F extends Error {\n constructor(t) {\n super(`${t} needs to be initialized before it can be used.`);\n }\n}\nclass H extends Error {\n constructor(t, e) {\n let r = `Unsupported Protocol ${Array.isArray(t) ? \"versions\" : \"version\"}: (${t}).`;\n e && (r += ` Minimum version supported is ${e}.`), super(r), this.version = t;\n }\n}\nfunction b(i) {\n return typeof i == \"function\";\n}\nfunction re(i) {\n return b(i == null ? void 0 : i.lift);\n}\nfunction S(i) {\n return function(t) {\n if (re(t))\n return t.lift(function(e) {\n try {\n return i(e, this);\n } catch (r) {\n this.error(r);\n }\n });\n throw new TypeError(\"Unable to lift unknown Observable type\");\n };\n}\nvar x = function(i, t) {\n return x = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {\n e.__proto__ = r;\n } || function(e, r) {\n for (var s in r)\n Object.prototype.hasOwnProperty.call(r, s) && (e[s] = r[s]);\n }, x(i, t);\n};\nfunction A(i, t) {\n if (typeof t != \"function\" && t !== null)\n throw new TypeError(\"Class extends value \" + String(t) + \" is not a constructor or null\");\n x(i, t);\n function e() {\n this.constructor = i;\n }\n i.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());\n}\nfunction N(i) {\n var t = typeof Symbol == \"function\" && Symbol.iterator, e = t && i[t], r = 0;\n if (e)\n return e.call(i);\n if (i && typeof i.length == \"number\")\n return {\n next: function() {\n return i && r >= i.length && (i = void 0), { value: i && i[r++], done: !i };\n }\n };\n throw new TypeError(t ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\nfunction P(i, t) {\n var e = typeof Symbol == \"function\" && i[Symbol.iterator];\n if (!e)\n return i;\n var r = e.call(i), s, n = [], o;\n try {\n for (; (t === void 0 || t-- > 0) && !(s = r.next()).done; )\n n.push(s.value);\n } catch (a) {\n o = { error: a };\n } finally {\n try {\n s && !s.done && (e = r.return) && e.call(r);\n } finally {\n if (o)\n throw o.error;\n }\n }\n return n;\n}\nfunction L(i, t, e) {\n if (e || arguments.length === 2)\n for (var r = 0, s = t.length, n; r < s; r++)\n (n || !(r in t)) && (n || (n = Array.prototype.slice.call(t, 0, r)), n[r] = t[r]);\n return i.concat(n || Array.prototype.slice.call(t));\n}\nfunction se(i) {\n var t = function(r) {\n Error.call(r), r.stack = new Error().stack;\n }, e = i(t);\n return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;\n}\nvar T = se(function(i) {\n return function(e) {\n i(this), this.message = e ? e.length + ` errors occurred during unsubscription:\n` + e.map(function(r, s) {\n return s + 1 + \") \" + r.toString();\n }).join(`\n `) : \"\", this.name = \"UnsubscriptionError\", this.errors = e;\n };\n});\nfunction _(i, t) {\n if (i) {\n var e = i.indexOf(t);\n 0 <= e && i.splice(e, 1);\n }\n}\nvar U = function() {\n function i(t) {\n this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;\n }\n return i.prototype.unsubscribe = function() {\n var t, e, r, s, n;\n if (!this.closed) {\n this.closed = !0;\n var o = this._parentage;\n if (o)\n if (this._parentage = null, Array.isArray(o))\n try {\n for (var a = N(o), c = a.next(); !c.done; c = a.next()) {\n var l = c.value;\n l.remove(this);\n }\n } catch (E) {\n t = { error: E };\n } finally {\n try {\n c && !c.done && (e = a.return) && e.call(a);\n } finally {\n if (t)\n throw t.error;\n }\n }\n else\n o.remove(this);\n var u = this.initialTeardown;\n if (b(u))\n try {\n u();\n } catch (E) {\n n = E instanceof T ? E.errors : [E];\n }\n var p = this._finalizers;\n if (p) {\n this._finalizers = null;\n try {\n for (var v = N(p), M = v.next(); !M.done; M = v.next()) {\n var z = M.value;\n try {\n V(z);\n } catch (E) {\n n = n ?? [], E instanceof T ? n = L(L([], P(n)), P(E.errors)) : n.push(E);\n }\n }\n } catch (E) {\n r = { error: E };\n } finally {\n try {\n M && !M.done && (s = v.return) && s.call(v);\n } finally {\n if (r)\n throw r.error;\n }\n }\n }\n if (n)\n throw new T(n);\n }\n }, i.prototype.add = function(t) {\n var e;\n if (t && t !== this)\n if (this.closed)\n V(t);\n else {\n if (t instanceof i) {\n if (t.closed || t._hasParent(this))\n return;\n t._addParent(this);\n }\n (this._finalizers = (e = this._finalizers) !== null && e !== void 0 ? e : []).push(t);\n }\n }, i.prototype._hasParent = function(t) {\n var e = this._parentage;\n return e === t || Array.isArray(e) && e.includes(t);\n }, i.prototype._addParent = function(t) {\n var e = this._parentage;\n this._parentage = Array.isArray(e) ? (e.push(t), e) : e ? [e, t] : t;\n }, i.prototype._removeParent = function(t) {\n var e = this._parentage;\n e === t ? this._parentage = null : Array.isArray(e) && _(e, t);\n }, i.prototype.remove = function(t) {\n var e = this._finalizers;\n e && _(e, t), t instanceof i && t._removeParent(this);\n }, i.EMPTY = function() {\n var t = new i();\n return t.closed = !0, t;\n }(), i;\n}();\nU.EMPTY;\nfunction q(i) {\n return i instanceof U || i && \"closed\" in i && b(i.remove) && b(i.add) && b(i.unsubscribe);\n}\nfunction V(i) {\n b(i) ? i() : i.unsubscribe();\n}\nvar Y = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: void 0,\n useDeprecatedSynchronousErrorHandling: !1,\n useDeprecatedNextContext: !1\n}, W = {\n setTimeout: function(i, t) {\n for (var e = [], r = 2; r < arguments.length; r++)\n e[r - 2] = arguments[r];\n return setTimeout.apply(void 0, L([i, t], P(e)));\n },\n clearTimeout: function(i) {\n var t = W.delegate;\n return ((t == null ? void 0 : t.clearTimeout) || clearTimeout)(i);\n },\n delegate: void 0\n};\nfunction ie(i) {\n W.setTimeout(function() {\n throw i;\n });\n}\nfunction k() {\n}\nfunction ne(i) {\n i();\n}\nvar $ = function(i) {\n A(t, i);\n function t(e) {\n var r = i.call(this) || this;\n return r.isStopped = !1, e ? (r.destination = e, q(e) && e.add(r)) : r.destination = le, r;\n }\n return t.create = function(e, r, s) {\n return new O(e, r, s);\n }, t.prototype.next = function(e) {\n this.isStopped || this._next(e);\n }, t.prototype.error = function(e) {\n this.isStopped || (this.isStopped = !0, this._error(e));\n }, t.prototype.complete = function() {\n this.isStopped || (this.isStopped = !0, this._complete());\n }, t.prototype.unsubscribe = function() {\n this.closed || (this.isStopped = !0, i.prototype.unsubscribe.call(this), this.destination = null);\n }, t.prototype._next = function(e) {\n this.destination.next(e);\n }, t.prototype._error = function(e) {\n try {\n this.destination.error(e);\n } finally {\n this.unsubscribe();\n }\n }, t.prototype._complete = function() {\n try {\n this.destination.complete();\n } finally {\n this.unsubscribe();\n }\n }, t;\n}(U), oe = Function.prototype.bind;\nfunction I(i, t) {\n return oe.call(i, t);\n}\nvar ae = function() {\n function i(t) {\n this.partialObserver = t;\n }\n return i.prototype.next = function(t) {\n var e = this.partialObserver;\n if (e.next)\n try {\n e.next(t);\n } catch (r) {\n R(r);\n }\n }, i.prototype.error = function(t) {\n var e = this.partialObserver;\n if (e.error)\n try {\n e.error(t);\n } catch (r) {\n R(r);\n }\n else\n R(t);\n }, i.prototype.complete = function() {\n var t = this.partialObserver;\n if (t.complete)\n try {\n t.complete();\n } catch (e) {\n R(e);\n }\n }, i;\n}(), O = function(i) {\n A(t, i);\n function t(e, r, s) {\n var n = i.call(this) || this, o;\n if (b(e) || !e)\n o = {\n next: e ?? void 0,\n error: r ?? void 0,\n complete: s ?? void 0\n };\n else {\n var a;\n n && Y.useDeprecatedNextContext ? (a = Object.create(e), a.unsubscribe = function() {\n return n.unsubscribe();\n }, o = {\n next: e.next && I(e.next, a),\n error: e.error && I(e.error, a),\n complete: e.complete && I(e.complete, a)\n }) : o = e;\n }\n return n.destination = new ae(o), n;\n }\n return t;\n}($);\nfunction R(i) {\n ie(i);\n}\nfunction ce(i) {\n throw i;\n}\nvar le = {\n closed: !0,\n next: k,\n error: ce,\n complete: k\n}, he = function() {\n return typeof Symbol == \"function\" && Symbol.observable || \"@@observable\";\n}();\nfunction B(i) {\n return i;\n}\nfunction ue(i) {\n return i.length === 0 ? B : i.length === 1 ? i[0] : function(e) {\n return i.reduce(function(r, s) {\n return s(r);\n }, e);\n };\n}\nvar de = function() {\n function i(t) {\n t && (this._subscribe = t);\n }\n return i.prototype.lift = function(t) {\n var e = new i();\n return e.source = this, e.operator = t, e;\n }, i.prototype.subscribe = function(t, e, r) {\n var s = this, n = fe(t) ? t : new O(t, e, r);\n return ne(function() {\n var o = s, a = o.operator, c = o.source;\n n.add(a ? a.call(n, c) : c ? s._subscribe(n) : s._trySubscribe(n));\n }), n;\n }, i.prototype._trySubscribe = function(t) {\n try {\n return this._subscribe(t);\n } catch (e) {\n t.error(e);\n }\n }, i.prototype.forEach = function(t, e) {\n var r = this;\n return e = G(e), new e(function(s, n) {\n var o = new O({\n next: function(a) {\n try {\n t(a);\n } catch (c) {\n n(c), o.unsubscribe();\n }\n },\n error: n,\n complete: s\n });\n r.subscribe(o);\n });\n }, i.prototype._subscribe = function(t) {\n var e;\n return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(t);\n }, i.prototype[he] = function() {\n return this;\n }, i.prototype.pipe = function() {\n for (var t = [], e = 0; e < arguments.length; e++)\n t[e] = arguments[e];\n return ue(t)(this);\n }, i.prototype.toPromise = function(t) {\n var e = this;\n return t = G(t), new t(function(r, s) {\n var n;\n e.subscribe(function(o) {\n return n = o;\n }, function(o) {\n return s(o);\n }, function() {\n return r(n);\n });\n });\n }, i.create = function(t) {\n return new i(t);\n }, i;\n}();\nfunction G(i) {\n var t;\n return (t = i ?? Y.Promise) !== null && t !== void 0 ? t : Promise;\n}\nfunction pe(i) {\n return i && b(i.next) && b(i.error) && b(i.complete);\n}\nfunction fe(i) {\n return i && i instanceof $ || pe(i) && q(i);\n}\nfunction C(i, t, e, r, s) {\n return new ge(i, t, e, r, s);\n}\nvar ge = function(i) {\n A(t, i);\n function t(e, r, s, n, o, a) {\n var c = i.call(this, e) || this;\n return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = r ? function(l) {\n try {\n r(l);\n } catch (u) {\n e.error(u);\n }\n } : i.prototype._next, c._error = n ? function(l) {\n try {\n n(l);\n } catch (u) {\n e.error(u);\n } finally {\n this.unsubscribe();\n }\n } : i.prototype._error, c._complete = s ? function() {\n try {\n s();\n } catch (l) {\n e.error(l);\n } finally {\n this.unsubscribe();\n }\n } : i.prototype._complete, c;\n }\n return t.prototype.unsubscribe = function() {\n var e;\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n var r = this.closed;\n i.prototype.unsubscribe.call(this), !r && ((e = this.onFinalize) === null || e === void 0 || e.call(this));\n }\n }, t;\n}($);\nfunction d(i, t) {\n return S(function(e, r) {\n var s = 0;\n e.subscribe(C(r, function(n) {\n r.next(i.call(t, n, s++));\n }));\n });\n}\nvar ye = new de(function(i) {\n return i.complete();\n});\nfunction y(i) {\n return i <= 0 ? function() {\n return ye;\n } : S(function(t, e) {\n var r = 0;\n t.subscribe(C(e, function(s) {\n ++r <= i && (e.next(s), i <= r && e.complete());\n }));\n });\n}\nfunction g(i, t) {\n return S(function(e, r) {\n var s = 0;\n e.subscribe(C(r, function(n) {\n return i.call(t, n, s++) && r.next(n);\n }));\n });\n}\nfunction ve(i, t) {\n return t === void 0 && (t = !1), S(function(e, r) {\n var s = 0;\n e.subscribe(C(r, function(n) {\n var o = i(n, s++);\n (o || t) && r.next(n), !o && r.complete();\n }));\n });\n}\nfunction f(i, t, e) {\n var r = b(i) || t || e ? { next: i, error: t, complete: e } : i;\n return r ? S(function(s, n) {\n var o;\n (o = r.subscribe) === null || o === void 0 || o.call(r);\n var a = !0;\n s.subscribe(C(n, function(c) {\n var l;\n (l = r.next) === null || l === void 0 || l.call(r, c), n.next(c);\n }, function() {\n var c;\n a = !1, (c = r.complete) === null || c === void 0 || c.call(r), n.complete();\n }, function(c) {\n var l;\n a = !1, (l = r.error) === null || l === void 0 || l.call(r, c), n.error(c);\n }, function() {\n var c, l;\n a && ((c = r.unsubscribe) === null || c === void 0 || c.call(r)), (l = r.finalize) === null || l === void 0 || l.call(r);\n }));\n }) : B;\n}\nconst Me = /^(\\d+)\\.(\\d+)$/;\nfunction Ee(i) {\n if (typeof i == \"string\") {\n const t = i.match(Me);\n if (t)\n return `${t[1]}.${t[2]}`;\n }\n throw new te(i);\n}\nfunction j(i) {\n const t = Ee(i), [e, r] = t.split(\".\"), [s, n] = [parseInt(e), parseInt(r)];\n return [s, n];\n}\nfunction D(i, t) {\n const [e, r] = j(i), [s, n] = j(t);\n return e < s ? -1 : e > s ? 1 : r < n ? -1 : r > n ? 1 : 0;\n}\nfunction be(i, t) {\n return D(i, t) === 1;\n}\nfunction me(i, t) {\n return D(i, t) >= 0;\n}\nconst Q = \"2.0\";\nclass Re {\n /**\n * Create a new instance of the {@link IpcHelper | IPC Protocol Helper}.\n *\n * @remarks\n * Ideally, you should always have only one instance of the helper created at any point.\n *\n * @param supportedVersions - An array of supported protocol versions to choose from\n * @param logService - An instance of a logging service or utility\n */\n constructor(t, e) {\n /**\n * Protocol version negotiated with the Host app. Will always be from one of the values passed via\n * the constructor.\n */\n m(this, \"negotiatedProtocolVersion\");\n /**\n * The current {@link AppContext} determined after running {@link IpcHelper.determineContext}. The\n * value will be `undefined` until the method is called.\n */\n m(this, \"currentContext\");\n m(this, \"incomingMessages$\");\n m(this, \"inIframe\", !1);\n m(this, \"embeddedResult\");\n m(this, \"iframePort1\");\n m(this, \"iframePort2\");\n if (this.supportedVersions = t, this.logService = e, this.incomingMessages$ = new X(), this.supportedVersions = t.filter((r) => me(r, Q)), !this.supportedVersions.length)\n throw new H(t, Q);\n this.negotiatedProtocolVersion = this.supportedVersions[0], this.embeddedResult = null, this.iframePort2 = null;\n }\n get parent() {\n return window.parent;\n }\n get self() {\n return window.self;\n }\n get frameElement() {\n return window.frameElement;\n }\n // only used by remote party, not used locally\n // @ts-expect-error\n get port1() {\n var t, e;\n return this.inIframe ? this.iframePort1 : (e = (t = window.Acrobits) == null ? void 0 : t.messageChannel) == null ? void 0 : e.port1;\n }\n get port2() {\n var t, e, r, s;\n if (this.inIframe) {\n if (!this.iframePort2)\n throw new F(\"port2\");\n return this.iframePort2;\n } else {\n if (!((e = (t = window.Acrobits) == null ? void 0 : t.messageChannel) != null && e.port2))\n throw new F(\"port2\");\n return (s = (r = window.Acrobits) == null ? void 0 : r.messageChannel) == null ? void 0 : s.port2;\n }\n }\n /**\n * Determines if the app is embedded in a Host app like WebRTC or native CSP clients.\n *\n * @returns Observable with the {@link AppContext} the app is running under. Emits once.\n */\n determineContext() {\n return Z(1e3).pipe(\n d(() => (this.isEmbedded() ? this.currentContext = \"user\" : this.currentContext = \"guest\", this.currentContext)),\n y(1)\n );\n }\n /**\n * Opens the IPC Bridge by sending the {@link HelloMessage} to the host application to initiate\n * handshake and returns an Observable that emits once with the {@link HelloMessageReply}.\n *\n * @returns Observable with a {@link HelloMessageReply} instance. Emits once.\n */\n openBridge() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"HELLO\", e = this.createMessage(t);\n e.protocolVersions = this.supportedVersions, this.logCreated(t, e);\n const r = this.incomingMessages$.pipe(\n g((s) => s.type === t && s.replyTo === e.id),\n d((s) => s),\n f(this.logReceived(t)),\n d((s) => {\n if (this.supportedVersions.some((n) => be(n, s.protocolVersion)))\n throw new H(s.protocolVersion, this.supportedVersions[0]);\n return s;\n }),\n f((s) => {\n this.negotiatedProtocolVersion = s.protocolVersion, this.logService.info(\n `[IPC] Negotiated IPC Protocol Version: ${this.negotiatedProtocolVersion}`\n );\n }),\n y(1)\n );\n return this.logService.debug(`Created ${t} Reply handler`), this.inIframe ? this.createIframeChannel().then(() => this.finishIpcSetup(e)) : this.finishIpcSetup(e), r;\n }\n /**\n * Request an SSO Token from the Host app to authenticate the current user and make further API\n * requests on their behalf.\n *\n * @returns Observable with a {@link TokenMessageReply} instance containing the SSO Token. Emits\n * once.\n */\n requestSSOToken() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"TOKEN\", e = this.createMessage(t);\n this.logCreated(t, e);\n const r = this.incomingMessages$.pipe(\n g((s) => s.type === t && s.replyTo === e.id),\n d((s) => s),\n f(this.logReceived(t)),\n y(1)\n );\n return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;\n }\n /**\n * Sends the {@link JoiningRoomMessage} lifecycle message to the Host application based on the\n * parameters provided.\n *\n * @remarks\n * This message should always be sent whenever joining a conference. The host app can use\n * information provided by the {@link JoiningRoomMessageParams} fields to properly setup it's own\n * state and context if needed.\n *\n * @param params - Parameters object for the {@link JoiningRoomMessage} message.\n *\n * @returns This method returns void.\n */\n sendJoiningRoomMessage(t) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const {\n roomName: e,\n roomInvite: r,\n displayName: s,\n jwtToken: n,\n serverUrl: o,\n region: a,\n joinMicMuted: c,\n joinWithoutCamera: l\n } = t, u = \"JOINING ROOM\", p = this.createMessage(u, !1);\n p.roomName = e, p.jwtToken = n, p.serverUrl = o, p.region = a, p.roomInvite = r, p.joinMicMuted = c ?? !1, p.joinWithoutCamera = l ?? !1, p.displayName = s, this.logCreated(u, p), this.port2.postMessage(p), this.logSent(u, p);\n }\n /**\n * Sends a {@link LeavingRoomMessage} lifecycle message to the Host app.\n *\n * @remarks\n * This message should always be sent whenever leaving a conference so the host app can manage\n * it's state and context properly.\n *\n * @param roomName - The name of the room or Meeting ID we are leaving\n *\n * @returns This method returns void.\n */\n sendLeavingRoomMessage(t) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const e = \"LEAVING ROOM\", r = this.createMessage(e, !1);\n r.roomName = t, this.logCreated(e, r), this.port2.postMessage(r), this.logSent(e, r);\n }\n /**\n * Setup listener for {@link JoinRoomMessage}, which can be sent by a host app to ask the client\n * to join the specified room or meeting.\n *\n * @remarks\n * The client app still needs to follow the standard workflow for joining a conference, including\n * requesting an SSO Token and then sending the {@link JoiningRoomMessage} when joining the\n * conference.\n *\n * @example\n * Here is an example of how a listener can be setup:\n *\n * ```ts\n * const ipcHelper = new IpcHelper(['2.0'], console);\n *\n * const joinRoomSubscription = ipcHelper.onJoinRoomMessage().subscribe((msg) => {\n * // your logic for handling the message goes here\n * });\n *\n * // don't forget to unsubscribe when you're cleaning up\n * joinRoomSubscription.unsubscribe();\n * ```\n *\n * @returns An Observable that emits whenever {@link JoinRoomMessage} is received so it can be\n * subscribed to indefinitely.\n */\n onJoinRoomMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"JOIN ROOM\";\n return this.incomingMessages$.pipe(\n g((e) => e.type === t && e.target === \"client\"),\n d((e) => e),\n f(this.logReceived(t)),\n d((e) => e)\n );\n }\n /**\n * Setup listener for {@link LeaveRoomMessage}, which can be sent by a host app to ask the client\n * to leave the current room or meeting.\n *\n * @remarks\n * The client app still needs to follow the standard workflow for leaving a conference, including\n * sending the {@link LeavingRoomMessage} when leaving the conference.\n *\n * @example\n * Here is an example of how a listener can be setup:\n *\n * ```ts\n * const ipcHelper = new IpcHelper(['2.0'], console);\n *\n * const leaveRoomSubscription = ipcHelper.onLeaveRoomMessage().subscribe((msg) => {\n * // your logic for handling the message goes here\n * });\n *\n * // don't forget to unsubscribe when you're cleaning up\n * leaveRoomSubscription.unsubscribe();\n * ```\n *\n * @returns An Observable that emits whenever {@link LeavingRoomMessage} is received so it can be\n * subscribed to indefinitely.\n */\n onLeaveRoomMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"LEAVE ROOM\";\n return this.incomingMessages$.pipe(\n g((e) => e.type === t && e.target === \"client\"),\n d((e) => e),\n f(this.logReceived(t)),\n d((e) => e)\n );\n }\n /**\n * Setup listener for {@link ConfigMessage}, which is be sent by a host app whenever there is\n * an update to the user preferences or configuration (e.g. new default video camera).\n *\n * @remarks\n * Ideally, the client app should honor the user preferences received via {@link ConfigMessage},\n * however if the client app has it's own preferences for similar options as well, then they\n * should take priority.\n *\n * @example\n * Here is an example of how a listener can be setup:\n *\n * ```ts\n * const ipcHelper = new IpcHelper(['2.0'], console);\n *\n * const configSubscription = ipcHelper.onConfigMessage().subscribe((msg) => {\n * // your logic for handling the configuration goes here\n * });\n *\n * // don't forget to unsubscribe when you're cleaning up\n * configSubscription.unsubscribe();\n * ```\n *\n * @returns An Observable that emits whenever {@link ConfigMessage} is received so it can be\n * subscribed to indefinitely.\n */\n onConfigMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"CONFIG\";\n return this.incomingMessages$.pipe(\n g((e) => e.type === t && e.target === \"client\"),\n d((e) => e),\n f(this.logReceived(t)),\n d((e) => ({\n preferredCameraType: e.preferredCameraType,\n preferredMicType: e.preferredMicType,\n preferredOutputType: e.preferredOutputType,\n preferredCameraDeviceLabel: e.preferredCameraDeviceLabel,\n preferredMicDeviceLabel: e.preferredMicDeviceLabel,\n preferredOutputDeviceLabel: e.preferredOutputDeviceLabel,\n performanceProfile: e.performanceProfile,\n cloudUsername: e.cloudUsername,\n configuredOAuthProviders: e.configuredOAuthProviders,\n locales: e.locales ? [...e.locales] : []\n }))\n );\n }\n sendScreenshareSourceMessage(t) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const e = \"SCREENSHARE SOURCE\", r = this.createMessage(e);\n r.sourceTypes = t, this.logCreated(e, r);\n const s = this.incomingMessages$.pipe(\n g((n) => n.type === e && n.replyTo === r.id),\n d((n) => n),\n f(this.logReceived(e)),\n d((n) => n),\n y(1)\n );\n return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), s;\n }\n layoutChange(t, e, r) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const s = \"LAYOUT CHANGE\";\n let n, o;\n if (e && r ? (n = this.createMessage(s, !1, r), n.result = e) : (n = this.createMessage(s), o = this.incomingMessages$.pipe(\n g((a) => a.type === s && a.replyTo === n.id),\n d((a) => a),\n f(this.logReceived(s)),\n d((a) => a),\n y(1)\n ), this.logService.debug(`Created ${s} Reply handler`)), n.layout = t, this.logCreated(s, n), this.port2.postMessage(n), this.logSent(s, n), o)\n return o;\n }\n /**\n * Setup listener for {@link LayoutChangeMessage}, which can be sent by a host app if it needs to\n * request a layout change on the client.\n *\n * @remarks\n * In some scenarios, a `host` app can request a layout change from the client, so this listener\n * should be setup to support that use case.\n *\n * Whenever such a request is received, the `client` app **SHOULD** respond with a\n * {@link LayoutChangeMessageReply} to acknowledge if it is ready for a change.\n *\n * @example\n * Here is an example of how a listener can be setup:\n *\n * ```ts\n * const ipcHelper = new IpcHelper(['2.0'], console);\n *\n * const layoutChangeSubscription = ipcHelper.onLayoutChangeMessage().subscribe((msg) => {\n * // your logic for handling the request goes here\n *\n * // once you're ready to acknowledge, let the `host` app know\n * ipcHelper.layoutChange(msg.layout, result, msg.id);\n * });\n *\n * // don't forget to unsubscribe when you're cleaning up\n * layoutChangeSubscription.unsubscribe();\n * ```\n *\n * @returns An Observable that emits whenever {@link LayoutChangeMessage} is received so it can be\n * subscribed to indefinitely.\n */\n onLayoutChangeMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"LAYOUT CHANGE\";\n return this.incomingMessages$.pipe(\n g((e) => e.type === t && e.target === \"client\" && e.replyTo === null),\n d((e) => e),\n f(this.logReceived(t)),\n d((e) => e)\n );\n }\n requestOAuthToken(t) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n Array.isArray(t) || (t = [t]);\n const e = \"OAUTH TOKEN\", r = this.createMessage(e);\n r.providerTypes = t, this.logCreated(e, r);\n const s = this.incomingMessages$.pipe(\n g((n) => n.type === e && n.replyTo === r.id),\n d((n) => n),\n f(this.logReceived(e)),\n y(1)\n );\n return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), s;\n }\n openUrl(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"OPEN URL\", s = this.createMessage(r, !1);\n s.url = t, s.data = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);\n }\n selectContacts(t, e, r, s) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n if (e === \"group\" && s === void 0)\n throw new w(\n \"currentContacts\",\n s,\n \"currentContacts is required for group streams\"\n );\n if (e === \"direct\" && s !== void 0)\n throw new w(\n \"currentContacts\",\n s,\n \"currentContacts should not be passed for direct streams\"\n );\n const n = \"SELECT CONTACTS\", o = this.createMessage(n, !0);\n o.streamType = e, o.streamId = t, o.contactType = r, o.currentContacts = s, this.logCreated(n, o);\n const a = this.incomingMessages$.pipe(\n g((c) => c.type === n && c.replyTo === o.id),\n f(this.logReceived(n)),\n // validate if `streamId` is the same as we sent\n d((c) => {\n const l = c;\n if (l.streamId !== t)\n throw new ee(l.streamId, t);\n return e === \"direct\" && l.contacts.length > 1 && (l.contacts = [l.contacts[0]]), l;\n }),\n y(1)\n );\n return this.logService.debug(`Created ${n} Reply handler`), this.port2.postMessage(o), this.logSent(n, o), a;\n }\n /**\n * Request detailed contact information for the given Cloud usernames.\n *\n * @param contacts - Cloud usernames for which we need detailed contact information\n *\n * @returns Observable with a {@link MatchContactsMessageReply} instance containing the requested\n * {@link ContactItem} information. Emits once.\n */\n matchContacts(t) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n if (!t.length)\n throw new w(\"contacts\", t, \"At least one contact is required\");\n const e = \"MATCH CONTACTS\", r = this.createMessage(e);\n r.contacts = [...t], this.logCreated(e, r);\n const s = this.incomingMessages$.pipe(\n g((n) => n.type === e && n.replyTo === r.id),\n f(this.logReceived(e)),\n d((n) => n),\n y(1)\n );\n return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), s;\n }\n /**\n * Setup listener for {@link PushMessageMessage}, which can be sent by a Host app to forward an\n * an Acrobits Messaging message received via push notification to the Client app.\n *\n * @remarks\n * The format of the payload SHOULD be kept the same as the one received from the push\n * notification. The Client app can then use the {@link MessagingNotificationType} to parse the\n * message as needed.\n *\n * @example\n * Here is an example of how a listener can be setup:\n *\n * ```ts\n * const ipcHelper = new IpcHelper(['2.0'], console);\n *\n * const pushMessageSubscription = ipcHelper.onPushMessageMessage().subscribe((msg) => {\n * // your logic for handling the incoming push message goes here\n * });\n *\n * // don't forget to unsubscribe when you're cleaning up\n * pushMessageSubscription.unsubscribe();\n * ```\n *\n * @returns An observable that emits whenever {@link PushMessageMessage} is received so it can be\n * subscribed to indefinitely.\n */\n onPushMessageMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"PUSH MESSAGE\";\n return this.incomingMessages$.pipe(\n g((e) => e.type === t && e.target === \"client\"),\n d((e) => e),\n f(this.logReceived(t))\n );\n }\n /**\n * Sends a {@link PushTokenMessage} to the Host app, to request the Push Token for the current\n * device.\n *\n * @remarks\n * The Host app should reply with a {@link PushTokenMessageReply} containing the Push Token.\n *\n * @returns Observable with a {@link PushTokenMessageReply} instance containing the Push Token.\n */\n requestPushToken() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"PUSH TOKEN\", e = this.createMessage(t);\n this.logCreated(t, e);\n const r = this.incomingMessages$.pipe(\n g((s) => s.type === t && s.replyTo === e.id),\n f(this.logReceived(t)),\n d((s) => s),\n y(1)\n );\n return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;\n }\n /**\n * Setup a listener for {@link PushTokenMessage}, which can be sent by a Host app to notify of a\n * new Push Token.\n *\n * @remarks\n * The Host app should send this message whenever the Push Token changes. The Client app should\n * then update it's Push Token accordingly.\n *\n * The Host app does not expect a reply to this message.\n *\n * @example\n * Here is an example of how a listener can be setup:\n *\n * ```ts\n * const ipcHelper = new IpcHelper(['2.0'], console);\n *\n * const pushTokenSubscription = ipcHelper.onPushTokenMessage().subscribe((msg) => {\n * // your logic for handling the push token goes here\n * });\n *\n * // don't forget to unsubscribe when you're cleaning up\n * pushTokenSubscription.unsubscribe();\n * ```\n *\n * @returns An observable that emits whenever {@link PushTokenMessage} is received so it can be\n * subscribed to indefinitely.\n */\n onPushTokenMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"PUSH TOKEN\";\n return this.incomingMessages$.pipe(\n g(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null && e.expectReply === !1\n ),\n d((e) => {\n if (e.pushToken && e.selector && e.appId)\n return e;\n throw new Error(\"PushTokenMessage is missing required PushTokenPayload fields\");\n }),\n f((e) => e.pushToken),\n f(this.logReceived(t))\n );\n }\n /**\n * Setup listener for {@link BadgeQueryMessage}, which can be sent by a `Host` app to request the\n * current badge counter from the `Client` app.\n *\n * @returns An observable that emits whenever {@link BadgeQueryMessage} is received so it can be\n * subscribed to indefinitely.\n */\n onBadgeQueryMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"BADGE QUERY\";\n return this.incomingMessages$.pipe(\n g((e) => e.type === t && e.target === \"client\"),\n d((e) => e),\n f(this.logReceived(t))\n );\n }\n /**\n * Sends a {@link BadgeUpdateMessage} from the `Client` to the `Host` with the current counter.\n *\n * @remarks\n * This message can be sent independently or as a reply to a {@link BadgeQueryMessage} from the\n * Host app. If sending as a reply, the `replyTo` parameter should contain the ID of the original\n * {@link BadgeQueryMessage}.\n *\n * @param count - The counter's value\n * @param isActivity - _Optional_. Whether the counter is for activity or not. Defaults to `false`\n * @param replyTo - _Optional_. The message ID to which the reply should be sent\n */\n sendBadgeUpdateMessage(t, e, r) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const s = \"BADGE UPDATE\", n = this.createMessage(s, !1, r);\n n.count = t, n.activity = e ?? !1, this.logCreated(s, n), this.port2.postMessage(n), this.logSent(s, n);\n }\n /**\n * Sends a {@link LifecycleMessage} to the Host app, to notify it of a lifecycle event.\n *\n * @remarks\n * This message is used to notify the Host app of a lifecycle event, such as the app\n * re-establishing a connection with it's server after being offline or the user joining a call\n * etc.\n *\n * @param eventName - Name of the event to send\n * @param payload - Payload to send with the event\n *\n * @returns This method returns void.\n */\n sendLifecycleMessage(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"LIFECYCLE\", s = this.createMessage(r, !1);\n s.eventName = t, s.payload = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);\n }\n /**\n * Setup listener for {@link LifecycleMessage}, which can be sent by a `Host` app to notify the\n * `Client` app of a lifecycle event.\n *\n * @remarks\n * This message is used to notify the Client app of a lifecycle event, such as the host app\n * re-establishing a connection with it's server after being offline.\n *\n * @returns An observable that emits whenever {@link LifecycleMessage} is received so it can be\n * subscribed to indefinitely.\n */\n onLifecycleMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"LIFECYCLE\";\n return this.incomingMessages$.pipe(\n g((e) => e.type === t && e.target === \"client\"),\n d((e) => e),\n f(this.logReceived(t))\n );\n }\n /**\n * Sends a {@link LogMessage} to the Host app, to add to it's application logs.\n *\n * @remarks\n * The purpose of this message is to provide a generic mechanism of reporting logs for various\n * apps using the IPC protocol.\n *\n * @param level - The {@link LogMessageLevel}\n * @param message - Message to log as a string. This can be a JSON string as well.\n *\n * @returns This method returns void.\n */\n sendLogMessage(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"LOG\", s = this.createMessage(r, !1);\n s.level = t, s.message = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);\n }\n /**\n * Setup listener for {@link RequestLogsMessage}, which can be sent by a `Host` app to request\n * logs from the `Client` app.\n *\n * @remarks\n * The `Host` app can either request that logs be sent as a transfer via the IPC Protocol or\n * trigger a file download by the `Client` by passing a {@link RequestLogsResponseType} in the\n * `responseType` property.\n *\n * @returns An observable that emits whenever a {@link RequestLogsMessage} is received so it can\n * be subscribed to indefinitely.\n */\n onRequestLogsMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"REQUEST LOGS\";\n return this.incomingMessages$.pipe(\n g((e) => e.type === t && e.target === \"client\"),\n d((e) => e),\n f(this.logReceived(t))\n );\n }\n /**\n * Send a {@link ViewTransitionMessage} to the `Host` app, notifying it of a view transition\n * happening in the `Client` app.\n *\n * @remarks\n * A view transition can be either a route navigation, opening or closing a modal, switching tabs\n * or opening a menu.\n *\n * @param transitionType - The kind of transition. Should be of {@link ViewTransitionType}.\n * @param targetView - The name of the view which is being transitioned to.\n *\n * @returns This method returns void.\n */\n sendViewTransitionMessage(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"VIEW TRANSITION\", s = this.createMessage(r, !1);\n s.transitionType = t, s.targetView = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);\n }\n /**\n * Sends a {@link FileRequestMessage} to the Host app, to request a file by it's SHA256 hash.\n *\n * @remarks\n * The initiating party can optionally suggest the other party to limit the size of the chunks\n * sent in the response by setting the `maxChunkSizeInBytes` field. However, this is only a\n * suggestion and the other party can still choose to send chunks of a different size.\n *\n * A client should subscribe to the returned observable to receive the file chunks by setting up\n * listeners for `next`, `error` and `complete` events.\n *\n * @example\n * Here is an example of how a listener can be setup:\n *\n * ```ts\n * const ipcHelper = new IpcHelper(['2.0'], console);\n *\n * ipcManager.sendFileRequestMessage(fileHash, 'attachment', streamId?.toString()).subscribe({\n * next: (msg) => {\n * // next listener. Fired for each chunk.\n * },\n * error: (err) => {\n * // error listener\n * },\n * complete: () => {\n * // complete listener. Fired once all chunks are complete.\n * }\n * });\n * ```\n *\n * @param fileId - An identifier for the file being requested. This should be a UUIDv4 string.\n * @param fileHash - An SHA256 hash of the file being requested.\n * @param intent - The intent of the file request. Can be either `attachment` or `general`.\n * @param streamId - _Optional_. The ID of the message stream to which the files will be attached\n * to. Only used if `intent` is set to `attachment`.\n * @param maxChunkSizeInBytes - _Optional_. The maximum size of the file chunk in bytes. Only\n * used as a suggestion to the other party.\n *\n * @returns An observable that either emits once if the result is `error` or `not found` or\n * emits as many times as the number of chunks in the file if the result is `success`.\n */\n sendFileRequestMessage(t, e, r, s, n) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const o = \"FILE REQUEST\", a = this.createMessage(o);\n if (a.fileId = t, a.fileHash = e.toLowerCase(), a.intent = r, a.maxChunkSizeInBytes = n, r === \"attachment\") {\n if (!s)\n throw new w(\n \"streamId\",\n s,\n \"streamId is required for attachment intent\"\n );\n a.streamId = s;\n }\n this.logCreated(o, a);\n let c = 0;\n const l = this.incomingMessages$.pipe(\n g(\n (u) => u.type === o && u.replyTo === a.id\n ),\n f(this.logReceived(o)),\n f(() => c++),\n d((u) => (u.result === \"success\" && (u.chunkHash = u.chunkHash.toLowerCase(), u.fileHash = u.fileHash.toLowerCase()), u)),\n ve((u) => u.result === \"success\" && c < u.totalChunks, !0)\n );\n return this.port2.postMessage(a), this.logSent(o, a), l;\n }\n /**\n * Sends a {@link FileRequestMessageReply} to the Host app, to reply to a\n * {@link FileRequestMessage} that was received.\n *\n * @remarks\n * The `result` parameter can be either `success`, `error` or `not found` along with the\n * associated {@link FileRequestResult} properties.\n *\n * In case of `success`, multiple `FileRequestMessageReply` messages can be sent to the Host app\n * to send the file chunks. The `chunkHash` field should be set to the SHA256 hash of the chunk\n * being sent.\n *\n * In case of `error` or `not found`, only one `FileRequestMessageReply` message should be sent\n * to the Host app to notify of the result.\n *\n * @param receivedMsg - The original {@link FileRequestMessage} that was received\n * @param result - The result of the file request. Can be either `success`, `error` or `not found`\n * along with the associated {@link FileRequestResult} properties.\n */\n sendFileRequestMessageReply(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"FILE REQUEST\", s = Object.assign(\n e,\n this.createMessage(r, !1, t.id)\n );\n this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);\n }\n /**\n * Setup a listener for {@link FileRequestMessage}, which can be sent by a Host app to request a\n * file by it's SHA256 hash.\n *\n * @remarks\n * The initiating party can optionally suggest the other party to limit the size of the chunks\n * sent in the response by setting the `maxChunkSizeInBytes` field. However, this is only a\n * suggestion and the other party can still choose to send chunks of a different size.\n *\n * @returns An observable that emits whenever {@link FileRequestMessage} is received so it can\n * be subscribed to indefinitely.\n */\n onFileRequestMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"FILE REQUEST\";\n return this.incomingMessages$.pipe(\n g(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null\n ),\n d((e) => (e.fileHash = e.fileHash.toLowerCase(), e)),\n f(this.logReceived(t))\n );\n }\n /**\n * Sends a {@link FileSelectionMessage} to the Host app, to request the user to select on or\n * more files.\n *\n * @remarks\n * The `Host` app should reply with a {@link FileSelectionMessageReply} containing the number of\n * files the user selected along with the file identifiers.\n *\n * @param intent - _Optional_. The intent of the file selection. Can be either `attachment` or\n * `general`. Defaults to `attachment`.\n * @param streamId - _Optional_. The ID of the message stream to which the files will be attached\n * to. Only used if `intent` is set to `attachment`.\n * @param correlationId - _Optional_. The correlation ID of the message the attachments are being\n * selected for. This should be a UUIDv4 string. Only used if `intent` is set to `attachment`.\n * @param maxCount - _Optional_. The maximum number of files the user can select. Defaults to\n * unlimited.\n * @param maxFileSize - _Optional_. The maximum size of the files to select in bytes. Defaults to\n * unlimited.\n * @param mimeTypes - _Optional_. The MIME type of the files to select. Defaults to `*\\/*`.\n *\n * @returns This method returns void.\n */\n sendFileSelectionMessage(t = \"attachment\", e, r, s, n, o) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const a = \"FILE SELECTION\", c = this.createMessage(a);\n if (c.intent = t, c.maxCount = s, c.maxFileSizeInBytes = n, c.mimeTypes = o, t === \"attachment\") {\n if (!e)\n throw new w(\n \"streamId\",\n e,\n \"streamId is required for attachment intent\"\n );\n if (!r)\n throw new w(\n \"correlationId\",\n r,\n \"correlationId is required for attachment intent\"\n );\n c.streamId = e, c.correlationId = r;\n }\n this.logCreated(a, c);\n const l = this.incomingMessages$.pipe(\n g(\n (u) => u.type === a && u.replyTo === c.id\n ),\n d((u) => {\n var p;\n return u.files = (p = u.files) == null ? void 0 : p.map((v) => (v.original.fileHash = v.original.fileHash.toLowerCase(), v.preview && (v.preview.fileHash = v.preview.fileHash.toLowerCase()), v)), u;\n }),\n f(this.logReceived(a)),\n y(1)\n );\n return this.port2.postMessage(c), this.logSent(a, c), l;\n }\n /**\n * Sends a {@link FileDownloadMessage} to the Host app, to request the download of a file.\n *\n * @remarks\n * The file at the specified `url` is encrypted using the provided `key` and the Host app needs\n * to decrypt it.\n *\n * @param url - The URL to download the file from\n * @param key - The decryption key for the file stream\n * @param fileName - The name of the file to download\n * @param mimeType - The MIME type of the file to download\n * @returns An observable which emits a {@link FileDownloadMessageReply} instance containing the\n * file ID and the file size in bytes. Emits once.\n */\n sendFileDownloadMessage(t, e, r, s) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const n = \"FILE DOWNLOAD\", o = this.createMessage(n);\n o.url = t, o.key = e, o.fileName = r, o.mimeType = s, this.logCreated(n, o);\n const a = this.incomingMessages$.pipe(\n g((c) => c.type === n && c.replyTo === o.id),\n f(this.logReceived(n)),\n d((c) => c),\n y(1)\n );\n return this.port2.postMessage(o), this.logSent(n, o), a;\n }\n /**\n * Sends a {@link FileDownloadProgressQueryMessage} to the Host app, to query the progress of a\n * file download that was initiated by a {@link FileDownloadMessage}.\n *\n * @remarks\n * The `fileHash` parameter is the SHA256 hash of the decrypted file, which is used as an\n * identifier for the target file in the `Host` app. The `url` parameter is the URL of the file\n * being downloaded.\n *\n * The `Host` app should reply with a {@link FileDownloadProgressUpdateMessage} containing the\n * progress of the file download.\n *\n * @param correlationId - A UUIDv4 string to identify the message this file was attached to.\n * @param fileHash - SHA256 hash of the decrypted file.\n * @param url - URL of the file being downloaded.\n * @returns An observable which emits a {@link FileDownloadProgressUpdateMessage} instance\n * containing the progress of the file download. Emits once.\n */\n sendFileDownloadProgressQueryMessage(t, e, r) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const s = \"FILE DOWNLOAD PROGRESS QUERY\", n = this.createMessage(\n s,\n !0\n );\n n.correlationId = t, n.fileHash = e.toLowerCase(), n.url = r, this.logCreated(s, n);\n const o = this.incomingMessages$.pipe(\n g(\n (a) => a.type === \"FILE DOWNLOAD PROGRESS UPDATE\" && a.replyTo === n.id\n ),\n f(this.logReceived(s)),\n d((a) => (a.fileHash && (a.fileHash = a.fileHash.toLowerCase()), a)),\n y(1)\n );\n return this.port2.postMessage(n), this.logSent(s, n), o;\n }\n /**\n * Setup listener for {@link FileDownloadProgressQueryMessage}, which can be sent by a `Host` app\n * to update the progress of a file download which was initiated by a {@link FileOpenMessage}.\n *\n * @returns An observable which emits a {@link FileDownloadProgressUpdateMessage} instance\n * containing the progress of the file download. Emits once.\n */\n onFileDownloadProgressUpdateMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"FILE DOWNLOAD PROGRESS UPDATE\";\n return this.incomingMessages$.pipe(\n g(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null\n ),\n d((e) => (e.fileHash && (e.fileHash = e.fileHash.toLowerCase()), e)),\n f(this.logReceived(t))\n );\n }\n /**\n * Sends a {@link FileUploadProgressQueryMessage} to the Host app, to query the progress of a file\n * upload.\n *\n * @remarks\n * The `host` app should reply with a {@link FileUploadProgressUpdateMessage} containing the\n * progress of the file upload.\n *\n * @param correlationId - A UUIDv4 string to identify the message this file was attached to.\n * @param fileHash - SHA256 hash of the decrypted file.\n * @param fileId - ID of the original file being uploaded.\n * @returns An observable which emits a {@link FileUploadProgressUpdateMessage} instance\n * containing the progress of the file upload. Emits once.\n */\n sendFileUploadProgressQueryMessage(t, e, r) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const s = \"FILE UPLOAD PROGRESS QUERY\", n = this.createMessage(\n s,\n !0\n );\n n.correlationId = t, n.fileHash = e.toLowerCase(), n.fileId = r, this.logCreated(s, n);\n const o = this.incomingMessages$.pipe(\n g(\n (a) => a.type === \"FILE DOWNLOAD PROGRESS UPDATE\" && a.replyTo === n.id\n ),\n f(this.logReceived(s)),\n d((a) => (a.fileHash && (a.fileHash = a.fileHash.toLowerCase()), a)),\n y(1)\n );\n return this.port2.postMessage(n), this.logSent(s, n), o;\n }\n /**\n * Setup listener for {@link FileUploadProgressQueryMessage}, which can be sent by a `Host` app to\n * update the progress of a file upload.\n *\n * @remarks\n * The `progressInBytesSent` and `fileSize` fields contain the combined size of the original file\n * and any preview that was generated.\n *\n * @returns An observable which emits a {@link FileUploadProgressUpdateMessage} instance\n * containing the progress of the file upload. Emits once.\n */\n onFileUploadProgressUpdateMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"FILE UPLOAD PROGRESS UPDATE\";\n return this.incomingMessages$.pipe(\n g(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null\n ),\n d((e) => (e.fileHash && (e.fileHash = e.fileHash.toLowerCase()), e)),\n f(this.logReceived(t))\n );\n }\n /**\n * Sends a {@link FileOpenMessage} to the Host app, to try and open a file the device may already\n * have in it's storage.\n *\n * @remarks\n * The `fileHash` parameter is the SHA256 hash of the decrypted file, which is used as an\n * identifier for the target file in the `Host` app as well as to verify the integrity of the\n * file.\n *\n * @param fileHash - The SHA256 hash of the file to open.\n * @param fileName - _Optional_. The name of the file to open.\n * @param streamId - _Optional_. The ID of the message stream from which the file is opened from.\n * @param url - _Optional_. URL from where the host can download the file if it isn't in storage.\n * @param correlationId - _Optional_. Correlation ID of the message this file was attached to.\n * @param key - _Optional_. Key used to encrypt the original attachment.\n * @param sender - _Optional_. The {@link ContactItem} of the sender of the file.\n *\n * @returns An observable which emits a {@link FileOpenMessageReply} instance containing the\n * result of the request. Emits once.\n */\n sendFileOpenMessage(t, e, r, s, n, o, a) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const c = \"FILE OPEN\", l = this.createMessage(c, !0);\n l.fileHash = t.toLowerCase(), l.fileName = e, l.streamId = r, l.url = s, l.correlationId = n, l.key = o, l.sender = a, this.logCreated(c, l);\n const u = this.incomingMessages$.pipe(\n g((p) => p.type === c && p.replyTo === l.id),\n f(this.logReceived(c)),\n d((p) => p),\n y(1)\n );\n return this.port2.postMessage(l), this.logSent(c, l), u;\n }\n /**\n * Sends a {@link CancelFileOpenMessage} to the Host app, to cancel opening or download of a file\n * that was initiated by a {@link FileOpenMessage} previously.\n *\n * @param correlationId - UUIDv4 string to identify the message this file was attached to.\n * @param fileHash - SHA256 hash of the file to cancel opening.\n */\n sendCancelFileOpenMessage(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"CANCEL FILE OPEN\", s = this.createMessage(r, !1);\n s.correlationId = t, s.fileHash = e.toLowerCase(), this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);\n }\n /**\n * Sends a {@link FileRemoveMessage} to the Host app, to request removal of a file from the\n * device's storage.\n *\n * @remarks\n * The file is identified by it's SHA256 hash. The Host app would reply with a\n * {@link FileRemoveMessageReply} containing the result of the request. In case the\n * file is not found, the `host` app should reply with `success` as well.\n *\n * @param hash - An SHA256 hash of the file\n * @param streamId - _Optional_. The ID of the message stream from which the file is removed from.\n *\n * @returns An observable which emits a {@link FileRemoveMessageReply} with the result of the\n * request. Emits once.\n */\n sendFileRemoveMessage(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"FILE REMOVE\", s = this.createMessage(r, !0);\n s.hash = t.toLowerCase(), s.streamId = e, this.logCreated(r, s);\n const n = this.incomingMessages$.pipe(\n g((o) => o.type === r && o.replyTo === s.id),\n f(this.logReceived(r)),\n d((o) => o),\n y(1)\n );\n return this.port2.postMessage(s), this.logSent(r, s), n;\n }\n /**\n * Sends a {@link AppResetMessage} to the Host app, to request logging out the user and resetting\n * the app to it's initial state.\n *\n * @remarks\n * This message is used to request the Host app to log out the user and reset the app to it's\n * initial state. This is useful when the user wants to log out of the app and log in with a\n * different account.\n *\n * The Host can confirm the user's intention to reset the app by displaying a confirmation dialog.\n *\n * @returns This method returns void.\n */\n sendAppResetMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"APP RESET\", e = this.createMessage(t, !1);\n this.logCreated(t, e), this.port2.postMessage(e), this.logSent(t, e);\n }\n /**\n * Sends a {@link MessageSentMessage} to the Host app, to notify it of a message that has been\n * sent to the specified stream.\n *\n * @remarks\n * @remarks\n * The `streamId` field is used to specify the ID of the message stream the message is being sent\n * to. The `correlationId` field is used to identify the message being composed and as an\n * idempotency key.\n *\n * The `host` app can use the `correlationId` to identify any attachments associated with the\n * message in it's storage\n *\n * @param streamId - ID of the stream the message was sent to.\n * @param correlationId - Correlation ID of the message that was sent.\n *\n * @returns This method returns void.\n */\n sendMessageSentMessage(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"MESSAGE SENT\", s = this.createMessage(r, !1);\n s.streamId = t, s.correlationId = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);\n }\n /**\n * Sends a {@link SendMessageMessage} to the Host app, to send a message to the specified stream.\n *\n * @param streamId - ID of the stream the message is being sent to.\n * @param correlationId - Correlation ID of the message being sent.\n * @param body - The body of the message.\n * @param messageType - The type of the message. Defaults to `TEXT`.\n * @param mentions - _Optional_. A list of mentions in the message.\n * @param attachments - _Optional_. A list of file IDs of the attachments being sent with the\n * message.\n * @param relatedMessageId - _Optional_. The ID of the related message in case `messageType` is\n * `REPLY` or `UPDATE`.\n * @param setCursors - _Optional_. Whether to set the cursors for the message. Defaults to `true`.\n * @param threadId - _Optional_. The ID of the thread the message is being sent to.\n *\n * @returns An observable which emits a {@link SendMessageMessageReply} instance containing the\n * result of the request. Emits once.\n */\n sendSendMessageMessage(t, e, r, s = \"TEXT\", n, o, a, c = !0, l) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const u = \"SEND MESSAGE\", p = this.createMessage(u, !0);\n p.streamId = t, p.correlationId = e, p.body = r, p.messageType = s, p.mentions = n ?? [], p.attachments = (o == null ? void 0 : o.map((M) => M.toLowerCase())) ?? [], p.relatedMessageId = a, p.setCursors = c, p.threadId = l, this.logCreated(u, p);\n const v = this.incomingMessages$.pipe(\n g((M) => M.type === u && M.replyTo === p.id),\n f(this.logReceived(u)),\n d((M) => M),\n y(1)\n );\n return this.port2.postMessage(p), this.logSent(u, p), v;\n }\n /**\n * Sends a {@link CancelSendMessageMessage} to the Host app, to cancel a message that was being\n * sent to the specified stream.\n *\n * @param streamId - ID of the stream the message was being sent to.\n * @param correlationId - Correlation ID of the message that was being sent.\n *\n * @returns This method returns void.\n */\n sendCancelSendMessageMessage(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"CANCEL SEND MESSAGE\", s = this.createMessage(r, !1);\n s.streamId = t, s.correlationId = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);\n }\n /**\n * Sends a {@link MessageDeletedMessage} to the Host app, to notify deletion of a message from the\n * specified stream.\n *\n * @param correlationId - UUIDv4 string of the message to be deleted.\n * @param streamId - ID of the stream the message was sent to.\n */\n sendMessageDeletedMessage(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"MESSAGE DELETED\", s = this.createMessage(r, !1);\n s.correlationId = t, s.streamId = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);\n }\n /**\n * Sends a {@link SendMessageStatusQueryMessage} to the Host app, to query the status of a message\n * that was sent via a {@link SendMessageMessage}.\n *\n * @remarks\n * This message expects a {@link SendMessageStatusUpdateMessage} in response.\n *\n * @param correlationId - A UUIDv4 string to identify the message that was sent.\n * @param streamId - The ID of the message stream the message was sent to.\n *\n * @returns An observable which emits a {@link SendMessageStatusUpdateMessage} instance containing\n * the status of the message. Emits once.\n */\n sendSendMessageStatusQueryMessage(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"SEND MESSAGE STATUS QUERY\", s = this.createMessage(r, !0);\n s.correlationId = t, s.streamId = e, this.logCreated(r, s);\n const n = this.incomingMessages$.pipe(\n g(\n (o) => o.type === \"SEND MESSAGE STATUS UPDATE\" && o.replyTo === s.id\n ),\n f(this.logReceived(r)),\n d((o) => o),\n y(1)\n );\n return this.port2.postMessage(s), this.logSent(r, s), n;\n }\n /**\n * Setup a listener for {@link SendMessageStatusUpdateMessage}, which can be sent by a Host app to\n * notify the `Client` app of the status of a message that was sent via a\n * {@link SendMessageMessage}.\n *\n * @returns An observable that emits whenever a {@link SendMessageStatusUpdateMessage} is received\n */\n onSendMessageStatusUpdateMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"SEND MESSAGE STATUS UPDATE\";\n return this.incomingMessages$.pipe(\n g((e) => e.type === t && e.target === \"client\" && e.replyTo === null),\n d((e) => e),\n f(this.logReceived(t))\n );\n }\n /**\n * Sends a {@link SipCallMessage} to the Host app to initiate a SIP call between the current user\n * and the callee.\n *\n * @param contact - The {@link ContactItem} for the callee.\n */\n sendSipCallMessage(t) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const e = \"SIP CALL\", r = this.createMessage(e, !1);\n r.contact = t, this.logCreated(e, r), this.port2.postMessage(r), this.logSent(e, r);\n }\n /**\n * Checks if the client app is either embedded in an iframe or in a native webview.\n *\n * @internal\n *\n * @returns `true` if the client app is embedded, `false` otherwise.\n */\n isEmbedded() {\n if (this.embeddedResult !== null)\n return this.embeddedResult;\n let t = !1;\n return this.logService.debug(\"Checking if running in iframe...\"), t = !!this.frameElement, t || (t = this.self !== this.parent), t ? (this.logService.debug(\"In iframe\"), this.inIframe = !0, this.embeddedResult = !0, !0) : (this.logService.debug(\"Not in iframe\"), this.logService.debug(\"Checking if running in native app...\"), !t && (t = !!window.Acrobits, t) ? (this.logService.debug(\"In native app\"), this.embeddedResult = !0, t) : (this.logService.debug(\"Not running in native app\"), this.embeddedResult = !1, this.embeddedResult));\n }\n /**\n * Compares the negotiated protocol version with the provided version.\n *\n * @remarks\n * This method is used to compare the negotiated protocol version with the provided version. This\n * is useful when you want to check if the client app supports a certain feature or not.\n *\n * @example\n * Here is an example of how you can use this method to check if the client app supports\n * {@link ViewTransitionMessage}:\n *\n * ```ts\n * const ipcHelper = new IpcHelper(['2.0'], console);\n *\n * const supportsViewTransition = ipcHelper.compareVersion('2.0') >= 0;\n * ```\n *\n * @param version - The version to compare against\n * @returns Returns the result of a comparison between the negotiated protocol version and the\n * provided version. Returns `0` if the versions are equal, `-1` if the negotiated version is\n * lower than the provided version and `1` if the negotiated version is higher than the provided\n * version.\n */\n compareVersion(t) {\n return D(this.negotiatedProtocolVersion, t);\n }\n logReceived(t, e) {\n e && we(e) && (e = { ...e, data: \"...\" });\n const r = (s) => this.logService.debug(`[IPC] Received ${t} message`, s);\n return e && r(e), r;\n }\n logSent(t, e) {\n e.type === \"FILE REQUEST\" && e.result === \"success\" && (e = { ...e, data: \"...\" }), this.logService.debug(`[IPC] Sent ${t} message`, e);\n }\n logCreated(t, e) {\n e.type === \"FILE REQUEST\" && e.result === \"success\" && (e = { ...e, data: \"...\" }), this.logService.debug(`[IPC] Created ${t} message`, e);\n }\n async createIframeChannel() {\n return new Promise((t) => {\n const e = (r) => {\n r.data === \"message channel port\" && (this.iframePort2 = r.ports[0], this.self.removeEventListener(\"message\", e), t());\n };\n this.self.addEventListener(\"message\", e), this.parent.postMessage(\"get channel\", \"*\");\n });\n }\n finishIpcSetup(t) {\n this.logService.debug(\"Registering listener on port2...\"), this.port2.addEventListener(\"message\", this.handleIpcMessage.bind(this)), this.port2.start(), this.logService.debug(\"Started listening on port2\"), this.port2.postMessage(t), this.logSent(\"HELLO\", t);\n }\n handleIpcMessage(t) {\n const { data: e } = t;\n !e.id || e.target !== \"client\" || this.incomingMessages$.next(e);\n }\n createMessage(t, e = !0, r) {\n return {\n type: t,\n id: this.generateId(),\n target: \"host\",\n expectReply: e,\n replyTo: r ?? null\n };\n }\n generateId(t = 8, e = !1) {\n let r = \"1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM\";\n const s = [];\n e && (r = r.substr(0, r.indexOf(\"Q\")));\n for (let n = 0; n < t; n++)\n s.push(r[Math.floor(Math.random() * r.length)]);\n return s.join(\"\");\n }\n}\nfunction we(i) {\n return i.type === \"FILE REQUEST\" && i.replyTo !== null;\n}\nexport {\n h as InvalidContextError,\n w as InvalidParameterError,\n ee as InvalidStreamIdError,\n te as InvalidVersionFormatError,\n Re as IpcHelper,\n F as MessagePortNotInitializedError,\n H as UnsupportedVersionError\n};\n","import {\n ContactType,\n InvalidParameterError,\n IpcHelper,\n type AppContext,\n type ContactItem,\n type HostType,\n type IpcProtocolVersion\n} from '@acrobits/ipc-protocol';\nimport { type ILogger } from '@acrobits/log-helper';\nimport { firstValueFrom } from 'rxjs';\nimport { map, tap } from 'rxjs/operators';\nimport { UnsubscribeCallback } from './UnsubscribeCallback.ts';\nimport { IPCEvents } from './events.ts';\n\nconst SUPPORTED_VERSIONS: IpcProtocolVersion[] = ['2.0'];\n\ntype GenericCallback = (...args: unknown[]) => void;\n\n/**\n * A class that manages the IPC communication between the `Client` and the `Host`.\n *\n * @remarks\n * Ideally, there should only be one instance of the IPCManager in the app. It is recommended to\n * create the instance as a singleton and use it throughout the app.\n *\n * @public\n */\nexport default class IPCManager {\n /**\n * The type of the `Host` app the `Client` is embedded in.\n */\n host?: HostType;\n\n /**\n * The cloud ID of the `Host` app the `Client` is embedded in.\n */\n cloudId?: string;\n\n private logger: ILogger;\n private helper: IpcHelper;\n\n private listeners: Map<IPCEvents, Set<GenericCallback>>;\n\n /**\n * Returns whether the app is running inside a native WebView (`host` context) or as a\n * `standalone` app.\n */\n get context() {\n return this.evaluateContext(this.helper.currentContext);\n }\n\n /**\n * Determines if the app is connected to a `Host` app.\n */\n get isConnected() {\n return !!(this.helper.currentContext === 'user' && this.host && this.cloudId);\n }\n\n /**\n * The negotiated IPC protocol version.\n */\n get negotiatedVersion() {\n return this.helper.negotiatedProtocolVersion;\n }\n\n /**\n * A class that manages the IPC communication between the `Client` and the `Host`.\n *\n * @remarks\n * Ideally, there should only be one instance of the IPCManager in the app. It is recommended to\n * create the instance as a singleton and use it throughout the app.\n *\n * @param logger - An optional logger instance to use for logging. If not provided, a default logger\n * will be used.\n */\n constructor(logger?: ILogger) {\n this.logger = logger ?? console;\n this.helper = new IpcHelper(SUPPORTED_VERSIONS, this.logger);\n\n this.listeners = new Map();\n this.listeners.set(IPCEvents.BadgeQuery, new Set());\n this.listeners.set(IPCEvents.Lifecycle, new Set());\n this.listeners.set(IPCEvents.PushToken, new Set());\n }\n\n /**\n * Determines if the app is embedded in a Host app or native CSP clients.\n *\n * @returns A promise with {@link IPCContext} the app is running under.\n */\n async determineContext() {\n const context = await firstValueFrom(this.helper.determineContext(), {\n defaultValue: 'guest' as AppContext\n });\n\n return this.evaluateContext(context);\n }\n\n /**\n * Initiates the IPC handshake with the `Host` app.\n */\n initiateConnection() {\n return firstValueFrom(\n this.helper.openBridge().pipe(\n tap((reply) => {\n // now that the bridge is open, register receive-only listeners\n this.helper.onBadgeQueryMessage().subscribe((msg) => {\n this.logger.debug('Received Badge Query: ', msg);\n\n for (const cb of this.listeners.get(IPCEvents.BadgeQuery)?.values() ?? []) {\n cb();\n }\n });\n\n this.helper.onLifecycleMessage().subscribe((msg) => {\n this.logger.debug('Received Lifecycle Event: ', msg);\n\n for (const cb of this.listeners.get(IPCEvents.Lifecycle)?.values() ?? []) {\n cb(msg.eventName, msg.payload);\n }\n });\n\n this.helper.onPushTokenMessage().subscribe((msg) => {\n this.logger.debug('Received Push Token: ', msg);\n\n for (const cb of this.listeners.get(IPCEvents.PushToken)?.values() ?? []) {\n cb(msg.pushToken, msg.appId, msg.selector);\n }\n });\n\n this.cloudId = reply.cloudId;\n this.host = reply.host;\n }),\n map(() => {\n return;\n })\n )\n );\n }\n\n /**\n * Requests the `Host` app to open the contact selection UI.\n *\n * @remarks\n * When requesting a `single` contact, the `Host` app will return immediately\n * after contact selection.\n *\n * @param corelationId - An identifier for the message stream\n * @param mode - _Optional_. Whether to allow `single` or `multi` contact selection.\n * @param contactType - _Optional_. The type of contacts to be selected. This can be either\n * `cloudUsername` or `uri`. Defaults to `cloudUsername`.\n *\n * @returns A collection of {@link ContactItem} objects which the user selected along with the\n * `corelationId`.\n */\n selectContacts(\n corelationId: number,\n mode?: 'single',\n contactType?: ContactType\n ): Promise<ContactItem[]>;\n\n /**\n * Requests the `Host` app to open the contact selection UI.\n *\n * @remarks\n * When requesting a `multi` contact, the user will have to manually close the contact selection\n * UI. The `Host` app will return the selected contacts when the user closes the UI.\n *\n * When requesting a `multi` contact, the `currentContacts` parameter is required. This will\n * be used to highlight the contacts that are already selected.\n *\n * @param corelationId - An identifier for the message stream\n * @param mode - Whether to allow `single` or `multi` contact selection.\n * @param currentContacts - A list of {@link ContactItem} objects that are currently selected.\n * This is used to highlight the current contacts from the selection UI.\n * @param contactType - _Optional_. The type of contacts to be selected. This can be either\n * `cloudUsername` or `uri`. Defaults to `cloudUsername`.\n *\n * @returns A collection of {@link ContactItem} objects which the user selected along with the\n * `corelationId`.\n */\n selectContacts(\n corelationId: number,\n mode: 'multi',\n currentContacts: ContactItem[],\n contactType?: ContactType\n ): Promise<ContactItem[]>;\n selectContacts(\n corelationId: number,\n mode?: 'single' | 'multi',\n currentContactsOrContactType?: ContactItem[] | ContactType,\n contactType?: ContactType\n ) {\n this.logger.debug('Selecting Contacts: ', ...arguments);\n\n let result: ReturnType<IpcHelper['selectContacts']> | undefined = undefined;\n\n if (mode === 'multi') {\n if (!currentContactsOrContactType || !Array.isArray(currentContactsOrContactType)) {\n throw new InvalidParameterError(\n 'currentContacts',\n currentContactsOrContactType,\n 'currentContacts is required for group streams'\n );\n }\n\n if (!contactType) {\n contactType = 'cloudUsername';\n }\n\n result = this.helper.selectContacts(\n corelationId.toString(),\n 'group',\n contactType,\n currentContactsOrContactType\n );\n } else {\n if (!currentContactsOrContactType) {\n contactType = 'cloudUsername';\n } else {\n contactType = currentContactsOrContactType as ContactType;\n }\n\n result = this.helper.selectContacts(corelationId.toString(), 'direct', contactType);\n }\n\n return firstValueFrom(result.pipe(map((reply) => reply.contacts)));\n }\n\n /**\n * Matches batch of {@link ContactItem} objects against the Host's contact list to fetch detailed\n * contact information.\n *\n * @param contacts - List of {@link ContactItem} collection to match against the Host's contact\n * list.\n * @returns A collection of {@link DetailedContactItem} objects which were matched against the\n * Host's contact list.\n */\n matchContacts(contacts: ContactItem[]) {\n this.logger.debug('Match Contacts: ', contacts);\n return firstValueFrom(this.helper.matchContacts(contacts).pipe(map((reply) => reply.contacts)));\n }\n\n /**\n * Requests the `Host` app to provide the Push Token for the current device.\n *\n * @returns A promise with the Push Token as `string`.\n */\n requestPushToken() {\n this.logger.debug('Requesting Push Token');\n return firstValueFrom(this.helper.requestPushToken().pipe(map((reply) => reply.pushToken)));\n }\n\n /**\n * Sends the current badge count to the `Host` app.\n *\n * @param count - The count to update the badge to.\n * @param isActivity - _Optional_. Whether the update is for an activity instead of a badge.\n */\n badgeUpdate(count: number, isActivity = false) {\n this.logger.debug(`Sending Badge Update, count: ${count}, activity: ${isActivity}`);\n this.helper.sendBadgeUpdateMessage(count, isActivity);\n }\n\n /**\n * Requests the `Host` app to reset the app and log out the user.\n *\n * @remarks\n * For added security, the Host can confirm the user's intention to reset the app by displaying\n * a confirmation dialog. The user can decide to cancel the reset operation.\n */\n requestAppReset() {\n this.logger.debug('Requesting App Reset');\n this.helper.sendAppResetMessage();\n }\n\n /**\n * Requests the `Host` app to open the given URL in an external browser.\n *\n * @remarks\n * Any additional data to be posted alongside the URL is included with the `data` parameter.\n *\n * @param url - URL to open in the external browser\n * @param data - _Optional_. Any additional data to be sent along with the URL\n */\n openUrl<TData>(url: string, data?: TData) {\n this.logger.debug('Opening URL: ', url);\n this.helper.openUrl(url, data);\n }\n\n /**\n * Initiates a SIP call to the given {@link ContactItem}.\n *\n * @param contact - {@link ContactItem} for the callee.\n */\n sipCall(contact: ContactItem) {\n this.logger.debug('Initiating SIP Call: ', contact);\n this.helper.sendSipCallMessage(contact);\n }\n\n /**\n * Registers a callback to be invoked when a {@link IPCEvents.BadgeQuery} is received.\n *\n * @param callback - A callback function to be invoked when a {@link IPCEvents.BadgeQuery} event\n * is received.\n * @returns An unsubscribe callback to remove the listener.\n */\n onBadgeQueryRequest(callback: () => void): UnsubscribeCallback {\n this.logger.debug('Registering for Badge Query');\n\n this.listeners.get(IPCEvents.BadgeQuery)?.add(callback);\n\n return () => this.listeners.get(IPCEvents.BadgeQuery)?.delete(callback);\n }\n\n /**\n * Registers a callback to be invoked when a {@link IPCEvents.Lifecycle} event is received.\n *\n * @remarks\n * The `eventName` and `payload` are defined by the `Host` app and can vary for each LIFECYCLE\n * event. The payload can be an empty object for events without any additional data.\n *\n * @param callback - A callback function to be invoked when a {@link IPCEvents.Lifecycle} event\n * is received.\n *\n * @returns An unsubscribe callback to remove the listener.\n */\n onLifecycleEvent(\n callback: (event: string, payload: Record<string, unknown>) => void\n ): UnsubscribeCallback {\n this.logger.debug('Registering for Lifecycle Event');\n\n this.listeners.get(IPCEvents.Lifecycle)?.add(callback as GenericCallback);\n\n return () => this.listeners.get(IPCEvents.Lifecycle)?.delete(callback as GenericCallback);\n }\n\n /**\n * Registers a callback to be invoked when a {@link IPCEvents.PushToken} event is received.\n *\n * @remarks\n * The `token`, `appId`, `selector` and `expiry` are defined by the `Host` app and can vary for\n * each Push Token event.\n *\n * @param callback - A callback function to be invoked when a {@link IPCEvents.PushToken} event\n * is received.\n * @returns An unsubscribe callback to remove the listener.\n */\n onPushToken(callback: (token: string, appId: string, selector: string) => void) {\n this.logger.debug('Registering for Push Token');\n\n this.listeners.get(IPCEvents.PushToken)?.add(callback as GenericCallback);\n\n return () => this.listeners.get(IPCEvents.PushToken)?.delete(callback as GenericCallback);\n }\n\n private evaluateContext(context?: AppContext) {\n if (context === 'user') {\n return 'host' as const;\n } else if (context === 'guest') {\n return 'standalone' as const;\n }\n\n return;\n }\n}\n"],"names":["IPCEvents","extendStatics","d","b","p","__extends","__","__values","o","s","m","i","__read","n","r","ar","e","error","__spreadArray","to","from","pack","l","isFunction","value","createErrorClass","createImpl","_super","instance","ctorFunc","UnsubscriptionError","errors","err","arrRemove","arr","item","index","Subscription","initialTeardown","e_1","_a","e_2","_b","_parentage","_parentage_1","_parentage_1_1","parent_1","e_1_1","initialFinalizer","_finalizers","_finalizers_1","_finalizers_1_1","finalizer","execFinalizer","e_2_1","teardown","parent","empty","EMPTY_SUBSCRIPTION","isSubscription","config","timeoutProvider","handler","timeout","args","_i","handle","delegate","reportUnhandledError","noop","errorContext","cb","Subscriber","destination","_this","EMPTY_OBSERVER","next","complete","SafeSubscriber","_bind","bind","fn","thisArg","ConsumerObserver","partialObserver","handleUnhandledError","observerOrNext","context_1","defaultErrorHandler","observable","identity","x","pipeFromArray","fns","input","prev","Observable","subscribe","operator","subscriber","isSubscriber","source","sink","promiseCtor","getPromiseCtor","resolve","reject","Symbol_observable","operations","isObserver","hasLift","operate","init","liftedSource","createOperatorSubscriber","onNext","onComplete","onError","onFinalize","OperatorSubscriber","shouldUnsubscribe","closed_1","ObjectUnsubscribedError","Subject","subject","AnonymousSubject","_c","observer","observers","hasError","isStopped","thrownError","dateTimestampProvider","Action","scheduler","work","state","delay","intervalProvider","AsyncAction","id","_id","_scheduler","_delay","errored","errorValue","actions","Scheduler","schedulerActionCtor","now","AsyncScheduler","SchedulerAction","action","asyncScheduler","async","isScheduler","EmptyError","firstValueFrom","hasConfig","isValidDate","map","project","timer","dueTime","intervalOrScheduler","intervalDuration","due","tap","tapObserver","isUnsub","J","K","w","ee","te","F","H","re","S","A","N","P","L","se","T","_","U","E","u","v","M","z","V","q","Y","W","ie","k","ne","$","le","O","oe","I","ae","R","ce","he","B","ue","de","fe","G","pe","C","ge","ye","y","ve","Me","Ee","j","D","be","me","Q","Re","X","Z","we","SUPPORTED_VERSIONS","IPCManager","logger","__publicField","IpcHelper","context","reply","msg","corelationId","mode","currentContactsOrContactType","contactType","result","InvalidParameterError","contacts","count","isActivity","url","data","contact","callback"],"mappings":"wZAKkB,IAAAA,GAAAA,IAIhBA,EAAA,WAAa,cAKbA,EAAA,UAAY,YAKZA,EAAA,UAAY,aAdIA,IAAAA,GAAA,CAAA,CAAA,ECWdC,EAAgB,SAASC,EAAGC,EAAG,CAC/B,OAAAF,EAAgB,OAAO,gBAClB,CAAE,UAAW,CAAA,aAAgB,OAAS,SAAUC,EAAGC,EAAG,CAAED,EAAE,UAAYC,CAAE,GACzE,SAAUD,EAAGC,EAAG,CAAE,QAASC,KAAKD,EAAO,OAAO,UAAU,eAAe,KAAKA,EAAGC,CAAC,IAAGF,EAAEE,CAAC,EAAID,EAAEC,CAAC,IAC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OAAO,MAAM,4BAA4B,GAE9ClN,EAAA,KAAK,UAAU,IAAIxC,EAAU,SAAS,IAAtC,MAAAwC,EAAyC,IAAIkN,GAEtC,IAAM,OAAA,OAAAlN,EAAA,KAAK,UAAU,IAAIxC,EAAU,SAAS,IAAtC,YAAAwC,EAAyC,OAAOkN,GAC/D,CAEQ,gBAAgBf,EAAsB,CAC5C,GAAIA,IAAY,OACP,MAAA,OACT,GAAWA,IAAY,QACd,MAAA,YAIX,CACF","x_google_ignoreList":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34]}
1
+ {"version":3,"file":"ipc-sdk.umd.cjs","sources":["../src/lib/events.ts","../../../node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.es6.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/isFunction.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/Subscription.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/config.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/noop.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/errorContext.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/Subscriber.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/symbol/observable.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/identity.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/pipe.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/Observable.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/lift.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/Subject.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/scheduler/dateTimestampProvider.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/scheduler/Action.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/scheduler/intervalProvider.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/scheduler/AsyncAction.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/Scheduler.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/scheduler/AsyncScheduler.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/scheduler/async.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/isScheduler.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/EmptyError.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/firstValueFrom.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/util/isDate.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/map.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/observable/timer.js","../../../node_modules/.pnpm/rxjs@7.8.1/node_modules/rxjs/dist/esm5/internal/operators/tap.js","../../ipc-protocol/lib/ipc-protocol.js","../src/lib/sdk.ts"],"sourcesContent":["/**\n * A collection of Events that are used by the `IPC` SDK.\n *\n * @public\n */\nexport const enum IPCEvents {\n /**\n * Event that is fired when the `Host` app requests a badge count update.\n */\n BadgeQuery = 'BADGE QUERY',\n\n /**\n * Event that is fired when the `Host` app sends a LIFECYCLE event.\n */\n Lifecycle = 'LIFECYCLE',\n\n /**\n * Event that is fired when the `Host` app sends a new PUSH TOKEN.\n */\n PushToken = 'PUSH TOKEN'\n}\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\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;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.push(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.push(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\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;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\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; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\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);\r\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); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\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\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\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\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","export function isFunction(value) {\n return typeof value === 'function';\n}\n//# sourceMappingURL=isFunction.js.map","export function createErrorClass(createImpl) {\n var _super = function (instance) {\n Error.call(instance);\n instance.stack = new Error().stack;\n };\n var ctorFunc = createImpl(_super);\n ctorFunc.prototype = Object.create(Error.prototype);\n ctorFunc.prototype.constructor = ctorFunc;\n return ctorFunc;\n}\n//# sourceMappingURL=createErrorClass.js.map","import { createErrorClass } from './createErrorClass';\nexport var UnsubscriptionError = createErrorClass(function (_super) {\n return function UnsubscriptionErrorImpl(errors) {\n _super(this);\n this.message = errors\n ? errors.length + \" errors occurred during unsubscription:\\n\" + errors.map(function (err, i) { return i + 1 + \") \" + err.toString(); }).join('\\n ')\n : '';\n this.name = 'UnsubscriptionError';\n this.errors = errors;\n };\n});\n//# sourceMappingURL=UnsubscriptionError.js.map","export function arrRemove(arr, item) {\n if (arr) {\n var index = arr.indexOf(item);\n 0 <= index && arr.splice(index, 1);\n }\n}\n//# sourceMappingURL=arrRemove.js.map","import { __read, __spreadArray, __values } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { UnsubscriptionError } from './util/UnsubscriptionError';\nimport { arrRemove } from './util/arrRemove';\nvar Subscription = (function () {\n function Subscription(initialTeardown) {\n this.initialTeardown = initialTeardown;\n this.closed = false;\n this._parentage = null;\n this._finalizers = null;\n }\n Subscription.prototype.unsubscribe = function () {\n var e_1, _a, e_2, _b;\n var errors;\n if (!this.closed) {\n this.closed = true;\n var _parentage = this._parentage;\n if (_parentage) {\n this._parentage = null;\n if (Array.isArray(_parentage)) {\n try {\n for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {\n var parent_1 = _parentage_1_1.value;\n parent_1.remove(this);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n else {\n _parentage.remove(this);\n }\n }\n var initialFinalizer = this.initialTeardown;\n if (isFunction(initialFinalizer)) {\n try {\n initialFinalizer();\n }\n catch (e) {\n errors = e instanceof UnsubscriptionError ? e.errors : [e];\n }\n }\n var _finalizers = this._finalizers;\n if (_finalizers) {\n this._finalizers = null;\n try {\n for (var _finalizers_1 = __values(_finalizers), _finalizers_1_1 = _finalizers_1.next(); !_finalizers_1_1.done; _finalizers_1_1 = _finalizers_1.next()) {\n var finalizer = _finalizers_1_1.value;\n try {\n execFinalizer(finalizer);\n }\n catch (err) {\n errors = errors !== null && errors !== void 0 ? errors : [];\n if (err instanceof UnsubscriptionError) {\n errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));\n }\n else {\n errors.push(err);\n }\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_finalizers_1_1 && !_finalizers_1_1.done && (_b = _finalizers_1.return)) _b.call(_finalizers_1);\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n if (errors) {\n throw new UnsubscriptionError(errors);\n }\n }\n };\n Subscription.prototype.add = function (teardown) {\n var _a;\n if (teardown && teardown !== this) {\n if (this.closed) {\n execFinalizer(teardown);\n }\n else {\n if (teardown instanceof Subscription) {\n if (teardown.closed || teardown._hasParent(this)) {\n return;\n }\n teardown._addParent(this);\n }\n (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown);\n }\n }\n };\n Subscription.prototype._hasParent = function (parent) {\n var _parentage = this._parentage;\n return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));\n };\n Subscription.prototype._addParent = function (parent) {\n var _parentage = this._parentage;\n this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;\n };\n Subscription.prototype._removeParent = function (parent) {\n var _parentage = this._parentage;\n if (_parentage === parent) {\n this._parentage = null;\n }\n else if (Array.isArray(_parentage)) {\n arrRemove(_parentage, parent);\n }\n };\n Subscription.prototype.remove = function (teardown) {\n var _finalizers = this._finalizers;\n _finalizers && arrRemove(_finalizers, teardown);\n if (teardown instanceof Subscription) {\n teardown._removeParent(this);\n }\n };\n Subscription.EMPTY = (function () {\n var empty = new Subscription();\n empty.closed = true;\n return empty;\n })();\n return Subscription;\n}());\nexport { Subscription };\nexport var EMPTY_SUBSCRIPTION = Subscription.EMPTY;\nexport function isSubscription(value) {\n return (value instanceof Subscription ||\n (value && 'closed' in value && isFunction(value.remove) && isFunction(value.add) && isFunction(value.unsubscribe)));\n}\nfunction execFinalizer(finalizer) {\n if (isFunction(finalizer)) {\n finalizer();\n }\n else {\n finalizer.unsubscribe();\n }\n}\n//# sourceMappingURL=Subscription.js.map","export var config = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: undefined,\n useDeprecatedSynchronousErrorHandling: false,\n useDeprecatedNextContext: false,\n};\n//# sourceMappingURL=config.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var timeoutProvider = {\n setTimeout: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = timeoutProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) {\n return delegate.setTimeout.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setTimeout.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearTimeout: function (handle) {\n var delegate = timeoutProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=timeoutProvider.js.map","import { config } from '../config';\nimport { timeoutProvider } from '../scheduler/timeoutProvider';\nexport function reportUnhandledError(err) {\n timeoutProvider.setTimeout(function () {\n var onUnhandledError = config.onUnhandledError;\n if (onUnhandledError) {\n onUnhandledError(err);\n }\n else {\n throw err;\n }\n });\n}\n//# sourceMappingURL=reportUnhandledError.js.map","export function noop() { }\n//# sourceMappingURL=noop.js.map","import { config } from '../config';\nvar context = null;\nexport function errorContext(cb) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n var isRoot = !context;\n if (isRoot) {\n context = { errorThrown: false, error: null };\n }\n cb();\n if (isRoot) {\n var _a = context, errorThrown = _a.errorThrown, error = _a.error;\n context = null;\n if (errorThrown) {\n throw error;\n }\n }\n }\n else {\n cb();\n }\n}\nexport function captureError(err) {\n if (config.useDeprecatedSynchronousErrorHandling && context) {\n context.errorThrown = true;\n context.error = err;\n }\n}\n//# sourceMappingURL=errorContext.js.map","import { __extends } from \"tslib\";\nimport { isFunction } from './util/isFunction';\nimport { isSubscription, Subscription } from './Subscription';\nimport { config } from './config';\nimport { reportUnhandledError } from './util/reportUnhandledError';\nimport { noop } from './util/noop';\nimport { nextNotification, errorNotification, COMPLETE_NOTIFICATION } from './NotificationFactories';\nimport { timeoutProvider } from './scheduler/timeoutProvider';\nimport { captureError } from './util/errorContext';\nvar Subscriber = (function (_super) {\n __extends(Subscriber, _super);\n function Subscriber(destination) {\n var _this = _super.call(this) || this;\n _this.isStopped = false;\n if (destination) {\n _this.destination = destination;\n if (isSubscription(destination)) {\n destination.add(_this);\n }\n }\n else {\n _this.destination = EMPTY_OBSERVER;\n }\n return _this;\n }\n Subscriber.create = function (next, error, complete) {\n return new SafeSubscriber(next, error, complete);\n };\n Subscriber.prototype.next = function (value) {\n if (this.isStopped) {\n handleStoppedNotification(nextNotification(value), this);\n }\n else {\n this._next(value);\n }\n };\n Subscriber.prototype.error = function (err) {\n if (this.isStopped) {\n handleStoppedNotification(errorNotification(err), this);\n }\n else {\n this.isStopped = true;\n this._error(err);\n }\n };\n Subscriber.prototype.complete = function () {\n if (this.isStopped) {\n handleStoppedNotification(COMPLETE_NOTIFICATION, this);\n }\n else {\n this.isStopped = true;\n this._complete();\n }\n };\n Subscriber.prototype.unsubscribe = function () {\n if (!this.closed) {\n this.isStopped = true;\n _super.prototype.unsubscribe.call(this);\n this.destination = null;\n }\n };\n Subscriber.prototype._next = function (value) {\n this.destination.next(value);\n };\n Subscriber.prototype._error = function (err) {\n try {\n this.destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n };\n Subscriber.prototype._complete = function () {\n try {\n this.destination.complete();\n }\n finally {\n this.unsubscribe();\n }\n };\n return Subscriber;\n}(Subscription));\nexport { Subscriber };\nvar _bind = Function.prototype.bind;\nfunction bind(fn, thisArg) {\n return _bind.call(fn, thisArg);\n}\nvar ConsumerObserver = (function () {\n function ConsumerObserver(partialObserver) {\n this.partialObserver = partialObserver;\n }\n ConsumerObserver.prototype.next = function (value) {\n var partialObserver = this.partialObserver;\n if (partialObserver.next) {\n try {\n partialObserver.next(value);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n ConsumerObserver.prototype.error = function (err) {\n var partialObserver = this.partialObserver;\n if (partialObserver.error) {\n try {\n partialObserver.error(err);\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n else {\n handleUnhandledError(err);\n }\n };\n ConsumerObserver.prototype.complete = function () {\n var partialObserver = this.partialObserver;\n if (partialObserver.complete) {\n try {\n partialObserver.complete();\n }\n catch (error) {\n handleUnhandledError(error);\n }\n }\n };\n return ConsumerObserver;\n}());\nvar SafeSubscriber = (function (_super) {\n __extends(SafeSubscriber, _super);\n function SafeSubscriber(observerOrNext, error, complete) {\n var _this = _super.call(this) || this;\n var partialObserver;\n if (isFunction(observerOrNext) || !observerOrNext) {\n partialObserver = {\n next: (observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined),\n error: error !== null && error !== void 0 ? error : undefined,\n complete: complete !== null && complete !== void 0 ? complete : undefined,\n };\n }\n else {\n var context_1;\n if (_this && config.useDeprecatedNextContext) {\n context_1 = Object.create(observerOrNext);\n context_1.unsubscribe = function () { return _this.unsubscribe(); };\n partialObserver = {\n next: observerOrNext.next && bind(observerOrNext.next, context_1),\n error: observerOrNext.error && bind(observerOrNext.error, context_1),\n complete: observerOrNext.complete && bind(observerOrNext.complete, context_1),\n };\n }\n else {\n partialObserver = observerOrNext;\n }\n }\n _this.destination = new ConsumerObserver(partialObserver);\n return _this;\n }\n return SafeSubscriber;\n}(Subscriber));\nexport { SafeSubscriber };\nfunction handleUnhandledError(error) {\n if (config.useDeprecatedSynchronousErrorHandling) {\n captureError(error);\n }\n else {\n reportUnhandledError(error);\n }\n}\nfunction defaultErrorHandler(err) {\n throw err;\n}\nfunction handleStoppedNotification(notification, subscriber) {\n var onStoppedNotification = config.onStoppedNotification;\n onStoppedNotification && timeoutProvider.setTimeout(function () { return onStoppedNotification(notification, subscriber); });\n}\nexport var EMPTY_OBSERVER = {\n closed: true,\n next: noop,\n error: defaultErrorHandler,\n complete: noop,\n};\n//# sourceMappingURL=Subscriber.js.map","export var observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();\n//# sourceMappingURL=observable.js.map","export function identity(x) {\n return x;\n}\n//# sourceMappingURL=identity.js.map","import { identity } from './identity';\nexport function pipe() {\n var fns = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n fns[_i] = arguments[_i];\n }\n return pipeFromArray(fns);\n}\nexport function pipeFromArray(fns) {\n if (fns.length === 0) {\n return identity;\n }\n if (fns.length === 1) {\n return fns[0];\n }\n return function piped(input) {\n return fns.reduce(function (prev, fn) { return fn(prev); }, input);\n };\n}\n//# sourceMappingURL=pipe.js.map","import { SafeSubscriber, Subscriber } from './Subscriber';\nimport { isSubscription } from './Subscription';\nimport { observable as Symbol_observable } from './symbol/observable';\nimport { pipeFromArray } from './util/pipe';\nimport { config } from './config';\nimport { isFunction } from './util/isFunction';\nimport { errorContext } from './util/errorContext';\nvar Observable = (function () {\n function Observable(subscribe) {\n if (subscribe) {\n this._subscribe = subscribe;\n }\n }\n Observable.prototype.lift = function (operator) {\n var observable = new Observable();\n observable.source = this;\n observable.operator = operator;\n return observable;\n };\n Observable.prototype.subscribe = function (observerOrNext, error, complete) {\n var _this = this;\n var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);\n errorContext(function () {\n var _a = _this, operator = _a.operator, source = _a.source;\n subscriber.add(operator\n ?\n operator.call(subscriber, source)\n : source\n ?\n _this._subscribe(subscriber)\n :\n _this._trySubscribe(subscriber));\n });\n return subscriber;\n };\n Observable.prototype._trySubscribe = function (sink) {\n try {\n return this._subscribe(sink);\n }\n catch (err) {\n sink.error(err);\n }\n };\n Observable.prototype.forEach = function (next, promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var subscriber = new SafeSubscriber({\n next: function (value) {\n try {\n next(value);\n }\n catch (err) {\n reject(err);\n subscriber.unsubscribe();\n }\n },\n error: reject,\n complete: resolve,\n });\n _this.subscribe(subscriber);\n });\n };\n Observable.prototype._subscribe = function (subscriber) {\n var _a;\n return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);\n };\n Observable.prototype[Symbol_observable] = function () {\n return this;\n };\n Observable.prototype.pipe = function () {\n var operations = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n operations[_i] = arguments[_i];\n }\n return pipeFromArray(operations)(this);\n };\n Observable.prototype.toPromise = function (promiseCtor) {\n var _this = this;\n promiseCtor = getPromiseCtor(promiseCtor);\n return new promiseCtor(function (resolve, reject) {\n var value;\n _this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });\n });\n };\n Observable.create = function (subscribe) {\n return new Observable(subscribe);\n };\n return Observable;\n}());\nexport { Observable };\nfunction getPromiseCtor(promiseCtor) {\n var _a;\n return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;\n}\nfunction isObserver(value) {\n return value && isFunction(value.next) && isFunction(value.error) && isFunction(value.complete);\n}\nfunction isSubscriber(value) {\n return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));\n}\n//# sourceMappingURL=Observable.js.map","import { isFunction } from './isFunction';\nexport function hasLift(source) {\n return isFunction(source === null || source === void 0 ? void 0 : source.lift);\n}\nexport function operate(init) {\n return function (source) {\n if (hasLift(source)) {\n return source.lift(function (liftedSource) {\n try {\n return init(liftedSource, this);\n }\n catch (err) {\n this.error(err);\n }\n });\n }\n throw new TypeError('Unable to lift unknown Observable type');\n };\n}\n//# sourceMappingURL=lift.js.map","import { __extends } from \"tslib\";\nimport { Subscriber } from '../Subscriber';\nexport function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) {\n return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize);\n}\nvar OperatorSubscriber = (function (_super) {\n __extends(OperatorSubscriber, _super);\n function OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) {\n var _this = _super.call(this, destination) || this;\n _this.onFinalize = onFinalize;\n _this.shouldUnsubscribe = shouldUnsubscribe;\n _this._next = onNext\n ? function (value) {\n try {\n onNext(value);\n }\n catch (err) {\n destination.error(err);\n }\n }\n : _super.prototype._next;\n _this._error = onError\n ? function (err) {\n try {\n onError(err);\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._error;\n _this._complete = onComplete\n ? function () {\n try {\n onComplete();\n }\n catch (err) {\n destination.error(err);\n }\n finally {\n this.unsubscribe();\n }\n }\n : _super.prototype._complete;\n return _this;\n }\n OperatorSubscriber.prototype.unsubscribe = function () {\n var _a;\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n var closed_1 = this.closed;\n _super.prototype.unsubscribe.call(this);\n !closed_1 && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this));\n }\n };\n return OperatorSubscriber;\n}(Subscriber));\nexport { OperatorSubscriber };\n//# sourceMappingURL=OperatorSubscriber.js.map","import { createErrorClass } from './createErrorClass';\nexport var ObjectUnsubscribedError = createErrorClass(function (_super) {\n return function ObjectUnsubscribedErrorImpl() {\n _super(this);\n this.name = 'ObjectUnsubscribedError';\n this.message = 'object unsubscribed';\n };\n});\n//# sourceMappingURL=ObjectUnsubscribedError.js.map","import { __extends, __values } from \"tslib\";\nimport { Observable } from './Observable';\nimport { Subscription, EMPTY_SUBSCRIPTION } from './Subscription';\nimport { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';\nimport { arrRemove } from './util/arrRemove';\nimport { errorContext } from './util/errorContext';\nvar Subject = (function (_super) {\n __extends(Subject, _super);\n function Subject() {\n var _this = _super.call(this) || this;\n _this.closed = false;\n _this.currentObservers = null;\n _this.observers = [];\n _this.isStopped = false;\n _this.hasError = false;\n _this.thrownError = null;\n return _this;\n }\n Subject.prototype.lift = function (operator) {\n var subject = new AnonymousSubject(this, this);\n subject.operator = operator;\n return subject;\n };\n Subject.prototype._throwIfClosed = function () {\n if (this.closed) {\n throw new ObjectUnsubscribedError();\n }\n };\n Subject.prototype.next = function (value) {\n var _this = this;\n errorContext(function () {\n var e_1, _a;\n _this._throwIfClosed();\n if (!_this.isStopped) {\n if (!_this.currentObservers) {\n _this.currentObservers = Array.from(_this.observers);\n }\n try {\n for (var _b = __values(_this.currentObservers), _c = _b.next(); !_c.done; _c = _b.next()) {\n var observer = _c.value;\n observer.next(value);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n });\n };\n Subject.prototype.error = function (err) {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.hasError = _this.isStopped = true;\n _this.thrownError = err;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().error(err);\n }\n }\n });\n };\n Subject.prototype.complete = function () {\n var _this = this;\n errorContext(function () {\n _this._throwIfClosed();\n if (!_this.isStopped) {\n _this.isStopped = true;\n var observers = _this.observers;\n while (observers.length) {\n observers.shift().complete();\n }\n }\n });\n };\n Subject.prototype.unsubscribe = function () {\n this.isStopped = this.closed = true;\n this.observers = this.currentObservers = null;\n };\n Object.defineProperty(Subject.prototype, \"observed\", {\n get: function () {\n var _a;\n return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;\n },\n enumerable: false,\n configurable: true\n });\n Subject.prototype._trySubscribe = function (subscriber) {\n this._throwIfClosed();\n return _super.prototype._trySubscribe.call(this, subscriber);\n };\n Subject.prototype._subscribe = function (subscriber) {\n this._throwIfClosed();\n this._checkFinalizedStatuses(subscriber);\n return this._innerSubscribe(subscriber);\n };\n Subject.prototype._innerSubscribe = function (subscriber) {\n var _this = this;\n var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;\n if (hasError || isStopped) {\n return EMPTY_SUBSCRIPTION;\n }\n this.currentObservers = null;\n observers.push(subscriber);\n return new Subscription(function () {\n _this.currentObservers = null;\n arrRemove(observers, subscriber);\n });\n };\n Subject.prototype._checkFinalizedStatuses = function (subscriber) {\n var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;\n if (hasError) {\n subscriber.error(thrownError);\n }\n else if (isStopped) {\n subscriber.complete();\n }\n };\n Subject.prototype.asObservable = function () {\n var observable = new Observable();\n observable.source = this;\n return observable;\n };\n Subject.create = function (destination, source) {\n return new AnonymousSubject(destination, source);\n };\n return Subject;\n}(Observable));\nexport { Subject };\nvar AnonymousSubject = (function (_super) {\n __extends(AnonymousSubject, _super);\n function AnonymousSubject(destination, source) {\n var _this = _super.call(this) || this;\n _this.destination = destination;\n _this.source = source;\n return _this;\n }\n AnonymousSubject.prototype.next = function (value) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);\n };\n AnonymousSubject.prototype.error = function (err) {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);\n };\n AnonymousSubject.prototype.complete = function () {\n var _a, _b;\n (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);\n };\n AnonymousSubject.prototype._subscribe = function (subscriber) {\n var _a, _b;\n return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;\n };\n return AnonymousSubject;\n}(Subject));\nexport { AnonymousSubject };\n//# sourceMappingURL=Subject.js.map","export var dateTimestampProvider = {\n now: function () {\n return (dateTimestampProvider.delegate || Date).now();\n },\n delegate: undefined,\n};\n//# sourceMappingURL=dateTimestampProvider.js.map","import { __extends } from \"tslib\";\nimport { Subscription } from '../Subscription';\nvar Action = (function (_super) {\n __extends(Action, _super);\n function Action(scheduler, work) {\n return _super.call(this) || this;\n }\n Action.prototype.schedule = function (state, delay) {\n if (delay === void 0) { delay = 0; }\n return this;\n };\n return Action;\n}(Subscription));\nexport { Action };\n//# sourceMappingURL=Action.js.map","import { __read, __spreadArray } from \"tslib\";\nexport var intervalProvider = {\n setInterval: function (handler, timeout) {\n var args = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n args[_i - 2] = arguments[_i];\n }\n var delegate = intervalProvider.delegate;\n if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) {\n return delegate.setInterval.apply(delegate, __spreadArray([handler, timeout], __read(args)));\n }\n return setInterval.apply(void 0, __spreadArray([handler, timeout], __read(args)));\n },\n clearInterval: function (handle) {\n var delegate = intervalProvider.delegate;\n return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle);\n },\n delegate: undefined,\n};\n//# sourceMappingURL=intervalProvider.js.map","import { __extends } from \"tslib\";\nimport { Action } from './Action';\nimport { intervalProvider } from './intervalProvider';\nimport { arrRemove } from '../util/arrRemove';\nvar AsyncAction = (function (_super) {\n __extends(AsyncAction, _super);\n function AsyncAction(scheduler, work) {\n var _this = _super.call(this, scheduler, work) || this;\n _this.scheduler = scheduler;\n _this.work = work;\n _this.pending = false;\n return _this;\n }\n AsyncAction.prototype.schedule = function (state, delay) {\n var _a;\n if (delay === void 0) { delay = 0; }\n if (this.closed) {\n return this;\n }\n this.state = state;\n var id = this.id;\n var scheduler = this.scheduler;\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, delay);\n }\n this.pending = true;\n this.delay = delay;\n this.id = (_a = this.id) !== null && _a !== void 0 ? _a : this.requestAsyncId(scheduler, this.id, delay);\n return this;\n };\n AsyncAction.prototype.requestAsyncId = function (scheduler, _id, delay) {\n if (delay === void 0) { delay = 0; }\n return intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay);\n };\n AsyncAction.prototype.recycleAsyncId = function (_scheduler, id, delay) {\n if (delay === void 0) { delay = 0; }\n if (delay != null && this.delay === delay && this.pending === false) {\n return id;\n }\n if (id != null) {\n intervalProvider.clearInterval(id);\n }\n return undefined;\n };\n AsyncAction.prototype.execute = function (state, delay) {\n if (this.closed) {\n return new Error('executing a cancelled action');\n }\n this.pending = false;\n var error = this._execute(state, delay);\n if (error) {\n return error;\n }\n else if (this.pending === false && this.id != null) {\n this.id = this.recycleAsyncId(this.scheduler, this.id, null);\n }\n };\n AsyncAction.prototype._execute = function (state, _delay) {\n var errored = false;\n var errorValue;\n try {\n this.work(state);\n }\n catch (e) {\n errored = true;\n errorValue = e ? e : new Error('Scheduled action threw falsy error');\n }\n if (errored) {\n this.unsubscribe();\n return errorValue;\n }\n };\n AsyncAction.prototype.unsubscribe = function () {\n if (!this.closed) {\n var _a = this, id = _a.id, scheduler = _a.scheduler;\n var actions = scheduler.actions;\n this.work = this.state = this.scheduler = null;\n this.pending = false;\n arrRemove(actions, this);\n if (id != null) {\n this.id = this.recycleAsyncId(scheduler, id, null);\n }\n this.delay = null;\n _super.prototype.unsubscribe.call(this);\n }\n };\n return AsyncAction;\n}(Action));\nexport { AsyncAction };\n//# sourceMappingURL=AsyncAction.js.map","import { dateTimestampProvider } from './scheduler/dateTimestampProvider';\nvar Scheduler = (function () {\n function Scheduler(schedulerActionCtor, now) {\n if (now === void 0) { now = Scheduler.now; }\n this.schedulerActionCtor = schedulerActionCtor;\n this.now = now;\n }\n Scheduler.prototype.schedule = function (work, delay, state) {\n if (delay === void 0) { delay = 0; }\n return new this.schedulerActionCtor(this, work).schedule(state, delay);\n };\n Scheduler.now = dateTimestampProvider.now;\n return Scheduler;\n}());\nexport { Scheduler };\n//# sourceMappingURL=Scheduler.js.map","import { __extends } from \"tslib\";\nimport { Scheduler } from '../Scheduler';\nvar AsyncScheduler = (function (_super) {\n __extends(AsyncScheduler, _super);\n function AsyncScheduler(SchedulerAction, now) {\n if (now === void 0) { now = Scheduler.now; }\n var _this = _super.call(this, SchedulerAction, now) || this;\n _this.actions = [];\n _this._active = false;\n return _this;\n }\n AsyncScheduler.prototype.flush = function (action) {\n var actions = this.actions;\n if (this._active) {\n actions.push(action);\n return;\n }\n var error;\n this._active = true;\n do {\n if ((error = action.execute(action.state, action.delay))) {\n break;\n }\n } while ((action = actions.shift()));\n this._active = false;\n if (error) {\n while ((action = actions.shift())) {\n action.unsubscribe();\n }\n throw error;\n }\n };\n return AsyncScheduler;\n}(Scheduler));\nexport { AsyncScheduler };\n//# sourceMappingURL=AsyncScheduler.js.map","import { AsyncAction } from './AsyncAction';\nimport { AsyncScheduler } from './AsyncScheduler';\nexport var asyncScheduler = new AsyncScheduler(AsyncAction);\nexport var async = asyncScheduler;\n//# sourceMappingURL=async.js.map","import { isFunction } from './isFunction';\nexport function isScheduler(value) {\n return value && isFunction(value.schedule);\n}\n//# sourceMappingURL=isScheduler.js.map","import { createErrorClass } from './createErrorClass';\nexport var EmptyError = createErrorClass(function (_super) { return function EmptyErrorImpl() {\n _super(this);\n this.name = 'EmptyError';\n this.message = 'no elements in sequence';\n}; });\n//# sourceMappingURL=EmptyError.js.map","import { EmptyError } from './util/EmptyError';\nimport { SafeSubscriber } from './Subscriber';\nexport function firstValueFrom(source, config) {\n var hasConfig = typeof config === 'object';\n return new Promise(function (resolve, reject) {\n var subscriber = new SafeSubscriber({\n next: function (value) {\n resolve(value);\n subscriber.unsubscribe();\n },\n error: reject,\n complete: function () {\n if (hasConfig) {\n resolve(config.defaultValue);\n }\n else {\n reject(new EmptyError());\n }\n },\n });\n source.subscribe(subscriber);\n });\n}\n//# sourceMappingURL=firstValueFrom.js.map","export function isValidDate(value) {\n return value instanceof Date && !isNaN(value);\n}\n//# sourceMappingURL=isDate.js.map","import { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nexport function map(project, thisArg) {\n return operate(function (source, subscriber) {\n var index = 0;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n subscriber.next(project.call(thisArg, value, index++));\n }));\n });\n}\n//# sourceMappingURL=map.js.map","import { Observable } from '../Observable';\nimport { async as asyncScheduler } from '../scheduler/async';\nimport { isScheduler } from '../util/isScheduler';\nimport { isValidDate } from '../util/isDate';\nexport function timer(dueTime, intervalOrScheduler, scheduler) {\n if (dueTime === void 0) { dueTime = 0; }\n if (scheduler === void 0) { scheduler = asyncScheduler; }\n var intervalDuration = -1;\n if (intervalOrScheduler != null) {\n if (isScheduler(intervalOrScheduler)) {\n scheduler = intervalOrScheduler;\n }\n else {\n intervalDuration = intervalOrScheduler;\n }\n }\n return new Observable(function (subscriber) {\n var due = isValidDate(dueTime) ? +dueTime - scheduler.now() : dueTime;\n if (due < 0) {\n due = 0;\n }\n var n = 0;\n return scheduler.schedule(function () {\n if (!subscriber.closed) {\n subscriber.next(n++);\n if (0 <= intervalDuration) {\n this.schedule(undefined, intervalDuration);\n }\n else {\n subscriber.complete();\n }\n }\n }, due);\n });\n}\n//# sourceMappingURL=timer.js.map","import { isFunction } from '../util/isFunction';\nimport { operate } from '../util/lift';\nimport { createOperatorSubscriber } from './OperatorSubscriber';\nimport { identity } from '../util/identity';\nexport function tap(observerOrNext, error, complete) {\n var tapObserver = isFunction(observerOrNext) || error || complete\n ?\n { next: observerOrNext, error: error, complete: complete }\n : observerOrNext;\n return tapObserver\n ? operate(function (source, subscriber) {\n var _a;\n (_a = tapObserver.subscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n var isUnsub = true;\n source.subscribe(createOperatorSubscriber(subscriber, function (value) {\n var _a;\n (_a = tapObserver.next) === null || _a === void 0 ? void 0 : _a.call(tapObserver, value);\n subscriber.next(value);\n }, function () {\n var _a;\n isUnsub = false;\n (_a = tapObserver.complete) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n subscriber.complete();\n }, function (err) {\n var _a;\n isUnsub = false;\n (_a = tapObserver.error) === null || _a === void 0 ? void 0 : _a.call(tapObserver, err);\n subscriber.error(err);\n }, function () {\n var _a, _b;\n if (isUnsub) {\n (_a = tapObserver.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver);\n }\n (_b = tapObserver.finalize) === null || _b === void 0 ? void 0 : _b.call(tapObserver);\n }));\n })\n :\n identity;\n}\n//# sourceMappingURL=tap.js.map","var J = Object.defineProperty;\nvar K = (i, t, e) => t in i ? J(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;\nvar m = (i, t, e) => (K(i, typeof t != \"symbol\" ? t + \"\" : t, e), e);\nimport { Subject as X, timer as Z } from \"rxjs\";\nclass h extends Error {\n constructor(e) {\n super(`Incorrect context (${e}). Cannot perform the requested operation.`);\n m(this, \"context\");\n this.context = e;\n }\n}\nclass w extends Error {\n constructor(t, e, r) {\n super(`Invalid parameter (${t}). ${r}`), this.param = t, this.value = e, this.reason = r;\n }\n}\nclass ee extends Error {\n constructor(t, e) {\n super(\n `'streamId' value of \"${t}\" is different from what we expected (\"${e}\")`\n ), this.streamId = t, this.expectedStreamId = e;\n }\n}\nclass te extends Error {\n constructor(t) {\n super(`Invalid version format: ${t}`);\n }\n}\nclass F extends Error {\n constructor(t) {\n super(`${t} needs to be initialized before it can be used.`);\n }\n}\nclass H extends Error {\n constructor(t, e) {\n let r = `Unsupported Protocol ${Array.isArray(t) ? \"versions\" : \"version\"}: (${t}).`;\n e && (r += ` Minimum version supported is ${e}.`), super(r), this.version = t;\n }\n}\nfunction b(i) {\n return typeof i == \"function\";\n}\nfunction re(i) {\n return b(i == null ? void 0 : i.lift);\n}\nfunction S(i) {\n return function(t) {\n if (re(t))\n return t.lift(function(e) {\n try {\n return i(e, this);\n } catch (r) {\n this.error(r);\n }\n });\n throw new TypeError(\"Unable to lift unknown Observable type\");\n };\n}\nvar x = function(i, t) {\n return x = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, r) {\n e.__proto__ = r;\n } || function(e, r) {\n for (var s in r)\n Object.prototype.hasOwnProperty.call(r, s) && (e[s] = r[s]);\n }, x(i, t);\n};\nfunction A(i, t) {\n if (typeof t != \"function\" && t !== null)\n throw new TypeError(\"Class extends value \" + String(t) + \" is not a constructor or null\");\n x(i, t);\n function e() {\n this.constructor = i;\n }\n i.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());\n}\nfunction N(i) {\n var t = typeof Symbol == \"function\" && Symbol.iterator, e = t && i[t], r = 0;\n if (e)\n return e.call(i);\n if (i && typeof i.length == \"number\")\n return {\n next: function() {\n return i && r >= i.length && (i = void 0), { value: i && i[r++], done: !i };\n }\n };\n throw new TypeError(t ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\nfunction P(i, t) {\n var e = typeof Symbol == \"function\" && i[Symbol.iterator];\n if (!e)\n return i;\n var r = e.call(i), s, n = [], o;\n try {\n for (; (t === void 0 || t-- > 0) && !(s = r.next()).done; )\n n.push(s.value);\n } catch (a) {\n o = { error: a };\n } finally {\n try {\n s && !s.done && (e = r.return) && e.call(r);\n } finally {\n if (o)\n throw o.error;\n }\n }\n return n;\n}\nfunction L(i, t, e) {\n if (e || arguments.length === 2)\n for (var r = 0, s = t.length, n; r < s; r++)\n (n || !(r in t)) && (n || (n = Array.prototype.slice.call(t, 0, r)), n[r] = t[r]);\n return i.concat(n || Array.prototype.slice.call(t));\n}\nfunction se(i) {\n var t = function(r) {\n Error.call(r), r.stack = new Error().stack;\n }, e = i(t);\n return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;\n}\nvar T = se(function(i) {\n return function(e) {\n i(this), this.message = e ? e.length + ` errors occurred during unsubscription:\n` + e.map(function(r, s) {\n return s + 1 + \") \" + r.toString();\n }).join(`\n `) : \"\", this.name = \"UnsubscriptionError\", this.errors = e;\n };\n});\nfunction _(i, t) {\n if (i) {\n var e = i.indexOf(t);\n 0 <= e && i.splice(e, 1);\n }\n}\nvar U = function() {\n function i(t) {\n this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;\n }\n return i.prototype.unsubscribe = function() {\n var t, e, r, s, n;\n if (!this.closed) {\n this.closed = !0;\n var o = this._parentage;\n if (o)\n if (this._parentage = null, Array.isArray(o))\n try {\n for (var a = N(o), c = a.next(); !c.done; c = a.next()) {\n var l = c.value;\n l.remove(this);\n }\n } catch (E) {\n t = { error: E };\n } finally {\n try {\n c && !c.done && (e = a.return) && e.call(a);\n } finally {\n if (t)\n throw t.error;\n }\n }\n else\n o.remove(this);\n var u = this.initialTeardown;\n if (b(u))\n try {\n u();\n } catch (E) {\n n = E instanceof T ? E.errors : [E];\n }\n var p = this._finalizers;\n if (p) {\n this._finalizers = null;\n try {\n for (var v = N(p), M = v.next(); !M.done; M = v.next()) {\n var z = M.value;\n try {\n V(z);\n } catch (E) {\n n = n ?? [], E instanceof T ? n = L(L([], P(n)), P(E.errors)) : n.push(E);\n }\n }\n } catch (E) {\n r = { error: E };\n } finally {\n try {\n M && !M.done && (s = v.return) && s.call(v);\n } finally {\n if (r)\n throw r.error;\n }\n }\n }\n if (n)\n throw new T(n);\n }\n }, i.prototype.add = function(t) {\n var e;\n if (t && t !== this)\n if (this.closed)\n V(t);\n else {\n if (t instanceof i) {\n if (t.closed || t._hasParent(this))\n return;\n t._addParent(this);\n }\n (this._finalizers = (e = this._finalizers) !== null && e !== void 0 ? e : []).push(t);\n }\n }, i.prototype._hasParent = function(t) {\n var e = this._parentage;\n return e === t || Array.isArray(e) && e.includes(t);\n }, i.prototype._addParent = function(t) {\n var e = this._parentage;\n this._parentage = Array.isArray(e) ? (e.push(t), e) : e ? [e, t] : t;\n }, i.prototype._removeParent = function(t) {\n var e = this._parentage;\n e === t ? this._parentage = null : Array.isArray(e) && _(e, t);\n }, i.prototype.remove = function(t) {\n var e = this._finalizers;\n e && _(e, t), t instanceof i && t._removeParent(this);\n }, i.EMPTY = function() {\n var t = new i();\n return t.closed = !0, t;\n }(), i;\n}();\nU.EMPTY;\nfunction q(i) {\n return i instanceof U || i && \"closed\" in i && b(i.remove) && b(i.add) && b(i.unsubscribe);\n}\nfunction V(i) {\n b(i) ? i() : i.unsubscribe();\n}\nvar Y = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: void 0,\n useDeprecatedSynchronousErrorHandling: !1,\n useDeprecatedNextContext: !1\n}, W = {\n setTimeout: function(i, t) {\n for (var e = [], r = 2; r < arguments.length; r++)\n e[r - 2] = arguments[r];\n return setTimeout.apply(void 0, L([i, t], P(e)));\n },\n clearTimeout: function(i) {\n var t = W.delegate;\n return ((t == null ? void 0 : t.clearTimeout) || clearTimeout)(i);\n },\n delegate: void 0\n};\nfunction ie(i) {\n W.setTimeout(function() {\n throw i;\n });\n}\nfunction k() {\n}\nfunction ne(i) {\n i();\n}\nvar $ = function(i) {\n A(t, i);\n function t(e) {\n var r = i.call(this) || this;\n return r.isStopped = !1, e ? (r.destination = e, q(e) && e.add(r)) : r.destination = le, r;\n }\n return t.create = function(e, r, s) {\n return new O(e, r, s);\n }, t.prototype.next = function(e) {\n this.isStopped || this._next(e);\n }, t.prototype.error = function(e) {\n this.isStopped || (this.isStopped = !0, this._error(e));\n }, t.prototype.complete = function() {\n this.isStopped || (this.isStopped = !0, this._complete());\n }, t.prototype.unsubscribe = function() {\n this.closed || (this.isStopped = !0, i.prototype.unsubscribe.call(this), this.destination = null);\n }, t.prototype._next = function(e) {\n this.destination.next(e);\n }, t.prototype._error = function(e) {\n try {\n this.destination.error(e);\n } finally {\n this.unsubscribe();\n }\n }, t.prototype._complete = function() {\n try {\n this.destination.complete();\n } finally {\n this.unsubscribe();\n }\n }, t;\n}(U), oe = Function.prototype.bind;\nfunction I(i, t) {\n return oe.call(i, t);\n}\nvar ae = function() {\n function i(t) {\n this.partialObserver = t;\n }\n return i.prototype.next = function(t) {\n var e = this.partialObserver;\n if (e.next)\n try {\n e.next(t);\n } catch (r) {\n R(r);\n }\n }, i.prototype.error = function(t) {\n var e = this.partialObserver;\n if (e.error)\n try {\n e.error(t);\n } catch (r) {\n R(r);\n }\n else\n R(t);\n }, i.prototype.complete = function() {\n var t = this.partialObserver;\n if (t.complete)\n try {\n t.complete();\n } catch (e) {\n R(e);\n }\n }, i;\n}(), O = function(i) {\n A(t, i);\n function t(e, r, s) {\n var n = i.call(this) || this, o;\n if (b(e) || !e)\n o = {\n next: e ?? void 0,\n error: r ?? void 0,\n complete: s ?? void 0\n };\n else {\n var a;\n n && Y.useDeprecatedNextContext ? (a = Object.create(e), a.unsubscribe = function() {\n return n.unsubscribe();\n }, o = {\n next: e.next && I(e.next, a),\n error: e.error && I(e.error, a),\n complete: e.complete && I(e.complete, a)\n }) : o = e;\n }\n return n.destination = new ae(o), n;\n }\n return t;\n}($);\nfunction R(i) {\n ie(i);\n}\nfunction ce(i) {\n throw i;\n}\nvar le = {\n closed: !0,\n next: k,\n error: ce,\n complete: k\n}, he = function() {\n return typeof Symbol == \"function\" && Symbol.observable || \"@@observable\";\n}();\nfunction B(i) {\n return i;\n}\nfunction ue(i) {\n return i.length === 0 ? B : i.length === 1 ? i[0] : function(e) {\n return i.reduce(function(r, s) {\n return s(r);\n }, e);\n };\n}\nvar de = function() {\n function i(t) {\n t && (this._subscribe = t);\n }\n return i.prototype.lift = function(t) {\n var e = new i();\n return e.source = this, e.operator = t, e;\n }, i.prototype.subscribe = function(t, e, r) {\n var s = this, n = fe(t) ? t : new O(t, e, r);\n return ne(function() {\n var o = s, a = o.operator, c = o.source;\n n.add(a ? a.call(n, c) : c ? s._subscribe(n) : s._trySubscribe(n));\n }), n;\n }, i.prototype._trySubscribe = function(t) {\n try {\n return this._subscribe(t);\n } catch (e) {\n t.error(e);\n }\n }, i.prototype.forEach = function(t, e) {\n var r = this;\n return e = G(e), new e(function(s, n) {\n var o = new O({\n next: function(a) {\n try {\n t(a);\n } catch (c) {\n n(c), o.unsubscribe();\n }\n },\n error: n,\n complete: s\n });\n r.subscribe(o);\n });\n }, i.prototype._subscribe = function(t) {\n var e;\n return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(t);\n }, i.prototype[he] = function() {\n return this;\n }, i.prototype.pipe = function() {\n for (var t = [], e = 0; e < arguments.length; e++)\n t[e] = arguments[e];\n return ue(t)(this);\n }, i.prototype.toPromise = function(t) {\n var e = this;\n return t = G(t), new t(function(r, s) {\n var n;\n e.subscribe(function(o) {\n return n = o;\n }, function(o) {\n return s(o);\n }, function() {\n return r(n);\n });\n });\n }, i.create = function(t) {\n return new i(t);\n }, i;\n}();\nfunction G(i) {\n var t;\n return (t = i ?? Y.Promise) !== null && t !== void 0 ? t : Promise;\n}\nfunction pe(i) {\n return i && b(i.next) && b(i.error) && b(i.complete);\n}\nfunction fe(i) {\n return i && i instanceof $ || pe(i) && q(i);\n}\nfunction C(i, t, e, r, s) {\n return new ge(i, t, e, r, s);\n}\nvar ge = function(i) {\n A(t, i);\n function t(e, r, s, n, o, a) {\n var c = i.call(this, e) || this;\n return c.onFinalize = o, c.shouldUnsubscribe = a, c._next = r ? function(l) {\n try {\n r(l);\n } catch (u) {\n e.error(u);\n }\n } : i.prototype._next, c._error = n ? function(l) {\n try {\n n(l);\n } catch (u) {\n e.error(u);\n } finally {\n this.unsubscribe();\n }\n } : i.prototype._error, c._complete = s ? function() {\n try {\n s();\n } catch (l) {\n e.error(l);\n } finally {\n this.unsubscribe();\n }\n } : i.prototype._complete, c;\n }\n return t.prototype.unsubscribe = function() {\n var e;\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n var r = this.closed;\n i.prototype.unsubscribe.call(this), !r && ((e = this.onFinalize) === null || e === void 0 || e.call(this));\n }\n }, t;\n}($);\nfunction d(i, t) {\n return S(function(e, r) {\n var s = 0;\n e.subscribe(C(r, function(n) {\n r.next(i.call(t, n, s++));\n }));\n });\n}\nvar ye = new de(function(i) {\n return i.complete();\n});\nfunction y(i) {\n return i <= 0 ? function() {\n return ye;\n } : S(function(t, e) {\n var r = 0;\n t.subscribe(C(e, function(s) {\n ++r <= i && (e.next(s), i <= r && e.complete());\n }));\n });\n}\nfunction g(i, t) {\n return S(function(e, r) {\n var s = 0;\n e.subscribe(C(r, function(n) {\n return i.call(t, n, s++) && r.next(n);\n }));\n });\n}\nfunction ve(i, t) {\n return t === void 0 && (t = !1), S(function(e, r) {\n var s = 0;\n e.subscribe(C(r, function(n) {\n var o = i(n, s++);\n (o || t) && r.next(n), !o && r.complete();\n }));\n });\n}\nfunction f(i, t, e) {\n var r = b(i) || t || e ? { next: i, error: t, complete: e } : i;\n return r ? S(function(s, n) {\n var o;\n (o = r.subscribe) === null || o === void 0 || o.call(r);\n var a = !0;\n s.subscribe(C(n, function(c) {\n var l;\n (l = r.next) === null || l === void 0 || l.call(r, c), n.next(c);\n }, function() {\n var c;\n a = !1, (c = r.complete) === null || c === void 0 || c.call(r), n.complete();\n }, function(c) {\n var l;\n a = !1, (l = r.error) === null || l === void 0 || l.call(r, c), n.error(c);\n }, function() {\n var c, l;\n a && ((c = r.unsubscribe) === null || c === void 0 || c.call(r)), (l = r.finalize) === null || l === void 0 || l.call(r);\n }));\n }) : B;\n}\nconst Me = /^(\\d+)\\.(\\d+)$/;\nfunction Ee(i) {\n if (typeof i == \"string\") {\n const t = i.match(Me);\n if (t)\n return `${t[1]}.${t[2]}`;\n }\n throw new te(i);\n}\nfunction j(i) {\n const t = Ee(i), [e, r] = t.split(\".\"), [s, n] = [parseInt(e), parseInt(r)];\n return [s, n];\n}\nfunction D(i, t) {\n const [e, r] = j(i), [s, n] = j(t);\n return e < s ? -1 : e > s ? 1 : r < n ? -1 : r > n ? 1 : 0;\n}\nfunction be(i, t) {\n return D(i, t) === 1;\n}\nfunction me(i, t) {\n return D(i, t) >= 0;\n}\nconst Q = \"2.0\";\nclass Re {\n /**\n * Create a new instance of the {@link IpcHelper | IPC Protocol Helper}.\n *\n * @remarks\n * Ideally, you should always have only one instance of the helper created at any point.\n *\n * @param supportedVersions - An array of supported protocol versions to choose from\n * @param logService - An instance of a logging service or utility\n */\n constructor(t, e) {\n /**\n * Protocol version negotiated with the Host app. Will always be from one of the values passed via\n * the constructor.\n */\n m(this, \"negotiatedProtocolVersion\");\n /**\n * The current {@link AppContext} determined after running {@link IpcHelper.determineContext}. The\n * value will be `undefined` until the method is called.\n */\n m(this, \"currentContext\");\n m(this, \"incomingMessages$\");\n m(this, \"inIframe\", !1);\n m(this, \"embeddedResult\");\n m(this, \"iframePort1\");\n m(this, \"iframePort2\");\n if (this.supportedVersions = t, this.logService = e, this.incomingMessages$ = new X(), this.supportedVersions = t.filter((r) => me(r, Q)), !this.supportedVersions.length)\n throw new H(t, Q);\n this.negotiatedProtocolVersion = this.supportedVersions[0], this.embeddedResult = null, this.iframePort2 = null;\n }\n get parent() {\n return window.parent;\n }\n get self() {\n return window.self;\n }\n get frameElement() {\n return window.frameElement;\n }\n // only used by remote party, not used locally\n // @ts-expect-error\n get port1() {\n var t, e;\n return this.inIframe ? this.iframePort1 : (e = (t = window.Acrobits) == null ? void 0 : t.messageChannel) == null ? void 0 : e.port1;\n }\n get port2() {\n var t, e, r, s;\n if (this.inIframe) {\n if (!this.iframePort2)\n throw new F(\"port2\");\n return this.iframePort2;\n } else {\n if (!((e = (t = window.Acrobits) == null ? void 0 : t.messageChannel) != null && e.port2))\n throw new F(\"port2\");\n return (s = (r = window.Acrobits) == null ? void 0 : r.messageChannel) == null ? void 0 : s.port2;\n }\n }\n /**\n * Determines if the app is embedded in a Host app like WebRTC or native CSP clients.\n *\n * @returns Observable with the {@link AppContext} the app is running under. Emits once.\n */\n determineContext() {\n return Z(1e3).pipe(\n d(() => (this.isEmbedded() ? this.currentContext = \"user\" : this.currentContext = \"guest\", this.currentContext)),\n y(1)\n );\n }\n /**\n * Opens the IPC Bridge by sending the {@link HelloMessage} to the host application to initiate\n * handshake and returns an Observable that emits once with the {@link HelloMessageReply}.\n *\n * @returns Observable with a {@link HelloMessageReply} instance. Emits once.\n */\n openBridge() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"HELLO\", e = this.createMessage(t);\n e.protocolVersions = this.supportedVersions, this.logCreated(t, e);\n const r = this.incomingMessages$.pipe(\n g((s) => s.type === t && s.replyTo === e.id),\n d((s) => s),\n f(this.logReceived(t)),\n d((s) => {\n if (this.supportedVersions.some((n) => be(n, s.protocolVersion)))\n throw new H(s.protocolVersion, this.supportedVersions[0]);\n return s;\n }),\n f((s) => {\n this.negotiatedProtocolVersion = s.protocolVersion, this.logService.info(\n `[IPC] Negotiated IPC Protocol Version: ${this.negotiatedProtocolVersion}`\n );\n }),\n y(1)\n );\n return this.logService.debug(`Created ${t} Reply handler`), this.inIframe ? this.createIframeChannel().then(() => this.finishIpcSetup(e)) : this.finishIpcSetup(e), r;\n }\n /**\n * Request an SSO Token from the Host app to authenticate the current user and make further API\n * requests on their behalf.\n *\n * @returns Observable with a {@link TokenMessageReply} instance containing the SSO Token. Emits\n * once.\n */\n requestSSOToken() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"TOKEN\", e = this.createMessage(t);\n this.logCreated(t, e);\n const r = this.incomingMessages$.pipe(\n g((s) => s.type === t && s.replyTo === e.id),\n d((s) => s),\n f(this.logReceived(t)),\n y(1)\n );\n return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;\n }\n /**\n * Sends the {@link JoiningRoomMessage} lifecycle message to the Host application based on the\n * parameters provided.\n *\n * @remarks\n * This message should always be sent whenever joining a conference. The host app can use\n * information provided by the {@link JoiningRoomMessageParams} fields to properly setup it's own\n * state and context if needed.\n *\n * @param params - Parameters object for the {@link JoiningRoomMessage} message.\n *\n * @returns This method returns void.\n */\n sendJoiningRoomMessage(t) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const {\n roomName: e,\n roomInvite: r,\n displayName: s,\n jwtToken: n,\n serverUrl: o,\n region: a,\n joinMicMuted: c,\n joinWithoutCamera: l\n } = t, u = \"JOINING ROOM\", p = this.createMessage(u, !1);\n p.roomName = e, p.jwtToken = n, p.serverUrl = o, p.region = a, p.roomInvite = r, p.joinMicMuted = c ?? !1, p.joinWithoutCamera = l ?? !1, p.displayName = s, this.logCreated(u, p), this.port2.postMessage(p), this.logSent(u, p);\n }\n /**\n * Sends a {@link LeavingRoomMessage} lifecycle message to the Host app.\n *\n * @remarks\n * This message should always be sent whenever leaving a conference so the host app can manage\n * it's state and context properly.\n *\n * @param roomName - The name of the room or Meeting ID we are leaving\n *\n * @returns This method returns void.\n */\n sendLeavingRoomMessage(t) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const e = \"LEAVING ROOM\", r = this.createMessage(e, !1);\n r.roomName = t, this.logCreated(e, r), this.port2.postMessage(r), this.logSent(e, r);\n }\n /**\n * Setup listener for {@link JoinRoomMessage}, which can be sent by a host app to ask the client\n * to join the specified room or meeting.\n *\n * @remarks\n * The client app still needs to follow the standard workflow for joining a conference, including\n * requesting an SSO Token and then sending the {@link JoiningRoomMessage} when joining the\n * conference.\n *\n * @example\n * Here is an example of how a listener can be setup:\n *\n * ```ts\n * const ipcHelper = new IpcHelper(['2.0'], console);\n *\n * const joinRoomSubscription = ipcHelper.onJoinRoomMessage().subscribe((msg) => {\n * // your logic for handling the message goes here\n * });\n *\n * // don't forget to unsubscribe when you're cleaning up\n * joinRoomSubscription.unsubscribe();\n * ```\n *\n * @returns An Observable that emits whenever {@link JoinRoomMessage} is received so it can be\n * subscribed to indefinitely.\n */\n onJoinRoomMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"JOIN ROOM\";\n return this.incomingMessages$.pipe(\n g((e) => e.type === t && e.target === \"client\"),\n d((e) => e),\n f(this.logReceived(t)),\n d((e) => e)\n );\n }\n /**\n * Setup listener for {@link LeaveRoomMessage}, which can be sent by a host app to ask the client\n * to leave the current room or meeting.\n *\n * @remarks\n * The client app still needs to follow the standard workflow for leaving a conference, including\n * sending the {@link LeavingRoomMessage} when leaving the conference.\n *\n * @example\n * Here is an example of how a listener can be setup:\n *\n * ```ts\n * const ipcHelper = new IpcHelper(['2.0'], console);\n *\n * const leaveRoomSubscription = ipcHelper.onLeaveRoomMessage().subscribe((msg) => {\n * // your logic for handling the message goes here\n * });\n *\n * // don't forget to unsubscribe when you're cleaning up\n * leaveRoomSubscription.unsubscribe();\n * ```\n *\n * @returns An Observable that emits whenever {@link LeavingRoomMessage} is received so it can be\n * subscribed to indefinitely.\n */\n onLeaveRoomMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"LEAVE ROOM\";\n return this.incomingMessages$.pipe(\n g((e) => e.type === t && e.target === \"client\"),\n d((e) => e),\n f(this.logReceived(t)),\n d((e) => e)\n );\n }\n /**\n * Setup listener for {@link ConfigMessage}, which is be sent by a host app whenever there is\n * an update to the user preferences or configuration (e.g. new default video camera).\n *\n * @remarks\n * Ideally, the client app should honor the user preferences received via {@link ConfigMessage},\n * however if the client app has it's own preferences for similar options as well, then they\n * should take priority.\n *\n * @example\n * Here is an example of how a listener can be setup:\n *\n * ```ts\n * const ipcHelper = new IpcHelper(['2.0'], console);\n *\n * const configSubscription = ipcHelper.onConfigMessage().subscribe((msg) => {\n * // your logic for handling the configuration goes here\n * });\n *\n * // don't forget to unsubscribe when you're cleaning up\n * configSubscription.unsubscribe();\n * ```\n *\n * @returns An Observable that emits whenever {@link ConfigMessage} is received so it can be\n * subscribed to indefinitely.\n */\n onConfigMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"CONFIG\";\n return this.incomingMessages$.pipe(\n g((e) => e.type === t && e.target === \"client\"),\n d((e) => e),\n f(this.logReceived(t)),\n d((e) => ({\n preferredCameraType: e.preferredCameraType,\n preferredMicType: e.preferredMicType,\n preferredOutputType: e.preferredOutputType,\n preferredCameraDeviceLabel: e.preferredCameraDeviceLabel,\n preferredMicDeviceLabel: e.preferredMicDeviceLabel,\n preferredOutputDeviceLabel: e.preferredOutputDeviceLabel,\n performanceProfile: e.performanceProfile,\n cloudUsername: e.cloudUsername,\n configuredOAuthProviders: e.configuredOAuthProviders,\n locales: e.locales ? [...e.locales] : []\n }))\n );\n }\n sendScreenshareSourceMessage(t) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const e = \"SCREENSHARE SOURCE\", r = this.createMessage(e);\n r.sourceTypes = t, this.logCreated(e, r);\n const s = this.incomingMessages$.pipe(\n g((n) => n.type === e && n.replyTo === r.id),\n d((n) => n),\n f(this.logReceived(e)),\n d((n) => n),\n y(1)\n );\n return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), s;\n }\n layoutChange(t, e, r) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const s = \"LAYOUT CHANGE\";\n let n, o;\n if (e && r ? (n = this.createMessage(s, !1, r), n.result = e) : (n = this.createMessage(s), o = this.incomingMessages$.pipe(\n g((a) => a.type === s && a.replyTo === n.id),\n d((a) => a),\n f(this.logReceived(s)),\n d((a) => a),\n y(1)\n ), this.logService.debug(`Created ${s} Reply handler`)), n.layout = t, this.logCreated(s, n), this.port2.postMessage(n), this.logSent(s, n), o)\n return o;\n }\n /**\n * Setup listener for {@link LayoutChangeMessage}, which can be sent by a host app if it needs to\n * request a layout change on the client.\n *\n * @remarks\n * In some scenarios, a `host` app can request a layout change from the client, so this listener\n * should be setup to support that use case.\n *\n * Whenever such a request is received, the `client` app **SHOULD** respond with a\n * {@link LayoutChangeMessageReply} to acknowledge if it is ready for a change.\n *\n * @example\n * Here is an example of how a listener can be setup:\n *\n * ```ts\n * const ipcHelper = new IpcHelper(['2.0'], console);\n *\n * const layoutChangeSubscription = ipcHelper.onLayoutChangeMessage().subscribe((msg) => {\n * // your logic for handling the request goes here\n *\n * // once you're ready to acknowledge, let the `host` app know\n * ipcHelper.layoutChange(msg.layout, result, msg.id);\n * });\n *\n * // don't forget to unsubscribe when you're cleaning up\n * layoutChangeSubscription.unsubscribe();\n * ```\n *\n * @returns An Observable that emits whenever {@link LayoutChangeMessage} is received so it can be\n * subscribed to indefinitely.\n */\n onLayoutChangeMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"LAYOUT CHANGE\";\n return this.incomingMessages$.pipe(\n g((e) => e.type === t && e.target === \"client\" && e.replyTo === null),\n d((e) => e),\n f(this.logReceived(t)),\n d((e) => e)\n );\n }\n requestOAuthToken(t) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n Array.isArray(t) || (t = [t]);\n const e = \"OAUTH TOKEN\", r = this.createMessage(e);\n r.providerTypes = t, this.logCreated(e, r);\n const s = this.incomingMessages$.pipe(\n g((n) => n.type === e && n.replyTo === r.id),\n d((n) => n),\n f(this.logReceived(e)),\n y(1)\n );\n return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), s;\n }\n openUrl(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"OPEN URL\", s = this.createMessage(r, !1);\n s.url = t, s.data = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);\n }\n selectContacts(t, e, r, s) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n if (e === \"group\" && s === void 0)\n throw new w(\n \"currentContacts\",\n s,\n \"currentContacts is required for group streams\"\n );\n if (e === \"direct\" && s !== void 0)\n throw new w(\n \"currentContacts\",\n s,\n \"currentContacts should not be passed for direct streams\"\n );\n const n = \"SELECT CONTACTS\", o = this.createMessage(n, !0);\n o.streamType = e, o.streamId = t, o.contactType = r, o.currentContacts = s, this.logCreated(n, o);\n const a = this.incomingMessages$.pipe(\n g((c) => c.type === n && c.replyTo === o.id),\n f(this.logReceived(n)),\n // validate if `streamId` is the same as we sent\n d((c) => {\n const l = c;\n if (l.streamId !== t)\n throw new ee(l.streamId, t);\n return e === \"direct\" && l.contacts.length > 1 && (l.contacts = [l.contacts[0]]), l;\n }),\n y(1)\n );\n return this.logService.debug(`Created ${n} Reply handler`), this.port2.postMessage(o), this.logSent(n, o), a;\n }\n /**\n * Request detailed contact information for the given Cloud usernames.\n *\n * @param contacts - Cloud usernames for which we need detailed contact information\n *\n * @returns Observable with a {@link MatchContactsMessageReply} instance containing the requested\n * {@link ContactItem} information. Emits once.\n */\n matchContacts(t) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n if (!t.length)\n throw new w(\"contacts\", t, \"At least one contact is required\");\n const e = \"MATCH CONTACTS\", r = this.createMessage(e);\n r.contacts = [...t], this.logCreated(e, r);\n const s = this.incomingMessages$.pipe(\n g((n) => n.type === e && n.replyTo === r.id),\n f(this.logReceived(e)),\n d((n) => n),\n y(1)\n );\n return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(r), this.logSent(e, r), s;\n }\n /**\n * Setup listener for {@link PushMessageMessage}, which can be sent by a Host app to forward an\n * an Acrobits Messaging message received via push notification to the Client app.\n *\n * @remarks\n * The format of the payload SHOULD be kept the same as the one received from the push\n * notification. The Client app can then use the {@link MessagingNotificationType} to parse the\n * message as needed.\n *\n * @example\n * Here is an example of how a listener can be setup:\n *\n * ```ts\n * const ipcHelper = new IpcHelper(['2.0'], console);\n *\n * const pushMessageSubscription = ipcHelper.onPushMessageMessage().subscribe((msg) => {\n * // your logic for handling the incoming push message goes here\n * });\n *\n * // don't forget to unsubscribe when you're cleaning up\n * pushMessageSubscription.unsubscribe();\n * ```\n *\n * @returns An observable that emits whenever {@link PushMessageMessage} is received so it can be\n * subscribed to indefinitely.\n */\n onPushMessageMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"PUSH MESSAGE\";\n return this.incomingMessages$.pipe(\n g((e) => e.type === t && e.target === \"client\"),\n d((e) => e),\n f(this.logReceived(t))\n );\n }\n /**\n * Sends a {@link PushTokenMessage} to the Host app, to request the Push Token for the current\n * device.\n *\n * @remarks\n * The Host app should reply with a {@link PushTokenMessageReply} containing the Push Token.\n *\n * @returns Observable with a {@link PushTokenMessageReply} instance containing the Push Token.\n */\n requestPushToken() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"PUSH TOKEN\", e = this.createMessage(t);\n this.logCreated(t, e);\n const r = this.incomingMessages$.pipe(\n g((s) => s.type === t && s.replyTo === e.id),\n f(this.logReceived(t)),\n d((s) => s),\n y(1)\n );\n return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), r;\n }\n /**\n * Setup a listener for {@link PushTokenMessage}, which can be sent by a Host app to notify of a\n * new Push Token.\n *\n * @remarks\n * The Host app should send this message whenever the Push Token changes. The Client app should\n * then update it's Push Token accordingly.\n *\n * The Host app does not expect a reply to this message.\n *\n * @example\n * Here is an example of how a listener can be setup:\n *\n * ```ts\n * const ipcHelper = new IpcHelper(['2.0'], console);\n *\n * const pushTokenSubscription = ipcHelper.onPushTokenMessage().subscribe((msg) => {\n * // your logic for handling the push token goes here\n * });\n *\n * // don't forget to unsubscribe when you're cleaning up\n * pushTokenSubscription.unsubscribe();\n * ```\n *\n * @returns An observable that emits whenever {@link PushTokenMessage} is received so it can be\n * subscribed to indefinitely.\n */\n onPushTokenMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"PUSH TOKEN\";\n return this.incomingMessages$.pipe(\n g(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null && e.expectReply === !1\n ),\n d((e) => {\n if (e.pushToken && e.selector && e.appId)\n return e;\n throw new Error(\"PushTokenMessage is missing required PushTokenPayload fields\");\n }),\n f((e) => e.pushToken),\n f(this.logReceived(t))\n );\n }\n /**\n * Setup listener for {@link BadgeQueryMessage}, which can be sent by a `Host` app to request the\n * current badge counter from the `Client` app.\n *\n * @returns An observable that emits whenever {@link BadgeQueryMessage} is received so it can be\n * subscribed to indefinitely.\n */\n onBadgeQueryMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"BADGE QUERY\";\n return this.incomingMessages$.pipe(\n g((e) => e.type === t && e.target === \"client\"),\n d((e) => e),\n f(this.logReceived(t))\n );\n }\n /**\n * Sends a {@link BadgeUpdateMessage} from the `Client` to the `Host` with the current counter.\n *\n * @remarks\n * This message can be sent independently or as a reply to a {@link BadgeQueryMessage} from the\n * Host app. If sending as a reply, the `replyTo` parameter should contain the ID of the original\n * {@link BadgeQueryMessage}.\n *\n * @param count - The counter's value\n * @param isActivity - _Optional_. Whether the counter is for activity or not. Defaults to `false`\n * @param replyTo - _Optional_. The message ID to which the reply should be sent\n */\n sendBadgeUpdateMessage(t, e, r) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const s = \"BADGE UPDATE\", n = this.createMessage(s, !1, r);\n n.count = t, n.activity = e ?? !1, this.logCreated(s, n), this.port2.postMessage(n), this.logSent(s, n);\n }\n /**\n * Sends a {@link LifecycleMessage} to the Host app, to notify it of a lifecycle event.\n *\n * @remarks\n * This message is used to notify the Host app of a lifecycle event, such as the app\n * re-establishing a connection with it's server after being offline or the user joining a call\n * etc.\n *\n * @param eventName - Name of the event to send\n * @param payload - Payload to send with the event\n *\n * @returns This method returns void.\n */\n sendLifecycleMessage(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"LIFECYCLE\", s = this.createMessage(r, !1);\n s.eventName = t, s.payload = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);\n }\n /**\n * Setup listener for {@link LifecycleMessage}, which can be sent by a `Host` app to notify the\n * `Client` app of a lifecycle event.\n *\n * @remarks\n * This message is used to notify the Client app of a lifecycle event, such as the host app\n * re-establishing a connection with it's server after being offline.\n *\n * @returns An observable that emits whenever {@link LifecycleMessage} is received so it can be\n * subscribed to indefinitely.\n */\n onLifecycleMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"LIFECYCLE\";\n return this.incomingMessages$.pipe(\n g((e) => e.type === t && e.target === \"client\"),\n d((e) => e),\n f(this.logReceived(t))\n );\n }\n /**\n * Sends a {@link LogMessage} to the Host app, to add to it's application logs.\n *\n * @remarks\n * The purpose of this message is to provide a generic mechanism of reporting logs for various\n * apps using the IPC protocol.\n *\n * @param level - The {@link LogMessageLevel}\n * @param message - Message to log as a string. This can be a JSON string as well.\n *\n * @returns This method returns void.\n */\n sendLogMessage(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"LOG\", s = this.createMessage(r, !1);\n s.level = t, s.message = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);\n }\n /**\n * Setup listener for {@link RequestLogsMessage}, which can be sent by a `Host` app to request\n * logs from the `Client` app.\n *\n * @remarks\n * The `Host` app can either request that logs be sent as a transfer via the IPC Protocol or\n * trigger a file download by the `Client` by passing a {@link RequestLogsResponseType} in the\n * `responseType` property.\n *\n * @returns An observable that emits whenever a {@link RequestLogsMessage} is received so it can\n * be subscribed to indefinitely.\n */\n onRequestLogsMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"REQUEST LOGS\";\n return this.incomingMessages$.pipe(\n g((e) => e.type === t && e.target === \"client\"),\n d((e) => e),\n f(this.logReceived(t))\n );\n }\n /**\n * Send a {@link ViewTransitionMessage} to the `Host` app, notifying it of a view transition\n * happening in the `Client` app.\n *\n * @remarks\n * A view transition can be either a route navigation, opening or closing a modal, switching tabs\n * or opening a menu.\n *\n * @param transitionType - The kind of transition. Should be of {@link ViewTransitionType}.\n * @param targetView - The name of the view which is being transitioned to.\n *\n * @returns This method returns void.\n */\n sendViewTransitionMessage(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"VIEW TRANSITION\", s = this.createMessage(r, !1);\n s.transitionType = t, s.targetView = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);\n }\n /**\n * Sends a {@link FileRequestMessage} to the Host app, to request a file by it's SHA256 hash.\n *\n * @remarks\n * The initiating party can optionally suggest the other party to limit the size of the chunks\n * sent in the response by setting the `maxChunkSizeInBytes` field. However, this is only a\n * suggestion and the other party can still choose to send chunks of a different size.\n *\n * A client should subscribe to the returned observable to receive the file chunks by setting up\n * listeners for `next`, `error` and `complete` events.\n *\n * @example\n * Here is an example of how a listener can be setup:\n *\n * ```ts\n * const ipcHelper = new IpcHelper(['2.0'], console);\n *\n * ipcManager.sendFileRequestMessage(fileHash, 'attachment', streamId?.toString()).subscribe({\n * next: (msg) => {\n * // next listener. Fired for each chunk.\n * },\n * error: (err) => {\n * // error listener\n * },\n * complete: () => {\n * // complete listener. Fired once all chunks are complete.\n * }\n * });\n * ```\n *\n * @param fileId - An identifier for the file being requested. This should be a UUIDv4 string.\n * @param fileHash - An SHA256 hash of the file being requested.\n * @param intent - The intent of the file request. Can be either `attachment` or `general`.\n * @param streamId - _Optional_. The ID of the message stream to which the files will be attached\n * to. Only used if `intent` is set to `attachment`.\n * @param maxChunkSizeInBytes - _Optional_. The maximum size of the file chunk in bytes. Only\n * used as a suggestion to the other party.\n *\n * @returns An observable that either emits once if the result is `error` or `not found` or\n * emits as many times as the number of chunks in the file if the result is `success`.\n */\n sendFileRequestMessage(t, e, r, s, n) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const o = \"FILE REQUEST\", a = this.createMessage(o);\n if (a.fileId = t, a.fileHash = e.toLowerCase(), a.intent = r, a.maxChunkSizeInBytes = n, r === \"attachment\") {\n if (!s)\n throw new w(\n \"streamId\",\n s,\n \"streamId is required for attachment intent\"\n );\n a.streamId = s;\n }\n this.logCreated(o, a);\n let c = 0;\n const l = this.incomingMessages$.pipe(\n g(\n (u) => u.type === o && u.replyTo === a.id\n ),\n f(this.logReceived(o)),\n f(() => c++),\n d((u) => (u.result === \"success\" && (u.chunkHash = u.chunkHash.toLowerCase(), u.fileHash = u.fileHash.toLowerCase()), u)),\n ve((u) => u.result === \"success\" && c < u.totalChunks, !0)\n );\n return this.port2.postMessage(a), this.logSent(o, a), l;\n }\n /**\n * Sends a {@link FileRequestMessageReply} to the Host app, to reply to a\n * {@link FileRequestMessage} that was received.\n *\n * @remarks\n * The `result` parameter can be either `success`, `error` or `not found` along with the\n * associated {@link FileRequestResult} properties.\n *\n * In case of `success`, multiple `FileRequestMessageReply` messages can be sent to the Host app\n * to send the file chunks. The `chunkHash` field should be set to the SHA256 hash of the chunk\n * being sent.\n *\n * In case of `error` or `not found`, only one `FileRequestMessageReply` message should be sent\n * to the Host app to notify of the result.\n *\n * @param receivedMsg - The original {@link FileRequestMessage} that was received\n * @param result - The result of the file request. Can be either `success`, `error` or `not found`\n * along with the associated {@link FileRequestResult} properties.\n */\n sendFileRequestMessageReply(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"FILE REQUEST\", s = Object.assign(\n e,\n this.createMessage(r, !1, t.id)\n );\n this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);\n }\n /**\n * Setup a listener for {@link FileRequestMessage}, which can be sent by a Host app to request a\n * file by it's SHA256 hash.\n *\n * @remarks\n * The initiating party can optionally suggest the other party to limit the size of the chunks\n * sent in the response by setting the `maxChunkSizeInBytes` field. However, this is only a\n * suggestion and the other party can still choose to send chunks of a different size.\n *\n * @returns An observable that emits whenever {@link FileRequestMessage} is received so it can\n * be subscribed to indefinitely.\n */\n onFileRequestMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"FILE REQUEST\";\n return this.incomingMessages$.pipe(\n g(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null\n ),\n d((e) => (e.fileHash = e.fileHash.toLowerCase(), e)),\n f(this.logReceived(t))\n );\n }\n /**\n * Sends a {@link FileSelectionMessage} to the Host app, to request the user to select on or\n * more files.\n *\n * @remarks\n * The `Host` app should reply with a {@link FileSelectionMessageReply} containing the number of\n * files the user selected along with the file identifiers.\n *\n * @param intent - _Optional_. The intent of the file selection. Can be either `attachment` or\n * `general`. Defaults to `attachment`.\n * @param streamId - _Optional_. The ID of the message stream to which the files will be attached\n * to. Only used if `intent` is set to `attachment`.\n * @param correlationId - _Optional_. The correlation ID of the message the attachments are being\n * selected for. This should be a UUIDv4 string. Only used if `intent` is set to `attachment`.\n * @param maxCount - _Optional_. The maximum number of files the user can select. Defaults to\n * unlimited.\n * @param maxFileSize - _Optional_. The maximum size of the files to select in bytes. Defaults to\n * unlimited.\n * @param mimeTypes - _Optional_. The MIME type of the files to select. Defaults to `*\\/*`.\n *\n * @returns This method returns void.\n */\n sendFileSelectionMessage(t = \"attachment\", e, r, s, n, o) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const a = \"FILE SELECTION\", c = this.createMessage(a);\n if (c.intent = t, c.maxCount = s, c.maxFileSizeInBytes = n, c.mimeTypes = o, t === \"attachment\") {\n if (!e)\n throw new w(\n \"streamId\",\n e,\n \"streamId is required for attachment intent\"\n );\n if (!r)\n throw new w(\n \"correlationId\",\n r,\n \"correlationId is required for attachment intent\"\n );\n c.streamId = e, c.correlationId = r;\n }\n this.logCreated(a, c);\n const l = this.incomingMessages$.pipe(\n g(\n (u) => u.type === a && u.replyTo === c.id\n ),\n d((u) => {\n var p;\n return u.files = (p = u.files) == null ? void 0 : p.map((v) => (v.original.fileHash = v.original.fileHash.toLowerCase(), v.preview && (v.preview.fileHash = v.preview.fileHash.toLowerCase()), v)), u;\n }),\n f(this.logReceived(a)),\n y(1)\n );\n return this.port2.postMessage(c), this.logSent(a, c), l;\n }\n /**\n * Sends a {@link FileDownloadMessage} to the Host app, to request the download of a file.\n *\n * @remarks\n * The file at the specified `url` is encrypted using the provided `key` and the Host app needs\n * to decrypt it.\n *\n * @param url - The URL to download the file from\n * @param key - The decryption key for the file stream\n * @param fileName - The name of the file to download\n * @param mimeType - The MIME type of the file to download\n * @returns An observable which emits a {@link FileDownloadMessageReply} instance containing the\n * file ID and the file size in bytes. Emits once.\n */\n sendFileDownloadMessage(t, e, r, s) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const n = \"FILE DOWNLOAD\", o = this.createMessage(n);\n o.url = t, o.key = e, o.fileName = r, o.mimeType = s, this.logCreated(n, o);\n const a = this.incomingMessages$.pipe(\n g((c) => c.type === n && c.replyTo === o.id),\n f(this.logReceived(n)),\n d((c) => c),\n y(1)\n );\n return this.port2.postMessage(o), this.logSent(n, o), a;\n }\n /**\n * Sends a {@link FileDownloadProgressQueryMessage} to the Host app, to query the progress of a\n * file download that was initiated by a {@link FileDownloadMessage}.\n *\n * @remarks\n * The `fileHash` parameter is the SHA256 hash of the decrypted file, which is used as an\n * identifier for the target file in the `Host` app. The `url` parameter is the URL of the file\n * being downloaded.\n *\n * The `Host` app should reply with a {@link FileDownloadProgressUpdateMessage} containing the\n * progress of the file download.\n *\n * @param correlationId - A UUIDv4 string to identify the message this file was attached to.\n * @param fileHash - SHA256 hash of the decrypted file.\n * @param url - URL of the file being downloaded.\n * @returns An observable which emits a {@link FileDownloadProgressUpdateMessage} instance\n * containing the progress of the file download. Emits once.\n */\n sendFileDownloadProgressQueryMessage(t, e, r) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const s = \"FILE DOWNLOAD PROGRESS QUERY\", n = this.createMessage(\n s,\n !0\n );\n n.correlationId = t, n.fileHash = e.toLowerCase(), n.url = r, this.logCreated(s, n);\n const o = this.incomingMessages$.pipe(\n g(\n (a) => a.type === \"FILE DOWNLOAD PROGRESS UPDATE\" && a.replyTo === n.id\n ),\n f(this.logReceived(s)),\n d((a) => (a.fileHash && (a.fileHash = a.fileHash.toLowerCase()), a)),\n y(1)\n );\n return this.port2.postMessage(n), this.logSent(s, n), o;\n }\n /**\n * Setup listener for {@link FileDownloadProgressQueryMessage}, which can be sent by a `Host` app\n * to update the progress of a file download which was initiated by a {@link FileOpenMessage}.\n *\n * @returns An observable which emits a {@link FileDownloadProgressUpdateMessage} instance\n * containing the progress of the file download. Emits once.\n */\n onFileDownloadProgressUpdateMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"FILE DOWNLOAD PROGRESS UPDATE\";\n return this.incomingMessages$.pipe(\n g(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null\n ),\n d((e) => (e.fileHash && (e.fileHash = e.fileHash.toLowerCase()), e)),\n f(this.logReceived(t))\n );\n }\n /**\n * Sends a {@link FileUploadProgressQueryMessage} to the Host app, to query the progress of a file\n * upload.\n *\n * @remarks\n * The `host` app should reply with a {@link FileUploadProgressUpdateMessage} containing the\n * progress of the file upload.\n *\n * @param correlationId - A UUIDv4 string to identify the message this file was attached to.\n * @param fileHash - SHA256 hash of the decrypted file.\n * @param fileId - ID of the original file being uploaded.\n * @returns An observable which emits a {@link FileUploadProgressUpdateMessage} instance\n * containing the progress of the file upload. Emits once.\n */\n sendFileUploadProgressQueryMessage(t, e, r) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const s = \"FILE UPLOAD PROGRESS QUERY\", n = this.createMessage(\n s,\n !0\n );\n n.correlationId = t, n.fileHash = e.toLowerCase(), n.fileId = r, this.logCreated(s, n);\n const o = this.incomingMessages$.pipe(\n g(\n (a) => a.type === \"FILE DOWNLOAD PROGRESS UPDATE\" && a.replyTo === n.id\n ),\n f(this.logReceived(s)),\n d((a) => (a.fileHash && (a.fileHash = a.fileHash.toLowerCase()), a)),\n y(1)\n );\n return this.port2.postMessage(n), this.logSent(s, n), o;\n }\n /**\n * Setup listener for {@link FileUploadProgressQueryMessage}, which can be sent by a `Host` app to\n * update the progress of a file upload.\n *\n * @remarks\n * The `progressInBytesSent` and `fileSize` fields contain the combined size of the original file\n * and any preview that was generated.\n *\n * @returns An observable which emits a {@link FileUploadProgressUpdateMessage} instance\n * containing the progress of the file upload. Emits once.\n */\n onFileUploadProgressUpdateMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"FILE UPLOAD PROGRESS UPDATE\";\n return this.incomingMessages$.pipe(\n g(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null\n ),\n d((e) => (e.fileHash && (e.fileHash = e.fileHash.toLowerCase()), e)),\n f(this.logReceived(t))\n );\n }\n /**\n * Sends a {@link FileOpenMessage} to the Host app, to try and open a file the device may already\n * have in it's storage.\n *\n * @remarks\n * The `fileHash` parameter is the SHA256 hash of the decrypted file, which is used as an\n * identifier for the target file in the `Host` app as well as to verify the integrity of the\n * file.\n *\n * @param fileHash - The SHA256 hash of the file to open.\n * @param fileName - _Optional_. The name of the file to open.\n * @param streamId - _Optional_. The ID of the message stream from which the file is opened from.\n * @param url - _Optional_. URL from where the host can download the file if it isn't in storage.\n * @param correlationId - _Optional_. Correlation ID of the message this file was attached to.\n * @param key - _Optional_. Key used to encrypt the original attachment.\n * @param sender - _Optional_. The {@link ContactItem} of the sender of the file.\n *\n * @returns An observable which emits a {@link FileOpenMessageReply} instance containing the\n * result of the request. Emits once.\n */\n sendFileOpenMessage(t, e, r, s, n, o, a) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const c = \"FILE OPEN\", l = this.createMessage(c, !0);\n l.fileHash = t.toLowerCase(), l.fileName = e, l.streamId = r, l.url = s, l.correlationId = n, l.key = o, l.sender = a, this.logCreated(c, l);\n const u = this.incomingMessages$.pipe(\n g((p) => p.type === c && p.replyTo === l.id),\n f(this.logReceived(c)),\n d((p) => p),\n y(1)\n );\n return this.port2.postMessage(l), this.logSent(c, l), u;\n }\n /**\n * Sends a {@link CancelFileOpenMessage} to the Host app, to cancel opening or download of a file\n * that was initiated by a {@link FileOpenMessage} previously.\n *\n * @param correlationId - UUIDv4 string to identify the message this file was attached to.\n * @param fileHash - SHA256 hash of the file to cancel opening.\n * @param url - URL of the file to cancel download.\n */\n sendCancelFileOpenMessage(t, e, r) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const s = \"CANCEL FILE OPEN\", n = this.createMessage(s, !1);\n n.correlationId = t, n.fileHash = e.toLowerCase(), n.url = r, this.logCreated(s, n), this.port2.postMessage(n), this.logSent(s, n);\n }\n /**\n * Sends a {@link FileRemoveMessage} to the Host app, to request removal of a file from the\n * device's storage.\n *\n * @remarks\n * The file is identified by it's SHA256 hash. The Host app would reply with a\n * {@link FileRemoveMessageReply} containing the result of the request. In case the\n * file is not found, the `host` app should reply with `success` as well.\n *\n * @param hash - An SHA256 hash of the file\n * @param streamId - _Optional_. The ID of the message stream from which the file is removed from.\n *\n * @returns An observable which emits a {@link FileRemoveMessageReply} with the result of the\n * request. Emits once.\n */\n sendFileRemoveMessage(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"FILE REMOVE\", s = this.createMessage(r, !0);\n s.hash = t.toLowerCase(), s.streamId = e, this.logCreated(r, s);\n const n = this.incomingMessages$.pipe(\n g((o) => o.type === r && o.replyTo === s.id),\n f(this.logReceived(r)),\n d((o) => o),\n y(1)\n );\n return this.port2.postMessage(s), this.logSent(r, s), n;\n }\n /**\n * Sends a {@link AppResetMessage} to the Host app, to request logging out the user and resetting\n * the app to it's initial state.\n *\n * @remarks\n * This message is used to request the Host app to log out the user and reset the app to it's\n * initial state. This is useful when the user wants to log out of the app and log in with a\n * different account.\n *\n * The Host can confirm the user's intention to reset the app by displaying a confirmation dialog.\n *\n * @returns This method returns void.\n */\n sendAppResetMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"APP RESET\", e = this.createMessage(t, !1);\n this.logCreated(t, e), this.port2.postMessage(e), this.logSent(t, e);\n }\n /**\n * Sends a {@link MessageSentMessage} to the Host app, to notify it of a message that has been\n * sent to the specified stream.\n *\n * @remarks\n * @remarks\n * The `streamId` field is used to specify the ID of the message stream the message is being sent\n * to. The `correlationId` field is used to identify the message being composed and as an\n * idempotency key.\n *\n * The `host` app can use the `correlationId` to identify any attachments associated with the\n * message in it's storage\n *\n * @param streamId - ID of the stream the message was sent to.\n * @param correlationId - Correlation ID of the message that was sent.\n *\n * @returns This method returns void.\n */\n sendMessageSentMessage(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"MESSAGE SENT\", s = this.createMessage(r, !1);\n s.streamId = t, s.correlationId = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);\n }\n /**\n * Sends a {@link SendMessageMessage} to the Host app, to send a message to the specified stream.\n *\n * @param streamId - ID of the stream the message is being sent to.\n * @param correlationId - Correlation ID of the message being sent.\n * @param body - The body of the message.\n * @param messageType - The type of the message. Defaults to `TEXT`.\n * @param mentions - _Optional_. A list of mentions in the message.\n * @param attachments - _Optional_. A list of file IDs of the attachments being sent with the\n * message.\n * @param relatedMessageId - _Optional_. The ID of the related message in case `messageType` is\n * `REPLY` or `UPDATE`.\n * @param setCursors - _Optional_. Whether to set the cursors for the message. Defaults to `true`.\n * @param threadId - _Optional_. The ID of the thread the message is being sent to.\n *\n * @returns An observable which emits a {@link SendMessageMessageReply} instance containing the\n * result of the request. Emits once.\n */\n sendSendMessageMessage(t, e, r, s = \"TEXT\", n, o, a, c = !0, l) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const u = \"SEND MESSAGE\", p = this.createMessage(u, !0);\n p.streamId = t, p.correlationId = e, p.body = r, p.messageType = s, p.mentions = n ?? [], p.attachments = (o == null ? void 0 : o.map((M) => M.toLowerCase())) ?? [], p.relatedMessageId = a, p.setCursors = c, p.threadId = l, this.logCreated(u, p);\n const v = this.incomingMessages$.pipe(\n g((M) => M.type === u && M.replyTo === p.id),\n f(this.logReceived(u)),\n d((M) => M),\n y(1)\n );\n return this.port2.postMessage(p), this.logSent(u, p), v;\n }\n /**\n * Sends a {@link CancelSendMessageMessage} to the Host app, to cancel a message that was being\n * sent to the specified stream.\n *\n * @param streamId - ID of the stream the message was being sent to.\n * @param correlationId - Correlation ID of the message that was being sent.\n *\n * @returns This method returns void.\n */\n sendCancelSendMessageMessage(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"CANCEL SEND MESSAGE\", s = this.createMessage(r, !1);\n s.streamId = t, s.correlationId = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);\n }\n /**\n * Sends a {@link MessageDeletedMessage} to the Host app, to notify deletion of a message from the\n * specified stream.\n *\n * @param correlationId - UUIDv4 string of the message to be deleted.\n * @param streamId - ID of the stream the message was sent to.\n */\n sendMessageDeletedMessage(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"MESSAGE DELETED\", s = this.createMessage(r, !1);\n s.correlationId = t, s.streamId = e, this.logCreated(r, s), this.port2.postMessage(s), this.logSent(r, s);\n }\n /**\n * Sends a {@link SendMessageStatusQueryMessage} to the Host app, to query the status of a message\n * that was sent via a {@link SendMessageMessage}.\n *\n * @remarks\n * This message expects a {@link SendMessageStatusUpdateMessage} in response.\n *\n * @param correlationId - A UUIDv4 string to identify the message that was sent.\n * @param streamId - The ID of the message stream the message was sent to.\n *\n * @returns An observable which emits a {@link SendMessageStatusUpdateMessage} instance containing\n * the status of the message. Emits once.\n */\n sendSendMessageStatusQueryMessage(t, e) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const r = \"SEND MESSAGE STATUS QUERY\", s = this.createMessage(r, !0);\n s.correlationId = t, s.streamId = e, this.logCreated(r, s);\n const n = this.incomingMessages$.pipe(\n g(\n (o) => o.type === \"SEND MESSAGE STATUS UPDATE\" && o.replyTo === s.id\n ),\n f(this.logReceived(r)),\n d((o) => o),\n y(1)\n );\n return this.port2.postMessage(s), this.logSent(r, s), n;\n }\n /**\n * Setup a listener for {@link SendMessageStatusUpdateMessage}, which can be sent by a Host app to\n * notify the `Client` app of the status of a message that was sent via a\n * {@link SendMessageMessage}.\n *\n * @returns An observable that emits whenever a {@link SendMessageStatusUpdateMessage} is received\n */\n onSendMessageStatusUpdateMessage() {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const t = \"SEND MESSAGE STATUS UPDATE\";\n return this.incomingMessages$.pipe(\n g((e) => e.type === t && e.target === \"client\" && e.replyTo === null),\n d((e) => e),\n f(this.logReceived(t))\n );\n }\n /**\n * Sends a {@link SipCallMessage} to the Host app to initiate a SIP call between the current user\n * and the callee.\n *\n * @param contact - The {@link ContactItem} for the callee.\n */\n sendSipCallMessage(t) {\n if (!this.isEmbedded())\n throw new h(this.currentContext);\n const e = \"SIP CALL\", r = this.createMessage(e, !1);\n r.contact = t, this.logCreated(e, r), this.port2.postMessage(r), this.logSent(e, r);\n }\n /**\n * Checks if the client app is either embedded in an iframe or in a native webview.\n *\n * @internal\n *\n * @returns `true` if the client app is embedded, `false` otherwise.\n */\n isEmbedded() {\n if (this.embeddedResult !== null)\n return this.embeddedResult;\n let t = !1;\n return this.logService.debug(\"Checking if running in iframe...\"), t = !!this.frameElement, t || (t = this.self !== this.parent), t ? (this.logService.debug(\"In iframe\"), this.inIframe = !0, this.embeddedResult = !0, !0) : (this.logService.debug(\"Not in iframe\"), this.logService.debug(\"Checking if running in native app...\"), !t && (t = !!window.Acrobits, t) ? (this.logService.debug(\"In native app\"), this.embeddedResult = !0, t) : (this.logService.debug(\"Not running in native app\"), this.embeddedResult = !1, this.embeddedResult));\n }\n /**\n * Compares the negotiated protocol version with the provided version.\n *\n * @remarks\n * This method is used to compare the negotiated protocol version with the provided version. This\n * is useful when you want to check if the client app supports a certain feature or not.\n *\n * @example\n * Here is an example of how you can use this method to check if the client app supports\n * {@link ViewTransitionMessage}:\n *\n * ```ts\n * const ipcHelper = new IpcHelper(['2.0'], console);\n *\n * const supportsViewTransition = ipcHelper.compareVersion('2.0') >= 0;\n * ```\n *\n * @param version - The version to compare against\n * @returns Returns the result of a comparison between the negotiated protocol version and the\n * provided version. Returns `0` if the versions are equal, `-1` if the negotiated version is\n * lower than the provided version and `1` if the negotiated version is higher than the provided\n * version.\n */\n compareVersion(t) {\n return D(this.negotiatedProtocolVersion, t);\n }\n logReceived(t, e) {\n e && we(e) && (e = { ...e, data: \"...\" });\n const r = (s) => this.logService.debug(`[IPC] Received ${t} message`, s);\n return e && r(e), r;\n }\n logSent(t, e) {\n e.type === \"FILE REQUEST\" && e.result === \"success\" && (e = { ...e, data: \"...\" }), this.logService.debug(`[IPC] Sent ${t} message`, e);\n }\n logCreated(t, e) {\n e.type === \"FILE REQUEST\" && e.result === \"success\" && (e = { ...e, data: \"...\" }), this.logService.debug(`[IPC] Created ${t} message`, e);\n }\n async createIframeChannel() {\n return new Promise((t) => {\n const e = (r) => {\n r.data === \"message channel port\" && (this.iframePort2 = r.ports[0], this.self.removeEventListener(\"message\", e), t());\n };\n this.self.addEventListener(\"message\", e), this.parent.postMessage(\"get channel\", \"*\");\n });\n }\n finishIpcSetup(t) {\n this.logService.debug(\"Registering listener on port2...\"), this.port2.addEventListener(\"message\", this.handleIpcMessage.bind(this)), this.port2.start(), this.logService.debug(\"Started listening on port2\"), this.port2.postMessage(t), this.logSent(\"HELLO\", t);\n }\n handleIpcMessage(t) {\n const { data: e } = t;\n !e.id || e.target !== \"client\" || this.incomingMessages$.next(e);\n }\n createMessage(t, e = !0, r) {\n return {\n type: t,\n id: this.generateId(),\n target: \"host\",\n expectReply: e,\n replyTo: r ?? null\n };\n }\n generateId(t = 8, e = !1) {\n let r = \"1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM\";\n const s = [];\n e && (r = r.substr(0, r.indexOf(\"Q\")));\n for (let n = 0; n < t; n++)\n s.push(r[Math.floor(Math.random() * r.length)]);\n return s.join(\"\");\n }\n}\nfunction we(i) {\n return i.type === \"FILE REQUEST\" && i.replyTo !== null;\n}\nexport {\n h as InvalidContextError,\n w as InvalidParameterError,\n ee as InvalidStreamIdError,\n te as InvalidVersionFormatError,\n Re as IpcHelper,\n F as MessagePortNotInitializedError,\n H as UnsupportedVersionError\n};\n","import {\n ContactType,\n InvalidParameterError,\n IpcHelper,\n type AppContext,\n type ContactItem,\n type HostType,\n type IpcProtocolVersion\n} from '@acrobits/ipc-protocol';\nimport { type ILogger } from '@acrobits/log-helper';\nimport { firstValueFrom } from 'rxjs';\nimport { map, tap } from 'rxjs/operators';\nimport { UnsubscribeCallback } from './UnsubscribeCallback.ts';\nimport { IPCEvents } from './events.ts';\n\nconst SUPPORTED_VERSIONS: IpcProtocolVersion[] = ['2.0'];\n\ntype GenericCallback = (...args: unknown[]) => void;\n\n/**\n * A class that manages the IPC communication between the `Client` and the `Host`.\n *\n * @remarks\n * Ideally, there should only be one instance of the IPCManager in the app. It is recommended to\n * create the instance as a singleton and use it throughout the app.\n *\n * @public\n */\nexport default class IPCManager {\n /**\n * The type of the `Host` app the `Client` is embedded in.\n */\n host?: HostType;\n\n /**\n * The cloud ID of the `Host` app the `Client` is embedded in.\n */\n cloudId?: string;\n\n private logger: ILogger;\n private helper: IpcHelper;\n\n private listeners: Map<IPCEvents, Set<GenericCallback>>;\n\n /**\n * Returns whether the app is running inside a native WebView (`host` context) or as a\n * `standalone` app.\n */\n get context() {\n return this.evaluateContext(this.helper.currentContext);\n }\n\n /**\n * Determines if the app is connected to a `Host` app.\n */\n get isConnected() {\n return !!(this.helper.currentContext === 'user' && this.host && this.cloudId);\n }\n\n /**\n * The negotiated IPC protocol version.\n */\n get negotiatedVersion() {\n return this.helper.negotiatedProtocolVersion;\n }\n\n /**\n * A class that manages the IPC communication between the `Client` and the `Host`.\n *\n * @remarks\n * Ideally, there should only be one instance of the IPCManager in the app. It is recommended to\n * create the instance as a singleton and use it throughout the app.\n *\n * @param logger - An optional logger instance to use for logging. If not provided, a default logger\n * will be used.\n */\n constructor(logger?: ILogger) {\n this.logger = logger ?? console;\n this.helper = new IpcHelper(SUPPORTED_VERSIONS, this.logger);\n\n this.listeners = new Map();\n this.listeners.set(IPCEvents.BadgeQuery, new Set());\n this.listeners.set(IPCEvents.Lifecycle, new Set());\n this.listeners.set(IPCEvents.PushToken, new Set());\n }\n\n /**\n * Determines if the app is embedded in a Host app or native CSP clients.\n *\n * @returns A promise with {@link IPCContext} the app is running under.\n */\n async determineContext() {\n const context = await firstValueFrom(this.helper.determineContext(), {\n defaultValue: 'guest' as AppContext\n });\n\n return this.evaluateContext(context);\n }\n\n /**\n * Initiates the IPC handshake with the `Host` app.\n */\n initiateConnection() {\n return firstValueFrom(\n this.helper.openBridge().pipe(\n tap((reply) => {\n // now that the bridge is open, register receive-only listeners\n this.helper.onBadgeQueryMessage().subscribe((msg) => {\n this.logger.debug('Received Badge Query: ', msg);\n\n for (const cb of this.listeners.get(IPCEvents.BadgeQuery)?.values() ?? []) {\n cb();\n }\n });\n\n this.helper.onLifecycleMessage().subscribe((msg) => {\n this.logger.debug('Received Lifecycle Event: ', msg);\n\n for (const cb of this.listeners.get(IPCEvents.Lifecycle)?.values() ?? []) {\n cb(msg.eventName, msg.payload);\n }\n });\n\n this.helper.onPushTokenMessage().subscribe((msg) => {\n this.logger.debug('Received Push Token: ', msg);\n\n for (const cb of this.listeners.get(IPCEvents.PushToken)?.values() ?? []) {\n cb(msg.pushToken, msg.appId, msg.selector);\n }\n });\n\n this.cloudId = reply.cloudId;\n this.host = reply.host;\n }),\n map(() => {\n return;\n })\n )\n );\n }\n\n /**\n * Requests the `Host` app to open the contact selection UI.\n *\n * @remarks\n * When requesting a `single` contact, the `Host` app will return immediately\n * after contact selection.\n *\n * @param corelationId - An identifier for the message stream\n * @param mode - _Optional_. Whether to allow `single` or `multi` contact selection.\n * @param contactType - _Optional_. The type of contacts to be selected. This can be either\n * `cloudUsername` or `uri`. Defaults to `cloudUsername`.\n *\n * @returns A collection of {@link ContactItem} objects which the user selected along with the\n * `corelationId`.\n */\n selectContacts(\n corelationId: number,\n mode?: 'single',\n contactType?: ContactType\n ): Promise<ContactItem[]>;\n\n /**\n * Requests the `Host` app to open the contact selection UI.\n *\n * @remarks\n * When requesting a `multi` contact, the user will have to manually close the contact selection\n * UI. The `Host` app will return the selected contacts when the user closes the UI.\n *\n * When requesting a `multi` contact, the `currentContacts` parameter is required. This will\n * be used to highlight the contacts that are already selected.\n *\n * @param corelationId - An identifier for the message stream\n * @param mode - Whether to allow `single` or `multi` contact selection.\n * @param currentContacts - A list of {@link ContactItem} objects that are currently selected.\n * This is used to highlight the current contacts from the selection UI.\n * @param contactType - _Optional_. The type of contacts to be selected. This can be either\n * `cloudUsername` or `uri`. Defaults to `cloudUsername`.\n *\n * @returns A collection of {@link ContactItem} objects which the user selected along with the\n * `corelationId`.\n */\n selectContacts(\n corelationId: number,\n mode: 'multi',\n currentContacts: ContactItem[],\n contactType?: ContactType\n ): Promise<ContactItem[]>;\n selectContacts(\n corelationId: number,\n mode?: 'single' | 'multi',\n currentContactsOrContactType?: ContactItem[] | ContactType,\n contactType?: ContactType\n ) {\n this.logger.debug('Selecting Contacts: ', ...arguments);\n\n let result: ReturnType<IpcHelper['selectContacts']> | undefined = undefined;\n\n if (mode === 'multi') {\n if (!currentContactsOrContactType || !Array.isArray(currentContactsOrContactType)) {\n throw new InvalidParameterError(\n 'currentContacts',\n currentContactsOrContactType,\n 'currentContacts is required for group streams'\n );\n }\n\n if (!contactType) {\n contactType = 'cloudUsername';\n }\n\n result = this.helper.selectContacts(\n corelationId.toString(),\n 'group',\n contactType,\n currentContactsOrContactType\n );\n } else {\n if (!currentContactsOrContactType) {\n contactType = 'cloudUsername';\n } else {\n contactType = currentContactsOrContactType as ContactType;\n }\n\n result = this.helper.selectContacts(corelationId.toString(), 'direct', contactType);\n }\n\n return firstValueFrom(result.pipe(map((reply) => reply.contacts)));\n }\n\n /**\n * Matches batch of {@link ContactItem} objects against the Host's contact list to fetch detailed\n * contact information.\n *\n * @param contacts - List of {@link ContactItem} collection to match against the Host's contact\n * list.\n * @returns A collection of {@link DetailedContactItem} objects which were matched against the\n * Host's contact list.\n */\n matchContacts(contacts: ContactItem[]) {\n this.logger.debug('Match Contacts: ', contacts);\n return firstValueFrom(this.helper.matchContacts(contacts).pipe(map((reply) => reply.contacts)));\n }\n\n /**\n * Requests the `Host` app to provide the Push Token for the current device.\n *\n * @returns A promise with the Push Token as `string`.\n */\n requestPushToken() {\n this.logger.debug('Requesting Push Token');\n return firstValueFrom(this.helper.requestPushToken().pipe(map((reply) => reply.pushToken)));\n }\n\n /**\n * Sends the current badge count to the `Host` app.\n *\n * @param count - The count to update the badge to.\n * @param isActivity - _Optional_. Whether the update is for an activity instead of a badge.\n */\n badgeUpdate(count: number, isActivity = false) {\n this.logger.debug(`Sending Badge Update, count: ${count}, activity: ${isActivity}`);\n this.helper.sendBadgeUpdateMessage(count, isActivity);\n }\n\n /**\n * Requests the `Host` app to reset the app and log out the user.\n *\n * @remarks\n * For added security, the Host can confirm the user's intention to reset the app by displaying\n * a confirmation dialog. The user can decide to cancel the reset operation.\n */\n requestAppReset() {\n this.logger.debug('Requesting App Reset');\n this.helper.sendAppResetMessage();\n }\n\n /**\n * Requests the `Host` app to open the given URL in an external browser.\n *\n * @remarks\n * Any additional data to be posted alongside the URL is included with the `data` parameter.\n *\n * @param url - URL to open in the external browser\n * @param data - _Optional_. Any additional data to be sent along with the URL\n */\n openUrl<TData>(url: string, data?: TData) {\n this.logger.debug('Opening URL: ', url);\n this.helper.openUrl(url, data);\n }\n\n /**\n * Initiates a SIP call to the given {@link ContactItem}.\n *\n * @param contact - {@link ContactItem} for the callee.\n */\n sipCall(contact: ContactItem) {\n this.logger.debug('Initiating SIP Call: ', contact);\n this.helper.sendSipCallMessage(contact);\n }\n\n /**\n * Registers a callback to be invoked when a {@link IPCEvents.BadgeQuery} is received.\n *\n * @param callback - A callback function to be invoked when a {@link IPCEvents.BadgeQuery} event\n * is received.\n * @returns An unsubscribe callback to remove the listener.\n */\n onBadgeQueryRequest(callback: () => void): UnsubscribeCallback {\n this.logger.debug('Registering for Badge Query');\n\n this.listeners.get(IPCEvents.BadgeQuery)?.add(callback);\n\n return () => this.listeners.get(IPCEvents.BadgeQuery)?.delete(callback);\n }\n\n /**\n * Registers a callback to be invoked when a {@link IPCEvents.Lifecycle} event is received.\n *\n * @remarks\n * The `eventName` and `payload` are defined by the `Host` app and can vary for each LIFECYCLE\n * event. The payload can be an empty object for events without any additional data.\n *\n * @param callback - A callback function to be invoked when a {@link IPCEvents.Lifecycle} event\n * is received.\n *\n * @returns An unsubscribe callback to remove the listener.\n */\n onLifecycleEvent(\n callback: (event: string, payload: Record<string, unknown>) => void\n ): UnsubscribeCallback {\n this.logger.debug('Registering for Lifecycle Event');\n\n this.listeners.get(IPCEvents.Lifecycle)?.add(callback as GenericCallback);\n\n return () => this.listeners.get(IPCEvents.Lifecycle)?.delete(callback as GenericCallback);\n }\n\n /**\n * Registers a callback to be invoked when a {@link IPCEvents.PushToken} event is received.\n *\n * @remarks\n * The `token`, `appId`, `selector` and `expiry` are defined by the `Host` app and can vary for\n * each Push Token event.\n *\n * @param callback - A callback function to be invoked when a {@link IPCEvents.PushToken} event\n * is received.\n * @returns An unsubscribe callback to remove the listener.\n */\n onPushToken(callback: (token: string, appId: string, selector: string) => void) {\n this.logger.debug('Registering for Push Token');\n\n this.listeners.get(IPCEvents.PushToken)?.add(callback as GenericCallback);\n\n return () => this.listeners.get(IPCEvents.PushToken)?.delete(callback as GenericCallback);\n }\n\n private evaluateContext(context?: AppContext) {\n if (context === 'user') {\n return 'host' as const;\n } else if (context === 'guest') {\n return 'standalone' as const;\n }\n\n return;\n }\n}\n"],"names":["IPCEvents","extendStatics","d","b","p","__extends","__","__values","o","s","m","i","__read","n","r","ar","e","error","__spreadArray","to","from","pack","l","isFunction","value","createErrorClass","createImpl","_super","instance","ctorFunc","UnsubscriptionError","errors","err","arrRemove","arr","item","index","Subscription","initialTeardown","e_1","_a","e_2","_b","_parentage","_parentage_1","_parentage_1_1","parent_1","e_1_1","initialFinalizer","_finalizers","_finalizers_1","_finalizers_1_1","finalizer","execFinalizer","e_2_1","teardown","parent","empty","EMPTY_SUBSCRIPTION","isSubscription","config","timeoutProvider","handler","timeout","args","_i","handle","delegate","reportUnhandledError","noop","errorContext","cb","Subscriber","destination","_this","EMPTY_OBSERVER","next","complete","SafeSubscriber","_bind","bind","fn","thisArg","ConsumerObserver","partialObserver","handleUnhandledError","observerOrNext","context_1","defaultErrorHandler","observable","identity","x","pipeFromArray","fns","input","prev","Observable","subscribe","operator","subscriber","isSubscriber","source","sink","promiseCtor","getPromiseCtor","resolve","reject","Symbol_observable","operations","isObserver","hasLift","operate","init","liftedSource","createOperatorSubscriber","onNext","onComplete","onError","onFinalize","OperatorSubscriber","shouldUnsubscribe","closed_1","ObjectUnsubscribedError","Subject","subject","AnonymousSubject","_c","observer","observers","hasError","isStopped","thrownError","dateTimestampProvider","Action","scheduler","work","state","delay","intervalProvider","AsyncAction","id","_id","_scheduler","_delay","errored","errorValue","actions","Scheduler","schedulerActionCtor","now","AsyncScheduler","SchedulerAction","action","asyncScheduler","async","isScheduler","EmptyError","firstValueFrom","hasConfig","isValidDate","map","project","timer","dueTime","intervalOrScheduler","intervalDuration","due","tap","tapObserver","isUnsub","J","K","w","ee","te","F","H","re","S","A","N","P","L","se","T","_","U","E","u","v","M","z","V","q","Y","W","ie","k","ne","$","le","O","oe","I","ae","R","ce","he","B","ue","de","fe","G","pe","C","ge","ye","y","ve","Me","Ee","j","D","be","me","Q","Re","X","Z","we","SUPPORTED_VERSIONS","IPCManager","logger","__publicField","IpcHelper","context","reply","msg","corelationId","mode","currentContactsOrContactType","contactType","result","InvalidParameterError","contacts","count","isActivity","url","data","contact","callback"],"mappings":"wZAKkB,IAAAA,GAAAA,IAIhBA,EAAA,WAAa,cAKbA,EAAA,UAAY,YAKZA,EAAA,UAAY,aAdIA,IAAAA,GAAA,CAAA,C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