@acrobits/ipc-sdk 0.12.0-alpha.10 → 0.12.0-alpha.11

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.js","sources":["../src/lib/events.ts","../../../node_modules/.pnpm/tslib@2.6.2/node_modules/tslib/tslib.es6.mjs","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/isFunction.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Subscription.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/config.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/noop.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/errorContext.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Subscriber.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/symbol/observable.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/identity.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/pipe.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Observable.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/lift.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Subject.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/dateTimestampProvider.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/Action.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/intervalProvider.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/AsyncAction.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Scheduler.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/AsyncScheduler.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/async.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/isScheduler.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/EmptyError.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/firstValueFrom.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/isDate.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/map.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/observable/timer.js","../../../node_modules/.pnpm/rxjs@7.8.2/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 /**\n * Event that is fired when the `Host` app sends a REQUEST LOGS event.\n */\n RequestLogs = 'REQUEST LOGS',\n\n /**\n * Event that is fired when the `Host` app sends a CALL INFO update.\n */\n CallInfo = 'CALL INFO'\n}\n","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\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); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\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) {\n return function EmptyErrorImpl() {\n _super(this);\n this.name = 'EmptyError';\n this.message = 'no elements in sequence';\n };\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 K = Object.defineProperty;\nvar X = (n, t, e) => t in n ? K(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;\nvar S = (n, t, e) => (X(n, typeof t != \"symbol\" ? t + \"\" : t, e), e);\nimport { Subject as Z, timer as ee } from \"rxjs\";\nclass u extends Error {\n constructor(e) {\n super(`Incorrect context (${e}). Cannot perform the requested operation.`);\n S(this, \"context\");\n this.context = e;\n }\n}\nclass m extends Error {\n constructor(t, e, s) {\n super(`Invalid parameter (${t}). ${s}`), this.param = t, this.value = e, this.reason = s;\n }\n}\nclass N 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 k extends Error {\n constructor(t) {\n super(`${t} needs to be initialized before it can be used.`);\n }\n}\nclass D extends Error {\n constructor(t, e) {\n let s = `Unsupported Protocol ${Array.isArray(t) ? \"versions\" : \"version\"}: (${t}).`;\n e && (s += ` Minimum version supported is ${e}.`), super(s), this.version = t;\n }\n}\nfunction E(n) {\n return typeof n == \"function\";\n}\nfunction se(n) {\n return E(n == null ? void 0 : n.lift);\n}\nfunction b(n) {\n return function(t) {\n if (se(t))\n return t.lift(function(e) {\n try {\n return n(e, this);\n } catch (s) {\n this.error(s);\n }\n });\n throw new TypeError(\"Unable to lift unknown Observable type\");\n };\n}\nvar R = function(n, t) {\n return R = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, s) {\n e.__proto__ = s;\n } || function(e, s) {\n for (var r in s)\n Object.prototype.hasOwnProperty.call(s, r) && (e[r] = s[r]);\n }, R(n, t);\n};\nfunction L(n, t) {\n if (typeof t != \"function\" && t !== null)\n throw new TypeError(\"Class extends value \" + String(t) + \" is not a constructor or null\");\n R(n, t);\n function e() {\n this.constructor = n;\n }\n n.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());\n}\nfunction F(n) {\n var t = typeof Symbol == \"function\" && Symbol.iterator, e = t && n[t], s = 0;\n if (e)\n return e.call(n);\n if (n && typeof n.length == \"number\")\n return {\n next: function() {\n return n && s >= n.length && (n = void 0), { value: n && n[s++], done: !n };\n }\n };\n throw new TypeError(t ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\nfunction x(n, t) {\n var e = typeof Symbol == \"function\" && n[Symbol.iterator];\n if (!e)\n return n;\n var s = e.call(n), r, i = [], a;\n try {\n for (; (t === void 0 || t-- > 0) && !(r = s.next()).done; )\n i.push(r.value);\n } catch (c) {\n a = { error: c };\n } finally {\n try {\n r && !r.done && (e = s.return) && e.call(s);\n } finally {\n if (a)\n throw a.error;\n }\n }\n return i;\n}\nfunction P(n, t, e) {\n if (e || arguments.length === 2)\n for (var s = 0, r = t.length, i; s < r; s++)\n (i || !(s in t)) && (i || (i = Array.prototype.slice.call(t, 0, s)), i[s] = t[s]);\n return n.concat(i || Array.prototype.slice.call(t));\n}\nfunction re(n) {\n var t = function(s) {\n Error.call(s), s.stack = new Error().stack;\n }, e = n(t);\n return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;\n}\nvar U = re(function(n) {\n return function(e) {\n n(this), this.message = e ? e.length + ` errors occurred during unsubscription:\n` + e.map(function(s, r) {\n return r + 1 + \") \" + s.toString();\n }).join(`\n `) : \"\", this.name = \"UnsubscriptionError\", this.errors = e;\n };\n});\nfunction V(n, t) {\n if (n) {\n var e = n.indexOf(t);\n 0 <= e && n.splice(e, 1);\n }\n}\nvar $ = function() {\n function n(t) {\n this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;\n }\n return n.prototype.unsubscribe = function() {\n var t, e, s, r, i;\n if (!this.closed) {\n this.closed = !0;\n var a = this._parentage;\n if (a)\n if (this._parentage = null, Array.isArray(a))\n try {\n for (var c = F(a), o = c.next(); !o.done; o = c.next()) {\n var d = o.value;\n d.remove(this);\n }\n } catch (v) {\n t = { error: v };\n } finally {\n try {\n o && !o.done && (e = c.return) && e.call(c);\n } finally {\n if (t)\n throw t.error;\n }\n }\n else\n a.remove(this);\n var h = this.initialTeardown;\n if (E(h))\n try {\n h();\n } catch (v) {\n i = v instanceof U ? v.errors : [v];\n }\n var l = this._finalizers;\n if (l) {\n this._finalizers = null;\n try {\n for (var M = F(l), f = M.next(); !f.done; f = M.next()) {\n var z = f.value;\n try {\n H(z);\n } catch (v) {\n i = i ?? [], v instanceof U ? i = P(P([], x(i)), x(v.errors)) : i.push(v);\n }\n }\n } catch (v) {\n s = { error: v };\n } finally {\n try {\n f && !f.done && (r = M.return) && r.call(M);\n } finally {\n if (s)\n throw s.error;\n }\n }\n }\n if (i)\n throw new U(i);\n }\n }, n.prototype.add = function(t) {\n var e;\n if (t && t !== this)\n if (this.closed)\n H(t);\n else {\n if (t instanceof n) {\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 }, n.prototype._hasParent = function(t) {\n var e = this._parentage;\n return e === t || Array.isArray(e) && e.includes(t);\n }, n.prototype._addParent = function(t) {\n var e = this._parentage;\n this._parentage = Array.isArray(e) ? (e.push(t), e) : e ? [e, t] : t;\n }, n.prototype._removeParent = function(t) {\n var e = this._parentage;\n e === t ? this._parentage = null : Array.isArray(e) && V(e, t);\n }, n.prototype.remove = function(t) {\n var e = this._finalizers;\n e && V(e, t), t instanceof n && t._removeParent(this);\n }, n.EMPTY = function() {\n var t = new n();\n return t.closed = !0, t;\n }(), n;\n}();\n$.EMPTY;\nfunction Q(n) {\n return n instanceof $ || n && \"closed\" in n && E(n.remove) && E(n.add) && E(n.unsubscribe);\n}\nfunction H(n) {\n E(n) ? n() : n.unsubscribe();\n}\nvar B = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: void 0,\n useDeprecatedSynchronousErrorHandling: !1,\n useDeprecatedNextContext: !1\n}, W = {\n setTimeout: function(n, t) {\n for (var e = [], s = 2; s < arguments.length; s++)\n e[s - 2] = arguments[s];\n return setTimeout.apply(void 0, P([n, t], x(e)));\n },\n clearTimeout: function(n) {\n var t = W.delegate;\n return ((t == null ? void 0 : t.clearTimeout) || clearTimeout)(n);\n },\n delegate: void 0\n};\nfunction ne(n) {\n W.setTimeout(function() {\n throw n;\n });\n}\nfunction _() {\n}\nfunction ie(n) {\n n();\n}\nvar O = function(n) {\n L(t, n);\n function t(e) {\n var s = n.call(this) || this;\n return s.isStopped = !1, e ? (s.destination = e, Q(e) && e.add(s)) : s.destination = le, s;\n }\n return t.create = function(e, s, r) {\n return new A(e, s, r);\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, n.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}($), oe = Function.prototype.bind;\nfunction T(n, t) {\n return oe.call(n, t);\n}\nvar ae = function() {\n function n(t) {\n this.partialObserver = t;\n }\n return n.prototype.next = function(t) {\n var e = this.partialObserver;\n if (e.next)\n try {\n e.next(t);\n } catch (s) {\n I(s);\n }\n }, n.prototype.error = function(t) {\n var e = this.partialObserver;\n if (e.error)\n try {\n e.error(t);\n } catch (s) {\n I(s);\n }\n else\n I(t);\n }, n.prototype.complete = function() {\n var t = this.partialObserver;\n if (t.complete)\n try {\n t.complete();\n } catch (e) {\n I(e);\n }\n }, n;\n}(), A = function(n) {\n L(t, n);\n function t(e, s, r) {\n var i = n.call(this) || this, a;\n if (E(e) || !e)\n a = {\n next: e ?? void 0,\n error: s ?? void 0,\n complete: r ?? void 0\n };\n else {\n var c;\n i && B.useDeprecatedNextContext ? (c = Object.create(e), c.unsubscribe = function() {\n return i.unsubscribe();\n }, a = {\n next: e.next && T(e.next, c),\n error: e.error && T(e.error, c),\n complete: e.complete && T(e.complete, c)\n }) : a = e;\n }\n return i.destination = new ae(a), i;\n }\n return t;\n}(O);\nfunction I(n) {\n ne(n);\n}\nfunction ce(n) {\n throw n;\n}\nvar le = {\n closed: !0,\n next: _,\n error: ce,\n complete: _\n}, de = function() {\n return typeof Symbol == \"function\" && Symbol.observable || \"@@observable\";\n}();\nfunction Y(n) {\n return n;\n}\nfunction ue(n) {\n return n.length === 0 ? Y : n.length === 1 ? n[0] : function(e) {\n return n.reduce(function(s, r) {\n return r(s);\n }, e);\n };\n}\nvar he = function() {\n function n(t) {\n t && (this._subscribe = t);\n }\n return n.prototype.lift = function(t) {\n var e = new n();\n return e.source = this, e.operator = t, e;\n }, n.prototype.subscribe = function(t, e, s) {\n var r = this, i = fe(t) ? t : new A(t, e, s);\n return ie(function() {\n var a = r, c = a.operator, o = a.source;\n i.add(c ? c.call(i, o) : o ? r._subscribe(i) : r._trySubscribe(i));\n }), i;\n }, n.prototype._trySubscribe = function(t) {\n try {\n return this._subscribe(t);\n } catch (e) {\n t.error(e);\n }\n }, n.prototype.forEach = function(t, e) {\n var s = this;\n return e = G(e), new e(function(r, i) {\n var a = new A({\n next: function(c) {\n try {\n t(c);\n } catch (o) {\n i(o), a.unsubscribe();\n }\n },\n error: i,\n complete: r\n });\n s.subscribe(a);\n });\n }, n.prototype._subscribe = function(t) {\n var e;\n return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(t);\n }, n.prototype[de] = function() {\n return this;\n }, n.prototype.pipe = function() {\n for (var t = [], e = 0; e < arguments.length; e++)\n t[e] = arguments[e];\n return ue(t)(this);\n }, n.prototype.toPromise = function(t) {\n var e = this;\n return t = G(t), new t(function(s, r) {\n var i;\n e.subscribe(function(a) {\n return i = a;\n }, function(a) {\n return r(a);\n }, function() {\n return s(i);\n });\n });\n }, n.create = function(t) {\n return new n(t);\n }, n;\n}();\nfunction G(n) {\n var t;\n return (t = n ?? B.Promise) !== null && t !== void 0 ? t : Promise;\n}\nfunction pe(n) {\n return n && E(n.next) && E(n.error) && E(n.complete);\n}\nfunction fe(n) {\n return n && n instanceof O || pe(n) && Q(n);\n}\nfunction C(n, t, e, s, r) {\n return new ge(n, t, e, s, r);\n}\nvar ge = function(n) {\n L(t, n);\n function t(e, s, r, i, a, c) {\n var o = n.call(this, e) || this;\n return o.onFinalize = a, o.shouldUnsubscribe = c, o._next = s ? function(d) {\n try {\n s(d);\n } catch (h) {\n e.error(h);\n }\n } : n.prototype._next, o._error = i ? function(d) {\n try {\n i(d);\n } catch (h) {\n e.error(h);\n } finally {\n this.unsubscribe();\n }\n } : n.prototype._error, o._complete = r ? function() {\n try {\n r();\n } catch (d) {\n e.error(d);\n } finally {\n this.unsubscribe();\n }\n } : n.prototype._complete, o;\n }\n return t.prototype.unsubscribe = function() {\n var e;\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n var s = this.closed;\n n.prototype.unsubscribe.call(this), !s && ((e = this.onFinalize) === null || e === void 0 || e.call(this));\n }\n }, t;\n}(O);\nfunction p(n, t) {\n return b(function(e, s) {\n var r = 0;\n e.subscribe(C(s, function(i) {\n s.next(n.call(t, i, r++));\n }));\n });\n}\nvar ye = new he(function(n) {\n return n.complete();\n});\nfunction w(n) {\n return n <= 0 ? function() {\n return ye;\n } : b(function(t, e) {\n var s = 0;\n t.subscribe(C(e, function(r) {\n ++s <= n && (e.next(r), n <= s && e.complete());\n }));\n });\n}\nfunction y(n, t) {\n return b(function(e, s) {\n var r = 0;\n e.subscribe(C(s, function(i) {\n return n.call(t, i, r++) && s.next(i);\n }));\n });\n}\nfunction me(n, t) {\n return t === void 0 && (t = !1), b(function(e, s) {\n var r = 0;\n e.subscribe(C(s, function(i) {\n var a = n(i, r++);\n (a || t) && s.next(i), !a && s.complete();\n }));\n });\n}\nfunction g(n, t, e) {\n var s = E(n) || t || e ? { next: n, error: t, complete: e } : n;\n return s ? b(function(r, i) {\n var a;\n (a = s.subscribe) === null || a === void 0 || a.call(s);\n var c = !0;\n r.subscribe(C(i, function(o) {\n var d;\n (d = s.next) === null || d === void 0 || d.call(s, o), i.next(o);\n }, function() {\n var o;\n c = !1, (o = s.complete) === null || o === void 0 || o.call(s), i.complete();\n }, function(o) {\n var d;\n c = !1, (d = s.error) === null || d === void 0 || d.call(s, o), i.error(o);\n }, function() {\n var o, d;\n c && ((o = s.unsubscribe) === null || o === void 0 || o.call(s)), (d = s.finalize) === null || d === void 0 || d.call(s);\n }));\n }) : Y;\n}\nconst we = /^(\\d+)\\.(\\d+)$/;\nfunction Me(n) {\n if (typeof n == \"string\") {\n const t = n.match(we);\n if (t)\n return `${t[1]}.${t[2]}`;\n }\n throw new te(n);\n}\nfunction j(n) {\n const t = Me(n), [e, s] = t.split(\".\"), [r, i] = [parseInt(e), parseInt(s)];\n return [r, i];\n}\nfunction J(n, t) {\n const [e, s] = j(n), [r, i] = j(t);\n return e < r ? -1 : e > r ? 1 : s < i ? -1 : s > i ? 1 : 0;\n}\nfunction ve(n, t) {\n return J(n, t) >= 0;\n}\nconst q = \"2.0\";\nclass Ce {\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 S(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 S(this, \"currentContext\");\n S(this, \"incomingMessages$\");\n S(this, \"inIframe\", !1);\n S(this, \"embeddedResult\");\n S(this, \"iframePort1\");\n S(this, \"iframePort2\");\n if (this.supportedVersions = t, this.logService = e, this.incomingMessages$ = new Z(), this.supportedVersions = t.filter((s) => ve(s, q)), !this.supportedVersions.length)\n throw new D(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, s, r;\n if (this.inIframe) {\n if (!this.iframePort2)\n throw new k(\"port2\");\n return this.iframePort2;\n } else {\n if (!((e = (t = window.Acrobits) == null ? void 0 : t.messageChannel) != null && e.port2))\n throw new k(\"port2\");\n return (r = (s = window.Acrobits) == null ? void 0 : s.messageChannel) == null ? void 0 : r.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 ee(1e3).pipe(\n p(() => (this.isEmbedded() ? this.currentContext = \"user\" : this.currentContext = \"guest\", this.currentContext)),\n w(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 u(this.currentContext);\n const t = \"HELLO\", e = this.createMessage(t);\n e.protocolVersions = this.supportedVersions, this.logCreated(t, e);\n const s = this.incomingMessages$.pipe(\n y((r) => r.type === t && r.replyTo === e.id),\n p((r) => r),\n g(this.logReceived()),\n p((r) => {\n if (!this.supportedVersions.includes(r.protocolVersion))\n throw new D(r.protocolVersion, this.supportedVersions[0]);\n return r.displayName || (r.displayName = r.cloudUsername), r;\n }),\n g((r) => {\n this.negotiatedProtocolVersion = r.protocolVersion, this.logService.info(\n `[IPC] Negotiated IPC Protocol Version: ${this.negotiatedProtocolVersion}`\n ), !r.networkId && this.compareVersion(\"2.2\") >= 0 && this.logService.error(\n `[IPC] Network ID is not set in the HELLO message reply. 'networkId' is required for protocol version ${this.negotiatedProtocolVersion}, and the client may derive an incorrect network ID from the cloudId.`\n );\n }),\n w(1)\n );\n return this.logService.debug(`Created ${t} Reply handler`), this.inIframe ? this.createIframeChannel().then(() => this.finishIpcSetup(e)) : this.finishIpcSetup(e), s;\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 u(this.currentContext);\n const t = \"TOKEN\", e = this.createMessage(t);\n this.logCreated(t, e);\n const s = this.incomingMessages$.pipe(\n y((r) => r.type === t && r.replyTo === e.id),\n p((r) => r),\n g(this.logReceived()),\n w(1)\n );\n return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), s;\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 u(this.currentContext);\n const {\n roomName: e,\n roomInvite: s,\n displayName: r,\n jwtToken: i,\n serverUrl: a,\n region: c,\n joinMicMuted: o,\n joinWithoutCamera: d\n } = t, h = \"JOINING ROOM\", l = this.createMessage(h, !1);\n l.roomName = e, l.jwtToken = i, l.serverUrl = a, l.region = c, l.roomInvite = s, l.joinMicMuted = o ?? !1, l.joinWithoutCamera = d ?? !1, l.displayName = r, this.logCreated(h, l), this.port2.postMessage(l), this.logSent(h, l);\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 u(this.currentContext);\n const e = \"LEAVING ROOM\", s = this.createMessage(e, !1);\n s.roomName = t, this.logCreated(e, s), this.port2.postMessage(s), this.logSent(e, s);\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 u(this.currentContext);\n const t = \"JOIN ROOM\";\n return this.incomingMessages$.pipe(\n y((e) => e.type === t && e.target === \"client\"),\n p((e) => e),\n g(this.logReceived()),\n p((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 u(this.currentContext);\n const t = \"LEAVE ROOM\";\n return this.incomingMessages$.pipe(\n y((e) => e.type === t && e.target === \"client\"),\n p((e) => e),\n g(this.logReceived()),\n p((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 u(this.currentContext);\n const t = \"CONFIG\";\n return this.incomingMessages$.pipe(\n y((e) => e.type === t && e.target === \"client\"),\n p((e) => e),\n g(this.logReceived()),\n p((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 timeFormat: e.timeFormat ?? \"default\"\n }))\n );\n }\n sendScreenshareSourceMessage(t) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const e = \"SCREENSHARE SOURCE\", s = this.createMessage(e);\n s.sourceTypes = t, this.logCreated(e, s);\n const r = this.incomingMessages$.pipe(\n y((i) => i.type === e && i.replyTo === s.id),\n p((i) => i),\n g(this.logReceived()),\n p((i) => i),\n w(1)\n );\n return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(s), this.logSent(e, s), r;\n }\n layoutChange(t, e, s) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const r = \"LAYOUT CHANGE\";\n let i, a;\n if (e && s ? (i = this.createMessage(r, !1, s), i.result = e) : (i = this.createMessage(r), a = this.incomingMessages$.pipe(\n y((c) => c.type === r && c.replyTo === i.id),\n p((c) => c),\n g(this.logReceived()),\n p((c) => c),\n w(1)\n ), this.logService.debug(`Created ${r} Reply handler`)), i.layout = t, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i), a)\n return a;\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 u(this.currentContext);\n const t = \"LAYOUT CHANGE\";\n return this.incomingMessages$.pipe(\n y((e) => e.type === t && e.target === \"client\" && e.replyTo === null),\n p((e) => e),\n g(this.logReceived()),\n p((e) => e)\n );\n }\n requestOAuthToken(t) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n Array.isArray(t) || (t = [t]);\n const e = \"OAUTH TOKEN\", s = this.createMessage(e);\n s.providerTypes = t, this.logCreated(e, s);\n const r = this.incomingMessages$.pipe(\n y((i) => i.type === e && i.replyTo === s.id),\n p((i) => i),\n g(this.logReceived()),\n w(1)\n );\n return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(s), this.logSent(e, s), r;\n }\n openUrl(t, e) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const s = \"OPEN URL\", r = this.createMessage(s, !1);\n r.url = t, r.data = e, this.logCreated(s, r), this.port2.postMessage(r), this.logSent(s, r);\n }\n selectContacts(t, e, s, r) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n if (this.negotiatedProtocolVersion === \"2.0\") {\n if (e === void 0 || typeof e == \"object\")\n throw new m(\n \"streamType\",\n e,\n \"streamType is missing or invalid\"\n );\n if (s === void 0 || typeof s == \"object\" || typeof s == \"number\")\n throw new m(\n \"contactType\",\n s,\n \"contactType is missing or invalid\"\n );\n return this.selectContactsV2_0(\n t,\n e,\n s,\n r\n );\n }\n if (typeof e < \"u\" && typeof e != \"object\")\n throw new m(\"options\", e, \"options is invalid\");\n if (typeof s < \"u\" && !Array.isArray(s))\n throw new m(\n \"currentContacts\",\n s,\n \"currentContacts is invalid\"\n );\n return this.selectContactsV2_1(t, e, s);\n }\n selectContactsV2_0(t, e, s, r) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n r && r.length > 0 && (r = r.map((o) => o.type === \"cloudUsername\" && o.contactUser ? {\n ...o,\n cloudId: o.cloudId || o.contactUser.cloudId,\n networkId: o.networkId || o.contactUser.networkId,\n cloudUsername: o.cloudUsername || o.contactUser.cloudUsername\n } : o));\n const i = \"SELECT CONTACTS\", a = this.createMessage(i, !0);\n a.streamId = t, a.streamType = e, a.contactType = s, a.resultTypes = [s], a.currentContacts = r, this.logCreated(i, a);\n const c = this.incomingMessages$.pipe(\n y((o) => o.type === i && o.replyTo === a.id),\n g(this.logReceived()),\n p((o) => {\n const d = o;\n if (d.result === \"success\") {\n if (d.streamId !== t)\n throw new N(d.streamId, t);\n e === \"direct\" && d.contacts.length > 1 && (d.contacts = [d.contacts[0]]);\n }\n return d;\n }),\n w(1)\n );\n return this.logService.debug(`Created ${i} Reply handler`), this.port2.postMessage(a), this.logSent(i, a), c;\n }\n selectContactsV2_1(t, e, s) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const r = {\n allowMultipleSelection: (e == null ? void 0 : e.allowMultipleSelection) ?? !1,\n filterToSelectedType: (e == null ? void 0 : e.filterToSelectedType) ?? !1,\n resultTypes: (e == null ? void 0 : e.resultTypes) ?? [\"cloudUsername\"],\n streamName: e == null ? void 0 : e.streamName\n };\n if (r.filterToSelectedType) {\n if (!r.allowMultipleSelection)\n throw new m(\n \"filterToSelectedType\",\n r.filterToSelectedType,\n \"filterToSelectedType can only be set when allowMultipleSelection is true\"\n );\n if (r.resultTypes.length === 1 && this.logService.warn(\n \"[IPC] [SelectContacts] filterToSelectedType is redundant when resultTypes contains only one type\"\n ), s && s.length > 0) {\n const o = s[0].type;\n if (s.some((h) => h.type !== o))\n throw new m(\n \"currentContacts\",\n s,\n \"When filterToSelectedType is true, all items in currentContacts must be of the same type\"\n );\n }\n }\n if (s && s.length > 0)\n for (const o of s) {\n if (o.contactId === void 0)\n throw new m(\n \"currentContacts\",\n s,\n \"ContactItem contactId is required since v2.1 on all contacts\"\n );\n if (o.type === \"cloudUsername\") {\n if (!o.contactUser)\n throw new m(\n \"currentContacts\",\n o,\n \"CloudUsername contact must include contactUser since v2.1\"\n );\n if (!o.contactUser.cloudId || !o.contactUser.networkId || !o.contactUser.cloudUsername)\n throw new m(\n \"currentContacts\",\n o,\n \"CloudContact must define cloudUsername, cloudId, and networkId since v2.1\"\n );\n }\n }\n const i = \"SELECT CONTACTS\", a = this.createMessage(i, !0);\n a.streamId = t, a.streamName = r.streamName, a.resultTypes = r.resultTypes, a.currentContacts = s, a.allowMultipleSelection = r.allowMultipleSelection, a.filterToSelectedType = r.filterToSelectedType, this.logCreated(i, a);\n const c = this.incomingMessages$.pipe(\n y((o) => o.type === i && o.replyTo === a.id),\n g(this.logReceived()),\n p((o) => {\n const d = o;\n if (d.result === \"success\") {\n if (d.streamId !== t)\n throw new N(d.streamId, t);\n const h = d.contacts.length;\n if (d.contacts = d.contacts.filter(\n (l) => r.resultTypes.includes(l.type)\n ), d.contacts.length !== h && this.logService.debug(\n `[IPC] [SelectContactsReply] Filtered ${h - d.contacts.length} contacts from reply`\n ), !r.allowMultipleSelection && d.contacts.length > 1 && (d.contacts = [d.contacts[0]]), r.filterToSelectedType && d.contacts.length > 1) {\n const l = d.contacts[0].type;\n if (d.contacts.some(\n (f) => f.type !== l\n ))\n throw new Error(\n `When filterToSelectedType is true, all contacts in the reply must be of the same type. Expected all contacts to be of type '${l}', but received mixed types.`\n );\n }\n for (const l of d.contacts) {\n if (l.type === \"cloudUsername\") {\n if (!l.contactUser)\n throw new Error(\n `CloudUsername contact must include contactUser since v2.1. ContactItem: ${JSON.stringify(\n l\n )}`\n );\n if (!l.contactUser.cloudId || !l.contactUser.networkId || !l.contactUser.cloudUsername)\n throw new Error(\n `CloudContact must define cloudUsername, cloudId, and networkId since v2.1. ContactItem: ${JSON.stringify(\n l\n )}`\n );\n }\n this.negotiatedProtocolVersion === \"2.2\" && (l.type === \"number\" && l.numbers.length > 1 ? l.numbers = [l.numbers[0]] : l.type === \"email\" && l.emails.length > 1 && (l.emails = [l.emails[0]]));\n }\n }\n return d;\n }),\n w(1)\n );\n return this.logService.debug(`Created ${i} Reply handler`), this.port2.postMessage(a), this.logSent(i, a), c;\n }\n matchContacts(t) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n if (!Array.isArray(t))\n throw new m(\"contacts\", t, \"contacts is not an array\");\n if (!t.length)\n throw new m(\"contacts\", t, \"At least one contact is required\");\n const s = this.createMessage(\"MATCH CONTACTS\");\n if (this.compareVersion(\"2.1\") >= 0) {\n for (const i of t)\n if (i.type === \"cloudUsername\") {\n if (!i.contactUser)\n throw new m(\n \"contacts\",\n i,\n \"CloudUsername contact must include contactUser\"\n );\n if (!i.contactUser.cloudUsername || !i.contactUser.cloudId || !i.contactUser.networkId)\n throw new m(\n \"contacts\",\n i,\n \"CloudContact must define cloudUsername, cloudId, and networkId\"\n );\n }\n s.contacts = [...t];\n } else {\n for (const i of t)\n i.type === \"cloudUsername\" && i.contactUser && (i.cloudId = i.contactUser.cloudId, i.networkId = i.contactUser.networkId, i.cloudUsername = i.contactUser.cloudUsername);\n s.contacts = [...t];\n }\n this.logCreated(s.type, s);\n const r = this.incomingMessages$.pipe(\n y((i) => i.type === s.type && i.replyTo === s.id),\n g(this.logReceived()),\n p((i) => {\n const a = i;\n if (this.compareVersion(\"2.1\") >= 0) {\n if (Array.isArray(a.contacts))\n throw new Error(\n \"MatchContactsMessageReply should return a Record<string, DetailedContactItem> of contacts when using IPC Protocol v2.1+\"\n );\n for (const [c, o] of Object.entries(a.contacts)) {\n if (o == null) {\n this.logService.debug(\n `[IPC] [MatchContactsReply] Received null or undefined contact for ${c}`\n );\n continue;\n }\n if (o.contactId === void 0)\n throw new Error(\n `ContactItem 'contactId' is required since v2.1. ContactItem: ${JSON.stringify(\n o\n )}`\n );\n if (!o.contactUser && (!o.uri || o.uri.length === 0) && (!o.numbers || o.numbers.length === 0))\n throw new Error(\n `DetailedContactItem must define at least one contact method (contactUser, uri, or numbers). ContactItem: ${JSON.stringify(\n o\n )}`\n );\n if (o.contactUser && (!o.contactUser.cloudId || !o.contactUser.networkId || !o.contactUser.cloudUsername))\n throw new Error(\n `When contactUser is defined, cloudId, networkId, and cloudUsername must also be defined. ContactItem: ${JSON.stringify(\n o\n )}`\n );\n }\n } else {\n if (!Array.isArray(a.contacts))\n throw new Error(\n \"MatchContactsMessageReply should return an array of contacts when using IPC Protocol v2.0\"\n );\n if (a.contacts.length !== s.contacts.length)\n throw new Error(\n \"The number of contacts in the reply does not match the number of contacts in the request\"\n );\n for (const c of a.contacts) {\n const o = c;\n if (o.type === \"cloudUsername\" && !(\"cloudUsername\" in o))\n throw new Error(\n `CloudUsernameDetailedContactItem must define cloudUsername. ContactItem: ${JSON.stringify(\n c\n )}`\n );\n if (o.type === \"uri\" && (!(\"uri\" in o) || !Array.isArray(o.uri)))\n throw new Error(\n `UriDetailedContactItem must define uri as an array. ContactItem: ${JSON.stringify(\n c\n )}`\n );\n }\n }\n return a;\n }),\n w(1)\n );\n return this.logService.debug(`Created ${s.type} Reply handler`), this.port2.postMessage(s), this.logSent(s.type, s), r;\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 u(this.currentContext);\n const t = \"PUSH MESSAGE\";\n return this.incomingMessages$.pipe(\n y((e) => e.type === t && e.target === \"client\"),\n p((e) => e),\n g(this.logReceived())\n );\n }\n /**\n * Setup listener for {@link DirectChannelCreateAndNavigateMessage}, which can be sent by a Host app to\n * instruct the Client to create (if needed) and navigate to a direct channel.\n *\n * @remarks\n * The Host app does not expect a reply to this message.\n *\n * @returns An observable that emits whenever {@link DirectChannelCreateAndNavigateMessage} is received so it\n * can be subscribed to indefinitely.\n */\n onDirectChannelCreateAndNavigateMessage() {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const t = \"DIRECT CHANNEL CREATE AND NAVIGATE\";\n return this.incomingMessages$.pipe(\n y(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null && e.expectReply === !1\n ),\n g(this.logReceived())\n );\n }\n /**\n * Setup listener for {@link NavigateToRouteMessage}, which can be sent by a Host app to instruct the\n * Client application to navigate to a specific in-app route.\n *\n * @remarks\n * The Host app does not expect a reply to this message.\n *\n * @returns An observable that emits whenever {@link NavigateToRouteMessage} is received so it can be\n * subscribed to indefinitely.\n */\n onNavigateToRouteMessage() {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const t = \"NAVIGATE TO ROUTE\";\n return this.incomingMessages$.pipe(\n y(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null && e.expectReply === !1\n ),\n g(this.logReceived())\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 u(this.currentContext);\n const t = \"PUSH TOKEN\", e = this.createMessage(t);\n this.logCreated(t, e);\n const s = this.incomingMessages$.pipe(\n y((r) => r.type === t && r.replyTo === e.id),\n g(this.logReceived()),\n p((r) => r),\n w(1)\n );\n return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), s;\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 u(this.currentContext);\n const t = \"PUSH TOKEN\";\n return this.incomingMessages$.pipe(\n y(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null && e.expectReply === !1\n ),\n p((e) => {\n if (e.pushToken && e.selector && e.appId)\n return e;\n throw new Error(\"PushTokenMessage is missing required PushTokenPayload fields\");\n }),\n g((e) => e.pushToken),\n g(this.logReceived())\n );\n }\n /**\n * Request current call information from the `Host` app.\n *\n * @remarks\n * The Host app should reply with a {@link CallInfoMessageReply} containing the current call\n * information.\n *\n * @returns Observable with a {@link CallInfoMessageReply} instance containing the call info.\n */\n requestCallInfo() {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const t = \"CALL INFO\", e = this.createMessage(t);\n this.logCreated(t, e);\n const s = this.incomingMessages$.pipe(\n y((r) => r.type === t && r.replyTo === e.id),\n g(this.logReceived()),\n p((r) => r),\n w(1)\n );\n return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), s;\n }\n /**\n * Setup a listener for {@link CallInfoMessageReply}, which can be sent by a Host app to notify\n * of call information changes.\n *\n * @remarks\n * The Host app should send this message whenever call properties change. The Client app can\n * use this to update its call state 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 callInfoSubscription = ipcHelper.onCallInfoMessage().subscribe((msg) => {\n * // your logic for handling call info updates goes here\n * });\n *\n * // don't forget to unsubscribe when you're cleaning up\n * callInfoSubscription.unsubscribe();\n * ```\n *\n * @returns An observable that emits whenever {@link CallInfoMessageReply} is received so it can\n * be subscribed to indefinitely.\n */\n onCallInfoMessage() {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const t = \"CALL INFO\";\n return this.incomingMessages$.pipe(\n y(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null\n ),\n g(this.logReceived())\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 u(this.currentContext);\n const t = \"BADGE QUERY\";\n return this.incomingMessages$.pipe(\n y((e) => e.type === t && e.target === \"client\"),\n p((e) => e),\n g(this.logReceived())\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, s) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const r = \"BADGE UPDATE\", i = this.createMessage(r, !1, s);\n i.count = t, i.activity = e ?? !1, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);\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 u(this.currentContext);\n const s = \"LIFECYCLE\", r = this.createMessage(s, !1);\n r.eventName = t, r.payload = e, this.logCreated(s, r), this.port2.postMessage(r), this.logSent(s, r);\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 u(this.currentContext);\n const t = \"LIFECYCLE\";\n return this.incomingMessages$.pipe(\n y((e) => e.type === t && e.target === \"client\"),\n p((e) => e),\n g(this.logReceived())\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 u(this.currentContext);\n const s = \"LOG\", r = this.createMessage(s, !1);\n r.level = t, r.message = e, this.logCreated(s, r), this.port2.postMessage(r), this.logSent(s, r);\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 u(this.currentContext);\n const t = \"REQUEST LOGS\";\n return this.incomingMessages$.pipe(\n y((e) => e.type === t && e.target === \"client\"),\n p((e) => e),\n g(this.logReceived())\n );\n }\n /**\n * Sends a {@link RequestLogsMessageReply} to the Host app, to reply to a\n * {@link RequestLogsMessage} which had `responseType` set to `file`.\n *\n * @param fileId - UUIDv4 string to identify the file\n * @param fileHash - SHA256 hash of the file\n * @param fileSize - Size of the file in bytes\n * @param format - Format of the file. Can be either `gzip` or `text`\n * @param replyTo - The message ID to which the reply should be sent\n */\n sendRequestLogsMessageReply(t, e, s, r, i) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const a = \"REQUEST LOGS\", c = this.createMessage(a, !1, i);\n c.fileId = t, c.fileHash = e, c.fileSize = s, c.format = r, this.logCreated(a, c), this.port2.postMessage(c), this.logSent(a, c);\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 u(this.currentContext);\n const s = \"VIEW TRANSITION\", r = this.createMessage(s, !1);\n r.transitionType = t, r.targetView = e, this.logCreated(s, r), this.port2.postMessage(r), this.logSent(s, r);\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, s, r, i) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const a = \"FILE REQUEST\", c = this.createMessage(a);\n if (c.fileId = t, c.fileHash = e.toLowerCase(), c.intent = s, c.maxChunkSizeInBytes = i, s === \"attachment\") {\n if (!r)\n throw new m(\n \"streamId\",\n r,\n \"streamId is required for attachment intent\"\n );\n c.streamId = r;\n }\n this.logCreated(a, c);\n let o = 0;\n const d = this.incomingMessages$.pipe(\n y(\n (h) => h.type === a && h.replyTo === c.id\n ),\n g(this.logReceived()),\n g(() => o++),\n p((h) => (h.result === \"success\" && (h.chunkHash = h.chunkHash.toLowerCase(), h.fileHash = h.fileHash.toLowerCase()), h)),\n me((h) => h.result === \"success\" && o < h.totalChunks, !0)\n );\n return this.port2.postMessage(c), this.logSent(a, c), d;\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 u(this.currentContext);\n const s = \"FILE REQUEST\", r = Object.assign(\n e,\n this.createMessage(s, !1, t.id)\n );\n this.logCreated(s, r), this.port2.postMessage(r), this.logSent(s, r);\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 u(this.currentContext);\n const t = \"FILE REQUEST\";\n return this.incomingMessages$.pipe(\n y(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null\n ),\n p((e) => (e.fileHash = e.fileHash.toLowerCase(), e)),\n g(this.logReceived())\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, s, r, i, a) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const c = \"FILE SELECTION\", o = this.createMessage(c);\n if (o.intent = t, o.maxCount = r, o.maxFileSizeInBytes = i, o.mimeTypes = a, t === \"attachment\") {\n if (!e)\n throw new m(\n \"streamId\",\n e,\n \"streamId is required for attachment intent\"\n );\n if (!s)\n throw new m(\n \"correlationId\",\n s,\n \"correlationId is required for attachment intent\"\n );\n o.streamId = e, o.correlationId = s;\n }\n this.logCreated(c, o);\n const d = this.incomingMessages$.pipe(\n y(\n (h) => h.type === c && h.replyTo === o.id\n ),\n p((h) => {\n var l;\n return h.result === \"success\" && (h.files = (l = h.files) == null ? void 0 : l.map((M) => (M.original.fileHash = M.original.fileHash.toLowerCase(), M.preview && (M.preview.fileHash = M.preview.fileHash.toLowerCase()), M))), h;\n }),\n g(this.logReceived()),\n w(1)\n );\n return this.port2.postMessage(o), this.logSent(c, o), d;\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 fileHash - SHA256 hash of the decrypted file.\n * @param url - URL of the file being downloaded.\n * @param correlationId - _Optional_. A UUIDv4 string to identify the message this file was\n * attached to.\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, s) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const r = \"FILE DOWNLOAD PROGRESS QUERY\", i = this.createMessage(\n r,\n !0\n );\n i.fileHash = t.toLowerCase(), i.url = e, i.correlationId = s, this.logCreated(r, i);\n const a = this.incomingMessages$.pipe(\n y(\n (c) => c.type === \"FILE DOWNLOAD PROGRESS UPDATE\" && c.replyTo === i.id\n ),\n g((c) => this.logReceived(c)),\n p((c) => (c.fileHash && (c.fileHash = c.fileHash.toLowerCase()), c)),\n w(1)\n );\n return this.port2.postMessage(i), this.logSent(r, i), a;\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 FileDownloadMessage}.\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 u(this.currentContext);\n const t = \"FILE DOWNLOAD PROGRESS UPDATE\";\n return this.incomingMessages$.pipe(\n y(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null\n ),\n p((e) => (e.fileHash && (e.fileHash = e.fileHash.toLowerCase()), e)),\n g(this.logReceived())\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 fileHash - SHA256 hash of the decrypted file.\n * @param fileId - ID of the original file being uploaded.\n * @param correlationId - _Optional_. A UUIDv4 string to identify the message this file was attached to.\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, s) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const r = \"FILE UPLOAD PROGRESS QUERY\", i = this.createMessage(\n r,\n !0\n );\n i.fileHash = t.toLowerCase(), i.fileId = e, i.correlationId = s, this.logCreated(r, i);\n const a = this.incomingMessages$.pipe(\n y(\n (c) => c.type === \"FILE UPLOAD PROGRESS UPDATE\" && c.replyTo === i.id\n ),\n g(this.logReceived()),\n p((c) => (c.fileHash && (c.fileHash = c.fileHash.toLowerCase()), c)),\n w(1)\n );\n return this.port2.postMessage(i), this.logSent(r, i), a;\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 u(this.currentContext);\n const t = \"FILE UPLOAD PROGRESS UPDATE\";\n return this.incomingMessages$.pipe(\n y(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null\n ),\n p((e) => (e.fileHash && (e.fileHash = e.fileHash.toLowerCase()), e)),\n g(this.logReceived())\n );\n }\n /**\n * Sends a {@link FileDownloadMessage} to the Host app, to download a file.\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 * If the `host` already has the file in it's storage, it can reply with a\n * {@link FileDownloadSkippedResult} to notify the client that the download was skipped.\n *\n * @param url - URL from where the host should download the file if it isn't in storage.\n * @param key - Key used to encrypt the original attachment.\n * @param fileHash - The SHA256 hash of the file to download.\n * @param mimeType - The MIME type of the file to download.\n * @param fileName - _Optional_. The name of the file to download.\n * @param streamId - _Optional_. ID of the message stream from which the file is downloaded from.\n * @param correlationId - _Optional_. Correlation ID of the message this file was attached to.\n * @param sender - _Optional_. The {@link ContactItem} of the sender of the file.\n * @param intent - _Optional_. The intent of the file download. Can be either `download` or\n * `open`. Defaults to `download`.\n *\n * @returns An observable which emits a {@link FileDownloadMessageReply} instance containing the\n * result of the request. Emits once.\n */\n sendFileDownloadMessage(t, e, s, r, i, a, c, o, d) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n if (o && this.compareVersion(\"2.1\") < 0)\n o.type === \"cloudUsername\" && o.contactUser && (o = {\n ...o,\n cloudId: o.cloudId || o.contactUser.cloudId,\n networkId: o.networkId || o.contactUser.networkId,\n cloudUsername: o.cloudUsername || o.contactUser.cloudUsername\n });\n else if (o && this.compareVersion(\"2.1\") >= 0 && o.type === \"cloudUsername\") {\n if (!o.contactUser)\n throw new m(\n \"sender\",\n o,\n \"CloudUsername contact must include contactUser since v2.1\"\n );\n if (!o.contactUser.cloudId || !o.contactUser.networkId || !o.contactUser.cloudUsername)\n throw new m(\n \"sender\",\n o,\n \"CloudContact must define cloudUsername, cloudId, and networkId since v2.1\"\n );\n }\n const h = \"FILE DOWNLOAD\", l = this.createMessage(h, !0);\n l.url = t, l.key = e, l.fileHash = s.toLowerCase(), l.mimeType = r, l.fileName = i, l.streamId = a, l.correlationId = c, l.sender = o, l.intent = d ?? \"download\", this.logCreated(h, l);\n const M = this.incomingMessages$.pipe(\n y((f) => f.type === h && f.replyTo === l.id),\n g(this.logReceived()),\n p((f) => f),\n w(1)\n );\n return this.port2.postMessage(l), this.logSent(h, l), M;\n }\n /**\n * Sends a {@link CancelFileDownloadMessage} to the Host app, to cancel downloading of a file\n * that was initiated by a {@link FileDownloadMessage} previously.\n *\n * @param fileHash - SHA256 hash of the file to cancel downloading.\n * @param url - URL of the file to cancel download.\n * @param correlationId - _Optional_. UUIDv4 string to identify the message this file was attached to.\n */\n sendCancelFileDownloadMessage(t, e, s) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const r = \"CANCEL FILE DOWNLOAD\", i = this.createMessage(r, !1);\n i.fileHash = t.toLowerCase(), i.url = e, i.correlationId = s, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);\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 u(this.currentContext);\n const s = \"FILE REMOVE\", r = this.createMessage(s, !0);\n r.hash = t.toLowerCase(), r.streamId = e, this.logCreated(s, r);\n const i = this.incomingMessages$.pipe(\n y((a) => a.type === s && a.replyTo === r.id),\n g(this.logReceived()),\n p((a) => a),\n w(1)\n );\n return this.port2.postMessage(r), this.logSent(s, r), i;\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 u(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 u(this.currentContext);\n const s = \"MESSAGE SENT\", r = this.createMessage(s, !1);\n r.streamId = t, r.correlationId = e, this.logCreated(s, r), this.port2.postMessage(r), this.logSent(s, r);\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, s, r = \"TEXT\", i, a, c, o = !0, d) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const h = \"SEND MESSAGE\", l = this.createMessage(h, !0);\n if (l.streamId = t, l.correlationId = e, l.body = s, l.messageType = r, i && i.length > 0)\n if (this.compareVersion(\"2.1\") < 0)\n l.mentions = i.map((f) => f.contactUser ? {\n ...f,\n cloudId: f.cloudId || f.contactUser.cloudId,\n networkId: f.networkId || f.contactUser.networkId,\n cloudUsername: f.cloudUsername || f.contactUser.cloudUsername\n } : f);\n else {\n for (const f of i) {\n if (f.type === \"cloudUsername\" && !f.contactUser)\n throw new m(\n \"mentions\",\n f,\n \"CloudUsername mention must include contactUser\"\n );\n if (f.contactUser && (!f.contactUser.cloudId || !f.contactUser.networkId || !f.contactUser.cloudUsername))\n throw new m(\n \"mentions\",\n f,\n \"CloudContact must define cloudUsername, cloudId, and networkId\"\n );\n }\n l.mentions = i;\n }\n else\n l.mentions = [];\n l.attachments = (a == null ? void 0 : a.map((f) => f.toLowerCase())) ?? [], l.relatedMessageId = c, l.setCursors = o, l.threadId = d, this.logCreated(h, l);\n const M = this.incomingMessages$.pipe(\n y((f) => f.type === h && f.replyTo === l.id),\n g(this.logReceived()),\n p((f) => f),\n w(1)\n );\n return this.port2.postMessage(l), this.logSent(h, l), M;\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 u(this.currentContext);\n const s = \"CANCEL SEND MESSAGE\", r = this.createMessage(s, !1);\n r.streamId = t, r.correlationId = e, this.logCreated(s, r), this.port2.postMessage(r), this.logSent(s, r);\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 u(this.currentContext);\n const s = \"MESSAGE DELETED\", r = this.createMessage(s, !1);\n r.correlationId = t, r.streamId = e, this.logCreated(s, r), this.port2.postMessage(r), this.logSent(s, r);\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 u(this.currentContext);\n const s = \"SEND MESSAGE STATUS QUERY\", r = this.createMessage(s, !0);\n r.correlationId = t, r.streamId = e, this.logCreated(s, r);\n const i = this.incomingMessages$.pipe(\n y(\n (a) => a.type === \"SEND MESSAGE STATUS UPDATE\" && a.replyTo === r.id\n ),\n g(this.logReceived()),\n p((a) => a),\n w(1)\n );\n return this.port2.postMessage(r), this.logSent(s, r), i;\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 u(this.currentContext);\n const t = \"SEND MESSAGE STATUS UPDATE\";\n return this.incomingMessages$.pipe(\n y((e) => e.type === t && e.target === \"client\" && e.replyTo === null),\n p((e) => e),\n g(this.logReceived())\n );\n }\n /**\n * Send a SIP call message to the Host app.\n *\n * @remarks\n * This message is used to initiate a SIP call to the specified contact.\n *\n * @param contact - The {@link ContactItem} for the callee.\n */\n sendSipCallMessage(t) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n if (this.compareVersion(\"2.1\") < 0)\n t.type === \"cloudUsername\" && t.contactUser && (t = {\n ...t,\n cloudId: t.cloudId || t.contactUser.cloudId,\n networkId: t.networkId || t.contactUser.networkId,\n cloudUsername: t.cloudUsername || t.contactUser.cloudUsername\n });\n else if (t.type === \"cloudUsername\") {\n if (!t.contactUser)\n throw new m(\n \"contact\",\n t,\n \"CloudUsername contact must include contactUser since v2.1\"\n );\n if (!t.contactUser.cloudId || !t.contactUser.networkId || !t.contactUser.cloudUsername)\n throw new m(\n \"contact\",\n t,\n \"CloudContact must define cloudUsername, cloudId, and networkId since v2.1\"\n );\n }\n const e = \"SIP CALL\", s = this.createMessage(e, !1);\n s.contact = t, this.logCreated(e, s), this.port2.postMessage(s), this.logSent(e, s);\n }\n sendCustomFunctionMessage(t, e) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const s = \"CUSTOM FUNCTION\", r = this.createMessage(s, !1);\n r.customFunctionId = t, r.context = e, this.logCreated(s, r), this.port2.postMessage(r), this.logSent(s, r);\n }\n /**\n * Sends a {@link SubscribeButtonsMessage} to the Host app to subscribe to button updates for\n * specific locations.\n *\n * @remarks\n * The host will respond with BUTTONS messages containing the current button configurations\n * for the subscribed locations.\n *\n * @param subscribe - Subscription configuration for different button locations\n *\n * @returns This method returns void.\n */\n sendSubscribeButtonsMessage(t) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const e = \"SUBSCRIBE BUTTONS\", s = this.createMessage(e, !1);\n s.subscribe = t, this.logCreated(e, s), this.port2.postMessage(s), this.logSent(e, s);\n }\n /**\n * Setup listener for {@link ButtonsMessage}, which can be sent by a Host app to provide button\n * configurations for subscribed locations.\n *\n * @remarks\n * This message is sent in response to a SUBSCRIBE BUTTONS message or when button configurations\n * change for subscribed locations.\n *\n * @example\n * Here is an example of how a listener can be setup:\n *\n * ```ts\n * const ipcHelper = new IpcHelper(['2.2'], console);\n *\n * const buttonsSubscription = ipcHelper.onButtonsMessage().subscribe((msg) => {\n * // your logic for handling the button configurations goes here\n * });\n *\n * // don't forget to unsubscribe when you're cleaning up\n * buttonsSubscription.unsubscribe();\n * ```\n *\n * @returns An Observable that emits whenever {@link ButtonsMessage} is received so it can be\n * subscribed to indefinitely.\n */\n onButtonsMessage() {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const t = \"BUTTONS\";\n return this.incomingMessages$.pipe(\n y((e) => e.type === t && e.target === \"client\"),\n p((e) => e),\n g(this.logReceived())\n );\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 J(this.negotiatedProtocolVersion, t);\n }\n logReceived(t) {\n const e = (s) => this.logService.debug(\n `[IPC] Received ${s.type} message${s.replyTo ? \" reply\" : \"\"}`,\n s\n );\n if (t) {\n Ee(t) && (t = { ...t, data: \"...\" }), e(t);\n return;\n } else\n return e;\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 = (s) => {\n s.data === \"message channel port\" && (this.iframePort2 = s.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, s) {\n return {\n type: t,\n id: this.generateId(),\n target: \"host\",\n expectReply: e,\n replyTo: s ?? null\n };\n }\n generateId(t = 8, e = !1) {\n let s = \"1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM\";\n const r = [];\n e && (s = s.substr(0, s.indexOf(\"Q\")));\n for (let i = 0; i < t; i++)\n r.push(s[Math.floor(Math.random() * s.length)]);\n return r.join(\"\");\n }\n}\nfunction Ee(n) {\n return n.type === \"FILE REQUEST\" && n.replyTo !== null;\n}\nexport {\n u as InvalidContextError,\n m as InvalidParameterError,\n N as InvalidStreamIdError,\n te as InvalidVersionFormatError,\n Ce as IpcHelper,\n k as MessagePortNotInitializedError,\n D as UnsupportedVersionError\n};\n","import {\n ContactType,\n InvalidParameterError,\n IpcHelper,\n UnsupportedVersionError,\n type AppContext,\n type CallInfoItem,\n type ContactItem,\n type HomogenizedContactItemArray,\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.2', '2.1', '2.0'];\n\ntype GenericCallback = (...args: unknown[]) => void;\n\ntype SelectContactsOptions = {\n mode: 'single' | 'multi';\n filterToSelectedType: boolean;\n currentContacts?: ContactItem[];\n resultTypes?: ContactType[];\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 * @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 /**\n * The cloud username of the logged in user.\n */\n cloudUsername?: string;\n\n /**\n * The display name of the logged in user.\n */\n displayName?: 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 this.listeners.set(IPCEvents.RequestLogs, new Set());\n this.listeners.set(IPCEvents.CallInfo, 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.helper.onRequestLogsMessage().subscribe((msg) => {\n this.logger.debug('Received Request Logs Message: ', msg);\n\n if (msg.responseType === 'file') {\n this.logger.error('File response type not supported');\n throw new Error('File response type not supported');\n }\n\n for (const cb of this.listeners.get(IPCEvents.RequestLogs)?.values() ?? []) {\n cb(msg.skipCompression);\n }\n });\n\n this.helper.onCallInfoMessage().subscribe((msg) => {\n this.logger.debug('Received Call Info update: ', msg);\n\n for (const cb of this.listeners.get(IPCEvents.CallInfo)?.values() ?? []) {\n cb(msg.calls);\n }\n });\n\n this.cloudId = reply.cloudId;\n this.cloudUsername = reply.cloudUsername;\n this.displayName = reply.displayName;\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 * This overload requires protocol version 2.1 or higher. If the negotiated version\n * is 2.0, an {@link UnsupportedVersionError} will be thrown.\n *\n * @param corelationId - An identifier for the message stream\n * @param options - Configuration options for contact selection:\n * - `mode`: Whether to allow 'single' or 'multi' contact selection\n * - `currentContacts`: For multi-select mode, the list of currently selected contacts\n * - `contactType`: The type of contacts to select ('cloudUsername' or 'uri'). Defaults to 'cloudUsername'\n * - `includeOffNetworkContacts`: Whether to include contacts not on the network. Defaults to false\n *\n * @returns A collection of {@link ContactItem} objects which the user selected\n *\n * @throws {@link UnsupportedVersionError} if the negotiated version is 2.0.\n */\n selectContacts(corelationId: number, options: SelectContactsOptions): Promise<ContactItem[]>;\n\n /**\n * Requests the `Host` app to open the contact selection UI.\n *\n * @deprecated Use the `selectContacts` method with the `options` parameter instead.\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 * @deprecated Use the `selectContacts` method with the `options` parameter instead.\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\n selectContacts(\n corelationId: number,\n modeOrOpts?: 'single' | 'multi' | SelectContactsOptions,\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 (this.negotiatedVersion === '2.0') {\n if (typeof modeOrOpts === 'object') {\n throw new UnsupportedVersionError('2.1', this.negotiatedVersion);\n }\n\n if (typeof modeOrOpts !== 'string' && modeOrOpts !== undefined) {\n throw new InvalidParameterError('mode', modeOrOpts, 'mode must be \"single\" or \"multi\"');\n }\n\n if (contactType === 'number') {\n throw new InvalidParameterError(\n 'contactType',\n contactType,\n 'contactType cannot be \"number\" for version 2.0 of the IPC protocol'\n );\n }\n\n result = this.selectContacts_V2_0(\n corelationId,\n modeOrOpts ?? 'single',\n modeOrOpts === 'multi' ? (currentContactsOrContactType as ContactItem[]) : undefined,\n modeOrOpts === 'multi' ? contactType : (currentContactsOrContactType as ContactType)\n );\n } else {\n if (typeof modeOrOpts === 'object') {\n result = this.selectContacts_V2_1(corelationId, modeOrOpts);\n } else {\n // Gracefully handle deprecated string-based API on v2.1+\n this.logger.warn(\n 'The string-based selectContacts API is deprecated. Please use the options object API instead.'\n );\n\n const mode = modeOrOpts ?? 'single';\n const currentContacts =\n mode === 'multi' ? (currentContactsOrContactType as ContactItem[]) : undefined;\n const resolvedContactType =\n mode === 'multi' ? contactType : (currentContactsOrContactType as ContactType);\n\n const options: SelectContactsOptions = {\n mode,\n filterToSelectedType: false,\n currentContacts,\n resultTypes: resolvedContactType ? [resolvedContactType] : ['cloudUsername']\n };\n\n result = this.selectContacts_V2_1(corelationId, options);\n }\n }\n\n return firstValueFrom(\n result.pipe(\n map((reply) => {\n if (reply.result === 'error') {\n return {\n result: 'error',\n errorMessage: reply.errorMessage\n };\n } else if (reply.result === 'cancelled') {\n return {\n result: 'cancelled'\n };\n } else {\n return reply.contacts;\n }\n })\n )\n );\n }\n\n private selectContacts_V2_0(\n corelationId: number,\n mode: 'single' | 'multi',\n currentContacts?: ContactItem[],\n contactType?: ContactType\n ) {\n this.logger.debug('Selecting Contacts: ', ...arguments);\n\n if (mode === 'multi') {\n if (!currentContacts || !Array.isArray(currentContacts)) {\n throw new InvalidParameterError(\n 'currentContacts',\n currentContacts,\n 'currentContacts is required for group streams'\n );\n }\n\n if (!contactType) {\n contactType = 'cloudUsername';\n }\n\n return this.helper.selectContacts(\n corelationId.toString(),\n 'group',\n contactType,\n currentContacts\n );\n } else {\n if (!contactType) {\n contactType = 'cloudUsername';\n }\n\n return this.helper.selectContacts(corelationId.toString(), 'direct', contactType);\n }\n }\n\n private selectContacts_V2_1(corelationId: number, options: SelectContactsOptions) {\n this.logger.debug('Selecting Contacts: ', options);\n\n const streamId = corelationId.toString();\n const resultTypes = options.resultTypes ?? ['cloudUsername'];\n\n if (options.mode === 'single') {\n return this.helper.selectContacts(streamId, {\n allowMultipleSelection: false,\n resultTypes\n });\n }\n\n if (!options.currentContacts || !Array.isArray(options.currentContacts)) {\n throw new InvalidParameterError(\n 'currentContacts',\n options.currentContacts,\n 'currentContacts is required for group streams'\n );\n }\n\n if (options.filterToSelectedType) {\n // Type assertion is safe here because selectContactsV2_1 validates homogeneity at runtime\n return this.helper.selectContacts(\n streamId,\n {\n allowMultipleSelection: true,\n filterToSelectedType: true,\n resultTypes\n },\n options.currentContacts as HomogenizedContactItemArray\n );\n }\n\n return this.helper.selectContacts(\n streamId,\n {\n allowMultipleSelection: true,\n filterToSelectedType: false,\n resultTypes\n },\n options.currentContacts\n );\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 * @example\n *\n * ```ts\n * // import the IPCManager\n * import { IPCManager } from '@acrobits/ipc-sdk';\n *\n * // create an instance of IPCManager\n * const manager = new IPCManager();\n *\n * // open the URL with additional data\n * const url = 'https://example.com';\n * const data = {\n * name: 'John Doe',\n * age: 30\n * };\n *\n * manager.openUrl(url, data);\n * ```\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 /**\n * Registers a callback to be invoked when a {@link IPCEvents.RequestLogs} event is received.\n *\n * @remarks\n * The Host app can request logs from the Client app by sending a RequestLogs event. The callback\n * will receive a skipCompression parameter indicating whether the logs should be compressed or not.\n *\n * When skipCompression is true, the logs should be sent uncompressed. When false or undefined,\n * the logs should be compressed before sending.\n *\n * @param callback - A callback function to be invoked when a {@link IPCEvents.RequestLogs} event\n * is received. The callback receives an optional skipCompression parameter.\n *\n * @returns An unsubscribe callback to remove the listener.\n */\n onRequestLogsMessage(callback: (skipCompression?: boolean) => void) {\n this.logger.debug('Registering for Request Logs Message');\n\n this.listeners.get(IPCEvents.RequestLogs)?.add(callback as GenericCallback);\n\n return () => this.listeners.get(IPCEvents.RequestLogs)?.delete(callback as GenericCallback);\n }\n\n /**\n * Requests the current call information from the `Host` app.\n *\n * @remarks\n * This method requires protocol version 2.2 or higher. If the negotiated version\n * is lower, an {@link UnsupportedVersionError} will be thrown.\n *\n * @returns A promise with an array of {@link CallInfoItem} objects representing\n * the current calls.\n *\n * @throws {@link UnsupportedVersionError} if the negotiated version is below 2.2.\n */\n requestCallInfo(): Promise<CallInfoItem[]> {\n this.logger.debug('Requesting Call Info');\n\n if (this.negotiatedVersion === '2.0' || this.negotiatedVersion === '2.1') {\n throw new UnsupportedVersionError('2.2', this.negotiatedVersion);\n }\n\n return firstValueFrom(this.helper.requestCallInfo().pipe(map((reply) => reply.calls)));\n }\n\n /**\n * Registers a callback to be invoked when a {@link IPCEvents.CallInfo} event is received.\n *\n * @remarks\n * The Host app sends CALL INFO updates when call state changes occur. This includes\n * new calls, call state transitions, and call terminations.\n *\n * Note: This event is only available on protocol version 2.2 or higher. On lower versions,\n * the callback will never be invoked.\n *\n * @param callback - A callback function to be invoked when a {@link IPCEvents.CallInfo} event\n * is received. The callback receives an array of {@link CallInfoItem} objects.\n *\n * @returns An unsubscribe callback to remove the listener.\n */\n onCallInfo(callback: (calls: CallInfoItem[]) => void): UnsubscribeCallback {\n this.logger.debug('Registering for Call Info updates');\n\n this.listeners.get(IPCEvents.CallInfo)?.add(callback as GenericCallback);\n\n return () => this.listeners.get(IPCEvents.CallInfo)?.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","K","X","S","u","N","te","k","D","se","R","L","F","a","c","P","re","U","V","$","h","M","f","z","H","Q","B","W","ne","_","ie","O","le","A","oe","T","ae","I","ce","de","Y","ue","he","fe","G","pe","C","ge","ye","w","me","we","Me","j","J","ve","q","Ce","Z","ee","Ee","SUPPORTED_VERSIONS","IPCManager","logger","__publicField","IpcHelper","context","reply","msg","corelationId","modeOrOpts","currentContactsOrContactType","contactType","result","UnsupportedVersionError","InvalidParameterError","mode","currentContacts","resolvedContactType","options","streamId","resultTypes","contacts","count","isActivity","url","data","contact","callback"],"mappings":";;;AAKkB,IAAAA,sBAAAA,OAIhBA,EAAA,aAAa,eAKbA,EAAA,YAAY,aAKZA,EAAA,YAAY,cAKZA,EAAA,cAAc,gBAKdA,EAAA,WAAW,aAxBKA,IAAAA,KAAA,CAAA,CAAA,GCWdC,IAAgB,SAASC,GAAGC,GAAG;AACjC,SAAAF,IAAgB,OAAO,kBAClB,EAAE,WAAW,CAAA,eAAgB,SAAS,SAAUC,GAAGC,GAAG;AAAE,IAAAD,EAAE,YAAYC;AAAA,EAAE,KACzE,SAAUD,GAAGC,GAAG;AAAE,aAASC,KAAKD;AAAG,MAAI,OAAO,UAAU,eAAe,KAAKA,GAAGC,CAAC,MAAGF,EAAEE,CAAC,IAAID,EAAEC,CAAC;AAAA,KAC1FH,EAAcC,GAAGC,CAAC;AAC3B;AAEO,SAASE,EAAUH,GAAGC,GAAG;AAC9B,MAAI,OAAOA,KAAM,cAAcA,MAAM;AACjC,UAAM,IAAI,UAAU,yBAAyB,OAAOA,CAAC,IAAI,+BAA+B;AAC5F,EAAAF,EAAcC,GAAGC,CAAC;AAClB,WAASG,IAAK;AAAE,SAAK,cAAcJ;AAAA,EAAI;AACvC,EAAAA,EAAE,YAAYC,MAAM,OAAO,OAAO,OAAOA,CAAC,KAAKG,EAAG,YAAYH,E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32,33,34]}
1
+ {"version":3,"file":"ipc-sdk.js","sources":["../../../node_modules/.pnpm/tslib@2.6.2/node_modules/tslib/tslib.es6.mjs","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/isFunction.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Subscription.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/config.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/noop.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/errorContext.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Subscriber.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/symbol/observable.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/identity.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/pipe.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Observable.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/lift.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/ObjectUnsubscribedError.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Subject.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/dateTimestampProvider.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/Action.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/intervalProvider.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/AsyncAction.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/Scheduler.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/AsyncScheduler.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/scheduler/async.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/isScheduler.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/EmptyError.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/firstValueFrom.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/util/isDate.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/map.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/observable/timer.js","../../../node_modules/.pnpm/rxjs@7.8.2/node_modules/rxjs/dist/esm5/internal/operators/tap.js","../../ipc-protocol/lib/ipc-protocol.js","../src/lib/events.ts","../src/lib/sdk.ts"],"sourcesContent":["/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\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); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n function next() {\n while (env.stack.length) {\n var rec = env.stack.pop();\n try {\n var result = rec.dispose && rec.dispose.call(rec.value);\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n catch (e) {\n fail(e);\n }\n }\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\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) {\n return function EmptyErrorImpl() {\n _super(this);\n this.name = 'EmptyError';\n this.message = 'no elements in sequence';\n };\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 K = Object.defineProperty;\nvar X = (n, t, e) => t in n ? K(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;\nvar S = (n, t, e) => (X(n, typeof t != \"symbol\" ? t + \"\" : t, e), e);\nimport { Subject as Z, timer as ee } from \"rxjs\";\nclass u extends Error {\n constructor(e) {\n super(`Incorrect context (${e}). Cannot perform the requested operation.`);\n S(this, \"context\");\n this.context = e;\n }\n}\nclass m extends Error {\n constructor(t, e, s) {\n super(`Invalid parameter (${t}). ${s}`), this.param = t, this.value = e, this.reason = s;\n }\n}\nclass N 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 k extends Error {\n constructor(t) {\n super(`${t} needs to be initialized before it can be used.`);\n }\n}\nclass D extends Error {\n constructor(t, e) {\n let s = `Unsupported Protocol ${Array.isArray(t) ? \"versions\" : \"version\"}: (${t}).`;\n e && (s += ` Minimum version supported is ${e}.`), super(s), this.version = t;\n }\n}\nfunction E(n) {\n return typeof n == \"function\";\n}\nfunction se(n) {\n return E(n == null ? void 0 : n.lift);\n}\nfunction b(n) {\n return function(t) {\n if (se(t))\n return t.lift(function(e) {\n try {\n return n(e, this);\n } catch (s) {\n this.error(s);\n }\n });\n throw new TypeError(\"Unable to lift unknown Observable type\");\n };\n}\nvar R = function(n, t) {\n return R = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, s) {\n e.__proto__ = s;\n } || function(e, s) {\n for (var r in s)\n Object.prototype.hasOwnProperty.call(s, r) && (e[r] = s[r]);\n }, R(n, t);\n};\nfunction L(n, t) {\n if (typeof t != \"function\" && t !== null)\n throw new TypeError(\"Class extends value \" + String(t) + \" is not a constructor or null\");\n R(n, t);\n function e() {\n this.constructor = n;\n }\n n.prototype = t === null ? Object.create(t) : (e.prototype = t.prototype, new e());\n}\nfunction F(n) {\n var t = typeof Symbol == \"function\" && Symbol.iterator, e = t && n[t], s = 0;\n if (e)\n return e.call(n);\n if (n && typeof n.length == \"number\")\n return {\n next: function() {\n return n && s >= n.length && (n = void 0), { value: n && n[s++], done: !n };\n }\n };\n throw new TypeError(t ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\nfunction x(n, t) {\n var e = typeof Symbol == \"function\" && n[Symbol.iterator];\n if (!e)\n return n;\n var s = e.call(n), r, i = [], a;\n try {\n for (; (t === void 0 || t-- > 0) && !(r = s.next()).done; )\n i.push(r.value);\n } catch (c) {\n a = { error: c };\n } finally {\n try {\n r && !r.done && (e = s.return) && e.call(s);\n } finally {\n if (a)\n throw a.error;\n }\n }\n return i;\n}\nfunction P(n, t, e) {\n if (e || arguments.length === 2)\n for (var s = 0, r = t.length, i; s < r; s++)\n (i || !(s in t)) && (i || (i = Array.prototype.slice.call(t, 0, s)), i[s] = t[s]);\n return n.concat(i || Array.prototype.slice.call(t));\n}\nfunction re(n) {\n var t = function(s) {\n Error.call(s), s.stack = new Error().stack;\n }, e = n(t);\n return e.prototype = Object.create(Error.prototype), e.prototype.constructor = e, e;\n}\nvar U = re(function(n) {\n return function(e) {\n n(this), this.message = e ? e.length + ` errors occurred during unsubscription:\n` + e.map(function(s, r) {\n return r + 1 + \") \" + s.toString();\n }).join(`\n `) : \"\", this.name = \"UnsubscriptionError\", this.errors = e;\n };\n});\nfunction V(n, t) {\n if (n) {\n var e = n.indexOf(t);\n 0 <= e && n.splice(e, 1);\n }\n}\nvar $ = function() {\n function n(t) {\n this.initialTeardown = t, this.closed = !1, this._parentage = null, this._finalizers = null;\n }\n return n.prototype.unsubscribe = function() {\n var t, e, s, r, i;\n if (!this.closed) {\n this.closed = !0;\n var a = this._parentage;\n if (a)\n if (this._parentage = null, Array.isArray(a))\n try {\n for (var c = F(a), o = c.next(); !o.done; o = c.next()) {\n var d = o.value;\n d.remove(this);\n }\n } catch (v) {\n t = { error: v };\n } finally {\n try {\n o && !o.done && (e = c.return) && e.call(c);\n } finally {\n if (t)\n throw t.error;\n }\n }\n else\n a.remove(this);\n var h = this.initialTeardown;\n if (E(h))\n try {\n h();\n } catch (v) {\n i = v instanceof U ? v.errors : [v];\n }\n var l = this._finalizers;\n if (l) {\n this._finalizers = null;\n try {\n for (var M = F(l), f = M.next(); !f.done; f = M.next()) {\n var z = f.value;\n try {\n H(z);\n } catch (v) {\n i = i ?? [], v instanceof U ? i = P(P([], x(i)), x(v.errors)) : i.push(v);\n }\n }\n } catch (v) {\n s = { error: v };\n } finally {\n try {\n f && !f.done && (r = M.return) && r.call(M);\n } finally {\n if (s)\n throw s.error;\n }\n }\n }\n if (i)\n throw new U(i);\n }\n }, n.prototype.add = function(t) {\n var e;\n if (t && t !== this)\n if (this.closed)\n H(t);\n else {\n if (t instanceof n) {\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 }, n.prototype._hasParent = function(t) {\n var e = this._parentage;\n return e === t || Array.isArray(e) && e.includes(t);\n }, n.prototype._addParent = function(t) {\n var e = this._parentage;\n this._parentage = Array.isArray(e) ? (e.push(t), e) : e ? [e, t] : t;\n }, n.prototype._removeParent = function(t) {\n var e = this._parentage;\n e === t ? this._parentage = null : Array.isArray(e) && V(e, t);\n }, n.prototype.remove = function(t) {\n var e = this._finalizers;\n e && V(e, t), t instanceof n && t._removeParent(this);\n }, n.EMPTY = function() {\n var t = new n();\n return t.closed = !0, t;\n }(), n;\n}();\n$.EMPTY;\nfunction Q(n) {\n return n instanceof $ || n && \"closed\" in n && E(n.remove) && E(n.add) && E(n.unsubscribe);\n}\nfunction H(n) {\n E(n) ? n() : n.unsubscribe();\n}\nvar B = {\n onUnhandledError: null,\n onStoppedNotification: null,\n Promise: void 0,\n useDeprecatedSynchronousErrorHandling: !1,\n useDeprecatedNextContext: !1\n}, W = {\n setTimeout: function(n, t) {\n for (var e = [], s = 2; s < arguments.length; s++)\n e[s - 2] = arguments[s];\n return setTimeout.apply(void 0, P([n, t], x(e)));\n },\n clearTimeout: function(n) {\n var t = W.delegate;\n return ((t == null ? void 0 : t.clearTimeout) || clearTimeout)(n);\n },\n delegate: void 0\n};\nfunction ne(n) {\n W.setTimeout(function() {\n throw n;\n });\n}\nfunction _() {\n}\nfunction ie(n) {\n n();\n}\nvar O = function(n) {\n L(t, n);\n function t(e) {\n var s = n.call(this) || this;\n return s.isStopped = !1, e ? (s.destination = e, Q(e) && e.add(s)) : s.destination = le, s;\n }\n return t.create = function(e, s, r) {\n return new A(e, s, r);\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, n.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}($), oe = Function.prototype.bind;\nfunction T(n, t) {\n return oe.call(n, t);\n}\nvar ae = function() {\n function n(t) {\n this.partialObserver = t;\n }\n return n.prototype.next = function(t) {\n var e = this.partialObserver;\n if (e.next)\n try {\n e.next(t);\n } catch (s) {\n I(s);\n }\n }, n.prototype.error = function(t) {\n var e = this.partialObserver;\n if (e.error)\n try {\n e.error(t);\n } catch (s) {\n I(s);\n }\n else\n I(t);\n }, n.prototype.complete = function() {\n var t = this.partialObserver;\n if (t.complete)\n try {\n t.complete();\n } catch (e) {\n I(e);\n }\n }, n;\n}(), A = function(n) {\n L(t, n);\n function t(e, s, r) {\n var i = n.call(this) || this, a;\n if (E(e) || !e)\n a = {\n next: e ?? void 0,\n error: s ?? void 0,\n complete: r ?? void 0\n };\n else {\n var c;\n i && B.useDeprecatedNextContext ? (c = Object.create(e), c.unsubscribe = function() {\n return i.unsubscribe();\n }, a = {\n next: e.next && T(e.next, c),\n error: e.error && T(e.error, c),\n complete: e.complete && T(e.complete, c)\n }) : a = e;\n }\n return i.destination = new ae(a), i;\n }\n return t;\n}(O);\nfunction I(n) {\n ne(n);\n}\nfunction ce(n) {\n throw n;\n}\nvar le = {\n closed: !0,\n next: _,\n error: ce,\n complete: _\n}, de = function() {\n return typeof Symbol == \"function\" && Symbol.observable || \"@@observable\";\n}();\nfunction Y(n) {\n return n;\n}\nfunction ue(n) {\n return n.length === 0 ? Y : n.length === 1 ? n[0] : function(e) {\n return n.reduce(function(s, r) {\n return r(s);\n }, e);\n };\n}\nvar he = function() {\n function n(t) {\n t && (this._subscribe = t);\n }\n return n.prototype.lift = function(t) {\n var e = new n();\n return e.source = this, e.operator = t, e;\n }, n.prototype.subscribe = function(t, e, s) {\n var r = this, i = fe(t) ? t : new A(t, e, s);\n return ie(function() {\n var a = r, c = a.operator, o = a.source;\n i.add(c ? c.call(i, o) : o ? r._subscribe(i) : r._trySubscribe(i));\n }), i;\n }, n.prototype._trySubscribe = function(t) {\n try {\n return this._subscribe(t);\n } catch (e) {\n t.error(e);\n }\n }, n.prototype.forEach = function(t, e) {\n var s = this;\n return e = G(e), new e(function(r, i) {\n var a = new A({\n next: function(c) {\n try {\n t(c);\n } catch (o) {\n i(o), a.unsubscribe();\n }\n },\n error: i,\n complete: r\n });\n s.subscribe(a);\n });\n }, n.prototype._subscribe = function(t) {\n var e;\n return (e = this.source) === null || e === void 0 ? void 0 : e.subscribe(t);\n }, n.prototype[de] = function() {\n return this;\n }, n.prototype.pipe = function() {\n for (var t = [], e = 0; e < arguments.length; e++)\n t[e] = arguments[e];\n return ue(t)(this);\n }, n.prototype.toPromise = function(t) {\n var e = this;\n return t = G(t), new t(function(s, r) {\n var i;\n e.subscribe(function(a) {\n return i = a;\n }, function(a) {\n return r(a);\n }, function() {\n return s(i);\n });\n });\n }, n.create = function(t) {\n return new n(t);\n }, n;\n}();\nfunction G(n) {\n var t;\n return (t = n ?? B.Promise) !== null && t !== void 0 ? t : Promise;\n}\nfunction pe(n) {\n return n && E(n.next) && E(n.error) && E(n.complete);\n}\nfunction fe(n) {\n return n && n instanceof O || pe(n) && Q(n);\n}\nfunction C(n, t, e, s, r) {\n return new ge(n, t, e, s, r);\n}\nvar ge = function(n) {\n L(t, n);\n function t(e, s, r, i, a, c) {\n var o = n.call(this, e) || this;\n return o.onFinalize = a, o.shouldUnsubscribe = c, o._next = s ? function(d) {\n try {\n s(d);\n } catch (h) {\n e.error(h);\n }\n } : n.prototype._next, o._error = i ? function(d) {\n try {\n i(d);\n } catch (h) {\n e.error(h);\n } finally {\n this.unsubscribe();\n }\n } : n.prototype._error, o._complete = r ? function() {\n try {\n r();\n } catch (d) {\n e.error(d);\n } finally {\n this.unsubscribe();\n }\n } : n.prototype._complete, o;\n }\n return t.prototype.unsubscribe = function() {\n var e;\n if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) {\n var s = this.closed;\n n.prototype.unsubscribe.call(this), !s && ((e = this.onFinalize) === null || e === void 0 || e.call(this));\n }\n }, t;\n}(O);\nfunction p(n, t) {\n return b(function(e, s) {\n var r = 0;\n e.subscribe(C(s, function(i) {\n s.next(n.call(t, i, r++));\n }));\n });\n}\nvar ye = new he(function(n) {\n return n.complete();\n});\nfunction w(n) {\n return n <= 0 ? function() {\n return ye;\n } : b(function(t, e) {\n var s = 0;\n t.subscribe(C(e, function(r) {\n ++s <= n && (e.next(r), n <= s && e.complete());\n }));\n });\n}\nfunction y(n, t) {\n return b(function(e, s) {\n var r = 0;\n e.subscribe(C(s, function(i) {\n return n.call(t, i, r++) && s.next(i);\n }));\n });\n}\nfunction me(n, t) {\n return t === void 0 && (t = !1), b(function(e, s) {\n var r = 0;\n e.subscribe(C(s, function(i) {\n var a = n(i, r++);\n (a || t) && s.next(i), !a && s.complete();\n }));\n });\n}\nfunction g(n, t, e) {\n var s = E(n) || t || e ? { next: n, error: t, complete: e } : n;\n return s ? b(function(r, i) {\n var a;\n (a = s.subscribe) === null || a === void 0 || a.call(s);\n var c = !0;\n r.subscribe(C(i, function(o) {\n var d;\n (d = s.next) === null || d === void 0 || d.call(s, o), i.next(o);\n }, function() {\n var o;\n c = !1, (o = s.complete) === null || o === void 0 || o.call(s), i.complete();\n }, function(o) {\n var d;\n c = !1, (d = s.error) === null || d === void 0 || d.call(s, o), i.error(o);\n }, function() {\n var o, d;\n c && ((o = s.unsubscribe) === null || o === void 0 || o.call(s)), (d = s.finalize) === null || d === void 0 || d.call(s);\n }));\n }) : Y;\n}\nconst we = /^(\\d+)\\.(\\d+)$/;\nfunction Me(n) {\n if (typeof n == \"string\") {\n const t = n.match(we);\n if (t)\n return `${t[1]}.${t[2]}`;\n }\n throw new te(n);\n}\nfunction j(n) {\n const t = Me(n), [e, s] = t.split(\".\"), [r, i] = [parseInt(e), parseInt(s)];\n return [r, i];\n}\nfunction J(n, t) {\n const [e, s] = j(n), [r, i] = j(t);\n return e < r ? -1 : e > r ? 1 : s < i ? -1 : s > i ? 1 : 0;\n}\nfunction ve(n, t) {\n return J(n, t) >= 0;\n}\nconst q = \"2.0\";\nclass Ce {\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 S(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 S(this, \"currentContext\");\n S(this, \"incomingMessages$\");\n S(this, \"inIframe\", !1);\n S(this, \"embeddedResult\");\n S(this, \"iframePort1\");\n S(this, \"iframePort2\");\n if (this.supportedVersions = t, this.logService = e, this.incomingMessages$ = new Z(), this.supportedVersions = t.filter((s) => ve(s, q)), !this.supportedVersions.length)\n throw new D(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, s, r;\n if (this.inIframe) {\n if (!this.iframePort2)\n throw new k(\"port2\");\n return this.iframePort2;\n } else {\n if (!((e = (t = window.Acrobits) == null ? void 0 : t.messageChannel) != null && e.port2))\n throw new k(\"port2\");\n return (r = (s = window.Acrobits) == null ? void 0 : s.messageChannel) == null ? void 0 : r.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 ee(1e3).pipe(\n p(() => (this.isEmbedded() ? this.currentContext = \"user\" : this.currentContext = \"guest\", this.currentContext)),\n w(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 u(this.currentContext);\n const t = \"HELLO\", e = this.createMessage(t);\n e.protocolVersions = this.supportedVersions, this.logCreated(t, e);\n const s = this.incomingMessages$.pipe(\n y((r) => r.type === t && r.replyTo === e.id),\n p((r) => r),\n g(this.logReceived()),\n p((r) => {\n if (!this.supportedVersions.includes(r.protocolVersion))\n throw new D(r.protocolVersion, this.supportedVersions[0]);\n return r.displayName || (r.displayName = r.cloudUsername), r;\n }),\n g((r) => {\n this.negotiatedProtocolVersion = r.protocolVersion, this.logService.info(\n `[IPC] Negotiated IPC Protocol Version: ${this.negotiatedProtocolVersion}`\n ), !r.networkId && this.compareVersion(\"2.2\") >= 0 && this.logService.error(\n `[IPC] Network ID is not set in the HELLO message reply. 'networkId' is required for protocol version ${this.negotiatedProtocolVersion}, and the client may derive an incorrect network ID from the cloudId.`\n );\n }),\n w(1)\n );\n return this.logService.debug(`Created ${t} Reply handler`), this.inIframe ? this.createIframeChannel().then(() => this.finishIpcSetup(e)) : this.finishIpcSetup(e), s;\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 u(this.currentContext);\n const t = \"TOKEN\", e = this.createMessage(t);\n this.logCreated(t, e);\n const s = this.incomingMessages$.pipe(\n y((r) => r.type === t && r.replyTo === e.id),\n p((r) => r),\n g(this.logReceived()),\n w(1)\n );\n return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), s;\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 u(this.currentContext);\n const {\n roomName: e,\n roomInvite: s,\n displayName: r,\n jwtToken: i,\n serverUrl: a,\n region: c,\n joinMicMuted: o,\n joinWithoutCamera: d\n } = t, h = \"JOINING ROOM\", l = this.createMessage(h, !1);\n l.roomName = e, l.jwtToken = i, l.serverUrl = a, l.region = c, l.roomInvite = s, l.joinMicMuted = o ?? !1, l.joinWithoutCamera = d ?? !1, l.displayName = r, this.logCreated(h, l), this.port2.postMessage(l), this.logSent(h, l);\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 u(this.currentContext);\n const e = \"LEAVING ROOM\", s = this.createMessage(e, !1);\n s.roomName = t, this.logCreated(e, s), this.port2.postMessage(s), this.logSent(e, s);\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 u(this.currentContext);\n const t = \"JOIN ROOM\";\n return this.incomingMessages$.pipe(\n y((e) => e.type === t && e.target === \"client\"),\n p((e) => e),\n g(this.logReceived()),\n p((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 u(this.currentContext);\n const t = \"LEAVE ROOM\";\n return this.incomingMessages$.pipe(\n y((e) => e.type === t && e.target === \"client\"),\n p((e) => e),\n g(this.logReceived()),\n p((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 u(this.currentContext);\n const t = \"CONFIG\";\n return this.incomingMessages$.pipe(\n y((e) => e.type === t && e.target === \"client\"),\n p((e) => e),\n g(this.logReceived()),\n p((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 timeFormat: e.timeFormat ?? \"default\"\n }))\n );\n }\n sendScreenshareSourceMessage(t) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const e = \"SCREENSHARE SOURCE\", s = this.createMessage(e);\n s.sourceTypes = t, this.logCreated(e, s);\n const r = this.incomingMessages$.pipe(\n y((i) => i.type === e && i.replyTo === s.id),\n p((i) => i),\n g(this.logReceived()),\n p((i) => i),\n w(1)\n );\n return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(s), this.logSent(e, s), r;\n }\n layoutChange(t, e, s) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const r = \"LAYOUT CHANGE\";\n let i, a;\n if (e && s ? (i = this.createMessage(r, !1, s), i.result = e) : (i = this.createMessage(r), a = this.incomingMessages$.pipe(\n y((c) => c.type === r && c.replyTo === i.id),\n p((c) => c),\n g(this.logReceived()),\n p((c) => c),\n w(1)\n ), this.logService.debug(`Created ${r} Reply handler`)), i.layout = t, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i), a)\n return a;\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 u(this.currentContext);\n const t = \"LAYOUT CHANGE\";\n return this.incomingMessages$.pipe(\n y((e) => e.type === t && e.target === \"client\" && e.replyTo === null),\n p((e) => e),\n g(this.logReceived()),\n p((e) => e)\n );\n }\n requestOAuthToken(t) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n Array.isArray(t) || (t = [t]);\n const e = \"OAUTH TOKEN\", s = this.createMessage(e);\n s.providerTypes = t, this.logCreated(e, s);\n const r = this.incomingMessages$.pipe(\n y((i) => i.type === e && i.replyTo === s.id),\n p((i) => i),\n g(this.logReceived()),\n w(1)\n );\n return this.logService.debug(`Created ${e} Reply handler`), this.port2.postMessage(s), this.logSent(e, s), r;\n }\n openUrl(t, e) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const s = \"OPEN URL\", r = this.createMessage(s, !1);\n r.url = t, r.data = e, this.logCreated(s, r), this.port2.postMessage(r), this.logSent(s, r);\n }\n selectContacts(t, e, s, r) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n if (this.negotiatedProtocolVersion === \"2.0\") {\n if (e === void 0 || typeof e == \"object\")\n throw new m(\n \"streamType\",\n e,\n \"streamType is missing or invalid\"\n );\n if (s === void 0 || typeof s == \"object\" || typeof s == \"number\")\n throw new m(\n \"contactType\",\n s,\n \"contactType is missing or invalid\"\n );\n return this.selectContactsV2_0(\n t,\n e,\n s,\n r\n );\n }\n if (typeof e < \"u\" && typeof e != \"object\")\n throw new m(\"options\", e, \"options is invalid\");\n if (typeof s < \"u\" && !Array.isArray(s))\n throw new m(\n \"currentContacts\",\n s,\n \"currentContacts is invalid\"\n );\n return this.selectContactsV2_1(t, e, s);\n }\n selectContactsV2_0(t, e, s, r) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n r && r.length > 0 && (r = r.map((o) => o.type === \"cloudUsername\" && o.contactUser ? {\n ...o,\n cloudId: o.cloudId || o.contactUser.cloudId,\n networkId: o.networkId || o.contactUser.networkId,\n cloudUsername: o.cloudUsername || o.contactUser.cloudUsername\n } : o));\n const i = \"SELECT CONTACTS\", a = this.createMessage(i, !0);\n a.streamId = t, a.streamType = e, a.contactType = s, a.resultTypes = [s], a.currentContacts = r, this.logCreated(i, a);\n const c = this.incomingMessages$.pipe(\n y((o) => o.type === i && o.replyTo === a.id),\n g(this.logReceived()),\n p((o) => {\n const d = o;\n if (d.result === \"success\") {\n if (d.streamId !== t)\n throw new N(d.streamId, t);\n e === \"direct\" && d.contacts.length > 1 && (d.contacts = [d.contacts[0]]);\n }\n return d;\n }),\n w(1)\n );\n return this.logService.debug(`Created ${i} Reply handler`), this.port2.postMessage(a), this.logSent(i, a), c;\n }\n selectContactsV2_1(t, e, s) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const r = {\n allowMultipleSelection: (e == null ? void 0 : e.allowMultipleSelection) ?? !1,\n filterToSelectedType: (e == null ? void 0 : e.filterToSelectedType) ?? !1,\n resultTypes: (e == null ? void 0 : e.resultTypes) ?? [\"cloudUsername\"],\n streamName: e == null ? void 0 : e.streamName\n };\n if (r.filterToSelectedType) {\n if (!r.allowMultipleSelection)\n throw new m(\n \"filterToSelectedType\",\n r.filterToSelectedType,\n \"filterToSelectedType can only be set when allowMultipleSelection is true\"\n );\n if (r.resultTypes.length === 1 && this.logService.warn(\n \"[IPC] [SelectContacts] filterToSelectedType is redundant when resultTypes contains only one type\"\n ), s && s.length > 0) {\n const o = s[0].type;\n if (s.some((h) => h.type !== o))\n throw new m(\n \"currentContacts\",\n s,\n \"When filterToSelectedType is true, all items in currentContacts must be of the same type\"\n );\n }\n }\n if (s && s.length > 0)\n for (const o of s) {\n if (o.contactId === void 0)\n throw new m(\n \"currentContacts\",\n s,\n \"ContactItem contactId is required since v2.1 on all contacts\"\n );\n if (o.type === \"cloudUsername\") {\n if (!o.contactUser)\n throw new m(\n \"currentContacts\",\n o,\n \"CloudUsername contact must include contactUser since v2.1\"\n );\n if (!o.contactUser.cloudId || !o.contactUser.networkId || !o.contactUser.cloudUsername)\n throw new m(\n \"currentContacts\",\n o,\n \"CloudContact must define cloudUsername, cloudId, and networkId since v2.1\"\n );\n }\n }\n const i = \"SELECT CONTACTS\", a = this.createMessage(i, !0);\n a.streamId = t, a.streamName = r.streamName, a.resultTypes = r.resultTypes, a.currentContacts = s, a.allowMultipleSelection = r.allowMultipleSelection, a.filterToSelectedType = r.filterToSelectedType, this.logCreated(i, a);\n const c = this.incomingMessages$.pipe(\n y((o) => o.type === i && o.replyTo === a.id),\n g(this.logReceived()),\n p((o) => {\n const d = o;\n if (d.result === \"success\") {\n if (d.streamId !== t)\n throw new N(d.streamId, t);\n const h = d.contacts.length;\n if (d.contacts = d.contacts.filter(\n (l) => r.resultTypes.includes(l.type)\n ), d.contacts.length !== h && this.logService.debug(\n `[IPC] [SelectContactsReply] Filtered ${h - d.contacts.length} contacts from reply`\n ), !r.allowMultipleSelection && d.contacts.length > 1 && (d.contacts = [d.contacts[0]]), r.filterToSelectedType && d.contacts.length > 1) {\n const l = d.contacts[0].type;\n if (d.contacts.some(\n (f) => f.type !== l\n ))\n throw new Error(\n `When filterToSelectedType is true, all contacts in the reply must be of the same type. Expected all contacts to be of type '${l}', but received mixed types.`\n );\n }\n for (const l of d.contacts) {\n if (l.type === \"cloudUsername\") {\n if (!l.contactUser)\n throw new Error(\n `CloudUsername contact must include contactUser since v2.1. ContactItem: ${JSON.stringify(\n l\n )}`\n );\n if (!l.contactUser.cloudId || !l.contactUser.networkId || !l.contactUser.cloudUsername)\n throw new Error(\n `CloudContact must define cloudUsername, cloudId, and networkId since v2.1. ContactItem: ${JSON.stringify(\n l\n )}`\n );\n }\n this.negotiatedProtocolVersion === \"2.2\" && (l.type === \"number\" && l.numbers.length > 1 ? l.numbers = [l.numbers[0]] : l.type === \"email\" && l.emails.length > 1 && (l.emails = [l.emails[0]]));\n }\n }\n return d;\n }),\n w(1)\n );\n return this.logService.debug(`Created ${i} Reply handler`), this.port2.postMessage(a), this.logSent(i, a), c;\n }\n matchContacts(t) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n if (!Array.isArray(t))\n throw new m(\"contacts\", t, \"contacts is not an array\");\n if (!t.length)\n throw new m(\"contacts\", t, \"At least one contact is required\");\n const s = this.createMessage(\"MATCH CONTACTS\");\n if (this.compareVersion(\"2.1\") >= 0) {\n for (const i of t)\n if (i.type === \"cloudUsername\") {\n if (!i.contactUser)\n throw new m(\n \"contacts\",\n i,\n \"CloudUsername contact must include contactUser\"\n );\n if (!i.contactUser.cloudUsername || !i.contactUser.cloudId || !i.contactUser.networkId)\n throw new m(\n \"contacts\",\n i,\n \"CloudContact must define cloudUsername, cloudId, and networkId\"\n );\n }\n s.contacts = [...t];\n } else {\n for (const i of t)\n i.type === \"cloudUsername\" && i.contactUser && (i.cloudId = i.contactUser.cloudId, i.networkId = i.contactUser.networkId, i.cloudUsername = i.contactUser.cloudUsername);\n s.contacts = [...t];\n }\n this.logCreated(s.type, s);\n const r = this.incomingMessages$.pipe(\n y((i) => i.type === s.type && i.replyTo === s.id),\n g(this.logReceived()),\n p((i) => {\n const a = i;\n if (this.compareVersion(\"2.1\") >= 0) {\n if (Array.isArray(a.contacts))\n throw new Error(\n \"MatchContactsMessageReply should return a Record<string, DetailedContactItem> of contacts when using IPC Protocol v2.1+\"\n );\n for (const [c, o] of Object.entries(a.contacts)) {\n if (o == null) {\n this.logService.debug(\n `[IPC] [MatchContactsReply] Received null or undefined contact for ${c}`\n );\n continue;\n }\n if (o.contactId === void 0)\n throw new Error(\n `ContactItem 'contactId' is required since v2.1. ContactItem: ${JSON.stringify(\n o\n )}`\n );\n if (!o.contactUser && (!o.uri || o.uri.length === 0) && (!o.numbers || o.numbers.length === 0))\n throw new Error(\n `DetailedContactItem must define at least one contact method (contactUser, uri, or numbers). ContactItem: ${JSON.stringify(\n o\n )}`\n );\n if (o.contactUser && (!o.contactUser.cloudId || !o.contactUser.networkId || !o.contactUser.cloudUsername))\n throw new Error(\n `When contactUser is defined, cloudId, networkId, and cloudUsername must also be defined. ContactItem: ${JSON.stringify(\n o\n )}`\n );\n }\n } else {\n if (!Array.isArray(a.contacts))\n throw new Error(\n \"MatchContactsMessageReply should return an array of contacts when using IPC Protocol v2.0\"\n );\n if (a.contacts.length !== s.contacts.length)\n throw new Error(\n \"The number of contacts in the reply does not match the number of contacts in the request\"\n );\n for (const c of a.contacts) {\n const o = c;\n if (o.type === \"cloudUsername\" && !(\"cloudUsername\" in o))\n throw new Error(\n `CloudUsernameDetailedContactItem must define cloudUsername. ContactItem: ${JSON.stringify(\n c\n )}`\n );\n if (o.type === \"uri\" && (!(\"uri\" in o) || !Array.isArray(o.uri)))\n throw new Error(\n `UriDetailedContactItem must define uri as an array. ContactItem: ${JSON.stringify(\n c\n )}`\n );\n }\n }\n return a;\n }),\n w(1)\n );\n return this.logService.debug(`Created ${s.type} Reply handler`), this.port2.postMessage(s), this.logSent(s.type, s), r;\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 u(this.currentContext);\n const t = \"PUSH MESSAGE\";\n return this.incomingMessages$.pipe(\n y((e) => e.type === t && e.target === \"client\"),\n p((e) => e),\n g(this.logReceived())\n );\n }\n /**\n * Setup listener for {@link DirectChannelCreateAndNavigateMessage}, which can be sent by a Host app to\n * instruct the Client to create (if needed) and navigate to a direct channel.\n *\n * @remarks\n * The Host app does not expect a reply to this message.\n *\n * @returns An observable that emits whenever {@link DirectChannelCreateAndNavigateMessage} is received so it\n * can be subscribed to indefinitely.\n */\n onDirectChannelCreateAndNavigateMessage() {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const t = \"DIRECT CHANNEL CREATE AND NAVIGATE\";\n return this.incomingMessages$.pipe(\n y(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null && e.expectReply === !1\n ),\n g(this.logReceived())\n );\n }\n /**\n * Setup listener for {@link NavigateToRouteMessage}, which can be sent by a Host app to instruct the\n * Client application to navigate to a specific in-app route.\n *\n * @remarks\n * The Host app does not expect a reply to this message.\n *\n * @returns An observable that emits whenever {@link NavigateToRouteMessage} is received so it can be\n * subscribed to indefinitely.\n */\n onNavigateToRouteMessage() {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const t = \"NAVIGATE TO ROUTE\";\n return this.incomingMessages$.pipe(\n y(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null && e.expectReply === !1\n ),\n g(this.logReceived())\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 u(this.currentContext);\n const t = \"PUSH TOKEN\", e = this.createMessage(t);\n this.logCreated(t, e);\n const s = this.incomingMessages$.pipe(\n y((r) => r.type === t && r.replyTo === e.id),\n g(this.logReceived()),\n p((r) => r),\n w(1)\n );\n return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), s;\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 u(this.currentContext);\n const t = \"PUSH TOKEN\";\n return this.incomingMessages$.pipe(\n y(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null && e.expectReply === !1\n ),\n p((e) => {\n if (e.pushToken && e.selector && e.appId)\n return e;\n throw new Error(\"PushTokenMessage is missing required PushTokenPayload fields\");\n }),\n g((e) => e.pushToken),\n g(this.logReceived())\n );\n }\n /**\n * Request current call information from the `Host` app.\n *\n * @remarks\n * The Host app should reply with a {@link CallInfoMessageReply} containing the current call\n * information.\n *\n * @returns Observable with a {@link CallInfoMessageReply} instance containing the call info.\n */\n requestCallInfo() {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const t = \"CALL INFO\", e = this.createMessage(t);\n this.logCreated(t, e);\n const s = this.incomingMessages$.pipe(\n y((r) => r.type === t && r.replyTo === e.id),\n g(this.logReceived()),\n p((r) => r),\n w(1)\n );\n return this.logService.debug(`Created ${t} Reply handler`), this.port2.postMessage(e), this.logSent(t, e), s;\n }\n /**\n * Setup a listener for {@link CallInfoMessageReply}, which can be sent by a Host app to notify\n * of call information changes.\n *\n * @remarks\n * The Host app should send this message whenever call properties change. The Client app can\n * use this to update its call state 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 callInfoSubscription = ipcHelper.onCallInfoMessage().subscribe((msg) => {\n * // your logic for handling call info updates goes here\n * });\n *\n * // don't forget to unsubscribe when you're cleaning up\n * callInfoSubscription.unsubscribe();\n * ```\n *\n * @returns An observable that emits whenever {@link CallInfoMessageReply} is received so it can\n * be subscribed to indefinitely.\n */\n onCallInfoMessage() {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const t = \"CALL INFO\";\n return this.incomingMessages$.pipe(\n y(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null\n ),\n g(this.logReceived())\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 u(this.currentContext);\n const t = \"BADGE QUERY\";\n return this.incomingMessages$.pipe(\n y((e) => e.type === t && e.target === \"client\"),\n p((e) => e),\n g(this.logReceived())\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, s) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const r = \"BADGE UPDATE\", i = this.createMessage(r, !1, s);\n i.count = t, i.activity = e ?? !1, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);\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 u(this.currentContext);\n const s = \"LIFECYCLE\", r = this.createMessage(s, !1);\n r.eventName = t, r.payload = e, this.logCreated(s, r), this.port2.postMessage(r), this.logSent(s, r);\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 u(this.currentContext);\n const t = \"LIFECYCLE\";\n return this.incomingMessages$.pipe(\n y((e) => e.type === t && e.target === \"client\"),\n p((e) => e),\n g(this.logReceived())\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 u(this.currentContext);\n const s = \"LOG\", r = this.createMessage(s, !1);\n r.level = t, r.message = e, this.logCreated(s, r), this.port2.postMessage(r), this.logSent(s, r);\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 u(this.currentContext);\n const t = \"REQUEST LOGS\";\n return this.incomingMessages$.pipe(\n y((e) => e.type === t && e.target === \"client\"),\n p((e) => e),\n g(this.logReceived())\n );\n }\n /**\n * Sends a {@link RequestLogsMessageReply} to the Host app, to reply to a\n * {@link RequestLogsMessage} which had `responseType` set to `file`.\n *\n * @param fileId - UUIDv4 string to identify the file\n * @param fileHash - SHA256 hash of the file\n * @param fileSize - Size of the file in bytes\n * @param format - Format of the file. Can be either `gzip` or `text`\n * @param replyTo - The message ID to which the reply should be sent\n */\n sendRequestLogsMessageReply(t, e, s, r, i) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const a = \"REQUEST LOGS\", c = this.createMessage(a, !1, i);\n c.fileId = t, c.fileHash = e, c.fileSize = s, c.format = r, this.logCreated(a, c), this.port2.postMessage(c), this.logSent(a, c);\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 u(this.currentContext);\n const s = \"VIEW TRANSITION\", r = this.createMessage(s, !1);\n r.transitionType = t, r.targetView = e, this.logCreated(s, r), this.port2.postMessage(r), this.logSent(s, r);\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, s, r, i) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const a = \"FILE REQUEST\", c = this.createMessage(a);\n if (c.fileId = t, c.fileHash = e.toLowerCase(), c.intent = s, c.maxChunkSizeInBytes = i, s === \"attachment\") {\n if (!r)\n throw new m(\n \"streamId\",\n r,\n \"streamId is required for attachment intent\"\n );\n c.streamId = r;\n }\n this.logCreated(a, c);\n let o = 0;\n const d = this.incomingMessages$.pipe(\n y(\n (h) => h.type === a && h.replyTo === c.id\n ),\n g(this.logReceived()),\n g(() => o++),\n p((h) => (h.result === \"success\" && (h.chunkHash = h.chunkHash.toLowerCase(), h.fileHash = h.fileHash.toLowerCase()), h)),\n me((h) => h.result === \"success\" && o < h.totalChunks, !0)\n );\n return this.port2.postMessage(c), this.logSent(a, c), d;\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 u(this.currentContext);\n const s = \"FILE REQUEST\", r = Object.assign(\n e,\n this.createMessage(s, !1, t.id)\n );\n this.logCreated(s, r), this.port2.postMessage(r), this.logSent(s, r);\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 u(this.currentContext);\n const t = \"FILE REQUEST\";\n return this.incomingMessages$.pipe(\n y(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null\n ),\n p((e) => (e.fileHash = e.fileHash.toLowerCase(), e)),\n g(this.logReceived())\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, s, r, i, a) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const c = \"FILE SELECTION\", o = this.createMessage(c);\n if (o.intent = t, o.maxCount = r, o.maxFileSizeInBytes = i, o.mimeTypes = a, t === \"attachment\") {\n if (!e)\n throw new m(\n \"streamId\",\n e,\n \"streamId is required for attachment intent\"\n );\n if (!s)\n throw new m(\n \"correlationId\",\n s,\n \"correlationId is required for attachment intent\"\n );\n o.streamId = e, o.correlationId = s;\n }\n this.logCreated(c, o);\n const d = this.incomingMessages$.pipe(\n y(\n (h) => h.type === c && h.replyTo === o.id\n ),\n p((h) => {\n var l;\n return h.result === \"success\" && (h.files = (l = h.files) == null ? void 0 : l.map((M) => (M.original.fileHash = M.original.fileHash.toLowerCase(), M.preview && (M.preview.fileHash = M.preview.fileHash.toLowerCase()), M))), h;\n }),\n g(this.logReceived()),\n w(1)\n );\n return this.port2.postMessage(o), this.logSent(c, o), d;\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 fileHash - SHA256 hash of the decrypted file.\n * @param url - URL of the file being downloaded.\n * @param correlationId - _Optional_. A UUIDv4 string to identify the message this file was\n * attached to.\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, s) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const r = \"FILE DOWNLOAD PROGRESS QUERY\", i = this.createMessage(\n r,\n !0\n );\n i.fileHash = t.toLowerCase(), i.url = e, i.correlationId = s, this.logCreated(r, i);\n const a = this.incomingMessages$.pipe(\n y(\n (c) => c.type === \"FILE DOWNLOAD PROGRESS UPDATE\" && c.replyTo === i.id\n ),\n g((c) => this.logReceived(c)),\n p((c) => (c.fileHash && (c.fileHash = c.fileHash.toLowerCase()), c)),\n w(1)\n );\n return this.port2.postMessage(i), this.logSent(r, i), a;\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 FileDownloadMessage}.\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 u(this.currentContext);\n const t = \"FILE DOWNLOAD PROGRESS UPDATE\";\n return this.incomingMessages$.pipe(\n y(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null\n ),\n p((e) => (e.fileHash && (e.fileHash = e.fileHash.toLowerCase()), e)),\n g(this.logReceived())\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 fileHash - SHA256 hash of the decrypted file.\n * @param fileId - ID of the original file being uploaded.\n * @param correlationId - _Optional_. A UUIDv4 string to identify the message this file was attached to.\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, s) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const r = \"FILE UPLOAD PROGRESS QUERY\", i = this.createMessage(\n r,\n !0\n );\n i.fileHash = t.toLowerCase(), i.fileId = e, i.correlationId = s, this.logCreated(r, i);\n const a = this.incomingMessages$.pipe(\n y(\n (c) => c.type === \"FILE UPLOAD PROGRESS UPDATE\" && c.replyTo === i.id\n ),\n g(this.logReceived()),\n p((c) => (c.fileHash && (c.fileHash = c.fileHash.toLowerCase()), c)),\n w(1)\n );\n return this.port2.postMessage(i), this.logSent(r, i), a;\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 u(this.currentContext);\n const t = \"FILE UPLOAD PROGRESS UPDATE\";\n return this.incomingMessages$.pipe(\n y(\n (e) => e.type === t && e.target === \"client\" && e.replyTo === null\n ),\n p((e) => (e.fileHash && (e.fileHash = e.fileHash.toLowerCase()), e)),\n g(this.logReceived())\n );\n }\n /**\n * Sends a {@link FileDownloadMessage} to the Host app, to download a file.\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 * If the `host` already has the file in it's storage, it can reply with a\n * {@link FileDownloadSkippedResult} to notify the client that the download was skipped.\n *\n * @param url - URL from where the host should download the file if it isn't in storage.\n * @param key - Key used to encrypt the original attachment.\n * @param fileHash - The SHA256 hash of the file to download.\n * @param mimeType - The MIME type of the file to download.\n * @param fileName - _Optional_. The name of the file to download.\n * @param streamId - _Optional_. ID of the message stream from which the file is downloaded from.\n * @param correlationId - _Optional_. Correlation ID of the message this file was attached to.\n * @param sender - _Optional_. The {@link ContactItem} of the sender of the file.\n * @param intent - _Optional_. The intent of the file download. Can be either `download` or\n * `open`. Defaults to `download`.\n *\n * @returns An observable which emits a {@link FileDownloadMessageReply} instance containing the\n * result of the request. Emits once.\n */\n sendFileDownloadMessage(t, e, s, r, i, a, c, o, d) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n if (o && this.compareVersion(\"2.1\") < 0)\n o.type === \"cloudUsername\" && o.contactUser && (o = {\n ...o,\n cloudId: o.cloudId || o.contactUser.cloudId,\n networkId: o.networkId || o.contactUser.networkId,\n cloudUsername: o.cloudUsername || o.contactUser.cloudUsername\n });\n else if (o && this.compareVersion(\"2.1\") >= 0 && o.type === \"cloudUsername\") {\n if (!o.contactUser)\n throw new m(\n \"sender\",\n o,\n \"CloudUsername contact must include contactUser since v2.1\"\n );\n if (!o.contactUser.cloudId || !o.contactUser.networkId || !o.contactUser.cloudUsername)\n throw new m(\n \"sender\",\n o,\n \"CloudContact must define cloudUsername, cloudId, and networkId since v2.1\"\n );\n }\n const h = \"FILE DOWNLOAD\", l = this.createMessage(h, !0);\n l.url = t, l.key = e, l.fileHash = s.toLowerCase(), l.mimeType = r, l.fileName = i, l.streamId = a, l.correlationId = c, l.sender = o, l.intent = d ?? \"download\", this.logCreated(h, l);\n const M = this.incomingMessages$.pipe(\n y((f) => f.type === h && f.replyTo === l.id),\n g(this.logReceived()),\n p((f) => f),\n w(1)\n );\n return this.port2.postMessage(l), this.logSent(h, l), M;\n }\n /**\n * Sends a {@link CancelFileDownloadMessage} to the Host app, to cancel downloading of a file\n * that was initiated by a {@link FileDownloadMessage} previously.\n *\n * @param fileHash - SHA256 hash of the file to cancel downloading.\n * @param url - URL of the file to cancel download.\n * @param correlationId - _Optional_. UUIDv4 string to identify the message this file was attached to.\n */\n sendCancelFileDownloadMessage(t, e, s) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const r = \"CANCEL FILE DOWNLOAD\", i = this.createMessage(r, !1);\n i.fileHash = t.toLowerCase(), i.url = e, i.correlationId = s, this.logCreated(r, i), this.port2.postMessage(i), this.logSent(r, i);\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 u(this.currentContext);\n const s = \"FILE REMOVE\", r = this.createMessage(s, !0);\n r.hash = t.toLowerCase(), r.streamId = e, this.logCreated(s, r);\n const i = this.incomingMessages$.pipe(\n y((a) => a.type === s && a.replyTo === r.id),\n g(this.logReceived()),\n p((a) => a),\n w(1)\n );\n return this.port2.postMessage(r), this.logSent(s, r), i;\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 u(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 u(this.currentContext);\n const s = \"MESSAGE SENT\", r = this.createMessage(s, !1);\n r.streamId = t, r.correlationId = e, this.logCreated(s, r), this.port2.postMessage(r), this.logSent(s, r);\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, s, r = \"TEXT\", i, a, c, o = !0, d) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const h = \"SEND MESSAGE\", l = this.createMessage(h, !0);\n if (l.streamId = t, l.correlationId = e, l.body = s, l.messageType = r, i && i.length > 0)\n if (this.compareVersion(\"2.1\") < 0)\n l.mentions = i.map((f) => f.contactUser ? {\n ...f,\n cloudId: f.cloudId || f.contactUser.cloudId,\n networkId: f.networkId || f.contactUser.networkId,\n cloudUsername: f.cloudUsername || f.contactUser.cloudUsername\n } : f);\n else {\n for (const f of i) {\n if (f.type === \"cloudUsername\" && !f.contactUser)\n throw new m(\n \"mentions\",\n f,\n \"CloudUsername mention must include contactUser\"\n );\n if (f.contactUser && (!f.contactUser.cloudId || !f.contactUser.networkId || !f.contactUser.cloudUsername))\n throw new m(\n \"mentions\",\n f,\n \"CloudContact must define cloudUsername, cloudId, and networkId\"\n );\n }\n l.mentions = i;\n }\n else\n l.mentions = [];\n l.attachments = (a == null ? void 0 : a.map((f) => f.toLowerCase())) ?? [], l.relatedMessageId = c, l.setCursors = o, l.threadId = d, this.logCreated(h, l);\n const M = this.incomingMessages$.pipe(\n y((f) => f.type === h && f.replyTo === l.id),\n g(this.logReceived()),\n p((f) => f),\n w(1)\n );\n return this.port2.postMessage(l), this.logSent(h, l), M;\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 u(this.currentContext);\n const s = \"CANCEL SEND MESSAGE\", r = this.createMessage(s, !1);\n r.streamId = t, r.correlationId = e, this.logCreated(s, r), this.port2.postMessage(r), this.logSent(s, r);\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 u(this.currentContext);\n const s = \"MESSAGE DELETED\", r = this.createMessage(s, !1);\n r.correlationId = t, r.streamId = e, this.logCreated(s, r), this.port2.postMessage(r), this.logSent(s, r);\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 u(this.currentContext);\n const s = \"SEND MESSAGE STATUS QUERY\", r = this.createMessage(s, !0);\n r.correlationId = t, r.streamId = e, this.logCreated(s, r);\n const i = this.incomingMessages$.pipe(\n y(\n (a) => a.type === \"SEND MESSAGE STATUS UPDATE\" && a.replyTo === r.id\n ),\n g(this.logReceived()),\n p((a) => a),\n w(1)\n );\n return this.port2.postMessage(r), this.logSent(s, r), i;\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 u(this.currentContext);\n const t = \"SEND MESSAGE STATUS UPDATE\";\n return this.incomingMessages$.pipe(\n y((e) => e.type === t && e.target === \"client\" && e.replyTo === null),\n p((e) => e),\n g(this.logReceived())\n );\n }\n /**\n * Send a SIP call message to the Host app.\n *\n * @remarks\n * This message is used to initiate a SIP call to the specified contact.\n *\n * @param contact - The {@link ContactItem} for the callee.\n */\n sendSipCallMessage(t) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n if (this.compareVersion(\"2.1\") < 0)\n t.type === \"cloudUsername\" && t.contactUser && (t = {\n ...t,\n cloudId: t.cloudId || t.contactUser.cloudId,\n networkId: t.networkId || t.contactUser.networkId,\n cloudUsername: t.cloudUsername || t.contactUser.cloudUsername\n });\n else if (t.type === \"cloudUsername\") {\n if (!t.contactUser)\n throw new m(\n \"contact\",\n t,\n \"CloudUsername contact must include contactUser since v2.1\"\n );\n if (!t.contactUser.cloudId || !t.contactUser.networkId || !t.contactUser.cloudUsername)\n throw new m(\n \"contact\",\n t,\n \"CloudContact must define cloudUsername, cloudId, and networkId since v2.1\"\n );\n }\n const e = \"SIP CALL\", s = this.createMessage(e, !1);\n s.contact = t, this.logCreated(e, s), this.port2.postMessage(s), this.logSent(e, s);\n }\n sendCustomFunctionMessage(t, e) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const s = \"CUSTOM FUNCTION\", r = this.createMessage(s, !1);\n r.customFunctionId = t, r.context = e, this.logCreated(s, r), this.port2.postMessage(r), this.logSent(s, r);\n }\n /**\n * Sends a {@link SubscribeButtonsMessage} to the Host app to subscribe to button updates for\n * specific locations.\n *\n * @remarks\n * The host will respond with BUTTONS messages containing the current button configurations\n * for the subscribed locations.\n *\n * @param subscribe - Subscription configuration for different button locations\n *\n * @returns This method returns void.\n */\n sendSubscribeButtonsMessage(t) {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const e = \"SUBSCRIBE BUTTONS\", s = this.createMessage(e, !1);\n s.subscribe = t, this.logCreated(e, s), this.port2.postMessage(s), this.logSent(e, s);\n }\n /**\n * Setup listener for {@link ButtonsMessage}, which can be sent by a Host app to provide button\n * configurations for subscribed locations.\n *\n * @remarks\n * This message is sent in response to a SUBSCRIBE BUTTONS message or when button configurations\n * change for subscribed locations.\n *\n * @example\n * Here is an example of how a listener can be setup:\n *\n * ```ts\n * const ipcHelper = new IpcHelper(['2.2'], console);\n *\n * const buttonsSubscription = ipcHelper.onButtonsMessage().subscribe((msg) => {\n * // your logic for handling the button configurations goes here\n * });\n *\n * // don't forget to unsubscribe when you're cleaning up\n * buttonsSubscription.unsubscribe();\n * ```\n *\n * @returns An Observable that emits whenever {@link ButtonsMessage} is received so it can be\n * subscribed to indefinitely.\n */\n onButtonsMessage() {\n if (!this.isEmbedded())\n throw new u(this.currentContext);\n const t = \"BUTTONS\";\n return this.incomingMessages$.pipe(\n y((e) => e.type === t && e.target === \"client\"),\n p((e) => e),\n g(this.logReceived())\n );\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 J(this.negotiatedProtocolVersion, t);\n }\n logReceived(t) {\n const e = (s) => this.logService.debug(\n `[IPC] Received ${s.type} message${s.replyTo ? \" reply\" : \"\"}`,\n s\n );\n if (t) {\n Ee(t) && (t = { ...t, data: \"...\" }), e(t);\n return;\n } else\n return e;\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 = (s) => {\n s.data === \"message channel port\" && (this.iframePort2 = s.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, s) {\n return {\n type: t,\n id: this.generateId(),\n target: \"host\",\n expectReply: e,\n replyTo: s ?? null\n };\n }\n generateId(t = 8, e = !1) {\n let s = \"1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM\";\n const r = [];\n e && (s = s.substr(0, s.indexOf(\"Q\")));\n for (let i = 0; i < t; i++)\n r.push(s[Math.floor(Math.random() * s.length)]);\n return r.join(\"\");\n }\n}\nfunction Ee(n) {\n return n.type === \"FILE REQUEST\" && n.replyTo !== null;\n}\nexport {\n u as InvalidContextError,\n m as InvalidParameterError,\n N as InvalidStreamIdError,\n te as InvalidVersionFormatError,\n Ce as IpcHelper,\n k as MessagePortNotInitializedError,\n D as UnsupportedVersionError\n};\n","/**\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 /**\n * Event that is fired when the `Host` app sends a REQUEST LOGS event.\n */\n RequestLogs = 'REQUEST LOGS',\n\n /**\n * Event that is fired when the `Host` app sends a CALL INFO update.\n */\n CallInfo = 'CALL INFO'\n}\n","import {\n ContactType,\n InvalidParameterError,\n IpcHelper,\n UnsupportedVersionError,\n type AppContext,\n type CallInfoItem,\n type ContactItem,\n type HomogenizedContactItemArray,\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.2', '2.1', '2.0'];\n\ntype GenericCallback = (...args: unknown[]) => void;\n\ntype SelectContactsOptions = {\n mode: 'single' | 'multi';\n filterToSelectedType: boolean;\n currentContacts?: ContactItem[];\n resultTypes?: ContactType[];\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 * @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 /**\n * The cloud username of the logged in user.\n */\n cloudUsername?: string;\n\n /**\n * The display name of the logged in user.\n */\n displayName?: 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 this.listeners.set(IPCEvents.RequestLogs, new Set());\n this.listeners.set(IPCEvents.CallInfo, 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.helper.onRequestLogsMessage().subscribe((msg) => {\n this.logger.debug('Received Request Logs Message: ', msg);\n\n if (msg.responseType === 'file') {\n this.logger.error('File response type not supported');\n throw new Error('File response type not supported');\n }\n\n for (const cb of this.listeners.get(IPCEvents.RequestLogs)?.values() ?? []) {\n cb(msg.skipCompression);\n }\n });\n\n this.helper.onCallInfoMessage().subscribe((msg) => {\n this.logger.debug('Received Call Info update: ', msg);\n\n for (const cb of this.listeners.get(IPCEvents.CallInfo)?.values() ?? []) {\n cb(msg.calls);\n }\n });\n\n this.cloudId = reply.cloudId;\n this.cloudUsername = reply.cloudUsername;\n this.displayName = reply.displayName;\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 * This overload requires protocol version 2.1 or higher. If the negotiated version\n * is 2.0, an {@link UnsupportedVersionError} will be thrown.\n *\n * @param corelationId - An identifier for the message stream\n * @param options - Configuration options for contact selection:\n * - `mode`: Whether to allow 'single' or 'multi' contact selection\n * - `currentContacts`: For multi-select mode, the list of currently selected contacts\n * - `contactType`: The type of contacts to select ('cloudUsername' or 'uri'). Defaults to 'cloudUsername'\n * - `includeOffNetworkContacts`: Whether to include contacts not on the network. Defaults to false\n *\n * @returns A collection of {@link ContactItem} objects which the user selected\n *\n * @throws {@link UnsupportedVersionError} if the negotiated version is 2.0.\n */\n selectContacts(corelationId: number, options: SelectContactsOptions): Promise<ContactItem[]>;\n\n /**\n * Requests the `Host` app to open the contact selection UI.\n *\n * @deprecated Use the `selectContacts` method with the `options` parameter instead.\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 * @deprecated Use the `selectContacts` method with the `options` parameter instead.\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\n selectContacts(\n corelationId: number,\n modeOrOpts?: 'single' | 'multi' | SelectContactsOptions,\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 (this.negotiatedVersion === '2.0') {\n if (typeof modeOrOpts === 'object') {\n throw new UnsupportedVersionError('2.1', this.negotiatedVersion);\n }\n\n if (typeof modeOrOpts !== 'string' && modeOrOpts !== undefined) {\n throw new InvalidParameterError('mode', modeOrOpts, 'mode must be \"single\" or \"multi\"');\n }\n\n if (contactType === 'number') {\n throw new InvalidParameterError(\n 'contactType',\n contactType,\n 'contactType cannot be \"number\" for version 2.0 of the IPC protocol'\n );\n }\n\n result = this.selectContacts_V2_0(\n corelationId,\n modeOrOpts ?? 'single',\n modeOrOpts === 'multi' ? (currentContactsOrContactType as ContactItem[]) : undefined,\n modeOrOpts === 'multi' ? contactType : (currentContactsOrContactType as ContactType)\n );\n } else {\n if (typeof modeOrOpts === 'object') {\n result = this.selectContacts_V2_1(corelationId, modeOrOpts);\n } else {\n // Gracefully handle deprecated string-based API on v2.1+\n this.logger.warn(\n 'The string-based selectContacts API is deprecated. Please use the options object API instead.'\n );\n\n const mode = modeOrOpts ?? 'single';\n const currentContacts =\n mode === 'multi' ? (currentContactsOrContactType as ContactItem[]) : undefined;\n const resolvedContactType =\n mode === 'multi' ? contactType : (currentContactsOrContactType as ContactType);\n\n const options: SelectContactsOptions = {\n mode,\n filterToSelectedType: false,\n currentContacts,\n resultTypes: resolvedContactType ? [resolvedContactType] : ['cloudUsername']\n };\n\n result = this.selectContacts_V2_1(corelationId, options);\n }\n }\n\n return firstValueFrom(\n result.pipe(\n map((reply) => {\n if (reply.result === 'error') {\n return {\n result: 'error',\n errorMessage: reply.errorMessage\n };\n } else if (reply.result === 'cancelled') {\n return {\n result: 'cancelled'\n };\n } else {\n return reply.contacts;\n }\n })\n )\n );\n }\n\n private selectContacts_V2_0(\n corelationId: number,\n mode: 'single' | 'multi',\n currentContacts?: ContactItem[],\n contactType?: ContactType\n ) {\n this.logger.debug('Selecting Contacts: ', ...arguments);\n\n if (mode === 'multi') {\n if (!currentContacts || !Array.isArray(currentContacts)) {\n throw new InvalidParameterError(\n 'currentContacts',\n currentContacts,\n 'currentContacts is required for group streams'\n );\n }\n\n if (!contactType) {\n contactType = 'cloudUsername';\n }\n\n return this.helper.selectContacts(\n corelationId.toString(),\n 'group',\n contactType,\n currentContacts\n );\n } else {\n if (!contactType) {\n contactType = 'cloudUsername';\n }\n\n return this.helper.selectContacts(corelationId.toString(), 'direct', contactType);\n }\n }\n\n private selectContacts_V2_1(corelationId: number, options: SelectContactsOptions) {\n this.logger.debug('Selecting Contacts: ', options);\n\n const streamId = corelationId.toString();\n const resultTypes = options.resultTypes ?? ['cloudUsername'];\n\n if (options.mode === 'single') {\n return this.helper.selectContacts(streamId, {\n allowMultipleSelection: false,\n resultTypes\n });\n }\n\n if (!options.currentContacts || !Array.isArray(options.currentContacts)) {\n throw new InvalidParameterError(\n 'currentContacts',\n options.currentContacts,\n 'currentContacts is required for group streams'\n );\n }\n\n if (options.filterToSelectedType) {\n // Type assertion is safe here because selectContactsV2_1 validates homogeneity at runtime\n return this.helper.selectContacts(\n streamId,\n {\n allowMultipleSelection: true,\n filterToSelectedType: true,\n resultTypes\n },\n options.currentContacts as HomogenizedContactItemArray\n );\n }\n\n return this.helper.selectContacts(\n streamId,\n {\n allowMultipleSelection: true,\n filterToSelectedType: false,\n resultTypes\n },\n options.currentContacts\n );\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 * @example\n *\n * ```ts\n * // import the IPCManager\n * import { IPCManager } from '@acrobits/ipc-sdk';\n *\n * // create an instance of IPCManager\n * const manager = new IPCManager();\n *\n * // open the URL with additional data\n * const url = 'https://example.com';\n * const data = {\n * name: 'John Doe',\n * age: 30\n * };\n *\n * manager.openUrl(url, data);\n * ```\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 /**\n * Registers a callback to be invoked when a {@link IPCEvents.RequestLogs} event is received.\n *\n * @remarks\n * The Host app can request logs from the Client app by sending a RequestLogs event. The callback\n * will receive a skipCompression parameter indicating whether the logs should be compressed or not.\n *\n * When skipCompression is true, the logs should be sent uncompressed. When false or undefined,\n * the logs should be compressed before sending.\n *\n * @param callback - A callback function to be invoked when a {@link IPCEvents.RequestLogs} event\n * is received. The callback receives an optional skipCompression parameter.\n *\n * @returns An unsubscribe callback to remove the listener.\n */\n onRequestLogsMessage(callback: (skipCompression?: boolean) => void) {\n this.logger.debug('Registering for Request Logs Message');\n\n this.listeners.get(IPCEvents.RequestLogs)?.add(callback as GenericCallback);\n\n return () => this.listeners.get(IPCEvents.RequestLogs)?.delete(callback as GenericCallback);\n }\n\n /**\n * Requests the current call information from the `Host` app.\n *\n * @remarks\n * This method requires protocol version 2.2 or higher. If the negotiated version\n * is lower, an {@link UnsupportedVersionError} will be thrown.\n *\n * @returns A promise with an array of {@link CallInfoItem} objects representing\n * the current calls.\n *\n * @throws {@link UnsupportedVersionError} if the negotiated version is below 2.2.\n */\n requestCallInfo(): Promise<CallInfoItem[]> {\n this.logger.debug('Requesting Call Info');\n\n if (this.negotiatedVersion === '2.0' || this.negotiatedVersion === '2.1') {\n throw new UnsupportedVersionError('2.2', this.negotiatedVersion);\n }\n\n return firstValueFrom(this.helper.requestCallInfo().pipe(map((reply) => reply.calls)));\n }\n\n /**\n * Registers a callback to be invoked when a {@link IPCEvents.CallInfo} event is received.\n *\n * @remarks\n * The Host app sends CALL INFO updates when call state changes occur. This includes\n * new calls, call state transitions, and call terminations.\n *\n * Note: This event is only available on protocol version 2.2 or higher. On lower versions,\n * the callback will never be invoked.\n *\n * @param callback - A callback function to be invoked when a {@link IPCEvents.CallInfo} event\n * is received. The callback receives an array of {@link CallInfoItem} objects.\n *\n * @returns An unsubscribe callback to remove the listener.\n */\n onCallInfo(callback: (calls: CallInfoItem[]) => void): UnsubscribeCallback {\n this.logger.debug('Registering for Call Info updates');\n\n this.listeners.get(IPCEvents.CallInfo)?.add(callback as GenericCallback);\n\n return () => this.listeners.get(IPCEvents.CallInfo)?.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":["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","K","X","S","u","N","te","k","D","se","R","L","F","a","c","P","re","U","V","$","h","M","f","z","H","Q","B","W","ne","_","ie","O","le","A","oe","T","ae","I","ce","de","Y","ue","he","fe","G","pe","C","ge","ye","w","me","we","Me","j","J","ve","q","Ce","Z","ee","Ee","IPCEvents","SUPPORTED_VERSIONS","IPCManager","logger","__publicField","IpcHelper","context","reply","msg","corelationId","modeOrOpts","currentContactsOrContactType","contactType","result","UnsupportedVersionError","InvalidParameterError","mode","currentContacts","resolvedContactType","options","streamId","resultTypes","contacts","count","isActivity","url","data","contact","callback"],"mappings":";;;AAgBA,IAAIA,IAAgB,SAASC,GAAGC,GAAG;AACjC,SAAAF,IAAgB,OAAO,kBAClB,EAAE,WAAW,CAAA,eAAgB,SAAS,SAAUC,GAAGC,GAAG;AAAE,IAAAD,EAAE,YAAYC;AAAA,EAAE,KACzE,SAAUD,GAAGC,GAAG;AAAE,aAASC,KAAKD;AAAG,MAAI,OAAO,UAAU,eAAe,KAAKA,GAAGC,CAAC,MAAGF,EAAEE,CAAC,IAAID,EAAEC,CAAC;AAAA,KAC1FH,EAAcC,GAAGC,CAAC;AAC3B;AAEO,SAASE,EAAUH,GAAGC,GAAG;AAC9B,MAAI,OAAOA,KAAM,cAAcA,MAAM;AACjC,UAAM,IAAI,UAAU,yBAAyB,OAAOA,CAAC,IAAI,+BAA+B;AAC5F,EAAAF,EAAcC,GAAGC,CAAC;AAClB,WAASG,IAAK;AAAE,SAAK,cAAcJ;AAAA,EAAI;AACvC,EAAAA,EAAE,YAAYC,MAAM,OAAO,OAAO,OAAOA,CAAC,KAAKG,EAAG,YAAYH,EAAE,WAAW,IAAIG,EAAI;AACrF;AA2IO,SAASC,EAASC,GAAG;AAC1B,MAAIC,IAAI,OAAO,UAAW,cAAc,OAAO,UAAUC,IAAID,KAAKD,EAAEC,CAAC,GAAGE,IAAI;AAC5E,MAAID;AAAG,WAAOA,EAAE,KAAKF,CAAC;AACtB,MAAIA,KAAK,OAAOA,EAAE,UAAW;AAAU,WAAO;AAAA,MAC1C,MAAM,WAAY;AACd,eAAIA,KA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