!function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";var e,t,n,i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e){return("object"==typeof e&&null!==e||"function"==typeof e)&&"function"==typeof e.then}function o(e){switch(typeof e){case"string":case"symbol":return e.toString();case"function":return e.name;default:throw new Error(`Unexpected ${typeof e} service id type`)}}e||(e=1,n=t||(t={}),function(){var e="object"==typeof globalThis?globalThis:"object"==typeof i?i:"object"==typeof self?self:"object"==typeof this?this:function(){try{return Function("return this;")()}catch(e){}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch(e){}}(),t=r(n);function r(e,t){return function(n,i){Object.defineProperty(e,n,{configurable:!0,writable:!0,value:i}),t&&t(n,i)}}void 0!==e.Reflect&&(t=r(e.Reflect,t)),function(e,t){var n=Object.prototype.hasOwnProperty,i="function"==typeof Symbol,r=i&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",o=i&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,a={__proto__:[]}instanceof Array,c=!s&&!a,u={create:s?function(){return fe(Object.create(null))}:a?function(){return fe({__proto__:null})}:function(){return fe({})},has:c?function(e,t){return n.call(e,t)}:function(e,t){return t in e},get:c?function(e,t){return n.call(e,t)?e[t]:void 0}:function(e,t){return e[t]}},d=Object.getPrototypeOf(Function),l="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:ue(),f="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:de(),h="function"==typeof WeakMap?WeakMap:le(),p=i?Symbol.for("@reflect-metadata:registry"):void 0,v=oe(),g=se(v);function y(e,t,n,i){if(F(n)){if(!W(e))throw new TypeError;if(!G(t))throw new TypeError;return R(e,t)}if(!W(e))throw new TypeError;if(!L(t))throw new TypeError;if(!L(i)&&!F(i)&&!$(i))throw new TypeError;return $(i)&&(i=void 0),T(e,t,n=H(n),i)}function m(e,t){function n(n,i){if(!L(n))throw new TypeError;if(!F(i)&&!X(i))throw new TypeError;M(e,t,n,i)}return n}function w(e,t,n,i){if(!L(n))throw new TypeError;return F(i)||(i=H(i)),M(e,t,n,i)}function b(e,t,n){if(!L(t))throw new TypeError;return F(n)||(n=H(n)),j(e,t,n)}function S(e,t,n){if(!L(t))throw new TypeError;return F(n)||(n=H(n)),P(e,t,n)}function O(e,t,n){if(!L(t))throw new TypeError;return F(n)||(n=H(n)),k(e,t,n)}function A(e,t,n){if(!L(t))throw new TypeError;return F(n)||(n=H(n)),_(e,t,n)}function I(e,t){if(!L(e))throw new TypeError;return F(t)||(t=H(t)),B(e,t)}function E(e,t){if(!L(e))throw new TypeError;return F(t)||(t=H(t)),N(e,t)}function C(e,t,n){if(!L(t))throw new TypeError;if(F(n)||(n=H(n)),!L(t))throw new TypeError;F(n)||(n=H(n));var i=ce(t,n,!1);return!F(i)&&i.OrdinaryDeleteMetadata(e,t,n)}function R(e,t){for(var n=e.length-1;n>=0;--n){var i=(0,e[n])(t);if(!F(i)&&!$(i)){if(!G(i))throw new TypeError;t=i}}return t}function T(e,t,n,i){for(var r=e.length-1;r>=0;--r){var o=(0,e[r])(t,n,i);if(!F(o)&&!$(o)){if(!L(o))throw new TypeError;i=o}}return i}function j(e,t,n){if(P(e,t,n))return!0;var i=ie(t);return!$(i)&&j(e,i,n)}function P(e,t,n){var i=ce(t,n,!1);return!F(i)&&K(i.OrdinaryHasOwnMetadata(e,t,n))}function k(e,t,n){if(P(e,t,n))return _(e,t,n);var i=ie(t);return $(i)?void 0:k(e,i,n)}function _(e,t,n){var i=ce(t,n,!1);if(!F(i))return i.OrdinaryGetOwnMetadata(e,t,n)}function M(e,t,n,i){ce(n,i,!0).OrdinaryDefineOwnMetadata(e,t,n,i)}function B(e,t){var n=N(e,t),i=ie(e);if(null===i)return n;var r=B(i,t);if(r.length<=0)return n;if(n.length<=0)return r;for(var o=new f,s=[],a=0,c=n;a=0&&e=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var i=this._keys.length,r=n+1;r=0;--n){var i=(0,e[n])(t);if(!_(i)&&!M(i)){if(!K(i))throw new TypeError;t=i}}return t}function A(e,t,n,i){for(var r=e.length-1;r>=0;--r){var o=(0,e[r])(t,n,i);if(!_(o)&&!M(o)){if(!N(o))throw new TypeError;i=o}}return i}function I(e,t,n){if(E(e,t,n))return!0;var i=Q(t);return!M(i)&&I(e,i,n)}function E(e,t,n){var i=ie(t,n,!1);return!_(i)&&$(i.OrdinaryHasOwnMetadata(e,t,n))}function C(e,t,n){if(E(e,t,n))return R(e,t,n);var i=Q(t);return M(i)?void 0:C(e,i,n)}function R(e,t,n){var i=ie(t,n,!1);if(!_(i))return i.OrdinaryGetOwnMetadata(e,t,n)}function T(e,t,n,i){ie(n,i,!0).OrdinaryDefineOwnMetadata(e,t,n,i)}function j(e,t){var n=P(e,t),i=Q(e);if(null===i)return n;var r=j(i,t);if(r.length<=0)return n;if(n.length<=0)return r;for(var o=new a,s=[],c=0,u=n;ce,e=>e+1),e}const v="Request",g="Singleton",y="Transient",m="ConstantValue",w="DynamicValue",b="Factory",S="Instance",O="Provider",A="ResolvedValue",I="ServiceRedirection";function*E(...e){for(const t of e)yield*t}class C{#e;#t;#n;constructor(e){this.#e=new Map,this.#t={};for(const t of Reflect.ownKeys(e))this.#t[t]=new Map;this.#n=e}add(e,t){this.#i(e).push(t);for(const n of Reflect.ownKeys(t))this.#r(n,t[n]).push(e)}clone(){const e=this.#o(),t=this.#s(),n=Reflect.ownKeys(this.#n),i=this._buildNewInstance(this.#n);this.#a(this.#e,i.#e,e,t);for(const r of n)this.#c(this.#t[r],i.#t[r],e);return i}get(e,t){return this.#t[e].get(t)}getAllKeys(e){return this.#t[e].keys()}removeByRelation(e,t){const n=this.get(e,t);if(void 0===n)return;const i=new Set(n);for(const r of i){const n=this.#e.get(r);if(void 0===n)throw new Error("Expecting model relation, none found");for(const i of n)i[e]===t&&this.#u(r,i);this.#e.delete(r)}}_buildNewInstance(e){return new C(e)}_cloneModel(e){return e}_cloneRelation(e){return e}#o(){const e=new Map;for(const t of this.#e.keys()){const n=this._cloneModel(t);e.set(t,n)}return e}#s(){const e=new Map;for(const t of this.#e.values())for(const n of t){const t=this._cloneRelation(n);e.set(n,t)}return e}#i(e){let t=this.#e.get(e);return void 0===t&&(t=[],this.#e.set(e,t)),t}#r(e,t){let n=this.#t[e].get(t);return void 0===n&&(n=[],this.#t[e].set(t,n)),n}#d(e,t){const n=t.get(e);if(void 0===n)throw new Error("Expecting model to be cloned, none found");return n}#l(e,t){const n=t.get(e);if(void 0===n)throw new Error("Expecting relation to be cloned, none found");return n}#c(e,t,n){for(const[i,r]of e){const e=new Array;for(const t of r)e.push(this.#d(t,n));t.set(i,e)}}#a(e,t,n,i){for(const[r,o]of e){const e=new Array;for(const t of o)e.push(this.#l(t,i));t.set(this.#d(r,n),e)}}#u(e,t){for(const n of Reflect.ownKeys(t))this.#f(e,n,t[n])}#f(e,t,n){const i=this.#t[t].get(n);if(void 0!==i){const r=i.indexOf(e);-1!==r&&i.splice(r,1),0===i.length&&this.#t[t].delete(n)}}}var R,x;(x=R||(R={})).moduleId="moduleId",x.serviceId="serviceId";class T{#h;#p;constructor(e,t){this.#h=t??new C({moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#p=e}static build(e){return new T(e)}add(e,t){this.#h.add(e,t)}clone(){return new T(this.#p,this.#h.clone())}get(e){const t=[],n=this.#h.get(R.serviceId,e);void 0!==n&&t.push(n);const i=this.#p()?.get(e);if(void 0!==i&&t.push(i),0!==t.length)return E(...t)}removeAllByModuleId(e){this.#h.removeByRelation(R.moduleId,e)}removeAllByServiceId(e){this.#h.removeByRelation(R.serviceId,e)}}const j="@inversifyjs/core/classMetadataReflectKey";function P(){return{constructorArguments:[],lifecycle:{postConstructMethodNames:new Set,preDestroyMethodNames:new Set},properties:new Map,scope:void 0}}const k="@inversifyjs/core/pendingClassMetadataCountReflectKey",_=Symbol.for("@inversifyjs/core/InversifyCoreError");class M extends Error{[_];kind;constructor(e,t,n){super(t,n),this[_]=!0,this.kind=e}static is(e){return"object"==typeof e&&null!==e&&!0===e[_]}static isErrorOfKind(e,t){return M.is(e)&&e.kind===t}}var B,N,D,F,U;function L(e){const t=d(e,j)??P();if(!function(e){const t=d(e,k);return void 0!==t&&0!==t}(e))return function(e,t){const n=[];if(t.length0)throw new M(B.missingInjectionDecorator,`Found unexpected missing metadata on type "${e.name}" at constructor indexes "${n.join('", "')}".\n\nAre you using @inject, @multiInject or @unmanaged decorators at those indexes?\n\nIf you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`)}(e,t.constructorArguments),t;!function(e,t){const n=[];for(let i=0;i!0,moduleId:void 0,onActivation:void 0,onDeactivation:void 0,scope:n,serviceIdentifier:t,type:S}}function z(e){return e.isRight?{isRight:!0,value:e.value}:e}!function(e){e[e.injectionDecoratorConflict=0]="injectionDecoratorConflict",e[e.missingInjectionDecorator=1]="missingInjectionDecorator",e[e.planning=2]="planning",e[e.resolution=3]="resolution",e[e.unknown=4]="unknown"}(B||(B={})),function(e){e[e.unknown=32]="unknown"}(N||(N={})),function(e){e.id="id",e.moduleId="moduleId",e.serviceId="serviceId"}(D||(D={}));let K=class e extends C{_buildNewInstance(t){return new e(t)}_cloneModel(e){return function(e){switch(e.type){case m:case w:return{cache:z((t=e).cache),id:t.id,isSatisfiedBy:t.isSatisfiedBy,moduleId:t.moduleId,onActivation:t.onActivation,onDeactivation:t.onDeactivation,scope:t.scope,serviceIdentifier:t.serviceIdentifier,type:t.type,value:t.value};case b:return function(e){return{cache:z(e.cache),factory:e.factory,id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}}(e);case S:return function(e){return{cache:z(e.cache),id:e.id,implementationType:e.implementationType,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}}(e);case O:return function(e){return{cache:z(e.cache),id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,provider:e.provider,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}}(e);case A:return function(e){return{cache:z(e.cache),factory:e.factory,id:e.id,isSatisfiedBy:e.isSatisfiedBy,metadata:e.metadata,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}}(e);case I:return function(e){return{id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,serviceIdentifier:e.serviceIdentifier,targetServiceIdentifier:e.targetServiceIdentifier,type:e.type}}(e)}var t}(e)}},V=class e{#v;#g;#p;constructor(e,t,n){this.#g=n??new K({id:{isOptional:!1},moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#p=e,this.#v=t}static build(t,n){return new e(t,n)}clone(){return new e(this.#p,this.#v,this.#g.clone())}get(e){const t=this.getNonParentBindings(e)??this.#p()?.get(e);if(void 0!==t)return t;const n=this.#y(e);return void 0===n?n:[n]}*getChained(e){const t=this.getNonParentBindings(e);void 0!==t&&(yield*t);const n=this.#p();if(void 0===n){if(void 0===t){const t=this.#y(e);void 0!==t&&(yield t)}}else yield*n.getChained(e)}getBoundServices(){const e=new Set(this.#g.getAllKeys(D.serviceId)),t=this.#p();if(void 0!==t)for(const n of t.getBoundServices())e.add(n);return e}getById(e){return this.#g.get(D.id,e)??this.#p()?.getById(e)}getByModuleId(e){return this.#g.get(D.moduleId,e)??this.#p()?.getByModuleId(e)}getNonParentBindings(e){return this.#g.get(D.serviceId,e)}getNonParentBoundServices(){return this.#g.getAllKeys(D.serviceId)}removeById(e){this.#g.removeByRelation(D.id,e)}removeAllByModuleId(e){this.#g.removeByRelation(D.moduleId,e)}removeAllByServiceId(e){this.#g.removeByRelation(D.serviceId,e)}set(e){const t={[D.id]:e.id,[D.serviceId]:e.serviceIdentifier};void 0!==e.moduleId&&(t[D.moduleId]=e.moduleId),this.#g.add(e,t)}#y(e){if(void 0===this.#v||"function"!=typeof e)return;const t=q(this.#v,e);return this.set(t),t}};!function(e){e.moduleId="moduleId",e.serviceId="serviceId"}(F||(F={}));let H=class e{#m;#p;constructor(e,t){this.#m=t??new C({moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#p=e}static build(t){return new e(t)}add(e,t){this.#m.add(e,t)}clone(){return new e(this.#p,this.#m.clone())}get(e){const t=[],n=this.#m.get(F.serviceId,e);void 0!==n&&t.push(n);const i=this.#p()?.get(e);if(void 0!==i&&t.push(i),0!==t.length)return E(...t)}removeAllByModuleId(e){this.#m.removeByRelation(F.moduleId,e)}removeAllByServiceId(e){this.#m.removeByRelation(F.serviceId,e)}};function W(e,t,n,i){const r=Array.isArray(e)?e:[e];if(void 0!==n)if("number"!=typeof n)Reflect.decorate(r,t.prototype,n);else for(const o of r)o(t,void 0,n);else Reflect.decorate(r,t)}function J(){return 0}function G(e){return t=>{void 0!==t&&t.kind===N.unknown&&f(e,k,J,e=>e-1)}}!function(e){e[e.multipleInjection=0]="multipleInjection",e[e.singleInjection=1]="singleInjection",e[e.unmanaged=2]="unmanaged"}(U||(U={}));const X=function(e,t){return(...n)=>i=>{if(void 0===i)return e(...n);if(i.kind===U.unmanaged)throw new M(B.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found");return t(i,...n)}}(function(e,t,n){return e===U.multipleInjection?{chained:n?.chained??!1,kind:e,name:void 0,optional:!1,tags:new Map,value:t}:{kind:e,name:void 0,optional:!1,tags:new Map,value:t}},function(e,t,n,i){return function(e){if(e.kind!==N.unknown&&!0!==e.isFromTypescriptParamType)throw new M(B.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found")}(e),t===U.multipleInjection?{...e,chained:i?.chained??!1,kind:t,value:n}:{...e,kind:t,value:n}});function Q(e,t){return n=>{const i=n.properties.get(t);return n.properties.set(t,e(i)),n}}var Y;function Z(e,t){return(n,i,r)=>{try{void 0===r?function(e,t){const n=ee(e,t);return(e,t)=>{f(e.constructor,j,P,Q(n(e),t))}}(e,t)(n,i):"number"==typeof r?function(e,t){const n=ee(e,t);return(e,t,i)=>{if(!function(e,t){return"function"==typeof e&&void 0===t}(e,t))throw new M(B.injectionDecoratorConflict,`Found an @inject decorator in a non constructor parameter.\nFound @inject decorator at method "${t?.toString()??""}" at class "${e.constructor.name}"`);f(e,j,P,function(e,t){return n=>{const i=n.constructorArguments[t];return n.constructorArguments[t]=e(i),n}}(n(e),i))}}(e,t)(n,i,r):function(e,t){const n=ee(e,t);return(e,t,i)=>{if(void 0===i.set)throw new M(B.injectionDecoratorConflict,`Found an @inject decorator in a non setter property method.\nFound @inject decorator at method "${t.toString()}" at class "${e.constructor.name}"`);f(e.constructor,j,P,Q(n(e),t))}}(e,t)(n,i,r)}catch(o){!function(e,t,n,i){if(M.isErrorOfKind(i,B.injectionDecoratorConflict)){const r=function(e,t,n){if(void 0===n){if(void 0===t)throw new M(B.unknown,"Unexpected undefined property and index values");return{kind:Y.property,property:t,targetClass:e.constructor}}return"number"==typeof n?{index:n,kind:Y.parameter,targetClass:e}:{kind:Y.method,method:t,targetClass:e}}(e,t,n);throw new M(B.injectionDecoratorConflict,`Unexpected injection error.\n\nCause:\n\n${i.message}\n\nDetails\n\n${function(e){switch(e.kind){case Y.method:return`[class: "${e.targetClass.name}", method: "${e.method.toString()}"]`;case Y.parameter:return`[class: "${e.targetClass.name}", index: "${e.index.toString()}"]`;case Y.property:return`[class: "${e.targetClass.name}", property: "${e.property.toString()}"]`}}(r)}`,{cause:i})}throw i}(n,i,r,o)}}}function ee(e,t){return n=>{const i=t(n);return t=>(i(t),e(t))}}!function(e){e[e.method=0]="method",e[e.parameter=1]="parameter",e[e.property=2]="property"}(Y||(Y={}));const te="@inversifyjs/core/classIsInjectableFlagReflectKey",ne=[Array,BigInt,Boolean,Function,Number,Object,String];function ie(e){return e=>{!function(e){if(void 0!==d(e,te))throw new M(B.injectionDecoratorConflict,`Cannot apply @injectable decorator multiple times at class "${e.name}"`);l(e,te,!0)}(e),function(e){const t=d(e,"design:paramtypes");void 0!==t&&f(e,j,P,function(e){return t=>(e.forEach((e,n)=>{var i,r;void 0!==t.constructorArguments[n]||(i=e,ne.includes(i))||(t.constructorArguments[n]=(r=e,{isFromTypescriptParamType:!0,kind:U.singleInjection,name:void 0,optional:!1,tags:new Map,value:r}))}),t)}(t))}(e)}}var re;function oe(e){return e instanceof Error&&(e instanceof RangeError&&/stack space|call stack|too much recursion/i.test(e.message)||"InternalError"===e.name&&/too much recursion/.test(e.message))}!function(e){e[e.multipleInjection=0]="multipleInjection",e[e.singleInjection=1]="singleInjection"}(re||(re={}));const se=Symbol.for("@inversifyjs/core/LazyPlanServiceNode");class ae{[se];_serviceIdentifier;_serviceNode;constructor(e,t){this[se]=!0,this._serviceNode=e,this._serviceIdentifier=t}get bindings(){return this._getNode().bindings}get isContextFree(){return this._getNode().isContextFree}get serviceIdentifier(){return this._serviceIdentifier}set bindings(e){this._getNode().bindings=e}set isContextFree(e){this._getNode().isContextFree=e}static is(e){return"object"==typeof e&&null!==e&&!0===e[se]}invalidate(){this._serviceNode=void 0}isExpanded(){return void 0!==this._serviceNode}_getNode(){return void 0===this._serviceNode&&(this._serviceNode=this._buildPlanServiceNode()),this._serviceNode}}class ce{#w;constructor(e){this.#w=e}get name(){return this.#w.elem.name}get serviceIdentifier(){return this.#w.elem.serviceIdentifier}get tags(){return this.#w.elem.tags}getAncestor(){if(this.#w.elem.getAncestorsCalled=!0,void 0!==this.#w.previous)return new ce(this.#w.previous)}}function ue(e,t,n){const i=n?.customServiceIdentifier??t.serviceIdentifier,r=(!0===n?.chained?[...e.operations.getBindingsChained(i)]:[...e.operations.getBindings(i)??[]]).filter(e=>e.isSatisfiedBy(t));if(0===r.length&&void 0!==e.autobindOptions&&"function"==typeof i){const n=q(e.autobindOptions,i);e.operations.setBinding(n),n.isSatisfiedBy(t)&&r.push(n)}return r}class de{last;constructor(e){this.last=e}concat(e){return new de({elem:e,previous:this.last})}[Symbol.iterator](){let e=this.last;return{next:()=>{if(void 0===e)return{done:!0,value:void 0};const t=e.elem;return e=e.previous,{done:!1,value:t}}}}}function le(e){const t=new Map;return void 0!==e.rootConstraints.tag&&t.set(e.rootConstraints.tag.key,e.rootConstraints.tag.value),new de({elem:{getAncestorsCalled:!1,name:e.rootConstraints.name,serviceIdentifier:e.rootConstraints.serviceIdentifier,tags:t},previous:void 0})}function fe(e){return void 0!==e.redirections}function he(e,t,n,i){const r=n.elem.serviceIdentifier,s=n.previous?.elem.serviceIdentifier;var a,c,u,d,l,f;Array.isArray(e)?function(e,t,n,i,r,s){if(0!==e.length){const t=`Ambiguous bindings found for service: "${o(s[s.length-1]??n)}".${ye(s)}\n\nRegistered bindings:\n\n${e.map(e=>function(e){switch(e.type){case S:return`[ type: "${e.type}", serviceIdentifier: "${o(e.serviceIdentifier)}", scope: "${e.scope}", implementationType: "${e.implementationType.name}" ]`;case I:return`[ type: "${e.type}", serviceIdentifier: "${o(e.serviceIdentifier)}", redirection: "${o(e.targetServiceIdentifier)}" ]`;default:return`[ type: "${e.type}", serviceIdentifier: "${o(e.serviceIdentifier)}", scope: "${e.scope}" ]`}}(e.binding)).join("\n")}\n\nTrying to resolve bindings for "${ve(n,i)}".${ge(r)}`;throw new M(B.planning,t)}t||pe(n,i,r,s)}(e,t,r,s,n.elem,i):(a=e,c=t,u=r,d=s,l=n.elem,f=i,void 0!==a||c||pe(u,d,l,f))}function pe(e,t,n,i){const r=`No bindings found for service: "${o(i[i.length-1]??e)}".\n\nTrying to resolve bindings for "${ve(e,t)}".${ye(i)}${ge(n)}`;throw new M(B.planning,r)}function ve(e,t){return void 0===t?`${o(e)} (Root service)`:o(t)}function ge(e){const t=0===e.tags.size?"":`\n- tags:\n - ${[...e.tags.keys()].map(e=>e.toString()).join("\n - ")}`;return`\n\nBinding constraints:\n- service identifier: ${o(e.serviceIdentifier)}\n- name: ${e.name?.toString()??"-"}${t}`}function ye(e){return 0===e.length?"":`\n\n- service redirections:\n - ${e.map(e=>o(e)).join("\n - ")}`}function me(e,t,n,i){if(1===e.redirections.length){const[r]=e.redirections;return void(fe(r)&&me(r,t,n,[...i,r.binding.targetServiceIdentifier]))}he(e.redirections,t,n,i)}function we(e,t,n){if(Array.isArray(e.bindings)&&1===e.bindings.length){const[i]=e.bindings;return void(fe(i)&&me(i,t,n,[i.binding.targetServiceIdentifier]))}he(e.bindings,t,n,[])}function be(e){return a.is(e)?e.unwrap():e}function Se(e){return(t,n,i)=>{const r=be(i.value),o=n.concat({getAncestorsCalled:!1,name:i.name,serviceIdentifier:r,tags:i.tags}),s=new ce(o.last),a=i.kind===U.multipleInjection&&i.chained,c=ue(t,s,{chained:a}),u=[],d={bindings:u,isContextFree:!0,serviceIdentifier:r};if(u.push(...e(t,o,c,d,a)),d.isContextFree=!o.last.elem.getAncestorsCalled,i.kind===U.singleInjection){we(d,i.optional,o.last);const[e]=u;d.bindings=e}return d}}function Oe(e){return(t,n,i)=>{const r=be(i.value),o=n.concat({getAncestorsCalled:!1,name:i.name,serviceIdentifier:r,tags:i.tags}),s=new ce(o.last),a=i.kind===re.multipleInjection&&i.chained,c=ue(t,s,{chained:a}),u=[],d={bindings:u,isContextFree:!0,serviceIdentifier:r};if(u.push(...e(t,o,c,d,a)),d.isContextFree=!o.last.elem.getAncestorsCalled,i.kind===re.singleInjection){we(d,i.optional,o.last);const[e]=u;d.bindings=e}return d}}function Ae(e){const t=function(e){return(t,n,i)=>{const r={binding:n,classMetadata:t.operations.getClassMetadata(n.implementationType),constructorParams:[],propertyParams:new Map},o={autobindOptions:t.autobindOptions,node:r,operations:t.operations,servicesBranch:t.servicesBranch};return e(o,i)}}(e),n=function(e){return(t,n,i)=>{const r={binding:n,params:[]},o={autobindOptions:t.autobindOptions,node:r,operations:t.operations,servicesBranch:t.servicesBranch};return e(o,i)}}(e),i=(e,i,o,s,a)=>{const c=fe(s)?s.binding.targetServiceIdentifier:s.serviceIdentifier;e.servicesBranch.push(c);const u=[];for(const d of o)switch(d.type){case S:u.push(t(e,d,i));break;case A:u.push(n(e,d,i));break;case I:{const t=r(e,i,d,a);u.push(t);break}default:u.push({binding:d})}return e.servicesBranch.pop(),u},r=function(e){return(t,n,i,r)=>{const o={binding:i,redirections:[]},s=ue(t,new ce(n.last),{chained:r,customServiceIdentifier:i.targetServiceIdentifier});return o.redirections.push(...e(t,n,s,o,r)),o}}(i);return i}function Ie(e,t,n,i){if(void 0!==e&&(ae.is(n)&&!n.isExpanded()||n.isContextFree)){const i={tree:{root:n}};t.setPlan(e,i)}else t.setNonCachedServiceNode(n,i)}class Ee extends ae{#b;#S;#O;#A;constructor(e,t,n,i,r){super(r,be(i.value)),this.#S=t,this.#b=e,this.#O=n,this.#A=i}_buildPlanServiceNode(){return this.#S(this.#b,this.#O,this.#A)}}class Ce extends ae{#b;#I;#O;#E;constructor(e,t,n,i,r){super(r,be(i.value)),this.#b=e,this.#I=t,this.#O=n,this.#E=i}_buildPlanServiceNode(){return this.#I(this.#b,this.#O,this.#E)}}function Re(e,t,n,i){const r=function(e,t){const n=function(e,t){return(n,i,r)=>{if(r.kind===U.unmanaged)return;const o=function(e){let t;if(0===e.tags.size)t=void 0;else{if(1!==e.tags.size)return;{const[n,i]=e.tags.entries().next().value;t={key:n,value:i}}}const n=a.is(e.value)?e.value.unwrap():e.value;return e.kind===U.multipleInjection?{chained:e.chained,isMultiple:!0,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}:{isMultiple:!1,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}}(r);if(void 0!==o){const e=n.operations.getPlan(o);if(void 0!==e&&e.tree.root.isContextFree)return e.tree.root}const s=t(n,i,r),c=new Ee(n,e,i,r,s);return Ie(o,n.operations,c,{bindingConstraintsList:i,chainedBindings:r.kind===U.multipleInjection&&r.chained,optionalBindings:r.optional}),c}}(e,t);return(e,t,i)=>{const r=t.classMetadata;for(const[o,s]of r.constructorArguments.entries())t.constructorParams[o]=n(e,i,s);for(const[o,s]of r.properties){const r=n(e,i,s);void 0!==r&&t.propertyParams.set(o,r)}return e.node}}(e,n),o=function(e,t){const n=function(e,t){return(n,i,r)=>{const o=function(e){let t;if(0===e.tags.size)t=void 0;else{if(1!==e.tags.size)return;{const[n,i]=e.tags.entries().next().value;t={key:n,value:i}}}const n=a.is(e.value)?e.value.unwrap():e.value;return e.kind===re.multipleInjection?{chained:e.chained,isMultiple:!0,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}:{isMultiple:!1,name:e.name,optional:e.optional,serviceIdentifier:n,tag:t}}(r);if(void 0!==o){const e=n.operations.getPlan(o);if(void 0!==e&&e.tree.root.isContextFree)return e.tree.root}const s=t(n,i,r),c=new Ce(n,e,i,r,s);return Ie(o,n.operations,c,{bindingConstraintsList:i,chainedBindings:r.kind===re.multipleInjection&&r.chained,optionalBindings:r.optional}),c}}(e,t);return(e,t,i)=>{const r=t.binding.metadata;for(const[o,s]of r.arguments.entries())t.params[o]=n(e,i,s);return e.node}}(t,i);return(e,t)=>e.node.binding.type===S?r(e,e.node,t):o(e,e.node,t)}class xe extends ae{#b;constructor(e,t){super(t,t.serviceIdentifier),this.#b=e}_buildPlanServiceNode(){return _e(this.#b)}}const Te=Se(ke),je=Oe(ke),Pe=Ae(Re(Te,je,Te,je));function ke(e,t,n,i,r){return Pe(e,t,n,i,r)}const _e=function(e){return t=>{const n=le(t),i=new ce(n.last),r=t.rootConstraints.isMultiple&&t.rootConstraints.chained,o=ue(t,i,{chained:r}),s=[],a={bindings:s,isContextFree:!0,serviceIdentifier:t.rootConstraints.serviceIdentifier};if(s.push(...e(t,n,o,a,r)),a.isContextFree=!n.last.elem.getAncestorsCalled,!t.rootConstraints.isMultiple){we(a,t.rootConstraints.isOptional??!1,n.last);const[e]=s;a.bindings=e}return a}}(Pe);function Me(e){try{const n=(t=e).rootConstraints.isMultiple?{chained:t.rootConstraints.chained,isMultiple:!0,name:t.rootConstraints.name,optional:t.rootConstraints.isOptional??!1,serviceIdentifier:t.rootConstraints.serviceIdentifier,tag:t.rootConstraints.tag}:{isMultiple:!1,name:t.rootConstraints.name,optional:t.rootConstraints.isOptional??!1,serviceIdentifier:t.rootConstraints.serviceIdentifier,tag:t.rootConstraints.tag},i=e.operations.getPlan(n);if(void 0!==i)return i;const r=_e(e),o={tree:{root:new xe(e,r)}};return e.operations.setPlan(n,o),o}catch(n){!function(e,t){if(oe(t)){const n=function(e){const t=[...e];return 0===t.length?"(No dependency trace)":t.map(o).join(" -> ")}(function(e){const t=new Set;for(const n of e.servicesBranch){if(t.has(n))return[...t,n];t.add(n)}return[...t]}(e));throw new M(B.planning,`Circular dependency found: ${n}`,{cause:t})}throw t}(e,n)}var t}var Be;!function(e){e.bindingAdded="bindingAdded",e.bindingRemoved="bindingRemoved"}(Be||(Be={}));class Ne{#C;#R;#x;constructor(){this.#C=[],this.#R=8,this.#x=1024}*[Symbol.iterator](){let e=0;for(const t of this.#C){const n=t.deref();void 0===n?++e:yield n}this.#C.length>=this.#R&&this.#T(e)&&this.#j(e)}push(e){const t=new WeakRef(e);if(this.#C.push(t),this.#C.length>=this.#R&&this.#C.length%this.#x===0){let e=0;for(const t of this.#C)void 0===t.deref()&&++e;this.#T(e)&&this.#j(e)}}#j(e){const t=new Array(this.#C.length-e);let n=0;for(const i of this.#C)i.deref()&&(t[n++]=i);this.#C=t}#T(e){return e>=.5*this.#C.length}}const De=Ae(Re(Te,je,function(e,t,n){return Fe(e,t,n)},function(e,t,n){return $e(e,t,n)})),Fe=function(e){const t=Se(e);return(e,n,i)=>{try{return t(e,n,i)}catch(r){if(M.isErrorOfKind(r,B.planning))return;throw r}}}(De),$e=function(e){const t=Oe(e);return(e,n,i)=>{try{return t(e,n,i)}catch(r){if(M.isErrorOfKind(r,B.planning))return;throw r}}}(De);function Ue(e,t,n,i,r){if(ae.is(t)&&!t.isExpanded())return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1};const o=new ce(i.last);return!n.isSatisfiedBy(o)||i.last.elem.getAncestorsCalled?{isContextFreeBinding:!i.last.elem.getAncestorsCalled,shouldInvalidateServiceNode:!1}:function(e,t,n,i,r){let o;try{[o]=De(e,i,[n],t,r)}catch(s){if(oe(s))return{isContextFreeBinding:!1,shouldInvalidateServiceNode:!0};throw s}return function(e,t){if(Array.isArray(e.bindings))e.bindings.push(t);else{if(void 0!==e.bindings){if(!ae.is(e))throw new M(B.planning,"Unexpected non-lazy plan service node. This is likely a bug in the planning logic. Please, report this issue");return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!0}}e.bindings=t}return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1}}(t,o)}(e,t,n,i,r)}function Le(e,t,n,i){if(ae.is(e)&&!e.isExpanded())return{bindingNodeRemoved:void 0,isContextFreeBinding:!0};const r=new ce(n.last);if(!t.isSatisfiedBy(r)||n.last.elem.getAncestorsCalled)return{bindingNodeRemoved:void 0,isContextFreeBinding:!n.last.elem.getAncestorsCalled};let o;if(Array.isArray(e.bindings))e.bindings=e.bindings.filter(e=>e.binding!==t||(o=e,!1));else if(e.bindings?.binding===t)if(o=e.bindings,i)e.bindings=void 0;else{if(!ae.is(e))throw new M(B.planning,"Unexpected non-lazy plan service node. This is likely a bug in the planning logic. Please, report this issue");e.invalidate()}return{bindingNodeRemoved:o,isContextFreeBinding:!0}}class qe{#P;#k;#_;#M;#B;#N;constructor(){this.#P=new Map,this.#k=this.#D(),this.#_=this.#D(),this.#M=this.#D(),this.#B=this.#D(),this.#N=new Ne}clearCache(){for(const e of this.#F())e.clear();for(const e of this.#N)e.clearCache()}get(e){return void 0===e.name?void 0===e.tag?this.#$(this.#k,e).get(e.serviceIdentifier):this.#$(this.#B,e).get(e.serviceIdentifier)?.get(e.tag.key)?.get(e.tag.value):void 0===e.tag?this.#$(this.#_,e).get(e.serviceIdentifier)?.get(e.name):this.#$(this.#M,e).get(e.serviceIdentifier)?.get(e.name)?.get(e.tag.key)?.get(e.tag.value)}invalidateServiceBinding(e){this.#U(e),this.#L(e),this.#q(e),this.#z(e),this.#K(e);for(const t of this.#N)t.invalidateServiceBinding(e)}set(e,t){void 0===e.name?void 0===e.tag?this.#$(this.#k,e).set(e.serviceIdentifier,t):this.#V(this.#V(this.#$(this.#B,e),e.serviceIdentifier),e.tag.key).set(e.tag.value,t):void 0===e.tag?this.#V(this.#$(this.#_,e),e.serviceIdentifier).set(e.name,t):this.#V(this.#V(this.#V(this.#$(this.#M,e),e.serviceIdentifier),e.name),e.tag.key).set(e.tag.value,t)}setNonCachedServiceNode(e,t){let n=this.#P.get(e.serviceIdentifier);void 0===n&&(n=new Map,this.#P.set(e.serviceIdentifier,n)),n.set(e,t)}subscribe(e){this.#N.push(e)}#D(){const e=new Array(8);for(let t=0;tKe(e,t))):Ke(e,t)}function Ke(e,t){return e.cache={isRight:!0,value:t},t}async function Ve(e,t,n){let i=await t,r=n.next();for(;!0!==r.done;)i=await r.value(e.context,i),r=n.next();return i}function He(e,t,n){let i=n;if(void 0!==t.onActivation){const n=t.onActivation;i=r(i)?i.then(t=>n(e.context,t)):n(e.context,i)}return function(e,t,n){const i=e.getActivations(t);return void 0===i?n:r(n)?Ve(e,n,i[Symbol.iterator]()):function(e,t,n){let i=t,o=n.next();for(;!0!==o.done;){const t=o.value(e.context,i);if(r(t))return Ve(e,t,n);i=t,o=n.next()}return i}(e,n,i[Symbol.iterator]())}(e,t.serviceIdentifier,i)}function We(e){return(t,n)=>n.cache.isRight?n.cache.value:ze(n,He(t,n,e(t,n)))}const Je=We(function(e,t){return t.value});function Ge(e){return e}function Xe(e,t){return(n,i)=>{const r=e(i);switch(r.scope){case g:return r.cache.isRight?r.cache.value:ze(r,He(n,r,t(n,i)));case v:{if(n.requestScopeCache.has(r.id))return n.requestScopeCache.get(r.id);const e=He(n,r,t(n,i));return n.requestScopeCache.set(r.id,e),e}case y:return He(n,r,t(n,i))}}}const Qe=Xe(Ge,function(e,t){return t.value(e.context)}),Ye=We(function(e,t){return t.factory(e.context)});function Ze(e,t,n){const i=function(e,t,n){if(!(n in e))throw new M(B.resolution,`Expecting a "${n.toString()}" property when resolving "${t.implementationType.name}" class @postConstruct decorated method, none found.`);if("function"!=typeof e[n])throw new M(B.resolution,`Expecting a "${n.toString()}" method when resolving "${t.implementationType.name}" class @postConstruct decorated method, a non function property was found instead.`);{let i;try{i=e[n]()}catch(x){throw new M(B.resolution,`Unexpected error found when calling "${n.toString()}" @postConstruct decorated method on class "${t.implementationType.name}"`,{cause:x})}if(r(i))return async function(e,t,n){try{await n}catch(i){throw new M(B.resolution,`Unexpected error found when calling "${t.toString()}" @postConstruct decorated method on class "${e.implementationType.name}"`,{cause:i})}}(t,n,i)}}(e,t,n);return r(i)?i.then(()=>e):e}function et(e,t,n){if(0===n.size)return e;let i=e;for(const o of n)i=r(i)?i.then(e=>Ze(e,t,o)):Ze(i,t,o);return i}function tt(e){return(t,n,i)=>{const o=new i.binding.implementationType(...t),s=e(n,o,i);return r(s)?s.then(()=>et(o,i.binding,i.classMetadata.lifecycle.postConstructMethodNames)):et(o,i.binding,i.classMetadata.lifecycle.postConstructMethodNames)}}const nt=We(function(e,t){return t.provider(e.context)});function it(e){return e.binding}function rt(e){return e.binding}const ot=function(e){return(t,n,i)=>{const o=[];for(const[s,a]of i.propertyParams){const c=i.classMetadata.properties.get(s);if(void 0===c)throw new M(B.resolution,`Expecting metadata at property "${s.toString()}", none found`);c.kind!==U.unmanaged&&void 0!==a.bindings&&(n[s]=e(t,a),r(n[s])&&o.push((async()=>{n[s]=await n[s]})()))}if(o.length>0)return Promise.all(o).then(()=>{})}}(ht),st=function(e){return function t(n,i){const r=[];for(const o of i.redirections)fe(o)?r.push(...t(n,o)):r.push(e(n,o));return r}}(ft),at=function(e,t,n){return(i,o)=>{const s=e(i,o);return r(s)?t(s,i,o):n(s,i,o)}}(function(e){return(t,n)=>{const i=[];for(const r of n.constructorParams)void 0===r?i.push(void 0):i.push(e(t,r));return i.some(r)?Promise.all(i):i}}(ht),function(e){return async(t,n,i)=>{const r=await t;return e(r,n,i)}}(tt(ot)),tt(ot)),ct=function(e){return(t,n)=>{const i=e(t,n);return r(i)?i.then(e=>n.binding.factory(...e)):n.binding.factory(...i)}}(function(e){return(t,n)=>{const i=[];for(const r of n.params)i.push(e(t,r));return i.some(r)?Promise.all(i):i}}(ht)),ut=(e=>Xe(it,e))(at),dt=(e=>Xe(rt,e))(ct);function lt(e){try{return ht(e,e.planResult.tree.root)}catch(t){!function(e,t){if(oe(t)){const n=function(e){const t=[...e];return 0===t.length?"(No dependency trace)":t.map(o).join(" -> ")}(function(e){const t=e.planResult.tree.root,n=[];return function e(t){const i=n.indexOf(t);if(-1!==i)return[...n.slice(i),t].map(e=>e.serviceIdentifier);n.push(t);try{for(const n of function(e){const t=[],n=e.bindings;if(void 0===n)return t;const i=e=>{if(fe(e))for(const t of e.redirections)i(t);else switch(e.binding.type){case S:{const n=e;for(const e of n.constructorParams)void 0!==e&&t.push(e);for(const e of n.propertyParams.values())t.push(e);break}case A:{const n=e;for(const e of n.params)t.push(e);break}}};if(Array.isArray(n))for(const r of n)i(r);else i(n);return t}(t)){const t=e(n);if(void 0!==t)return t}}finally{n.pop()}}(t)??[]}(e));throw new M(B.planning,`Circular dependency found: ${n}`,{cause:t})}throw t}(e,t)}}function ft(e,t){switch(t.binding.type){case m:return Je(e,t.binding);case w:return Qe(e,t.binding);case b:return Ye(e,t.binding);case S:return ut(e,t);case O:return nt(e,t.binding);case A:return dt(e,t)}}function ht(e,t){if(void 0!==t.bindings)return Array.isArray(t.bindings)?function(e,t){const n=[];for(const i of t)fe(i)?n.push(...st(e,i)):n.push(ft(e,i));return n.some(r)?Promise.all(n):n}(e,t.bindings):function(e,t){if(fe(t)){const n=st(e,t);if(1===n.length)return n[0];throw new M(B.resolution,"Unexpected multiple resolved values on single injection")}return ft(e,t)}(e,t.bindings)}function pt(e){return void 0!==e.scope}function vt(e,t){if("function"==typeof e[t])return e[t]()}function gt(e,t){const n=e.lifecycle.preDestroyMethodNames;if(0===n.size)return;let i;for(const r of n)i=void 0===i?vt(t,r):i.then(()=>vt(t,r));return i}function yt(e,t,n){const i=e.getDeactivations(t);if(void 0!==i)return r(n)?mt(n,i[Symbol.iterator]()):function(e,t){let n=t.next();for(;!0!==n.done;){if(r(n.value(e)))return mt(e,t);n=t.next()}}(n,i[Symbol.iterator]())}async function mt(e,t){const n=await e;let i=t.next();for(;!0!==i.done;)await i.value(n),i=t.next()}function wt(e,t){const n=function(e,t){if(t.type===S){const n=e.getClassMetadata(t.implementationType),i=t.cache.value;return r(i)?i.then(e=>gt(n,e)):gt(n,i)}}(e,t);return void 0===n?bt(e,t):n.then(()=>bt(e,t))}function bt(e,t){const n=t.cache;return r(n.value)?n.value.then(n=>St(e,t,n)):St(e,t,n.value)}function St(e,t,n){let i;return void 0!==t.onDeactivation&&(i=(0,t.onDeactivation)(n)),void 0===i?yt(e,t.serviceIdentifier,n):i.then(()=>yt(e,t.serviceIdentifier,n))}function Ot(e,t){if(void 0===t)return;const n=function(e){const t=[];for(const n of e)pt(n)&&n.scope===g&&n.cache.isRight&&t.push(n);return t}(t),i=[];for(const r of n){const t=wt(e,r);void 0!==t&&i.push(t)}return i.length>0?Promise.all(i).then(()=>{}):void 0}const At=Symbol.for("@inversifyjs/plugin/isPlugin"),It=Symbol.for("@inversifyjs/container/bindingIdentifier");function Et(e){return"object"==typeof e&&null!==e&&!0===e[It]}class Ct{static always=e=>!0}const Rt=Symbol.for("@inversifyjs/container/InversifyContainerError");class xt extends Error{[Rt];kind;constructor(e,t,n){super(t,n),this[Rt]=!0,this.kind=e}static is(e){return"object"==typeof e&&null!==e&&!0===e[Rt]}static isErrorOfKind(e,t){return xt.is(e)&&e.kind===t}}var Tt;function jt(e){return{[It]:!0,id:e.id}}function Pt(e){return t=>{for(let n=t.getAncestor();void 0!==n;n=n.getAncestor())if(e(n))return!0;return!1}}function kt(e){return t=>t.name===e}function _t(e){return t=>t.serviceIdentifier===e}function Mt(e,t){return n=>n.tags.has(e)&&n.tags.get(e)===t}function Bt(e){return void 0===e.name&&0===e.tags.size}function Nt(e){const t=Pt(e);return e=>!t(e)}function Dt(e){return t=>{const n=t.getAncestor();return void 0===n||!e(n)}}function Ft(e){return t=>{const n=t.getAncestor();return void 0!==n&&e(n)}}!function(e){e[e.invalidOperation=0]="invalidOperation"}(Tt||(Tt={}));class $t{#i;constructor(e){this.#i=e}getIdentifier(){return jt(this.#i)}inRequestScope(){return this.#i.scope=v,new zt(this.#i)}inSingletonScope(){return this.#i.scope=g,new zt(this.#i)}inTransientScope(){return this.#i.scope=y,new zt(this.#i)}}class Ut{#t;#o;#a;#s;constructor(e,t,n,i){this.#t=e,this.#o=t,this.#a=n,this.#s=i}to(e){const t=L(e),n={cache:{isRight:!1,value:void 0},id:p(),implementationType:e,isSatisfiedBy:Ct.always,moduleId:this.#o,onActivation:void 0,onDeactivation:void 0,scope:t.scope??this.#a,serviceIdentifier:this.#s,type:S};return this.#t(n),new Kt(n)}toSelf(){if("function"!=typeof this.#s)throw new Error('"toSelf" function can only be applied when a newable function is used as service identifier');return this.to(this.#s)}toConstantValue(e){const t={cache:{isRight:!1,value:void 0},id:p(),isSatisfiedBy:Ct.always,moduleId:this.#o,onActivation:void 0,onDeactivation:void 0,scope:g,serviceIdentifier:this.#s,type:m,value:e};return this.#t(t),new zt(t)}toDynamicValue(e){const t={cache:{isRight:!1,value:void 0},id:p(),isSatisfiedBy:Ct.always,moduleId:this.#o,onActivation:void 0,onDeactivation:void 0,scope:this.#a,serviceIdentifier:this.#s,type:w,value:e};return this.#t(t),new Kt(t)}toResolvedValue(e,t){const n={cache:{isRight:!1,value:void 0},factory:e,id:p(),isSatisfiedBy:Ct.always,metadata:this.#r(t),moduleId:this.#o,onActivation:void 0,onDeactivation:void 0,scope:this.#a,serviceIdentifier:this.#s,type:A};return this.#t(n),new Kt(n)}toFactory(e){const t={cache:{isRight:!1,value:void 0},factory:e,id:p(),isSatisfiedBy:Ct.always,moduleId:this.#o,onActivation:void 0,onDeactivation:void 0,scope:g,serviceIdentifier:this.#s,type:b};return this.#t(t),new zt(t)}toProvider(e){const t={cache:{isRight:!1,value:void 0},id:p(),isSatisfiedBy:Ct.always,moduleId:this.#o,onActivation:void 0,onDeactivation:void 0,provider:e,scope:g,serviceIdentifier:this.#s,type:O};return this.#t(t),new zt(t)}toService(e){const t={id:p(),isSatisfiedBy:Ct.always,moduleId:this.#o,serviceIdentifier:this.#s,targetServiceIdentifier:e,type:I};this.#t(t)}#r(e){return{arguments:(e??[]).map(e=>{return"object"!=typeof(t=e)||a.is(t)?{kind:re.singleInjection,name:void 0,optional:!1,tags:new Map,value:e}:function(e){return!0===e.isMultiple}(e)?{chained:e.chained??!1,kind:re.multipleInjection,name:e.name,optional:e.optional??!1,tags:new Map((e.tags??[]).map(e=>[e.key,e.value])),value:e.serviceIdentifier}:{kind:re.singleInjection,name:e.name,optional:e.optional??!1,tags:new Map((e.tags??[]).map(e=>[e.key,e.value])),value:e.serviceIdentifier};var t})}}}let Lt=class{#i;constructor(e){this.#i=e}getIdentifier(){return jt(this.#i)}onActivation(e){return this.#i.onActivation=e,new qt(this.#i)}onDeactivation(e){if(this.#i.onDeactivation=e,this.#i.scope!==g)throw new xt(Tt.invalidOperation,`Binding for service "${o(this.#i.serviceIdentifier)}" has a deactivation function, but its scope is not singleton. Deactivation functions can only be used with singleton bindings.`);return new qt(this.#i)}};class qt{#i;constructor(e){this.#i=e}getIdentifier(){return jt(this.#i)}when(e){return this.#i.isSatisfiedBy=e,new Lt(this.#i)}whenAnyAncestor(e){return this.when(Pt(e))}whenAnyAncestorIs(e){return this.when(Pt(_t(e)))}whenAnyAncestorNamed(e){return this.when(Pt(kt(e)))}whenAnyAncestorTagged(e,t){return this.when(Pt(Mt(e,t)))}whenDefault(){return this.when(Bt)}whenNamed(e){return this.when(kt(e))}whenNoParent(e){return this.when(Dt(e))}whenNoParentIs(e){return this.when(Dt(_t(e)))}whenNoParentNamed(e){return this.when(Dt(kt(e)))}whenNoParentTagged(e,t){return this.when(Dt(Mt(e,t)))}whenParent(e){return this.when(Ft(e))}whenParentIs(e){return this.when(Ft(_t(e)))}whenParentNamed(e){return this.when(Ft(kt(e)))}whenParentTagged(e,t){return this.when(Ft(Mt(e,t)))}whenTagged(e,t){return this.when(Mt(e,t))}whenNoAncestor(e){return this.when(Nt(e))}whenNoAncestorIs(e){return this.when(Nt(_t(e)))}whenNoAncestorNamed(e){return this.when(Nt(kt(e)))}whenNoAncestorTagged(e,t){return this.when(Nt(Mt(e,t)))}}class zt extends qt{#c;constructor(e){super(e),this.#c=new Lt(e)}onActivation(e){return this.#c.onActivation(e)}onDeactivation(e){return this.#c.onDeactivation(e)}}class Kt extends zt{#u;constructor(e){super(e),this.#u=new $t(e)}inRequestScope(){return this.#u.inRequestScope()}inSingletonScope(){return this.#u.inSingletonScope()}inTransientScope(){return this.#u.inTransientScope()}}class Vt{#l;#a;#d;#v;constructor(e,t,n,i){this.#l=e,this.#a=t,this.#d=n,this.#v=i}bind(e){return new Ut(e=>{this.#p(e)},void 0,this.#a,e)}isBound(e,t){const n=this.#v.bindingService.get(e);return this.#g(e,n,t)}isCurrentBound(e,t){const n=this.#v.bindingService.getNonParentBindings(e);return this.#g(e,n,t)}async rebind(e){return await this.unbind(e),this.bind(e)}rebindSync(e){return this.unbindSync(e),this.bind(e)}async unbind(e){await this.#h(e)}async unbindAll(){const e=[...this.#v.bindingService.getNonParentBoundServices()];await Promise.all(e.map(async e=>function(e,t){const n=e.getBindings(t);return Ot(e,n)}(this.#l,e)));for(const t of e)this.#v.activationService.removeAllByServiceId(t),this.#v.bindingService.removeAllByServiceId(t),this.#v.deactivationService.removeAllByServiceId(t);this.#v.planResultCacheService.clearCache()}unbindSync(e){void 0!==this.#h(e)&&this.#S(e)}#p(e){this.#v.bindingService.set(e),this.#d.invalidateService({binding:e,kind:Be.bindingAdded})}#S(e){let t;if(Et(e)){const i=this.#v.bindingService.getById(e.id),r=(n=i,function(e){if(void 0===e)return;const t=e.next();return!0!==t.done?t.value:void 0}(n?.[Symbol.iterator]()))?.serviceIdentifier;t=void 0===r?"Unexpected asynchronous deactivation when unbinding binding identifier. Consider using Container.unbind() instead.":`Unexpected asynchronous deactivation when unbinding "${o(r)}" binding. Consider using Container.unbind() instead.`}else t=`Unexpected asynchronous deactivation when unbinding "${o(e)}" service. Consider using Container.unbind() instead.`;var n;throw new xt(Tt.invalidOperation,t)}#h(e){return Et(e)?this.#f(e):this.#I(e)}#f(e){const t=this.#v.bindingService.getById(e.id),n=void 0===t?void 0:[...t],i=Ot(this.#l,t);if(void 0!==i)return i.then(()=>{this.#w(n,e)});this.#w(n,e)}#w(e,t){if(this.#v.bindingService.removeById(t.id),void 0!==e)for(const n of e)this.#d.invalidateService({binding:n,kind:Be.bindingRemoved})}#I(e){const t=this.#v.bindingService.get(e),n=void 0===t?void 0:[...t],i=Ot(this.#l,t);if(void 0!==i)return i.then(()=>{this.#x(e,n)});this.#x(e,n)}#x(e,t){if(this.#v.activationService.removeAllByServiceId(e),this.#v.bindingService.removeAllByServiceId(e),this.#v.deactivationService.removeAllByServiceId(e),void 0!==t)for(const n of t)this.#d.invalidateService({binding:n,kind:Be.bindingRemoved})}#g(e,t,n){if(void 0===t)return!1;const i={getAncestor:()=>{},name:n?.name,serviceIdentifier:e,tags:new Map};void 0!==n?.tag&&i.tags.set(n.tag.key,n.tag.value);for(const r of t)if(r.isSatisfiedBy(i))return!0;return!1}}class Ht{#m;#l;#a;#d;#v;constructor(e,t,n,i,r){this.#m=e,this.#l=t,this.#a=n,this.#d=i,this.#v=r}async load(...e){await Promise.all(this.#n(...e))}loadSync(...e){const t=this.#n(...e);for(const n of t)if(void 0!==n)throw new xt(Tt.invalidOperation,"Unexpected asynchronous module load. Consider using Container.load() instead.")}async unload(...e){await Promise.all(this.#y(...e)),this.#O(e)}unloadSync(...e){const t=this.#y(...e);for(const n of t)if(void 0!==n)throw new xt(Tt.invalidOperation,"Unexpected asynchronous module unload. Consider using Container.unload() instead.");this.#O(e)}#b(e){return{bind:t=>new Ut(e=>{this.#p(e)},e,this.#a,t),isBound:this.#m.isBound.bind(this.#m),onActivation:(t,n)=>{this.#v.activationService.add(n,{moduleId:e,serviceId:t})},onDeactivation:(t,n)=>{this.#v.deactivationService.add(n,{moduleId:e,serviceId:t})},rebind:this.#m.rebind.bind(this.#m),rebindSync:this.#m.rebindSync.bind(this.#m),unbind:this.#m.unbind.bind(this.#m),unbindSync:this.#m.unbindSync.bind(this.#m)}}#O(e){for(const t of e)this.#v.activationService.removeAllByModuleId(t.id),this.#v.bindingService.removeAllByModuleId(t.id),this.#v.deactivationService.removeAllByModuleId(t.id);this.#v.planResultCacheService.clearCache()}#n(...e){return e.map(e=>e.load(this.#b(e.id)))}#p(e){this.#v.bindingService.set(e),this.#d.invalidateService({binding:e,kind:Be.bindingAdded})}#y(...e){return e.map(e=>function(e,t){const n=e.getBindingsFromModule(t);return Ot(e,n)}(this.#l,e.id))}}class Wt{deactivationParams;constructor(e){var t;this.deactivationParams={getBindings:(t=e).bindingService.get.bind(t.bindingService),getBindingsFromModule:t.bindingService.getByModuleId.bind(t.bindingService),getClassMetadata:L,getDeactivations:t.deactivationService.get.bind(t.deactivationService)},e.onReset(()=>{!function(e,t){t.getBindings=e.bindingService.get.bind(e.bindingService),t.getBindingsFromModule=e.bindingService.getByModuleId.bind(e.bindingService),t.getDeactivations=e.deactivationService.get.bind(e.deactivationService)}(e,this.deactivationParams)})}}class Jt{planParamsOperations;#v;constructor(e){this.#v=e,this.planParamsOperations={getBindings:this.#v.bindingService.get.bind(this.#v.bindingService),getBindingsChained:this.#v.bindingService.getChained.bind(this.#v.bindingService),getClassMetadata:L,getPlan:this.#v.planResultCacheService.get.bind(this.#v.planResultCacheService),setBinding:this.#p.bind(this),setNonCachedServiceNode:this.#v.planResultCacheService.setNonCachedServiceNode.bind(this.#v.planResultCacheService),setPlan:this.#v.planResultCacheService.set.bind(this.#v.planResultCacheService)},this.#v.onReset(()=>{this.#R()})}#R(){this.planParamsOperations.getBindings=this.#v.bindingService.get.bind(this.#v.bindingService),this.planParamsOperations.getBindingsChained=this.#v.bindingService.getChained.bind(this.#v.bindingService),this.planParamsOperations.setBinding=this.#p.bind(this)}#p(e){this.#v.bindingService.set(e),this.#v.planResultCacheService.invalidateServiceBinding({binding:e,kind:Be.bindingAdded,operations:this.planParamsOperations})}}class Gt{#C;#v;constructor(e,t){this.#C=e,this.#v=t}invalidateService(e){this.#v.planResultCacheService.invalidateServiceBinding({...e,operations:this.#C.planParamsOperations})}}class Xt{#A;#k;#F;#v;constructor(e,t,n){this.#v=t,this.#F=n,this.#A=this.#T(e),this.#k=this.#M()}register(e,t){const n=new t(e,this.#k);if(!0!==n[At])throw new xt(Tt.invalidOperation,"Invalid plugin. The plugin must extend the Plugin class");n.load(this.#A)}#T(e){return{define:(t,n)=>{if(Object.prototype.hasOwnProperty.call(e,t))throw new xt(Tt.invalidOperation,`Container already has a method named "${String(t)}"`);e[t]=n},onPlan:this.#F.onPlan.bind(this.#F)}}#M(){const e=this.#v;return{get activationService(){return e.activationService},get bindingService(){return e.bindingService},get deactivationService(){return e.deactivationService},get planResultCacheService(){return e.planResultCacheService}}}}class Qt{activationService;bindingService;deactivationService;planResultCacheService;#E;constructor(e,t,n,i){this.activationService=e,this.bindingService=t,this.deactivationService=n,this.planResultCacheService=i,this.#E=[]}reset(e,t,n){this.activationService=e,this.bindingService=t,this.deactivationService=n,this.planResultCacheService.clearCache();for(const i of this.#E)i()}onReset(e){this.#E.push(e)}}class Yt{#_;#a;#z;#N;#P;#C;#v;constructor(e,t,n,i){this.#C=e,this.#v=t,this.#N=this.#j(),this.#_=n,this.#a=i,this.#z=e=>this.#v.activationService.get(e),this.#P=[],this.#v.onReset(()=>{this.#R()})}get(e,t){const n=this.#D(!1,e,t),i=this.#$(n);if(r(i))throw new xt(Tt.invalidOperation,`Unexpected asynchronous service when resolving service "${o(e)}"`);return i}getAll(e,t){const n=this.#D(!0,e,t),i=this.#$(n);if(r(i))throw new xt(Tt.invalidOperation,`Unexpected asynchronous service when resolving service "${o(e)}"`);return i}async getAllAsync(e,t){const n=this.#D(!0,e,t);return this.#$(n)}async getAsync(e,t){const n=this.#D(!1,e,t);return this.#$(n)}onPlan(e){this.#P.push(e)}#R(){this.#N=this.#j()}#q(e,t,n){const i=n?.name,r=n?.optional??!1,o=n?.tag;return e?{chained:n?.chained??!1,isMultiple:e,name:i,optional:r,serviceIdentifier:t,tag:o}:{isMultiple:e,name:i,optional:r,serviceIdentifier:t,tag:o}}#B(e,t,n){const i={autobindOptions:n?.autobind??this.#_?{scope:this.#a}:void 0,operations:this.#C.planParamsOperations,rootConstraints:this.#V(e,t,n),servicesBranch:[]};return this.#H(i,n),i}#V(e,t,n){return t?{chained:n?.chained??!1,isMultiple:t,serviceIdentifier:e}:{isMultiple:t,serviceIdentifier:e}}#D(e,t,n){const i=this.#q(e,t,n),r=this.#v.planResultCacheService.get(i);if(void 0!==r)return r;const o=Me(this.#B(t,e,n));for(const s of this.#P)s(i,o);return o}#j(){return{get:this.get.bind(this),getAll:this.getAll.bind(this),getAllAsync:this.getAllAsync.bind(this),getAsync:this.getAsync.bind(this)}}#$(e){return lt({context:this.#N,getActivations:this.#z,planResult:e,requestScopeCache:new Map})}#H(e,t){void 0!==t&&(void 0!==t.name&&(e.rootConstraints.name=t.name),!0===t.optional&&(e.rootConstraints.isOptional=!0),void 0!==t.tag&&(e.rootConstraints.tag={key:t.tag.key,value:t.tag.value}),e.rootConstraints.isMultiple&&(e.rootConstraints.chained=t?.chained??!1))}}class Zt{#v;#G;constructor(e){this.#v=e,this.#G=[]}restore(){const e=this.#G.pop();if(void 0===e)throw new xt(Tt.invalidOperation,"No snapshot available to restore");this.#v.reset(e.activationService,e.bindingService,e.deactivationService)}snapshot(){this.#G.push({activationService:this.#v.activationService.clone(),bindingService:this.#v.bindingService.clone(),deactivationService:this.#v.deactivationService.clone()})}}const en=y;class tn{#m;#U;#L;#v;#F;#K;constructor(e){const t=e?.autobind??!1,n=e?.defaultScope??en;this.#v=this.#J(e,t,n);const i=new Jt(this.#v),r=new Gt(i,this.#v),o=new Wt(this.#v);this.#m=new Vt(o.deactivationParams,n,r,this.#v),this.#U=new Ht(this.#m,o.deactivationParams,n,r,this.#v),this.#F=new Yt(i,this.#v,t,n),this.#L=new Xt(this,this.#v,this.#F),this.#K=new Zt(this.#v)}bind(e){return this.#m.bind(e)}get(e,t){return this.#F.get(e,t)}getAll(e,t){return this.#F.getAll(e,t)}async getAllAsync(e,t){return this.#F.getAllAsync(e,t)}async getAsync(e,t){return this.#F.getAsync(e,t)}isBound(e,t){return this.#m.isBound(e,t)}isCurrentBound(e,t){return this.#m.isCurrentBound(e,t)}async load(...e){return this.#U.load(...e)}loadSync(...e){this.#U.loadSync(...e)}onActivation(e,t){this.#v.activationService.add(t,{serviceId:e})}onDeactivation(e,t){this.#v.deactivationService.add(t,{serviceId:e})}register(e){this.#L.register(this,e)}restore(){this.#K.restore()}async rebind(e){return this.#m.rebind(e)}rebindSync(e){return this.#m.rebindSync(e)}snapshot(){this.#K.snapshot()}async unbind(e){await this.#m.unbind(e)}async unbindAll(){return this.#m.unbindAll()}unbindSync(e){this.#m.unbindSync(e)}async unload(...e){return this.#U.unload(...e)}unloadSync(...e){this.#U.unloadSync(...e)}#X(e,t){if(e)return{scope:t}}#J(e,t,n){const i=this.#X(t,n);if(void 0===e?.parent)return new Qt(T.build(()=>{}),V.build(()=>{},i),H.build(()=>{}),new qe);const r=new qe,o=e.parent;return o.#v.planResultCacheService.subscribe(r),new Qt(T.build(()=>o.#v.activationService),V.build(()=>o.#v.bindingService,i),H.build(()=>o.#v.deactivationService),r)}}var nn=Symbol.for("INJECTION");function rn(e,t,n,i){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return Reflect.hasMetadata(nn,this,t)?Reflect.getMetadata(nn,this,t):n()},set:function(e){Reflect.defineMetadata(nn,e,this,t)}})}function on(e,t){var n=function(e){return function(t){return function(n,i){rn(n,i,function(){return e.get(t)})}}}(e),i=function(e){return function(t,n){return function(i,r){rn(i,r,function(){return e.getNamed(t,n)})}}}(e),r=function(e){return function(t,n,i){return function(r,o){rn(r,o,function(){return e.getTagged(t,n,i)})}}}(e),o=function(e){return function(t){return function(n,i){rn(n,i,function(){return e.getAll(t)})}}}(e);return{lazyInject:n,lazyInjectNamed:i,lazyInjectTagged:r,lazyMultiInject:o}}class sn{static defaultScope="Singleton";container=new tn({autobind:!0,defaultScope:sn.defaultScope});lazyInject=on(this.container).lazyInject;get(e){return this.container.get(e)}getAll(e){return this.container.getAll(e)}bind(e){return this.container.bind(e)}bindForce(e){return this.container.isBound(e)?this.container.rebindSync(e):this.container.bind(e)}unbind(e){return this.container.unbindSync(e)}isBound(e){return this.container.isBound(e)}}const an=new sn;function cn(){return e=>{W(ie(),e)}}function un(e){return(t,n,i)=>{"function"==typeof t&&W(function(e){return Z(X(U.singleInjection,e),G)}(e),t,i)}}const dn=Symbol("TradingAssetService");function ln(e,{include:t,exclude:n}={}){const i=e=>{const i=t=>"string"==typeof t?e===t:t.test(e);return t?t.some(i):!n||!n.some(i)};for(const[r,o]of(e=>{const t=new Set;do{for(const n of Reflect.ownKeys(e))t.add([e,n])}while((e=Reflect.getPrototypeOf(e))&&e!==Object.prototype);return t})(e.constructor.prototype)){if("constructor"===o||!i(o))continue;const t=Reflect.getOwnPropertyDescriptor(r,o);t&&"function"==typeof t.value&&(e[o]=e[o].bind(e))}return e}const fn=Symbol("TradingAssetRepository"),hn=Symbol("HttpService");function pn(e,t){return function(){return e.apply(t,arguments)}}const{toString:vn}=Object.prototype,{getPrototypeOf:gn}=Object,{iterator:yn,toStringTag:mn}=Symbol,wn=(e=>t=>{const n=vn.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),bn=e=>(e=e.toLowerCase(),t=>wn(t)===e),Sn=e=>t=>typeof t===e,{isArray:On}=Array,An=Sn("undefined");function In(e){return null!==e&&!An(e)&&null!==e.constructor&&!An(e.constructor)&&Rn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const En=bn("ArrayBuffer");const Cn=Sn("string"),Rn=Sn("function"),xn=Sn("number"),Tn=e=>null!==e&&"object"==typeof e,jn=e=>{if("object"!==wn(e))return!1;const t=gn(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||mn in e||yn in e)},Pn=bn("Date"),kn=bn("File"),_n=bn("Blob"),Mn=bn("FileList"),Bn=bn("URLSearchParams"),[Nn,Dn,Fn,$n]=["ReadableStream","Request","Response","Headers"].map(bn);function Un(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let i,r;if("object"!=typeof e&&(e=[e]),On(e))for(i=0,r=e.length;i0;)if(i=n[r],t===i.toLowerCase())return i;return null}const qn="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,zn=e=>!An(e)&&e!==qn;const Kn=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&gn(Uint8Array)),Vn=bn("HTMLFormElement"),Hn=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Wn=bn("RegExp"),Jn=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),i={};Un(n,(n,r)=>{let o;!1!==(o=t(n,r,e))&&(i[r]=o||n)}),Object.defineProperties(e,i)};const Gn=bn("AsyncFunction"),Xn=(Qn="function"==typeof setImmediate,Yn=Rn(qn.postMessage),Qn?setImmediate:Yn?(Zn=`axios@${Math.random()}`,ei=[],qn.addEventListener("message",({source:e,data:t})=>{e===qn&&t===Zn&&ei.length&&ei.shift()()},!1),e=>{ei.push(e),qn.postMessage(Zn,"*")}):e=>setTimeout(e));var Qn,Yn,Zn,ei;const ti="undefined"!=typeof queueMicrotask?queueMicrotask.bind(qn):"undefined"!=typeof process&&process.nextTick||Xn,ni={isArray:On,isArrayBuffer:En,isBuffer:In,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Rn(e.append)&&("formdata"===(t=wn(e))||"object"===t&&Rn(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&En(e.buffer),t},isString:Cn,isNumber:xn,isBoolean:e=>!0===e||!1===e,isObject:Tn,isPlainObject:jn,isEmptyObject:e=>{if(!Tn(e)||In(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(x){return!1}},isReadableStream:Nn,isRequest:Dn,isResponse:Fn,isHeaders:$n,isUndefined:An,isDate:Pn,isFile:kn,isBlob:_n,isRegExp:Wn,isFunction:Rn,isStream:e=>Tn(e)&&Rn(e.pipe),isURLSearchParams:Bn,isTypedArray:Kn,isFileList:Mn,forEach:Un,merge:function e(){const{caseless:t,skipUndefined:n}=zn(this)&&this||{},i={},r=(r,o)=>{const s=t&&Ln(i,o)||o;jn(i[s])&&jn(r)?i[s]=e(i[s],r):jn(r)?i[s]=e({},r):On(r)?i[s]=r.slice():n&&An(r)||(i[s]=r)};for(let o=0,s=arguments.length;o(Un(t,(t,i)=>{n&&Rn(t)?e[i]=pn(t,n):e[i]=t},{allOwnKeys:i}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,i)=>{let r,o,s;const a={};if(t=t||{},null==e)return t;do{for(r=Object.getOwnPropertyNames(e),o=r.length;o-- >0;)s=r[o],i&&!i(s,e,t)||a[s]||(t[s]=e[s],a[s]=!0);e=!1!==n&&gn(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:wn,kindOfTest:bn,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const i=e.indexOf(t,n);return-1!==i&&i===n},toArray:e=>{if(!e)return null;if(On(e))return e;let t=e.length;if(!xn(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[yn]).call(e);let i;for(;(i=n.next())&&!i.done;){const n=i.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const i=[];for(;null!==(n=e.exec(t));)i.push(n);return i},isHTMLForm:Vn,hasOwnProperty:Hn,hasOwnProp:Hn,reduceDescriptors:Jn,freezeMethods:e=>{Jn(e,(t,n)=>{if(Rn(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const i=e[n];Rn(i)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},i=e=>{e.forEach(e=>{n[e]=!0})};return On(e)?i(e):i(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Ln,global:qn,isContextDefined:zn,isSpecCompliantForm:function(e){return!!(e&&Rn(e.append)&&"FormData"===e[mn]&&e[yn])},toJSONObject:e=>{const t=new Array(10),n=(e,i)=>{if(Tn(e)){if(t.indexOf(e)>=0)return;if(In(e))return e;if(!("toJSON"in e)){t[i]=e;const r=On(e)?[]:{};return Un(e,(e,t)=>{const o=n(e,i+1);!An(o)&&(r[t]=o)}),t[i]=void 0,r}}return e};return n(e,0)},isAsyncFn:Gn,isThenable:e=>e&&(Tn(e)||Rn(e))&&Rn(e.then)&&Rn(e.catch),setImmediate:Xn,asap:ti,isIterable:e=>null!=e&&Rn(e[yn])};function ii(e,t,n,i,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),i&&(this.request=i),r&&(this.response=r,this.status=r.status?r.status:null)}ni.inherits(ii,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ni.toJSONObject(this.config),code:this.code,status:this.status}}});const ri=ii.prototype,oi={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{oi[e]={value:e}}),Object.defineProperties(ii,oi),Object.defineProperty(ri,"isAxiosError",{value:!0}),ii.from=(e,t,n,i,r,o)=>{const s=Object.create(ri);ni.toFlatObject(e,s,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e);const a=e&&e.message?e.message:"Error",c=null==t&&e?e.code:t;return ii.call(s,a,c,n,i,r),e&&null==s.cause&&Object.defineProperty(s,"cause",{value:e,configurable:!0}),s.name=e&&e.name||"Error",o&&Object.assign(s,o),s};function si(e){return ni.isPlainObject(e)||ni.isArray(e)}function ai(e){return ni.endsWith(e,"[]")?e.slice(0,-2):e}function ci(e,t,n){return e?e.concat(t).map(function(e,t){return e=ai(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const ui=ni.toFlatObject(ni,{},null,function(e){return/^is[A-Z]/.test(e)});function di(e,t,n){if(!ni.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const i=(n=ni.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!ni.isUndefined(t[e])})).metaTokens,r=n.visitor||u,o=n.dots,s=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&ni.isSpecCompliantForm(t);if(!ni.isFunction(r))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(ni.isDate(e))return e.toISOString();if(ni.isBoolean(e))return e.toString();if(!a&&ni.isBlob(e))throw new ii("Blob is not supported. Use a Buffer instead.");return ni.isArrayBuffer(e)||ni.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,r){let a=e;if(e&&!r&&"object"==typeof e)if(ni.endsWith(n,"{}"))n=i?n:n.slice(0,-2),e=JSON.stringify(e);else if(ni.isArray(e)&&function(e){return ni.isArray(e)&&!e.some(si)}(e)||(ni.isFileList(e)||ni.endsWith(n,"[]"))&&(a=ni.toArray(e)))return n=ai(n),a.forEach(function(e,i){!ni.isUndefined(e)&&null!==e&&t.append(!0===s?ci([n],i,o):null===s?n:n+"[]",c(e))}),!1;return!!si(e)||(t.append(ci(r,n,o),c(e)),!1)}const d=[],l=Object.assign(ui,{defaultVisitor:u,convertValue:c,isVisitable:si});if(!ni.isObject(e))throw new TypeError("data must be an object");return function e(n,i){if(!ni.isUndefined(n)){if(-1!==d.indexOf(n))throw Error("Circular reference detected in "+i.join("."));d.push(n),ni.forEach(n,function(n,o){!0===(!(ni.isUndefined(n)||null===n)&&r.call(t,n,ni.isString(o)?o.trim():o,i,l))&&e(n,i?i.concat(o):[o])}),d.pop()}}(e),t}function li(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function fi(e,t){this._pairs=[],e&&di(e,this,t)}const hi=fi.prototype;function pi(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function vi(e,t,n){if(!t)return e;const i=n&&n.encode||pi;ni.isFunction(n)&&(n={serialize:n});const r=n&&n.serialize;let o;if(o=r?r(t,n):ni.isURLSearchParams(t)?t.toString():new fi(t,n).toString(i),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}hi.append=function(e,t){this._pairs.push([e,t])},hi.toString=function(e){const t=e?function(t){return e.call(this,t,li)}:li;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class gi{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ni.forEach(this.handlers,function(t){null!==t&&e(t)})}}const yi={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},mi={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:fi,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},wi="undefined"!=typeof window&&"undefined"!=typeof document,bi="object"==typeof navigator&&navigator||void 0,Si=wi&&(!bi||["ReactNative","NativeScript","NS"].indexOf(bi.product)<0),Oi="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ai=wi&&window.location.href||"http://localhost",Ii={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:wi,hasStandardBrowserEnv:Si,hasStandardBrowserWebWorkerEnv:Oi,navigator:bi,origin:Ai},Symbol.toStringTag,{value:"Module"})),...mi};function Ei(e){function t(e,n,i,r){let o=e[r++];if("__proto__"===o)return!0;const s=Number.isFinite(+o),a=r>=e.length;if(o=!o&&ni.isArray(i)?i.length:o,a)return ni.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!s;i[o]&&ni.isObject(i[o])||(i[o]=[]);return t(e,n,i[o],r)&&ni.isArray(i[o])&&(i[o]=function(e){const t={},n=Object.keys(e);let i;const r=n.length;let o;for(i=0;i{t(function(e){return ni.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),i,n,0)}),n}return null}const Ci={transitional:yi,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",i=n.indexOf("application/json")>-1,r=ni.isObject(e);r&&ni.isHTMLForm(e)&&(e=new FormData(e));if(ni.isFormData(e))return i?JSON.stringify(Ei(e)):e;if(ni.isArrayBuffer(e)||ni.isBuffer(e)||ni.isStream(e)||ni.isFile(e)||ni.isBlob(e)||ni.isReadableStream(e))return e;if(ni.isArrayBufferView(e))return e.buffer;if(ni.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(r){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return di(e,new Ii.classes.URLSearchParams,{visitor:function(e,t,n,i){return Ii.isNode&&ni.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((o=ni.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return di(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return r||i?(t.setContentType("application/json",!1),function(e,t,n){if(ni.isString(e))try{return(t||JSON.parse)(e),ni.trim(e)}catch(x){if("SyntaxError"!==x.name)throw x}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Ci.transitional,n=t&&t.forcedJSONParsing,i="json"===this.responseType;if(ni.isResponse(e)||ni.isReadableStream(e))return e;if(e&&ni.isString(e)&&(n&&!this.responseType||i)){const n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(x){if(n){if("SyntaxError"===x.name)throw ii.from(x,ii.ERR_BAD_RESPONSE,this,null,this.response);throw x}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ii.classes.FormData,Blob:Ii.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ni.forEach(["delete","get","head","post","put","patch"],e=>{Ci.headers[e]={}});const Ri=ni.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),xi=Symbol("internals");function Ti(e){return e&&String(e).trim().toLowerCase()}function ji(e){return!1===e||null==e?e:ni.isArray(e)?e.map(ji):String(e)}function Pi(e,t,n,i,r){return ni.isFunction(i)?i.call(this,t,n):(r&&(t=n),ni.isString(t)?ni.isString(i)?-1!==t.indexOf(i):ni.isRegExp(i)?i.test(t):void 0:void 0)}let ki=class{constructor(e){e&&this.set(e)}set(e,t,n){const i=this;function r(e,t,n){const r=Ti(t);if(!r)throw new Error("header name must be a non-empty string");const o=ni.findKey(i,r);(!o||void 0===i[o]||!0===n||void 0===n&&!1!==i[o])&&(i[o||t]=ji(e))}const o=(e,t)=>ni.forEach(e,(e,n)=>r(e,n,t));if(ni.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(ni.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let n,i,r;return e&&e.split("\n").forEach(function(e){r=e.indexOf(":"),n=e.substring(0,r).trim().toLowerCase(),i=e.substring(r+1).trim(),!n||t[n]&&Ri[n]||("set-cookie"===n?t[n]?t[n].push(i):t[n]=[i]:t[n]=t[n]?t[n]+", "+i:i)}),t})(e),t);else if(ni.isObject(e)&&ni.isIterable(e)){let n,i,r={};for(const t of e){if(!ni.isArray(t))throw TypeError("Object iterator must return a key-value pair");r[i=t[0]]=(n=r[i])?ni.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}o(r,t)}else null!=e&&r(t,e,n);return this}get(e,t){if(e=Ti(e)){const n=ni.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=n.exec(e);)t[i[1]]=i[2];return t}(e);if(ni.isFunction(t))return t.call(this,e,n);if(ni.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Ti(e)){const n=ni.findKey(this,e);return!(!n||void 0===this[n]||t&&!Pi(0,this[n],n,t))}return!1}delete(e,t){const n=this;let i=!1;function r(e){if(e=Ti(e)){const r=ni.findKey(n,e);!r||t&&!Pi(0,n[r],r,t)||(delete n[r],i=!0)}}return ni.isArray(e)?e.forEach(r):r(e),i}clear(e){const t=Object.keys(this);let n=t.length,i=!1;for(;n--;){const r=t[n];e&&!Pi(0,this[r],r,e,!0)||(delete this[r],i=!0)}return i}normalize(e){const t=this,n={};return ni.forEach(this,(i,r)=>{const o=ni.findKey(n,r);if(o)return t[o]=ji(i),void delete t[r];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(r):String(r).trim();s!==r&&delete t[r],t[s]=ji(i),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return ni.forEach(this,(n,i)=>{null!=n&&!1!==n&&(t[i]=e&&ni.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[xi]=this[xi]={accessors:{}}).accessors,n=this.prototype;function i(e){const i=Ti(e);t[i]||(!function(e,t){const n=ni.toCamelCase(" "+t);["get","set","has"].forEach(i=>{Object.defineProperty(e,i+n,{value:function(e,n,r){return this[i].call(this,t,e,n,r)},configurable:!0})})}(n,e),t[i]=!0)}return ni.isArray(e)?e.forEach(i):i(e),this}};function _i(e,t){const n=this||Ci,i=t||n,r=ki.from(i.headers);let o=i.data;return ni.forEach(e,function(e){o=e.call(n,o,r.normalize(),t?t.status:void 0)}),r.normalize(),o}function Mi(e){return!(!e||!e.__CANCEL__)}function Bi(e,t,n){ii.call(this,null==e?"canceled":e,ii.ERR_CANCELED,t,n),this.name="CanceledError"}function Ni(e,t,n){const i=n.config.validateStatus;n.status&&i&&!i(n.status)?t(new ii("Request failed with status code "+n.status,[ii.ERR_BAD_REQUEST,ii.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}ki.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),ni.reduceDescriptors(ki.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),ni.freezeMethods(ki),ni.inherits(Bi,ii,{__CANCEL__:!0});const Di=(e,t,n=3)=>{let i=0;const r=function(e,t){e=e||10;const n=new Array(e),i=new Array(e);let r,o=0,s=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=i[s];r||(r=c),n[o]=a,i[o]=c;let d=s,l=0;for(;d!==o;)l+=n[d++],d%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-r{r=o,n=null,i&&(clearTimeout(i),i=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-r;a>=o?s(e,t):(n=e,i||(i=setTimeout(()=>{i=null,s(n)},o-a)))},()=>n&&s(n)]}(n=>{const o=n.loaded,s=n.lengthComputable?n.total:void 0,a=o-i,c=r(a);i=o;e({loaded:o,total:s,progress:s?o/s:void 0,bytes:a,rate:c||void 0,estimated:c&&s&&o<=s?(s-o)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},Fi=(e,t)=>{const n=null!=e;return[i=>t[0]({lengthComputable:n,total:e,loaded:i}),t[1]]},$i=e=>(...t)=>ni.asap(()=>e(...t)),Ui=Ii.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ii.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ii.origin),Ii.navigator&&/(msie|trident)/i.test(Ii.navigator.userAgent)):()=>!0,Li=Ii.hasStandardBrowserEnv?{write(e,t,n,i,r,o,s){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];ni.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),ni.isString(i)&&a.push(`path=${i}`),ni.isString(r)&&a.push(`domain=${r}`),!0===o&&a.push("secure"),ni.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function qi(e,t,n){let i=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(i||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const zi=e=>e instanceof ki?{...e}:e;function Ki(e,t){t=t||{};const n={};function i(e,t,n,i){return ni.isPlainObject(e)&&ni.isPlainObject(t)?ni.merge.call({caseless:i},e,t):ni.isPlainObject(t)?ni.merge({},t):ni.isArray(t)?t.slice():t}function r(e,t,n,r){return ni.isUndefined(t)?ni.isUndefined(e)?void 0:i(void 0,e,0,r):i(e,t,0,r)}function o(e,t){if(!ni.isUndefined(t))return i(void 0,t)}function s(e,t){return ni.isUndefined(t)?ni.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function a(n,r,o){return o in t?i(n,r):o in e?i(void 0,n):void 0}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(e,t,n)=>r(zi(e),zi(t),0,!0)};return ni.forEach(Object.keys({...e,...t}),function(i){const o=c[i]||r,s=o(e[i],t[i],i);ni.isUndefined(s)&&o!==a||(n[i]=s)}),n}const Vi=e=>{const t=Ki({},e);let{data:n,withXSRFToken:i,xsrfHeaderName:r,xsrfCookieName:o,headers:s,auth:a}=t;if(t.headers=s=ki.from(s),t.url=vi(qi(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),ni.isFormData(n))if(Ii.hasStandardBrowserEnv||Ii.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(ni.isFunction(n.getHeaders)){const e=n.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&s.set(e,n)})}if(Ii.hasStandardBrowserEnv&&(i&&ni.isFunction(i)&&(i=i(t)),i||!1!==i&&Ui(t.url))){const e=r&&o&&Li.read(o);e&&s.set(r,e)}return t},Hi="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const i=Vi(e);let r=i.data;const o=ki.from(i.headers).normalize();let s,a,c,u,d,{responseType:l,onUploadProgress:f,onDownloadProgress:h}=i;function p(){u&&u(),d&&d(),i.cancelToken&&i.cancelToken.unsubscribe(s),i.signal&&i.signal.removeEventListener("abort",s)}let v=new XMLHttpRequest;function g(){if(!v)return;const i=ki.from("getAllResponseHeaders"in v&&v.getAllResponseHeaders());Ni(function(e){t(e),p()},function(e){n(e),p()},{data:l&&"text"!==l&&"json"!==l?v.response:v.responseText,status:v.status,statusText:v.statusText,headers:i,config:e,request:v}),v=null}v.open(i.method.toUpperCase(),i.url,!0),v.timeout=i.timeout,"onloadend"in v?v.onloadend=g:v.onreadystatechange=function(){v&&4===v.readyState&&(0!==v.status||v.responseURL&&0===v.responseURL.indexOf("file:"))&&setTimeout(g)},v.onabort=function(){v&&(n(new ii("Request aborted",ii.ECONNABORTED,e,v)),v=null)},v.onerror=function(t){const i=new ii(t&&t.message?t.message:"Network Error",ii.ERR_NETWORK,e,v);i.event=t||null,n(i),v=null},v.ontimeout=function(){let t=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const r=i.transitional||yi;i.timeoutErrorMessage&&(t=i.timeoutErrorMessage),n(new ii(t,r.clarifyTimeoutError?ii.ETIMEDOUT:ii.ECONNABORTED,e,v)),v=null},void 0===r&&o.setContentType(null),"setRequestHeader"in v&&ni.forEach(o.toJSON(),function(e,t){v.setRequestHeader(t,e)}),ni.isUndefined(i.withCredentials)||(v.withCredentials=!!i.withCredentials),l&&"json"!==l&&(v.responseType=i.responseType),h&&([c,d]=Di(h,!0),v.addEventListener("progress",c)),f&&v.upload&&([a,u]=Di(f),v.upload.addEventListener("progress",a),v.upload.addEventListener("loadend",u)),(i.cancelToken||i.signal)&&(s=t=>{v&&(n(!t||t.type?new Bi(null,e,v):t),v.abort(),v=null)},i.cancelToken&&i.cancelToken.subscribe(s),i.signal&&(i.signal.aborted?s():i.signal.addEventListener("abort",s)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(i.url);y&&-1===Ii.protocols.indexOf(y)?n(new ii("Unsupported protocol "+y+":",ii.ERR_BAD_REQUEST,e)):v.send(r||null)})},Wi=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,i=new AbortController;const r=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;i.abort(t instanceof ii?t:new Bi(t instanceof Error?t.message:t))}};let o=t&&setTimeout(()=>{o=null,r(new ii(`timeout ${t} of ms exceeded`,ii.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(r):e.removeEventListener("abort",r)}),e=null)};e.forEach(e=>e.addEventListener("abort",r));const{signal:a}=i;return a.unsubscribe=()=>ni.asap(s),a}},Ji=function*(e,t){let n=e.byteLength;if(n{const r=async function*(e,t){for await(const n of Gi(e))yield*Ji(n,t)}(e,t);let o,s=0,a=e=>{o||(o=!0,i&&i(e))};return new ReadableStream({async pull(e){try{const{done:t,value:i}=await r.next();if(t)return a(),void e.close();let o=i.byteLength;if(n){let e=s+=o;n(e)}e.enqueue(new Uint8Array(i))}catch(t){throw a(t),t}},cancel:e=>(a(e),r.return())},{highWaterMark:2})},{isFunction:Qi}=ni,Yi=(({Request:e,Response:t})=>({Request:e,Response:t}))(ni.global),{ReadableStream:Zi,TextEncoder:er}=ni.global,tr=(e,...t)=>{try{return!!e(...t)}catch(x){return!1}},nr=e=>{e=ni.merge.call({skipUndefined:!0},Yi,e);const{fetch:t,Request:n,Response:i}=e,r=t?Qi(t):"function"==typeof fetch,o=Qi(n),s=Qi(i);if(!r)return!1;const a=r&&Qi(Zi),c=r&&("function"==typeof er?(e=>t=>e.encode(t))(new er):async e=>new Uint8Array(await new n(e).arrayBuffer())),u=o&&a&&tr(()=>{let e=!1;const t=new n(Ii.origin,{body:new Zi,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d=s&&a&&tr(()=>ni.isReadableStream(new i("").body)),l={stream:d&&(e=>e.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!l[e]&&(l[e]=(t,n)=>{let i=t&&t[e];if(i)return i.call(t);throw new ii(`Response type '${e}' is not supported`,ii.ERR_NOT_SUPPORT,n)})});const f=async(e,t)=>{const i=ni.toFiniteNumber(e.getContentLength());return null==i?(async e=>{if(null==e)return 0;if(ni.isBlob(e))return e.size;if(ni.isSpecCompliantForm(e)){const t=new n(Ii.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return ni.isArrayBufferView(e)||ni.isArrayBuffer(e)?e.byteLength:(ni.isURLSearchParams(e)&&(e+=""),ni.isString(e)?(await c(e)).byteLength:void 0)})(t):i};return async e=>{let{url:r,method:s,data:a,signal:c,cancelToken:h,timeout:p,onDownloadProgress:v,onUploadProgress:g,responseType:y,headers:m,withCredentials:w="same-origin",fetchOptions:b}=Vi(e),S=t||fetch;y=y?(y+"").toLowerCase():"text";let O=Wi([c,h&&h.toAbortSignal()],p),A=null;const I=O&&O.unsubscribe&&(()=>{O.unsubscribe()});let E;try{if(g&&u&&"get"!==s&&"head"!==s&&0!==(E=await f(m,a))){let e,t=new n(r,{method:"POST",body:a,duplex:"half"});if(ni.isFormData(a)&&(e=t.headers.get("content-type"))&&m.setContentType(e),t.body){const[e,n]=Fi(E,Di($i(g)));a=Xi(t.body,65536,e,n)}}ni.isString(w)||(w=w?"include":"omit");const t=o&&"credentials"in n.prototype,c={...b,signal:O,method:s.toUpperCase(),headers:m.normalize().toJSON(),body:a,duplex:"half",credentials:t?w:void 0};A=o&&new n(r,c);let h=await(o?S(A,b):S(r,c));const p=d&&("stream"===y||"response"===y);if(d&&(v||p&&I)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=h[t]});const t=ni.toFiniteNumber(h.headers.get("content-length")),[n,r]=v&&Fi(t,Di($i(v),!0))||[];h=new i(Xi(h.body,65536,n,()=>{r&&r(),I&&I()}),e)}y=y||"text";let C=await l[ni.findKey(l,y)||"text"](h,e);return!p&&I&&I(),await new Promise((t,n)=>{Ni(t,n,{data:C,headers:ki.from(h.headers),status:h.status,statusText:h.statusText,config:e,request:A})})}catch(C){if(I&&I(),C&&"TypeError"===C.name&&/Load failed|fetch/i.test(C.message))throw Object.assign(new ii("Network Error",ii.ERR_NETWORK,e,A),{cause:C.cause||C});throw ii.from(C,C&&C.code,e,A)}}},ir=new Map,rr=e=>{let t=e&&e.env||{};const{fetch:n,Request:i,Response:r}=t,o=[i,r,n];let s,a,c=o.length,u=ir;for(;c--;)s=o[c],a=u.get(s),void 0===a&&u.set(s,a=c?new Map:nr(t)),u=a;return a};rr();const or={http:null,xhr:Hi,fetch:{get:rr}};ni.forEach(or,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(x){}Object.defineProperty(e,"adapterName",{value:t})}});const sr=e=>`- ${e}`,ar=e=>ni.isFunction(e)||null===e||!1===e;const cr={getAdapter:function(e,t){e=ni.isArray(e)?e:[e];const{length:n}=e;let i,r;const o={};for(let s=0;s`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new ii("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(sr).join("\n"):" "+sr(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r},adapters:or};function ur(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Bi(null,e)}function dr(e){ur(e),e.headers=ki.from(e.headers),e.data=_i.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return cr.getAdapter(e.adapter||Ci.adapter,e)(e).then(function(t){return ur(e),t.data=_i.call(e,e.transformResponse,t),t.headers=ki.from(t.headers),t},function(t){return Mi(t)||(ur(e),t&&t.response&&(t.response.data=_i.call(e,e.transformResponse,t.response),t.response.headers=ki.from(t.response.headers))),Promise.reject(t)})}const lr="1.13.2",fr={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{fr[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const hr={};fr.transitional=function(e,t,n){function i(e,t){return"[Axios v"+lr+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,r,o)=>{if(!1===e)throw new ii(i(r," has been removed"+(t?" in "+t:"")),ii.ERR_DEPRECATED);return t&&!hr[r]&&(hr[r]=!0,console.warn(i(r," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,r,o)}},fr.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const pr={assertOptions:function(e,t,n){if("object"!=typeof e)throw new ii("options must be an object",ii.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let r=i.length;for(;r-- >0;){const o=i[r],s=t[o];if(s){const t=e[o],n=void 0===t||s(t,o,e);if(!0!==n)throw new ii("option "+o+" must be "+n,ii.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new ii("Unknown option "+o,ii.ERR_BAD_OPTION)}},validators:fr},vr=pr.validators;let gr=class{constructor(e){this.defaults=e||{},this.interceptors={request:new gi,response:new gi}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{n.stack?t&&!String(n.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+t):n.stack=t}catch(x){}}throw n}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Ki(this.defaults,t);const{transitional:n,paramsSerializer:i,headers:r}=t;void 0!==n&&pr.assertOptions(n,{silentJSONParsing:vr.transitional(vr.boolean),forcedJSONParsing:vr.transitional(vr.boolean),clarifyTimeoutError:vr.transitional(vr.boolean)},!1),null!=i&&(ni.isFunction(i)?t.paramsSerializer={serialize:i}:pr.assertOptions(i,{encode:vr.function,serialize:vr.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),pr.assertOptions(t,{baseUrl:vr.spelling("baseURL"),withXsrfToken:vr.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=r&&ni.merge(r.common,r[t.method]);r&&ni.forEach(["delete","get","head","post","put","patch","common"],e=>{delete r[e]}),t.headers=ki.concat(o,r);const s=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,s.unshift(e.fulfilled,e.rejected))});const c=[];let u;this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let d,l=0;if(!a){const e=[dr.bind(this),void 0];for(e.unshift(...s),e.push(...c),d=e.length,u=Promise.resolve(t);l{yr[t]=e});const mr=function e(t){const n=new gr(t),i=pn(gr.prototype.request,n);return ni.extend(i,gr.prototype,n,{allOwnKeys:!0}),ni.extend(i,n,null,{allOwnKeys:!0}),i.create=function(n){return e(Ki(t,n))},i}(Ci);mr.Axios=gr,mr.CanceledError=Bi,mr.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const i=new Promise(e=>{n.subscribe(e),t=e}).then(e);return i.cancel=function(){n.unsubscribe(t)},i},e(function(e,i,r){n.reason||(n.reason=new Bi(e,i,r),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}},mr.isCancel=Mi,mr.VERSION=lr,mr.toFormData=di,mr.AxiosError=ii,mr.Cancel=mr.CanceledError,mr.all=function(e){return Promise.all(e)},mr.spread=function(e){return function(t){return e.apply(null,t)}},mr.isAxiosError=function(e){return ni.isObject(e)&&!0===e.isAxiosError},mr.mergeConfig=Ki,mr.AxiosHeaders=ki,mr.formToJSON=e=>Ei(ni.isHTMLForm(e)?new FormData(e):e),mr.getAdapter=cr.getAdapter,mr.HttpStatusCode=yr,mr.default=mr;const{Axios:wr,AxiosError:br,CanceledError:Sr,isCancel:Or,CancelToken:Ar,VERSION:Ir,all:Er,Cancel:Cr,isAxiosError:Rr,spread:xr,toFormData:Tr,AxiosHeaders:jr,HttpStatusCode:Pr,formToJSON:kr,getAdapter:_r,mergeConfig:Mr}=mr;var Br=Object.getOwnPropertyDescriptor;let Nr=class{constructor(){ln(this)}async get(e,t){const n=this.prepareAxiosRequestConfig(t),i=await mr.get(e,n);return{data:i.data,statusCode:i.status,headers:i.headers}}async post(e,t,n){const i=this.prepareAxiosRequestConfig(n),r=await mr.post(e,t,i);return{data:r.data,statusCode:r.status,headers:r.headers}}async put(e,t,n){const i=this.prepareAxiosRequestConfig(n),r=await mr.put(e,t,i);return{data:r.data,statusCode:r.status,headers:r.headers}}async patch(e,t,n){const i=this.prepareAxiosRequestConfig(n),r=await mr.patch(e,t,i);return{data:r.data,statusCode:r.status,headers:r.headers}}prepareAxiosRequestConfig(e){const t={};return e&&(e.firstInvalidStatusCode&&(t.validateStatus=t=>t{for(var r,o=i>1?void 0:i?Br(t,n):t,s=e.length-1;s>=0;s--)(r=e[s])&&(o=r(o)||o);return o})([cn()],Nr),an.bindForce(hn).to(Nr);const Dr=Symbol("HttpApiService"),Fr=Symbol("EnvironmentService");class $r extends Error{constructor(e){super(`Environment variable is not provided: ${e}`)}}class Ur extends Error{constructor(e,t,n){super(`Invalid type for environment variable: ${e}, expected: ${t}, got value: "${n}"`)}}class Lr extends Error{constructor(e,t){super(`\n\nUrl environment variable were provided with slash at the end:\n${e}=${t.slice(0,t.length-1)}/\n\nConsider removing slash for consistency\n`)}}const qr={string:(e,t)=>t,boolean:(e,t)=>{switch(t){case"true":return!0;case"false":return!1;default:throw new Ur(e,"boolean",t)}},number:(e,t)=>{try{const n=parseFloat(t);if(isNaN(n))throw new Ur(e,"number",t);return n}catch{throw new Ur(e,"number",t)}}},zr={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BACKEND_API_DOMAIN_0:"api.x.rho.trading",VITE_BACKEND_API_NAME_0:"Production",VITE_BACKEND_API_REST_V1_URL_0:"https://api.x.rho.trading/api/v1",VITE_RHO_TARGET:"home-page"};var Kr=Object.getOwnPropertyDescriptor;let Vr=class{_vars=null;get vars(){return this._vars||this.initializeVars(),this._vars}isDevelopment(){return"development"===this.vars.environment}isProduction(){return"production"===this.vars.environment}initializeVars(){this._vars={environment:this.getEnvironment(),backend:{apiCollections:this.parseBackendUrls()}}}parseBackendUrls(){const e=this.getEnvArray("VITE_BACKEND_API_NAME"),t=this.getEnvArray("VITE_BACKEND_API_DOMAIN"),n=this.getEnvArray("VITE_BACKEND_API_REST_V1_URL"),i=Math.min(e.length,t.length,n.length),r=[];for(let o=0;o{for(var r,o=i>1?void 0:i?Kr(t,n):t,s=e.length-1;s>=0;s--)(r=e[s])&&(o=r(o)||o);return o})([cn()],Vr),an.bindForce(Fr).to(Vr);var Hr=Object.getOwnPropertyDescriptor,Wr=(e,t)=>(n,i)=>t(n,i,e);let Jr=class{constructor(e,t){this.environmentService=e,this.httpService=t,ln(this)}salt=null;async get(e,t){const n=this.getApiUrl(),i=await this.prepareHttpRequestConfig(t);return this.httpService.get(`${n}/${e}`,i)}async post(e,t,n){const i=this.getApiUrl(),r=await this.prepareHttpRequestConfig(n);return this.httpService.post(`${i}/${e}`,t,r)}async patch(e,t,n){const i=this.getApiUrl(),r=await this.prepareHttpRequestConfig(n);return this.httpService.post(`${i}/${e}`,t,r)}async put(e,t,n){const i=this.getApiUrl(),r=await this.prepareHttpRequestConfig(n);return this.httpService.post(`${i}/${e}`,t,r)}async prepareHttpRequestConfig(e){let t={};if(e){const{...n}=e;t=n}return t.headers={...t.headers},Promise.resolve(t)}getApiUrl(){const e=this.environmentService.vars.backend.apiCollections;if(0===e.length)throw new Error("No API collections configured");return e[0].rest.v1}};Jr=((e,t,n,i)=>{for(var r,o=i>1?void 0:i?Hr(t,n):t,s=e.length-1;s>=0;s--)(r=e[s])&&(o=r(o)||o);return o})([cn(),Wr(0,un(Fr)),Wr(1,un(hn))],Jr),an.bindForce(Dr).to(Jr);var Gr=Object.getOwnPropertyDescriptor,Xr=(e,t)=>(n,i)=>t(n,i,e);let Qr=class{constructor(e,t){this.httpService=e,this.httpApiService=t,ln(this)}async getAllTickers(){const{data:e}=await this.httpApiService.get("tickers");return e}async getWhitelistedSymbols(){const{data:e}=await this.httpService.get("https://cdn.prod.website-files.com/66140477c9e704ff4f42b1d6/694448a1a7a5798d6db8c899_6a962419bbcf7801f6c791d8dc8e6977_whitelisted-symbols.txt");return e}};Qr=((e,t,n,i)=>{for(var r,o=i>1?void 0:i?Gr(t,n):t,s=e.length-1;s>=0;s--)(r=e[s])&&(o=r(o)||o);return o})([cn(),Xr(0,un(hn)),Xr(1,un(Dr))],Qr),an.bindForce(fn).to(Qr);var Yr=Object.getOwnPropertyDescriptor,Zr=(e,t)=>(n,i)=>t(n,i,e);let eo=class{constructor(e,t){this.environmentService=e,this.tradingAssetRepository=t,ln(this)}MIN_TRADES_COUNT=1e3;async getAll(){return this.getTickers()}async getTickers(){try{const[{tickers:e},{symbols:t}]=await Promise.all([this.tradingAssetRepository.getAllTickers(),this.tradingAssetRepository.getWhitelistedSymbols()]),{whitelistMap:n,validCounters:i}=this.buildWhitelistMap(t),r=new Date,o=e.map(e=>({ticker:e,parsed:this.parseTickerSymbol(e.symbol,Array.from(i))}));this.logParseStats(o);return o.filter(({ticker:e,parsed:t})=>this.isValidTicker(e,t,n)).map(({ticker:e,parsed:t})=>this.mapToTradingAsset(e,t,n)).filter(e=>this.isNotExpired(e,r))}catch(e){return this.environmentService.isDevelopment()&&console.error("[getTickers] Error:",e),[]}}buildWhitelistMap(e){const t=new Map,n=new Set;for(const i of e){const e=`${i.exchangeCode}-${i.base}-${i.counter}`;t.set(e,i),n.add(i.counter)}return this.environmentService.isDevelopment()&&console.log("[getTickers] Whitelist map keys:",Array.from(t.keys())),{whitelistMap:t,validCounters:n}}parseTickerSymbol(e,t){const[n,i]=e.split(":");if(!n)return null;const r=n.split("-");if(r.length<2||!r[0])return null;const o=r[0].toLowerCase(),s=r.slice(1).join("-");if(!s)return null;let a,c;if(s.includes("-")){const e=s.split("-");if(!e[0])return null;a=e[0],c=e.slice(1).join("-")||"USDT"}else{const e=this.extractBaseAndCounter(s,t);e?(a=e.base,c=e.counter):(a=s,c="USDT")}const u={exchangeCode:o,base:a,counter:c};return i&&(u.expiry=this.parseExpiry(i)),u}extractBaseAndCounter(e,t){for(const n of t)if(e.endsWith(n)&&e.length>n.length){const t=e.slice(0,-n.length);if(t.length>0)return{base:t,counter:n}}return null}isValidTicker(e,t,n){if(!t?.expiry)return!1;const i=`${t.exchangeCode}-${t.base}-${t.counter}`,r=n.has(i),o=parseInt(e.lastAccumulatedTradesCount)>this.MIN_TRADES_COUNT;return this.environmentService.isDevelopment()&&(r||console.log(`[getTickers] Filtered out (not whitelisted): ${e.symbol} -> key: ${i}`),o||console.log(`[getTickers] Filtered out (min trades): ${e.symbol} -> trades: ${e.lastAccumulatedTradesCount}`)),r&&o}mapToTradingAsset(e,t,n){const i=`${t.exchangeCode}-${t.base}-${t.counter}`,r=n.get(i),o=t.expiry?{...r,expiry:t.expiry}:r,s=t.expiry?{...r,expiry:t.expiry,meta:{...r.meta,name:this.interpolateTemplate(r.meta.name,o)}}:{...r,meta:{...r.meta,name:this.interpolateTemplate(r.meta.name,o)}};this.environmentService.isDevelopment()&&t.expiry&&console.log(`[getTickers] Mapped asset: ${e.symbol} -> exchange: ${t.exchangeCode}, base: ${t.base}, counter: ${t.counter}, expiry: ${t.expiry.toISOString()}`);const a=e.symbol;return{id:a,symbol:s,apy:this.calculateApy(e),tradingUrl:`https://x.rho.trading/${s.meta.type}/${a}`}}isNotExpired(e,t){if(!e.symbol.expiry)return!1;const n=e.symbol.expiry>t;return this.environmentService.isDevelopment()&&!n&&console.log(`[getTickers] Filtered out (expired): ${e.id} -> expiry: ${e.symbol.expiry.toISOString()}, now: ${t.toISOString()}`),n}interpolateTemplate(e,t){return e.replace(/\$\{([^}]+)\}/g,(e,n)=>{const i=this.getNestedValue(t,n);return null!=i?String(i):e})}getNestedValue(e,t){const n=t.split(".");let i=e;for(const r of n){if(null==i||"object"!=typeof i)return;i=i[r]}return i}calculateApy(e){return Number((100*parseFloat(e.markPrice)).toFixed(2))}parseExpiry(e){const t=parseInt(e.slice(0,2)),n=e.slice(2,5).toUpperCase(),i=2e3+parseInt(e.slice(5,7)),r={JAN:0,FEB:1,MAR:2,APR:3,MAY:4,JUN:5,JUL:6,AUG:7,SEP:8,OCT:9,NOV:10,DEC:11}[n];if(void 0===r)throw new Error(`Invalid month: ${n}`);return new Date(Date.UTC(i,r,t,8))}logParseStats(e){if(!this.environmentService.isDevelopment())return;const t=e.reduce((e,{parsed:t})=>(t?e.parsed+=1:e.failed+=1,e),{parsed:0,failed:0});console.log("[getTickers] Parse stats:",t)}};eo=((e,t,n,i)=>{for(var r,o=i>1?void 0:i?Yr(t,n):t,s=e.length-1;s>=0;s--)(r=e[s])&&(o=r(o)||o);return o})([cn(),Zr(0,un(Fr)),Zr(1,un(fn))],eo),an.bindForce(dn).to(eo);const to=Symbol("AssetsMarqueeService"),no=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var io=Object.getOwnPropertyDescriptor;const ro="assets-marquee-card-highlighted",oo={name:"asset-card-name",images:{exchange:"asset-card-exchange-icon",base:"asset-card-base-icon"},apy:"asset-card-apy",expirationDate:"asset-card-expiration-date"},so="assets-marquee-row";let ao=class{constructor(e){this.tradingAssetService=e,ln(this)}assetsPollingIntervalInMs=3e4;$assetsMarqueeRow=$();$assetCardTemplate=$();pollingInterval=null;init(){this.initElements(),this.adjustMarqueeAnimationSpeed(this.$assetsMarqueeRow),setTimeout(()=>{this.enablePolling()},500)}enablePolling(){this.pollingInterval&&this.disablePolling(),this.assetsPollingTick(),this.pollingInterval=setInterval(this.assetsPollingTick,this.assetsPollingIntervalInMs)}disablePolling(){this.pollingInterval&&(clearInterval(this.pollingInterval),this.setPollingInterval(null))}initElements(){const e=$("#assets-marquee").children(`#${so}`);if(0===e.length)throw new Error(`#${so} is not found`);this.$setAssetsMarqueeRow(e);const t=e.children().first();if(0===t.length)throw new Error(`#${so} -> children is not found`);this.$setAssetCardTemplate(t.clone())}async assetsPollingTick(){const e=await this.tradingAssetService.getAll();if(0===e.length)return;const t=e.concat(e,e).map(e=>{const t=this.$assetCardTemplate.clone().attr("data-asset-id",e.id);t.removeClass("skeleton"),t.find(".skeleton").removeClass("skeleton"),e.symbol.meta.highlighted&&t.addClass(ro),t.on("click",()=>{window.open(e.tradingUrl,"_blank")});const n=this.getCardComponents(t);var i;return n.name.text(e.symbol.meta.name),n.apy.text(`${e.apy}%`),e.symbol.expiry&&n.expirationDate.text("expires "+(i=e.symbol.expiry,`${no[i.getMonth()]} ${i.getDate()}, ${i.getFullYear()}`)),n.images.base.attr("src",e.symbol.meta.images.base),n.images.exchange.attr("src",e.symbol.meta.images.exchange),t});this.$assetsMarqueeRow.stop().empty().append(t),this.adjustMarqueeAnimationSpeed(this.$assetsMarqueeRow)}getCardComponents(e){const t=e=>"object"==typeof e&&null!==e,n=i=>{const r={};for(const[o,s]of Object.entries(i))if(t(s))r[o]=n(s);else if("string"==typeof s){const t=e.find(`.${s}`);r[o]=t}return r};return n(oo)}adjustMarqueeAnimationSpeed(e){const t=70/18460,n=Math.round((e.width()??18460)*t);e.css("animation-duration",`${n}s`)}$setAssetsMarqueeRow(e){this.$assetsMarqueeRow=e}$setAssetCardTemplate(e){this.$assetCardTemplate=e}setPollingInterval(e){this.pollingInterval=e}};var co,uo;ao=((e,t,n,i)=>{for(var r,o=i>1?void 0:i?io(t,n):t,s=e.length-1;s>=0;s--)(r=e[s])&&(o=r(o)||o);return o})([cn(),(co=0,uo=un(dn),(e,t)=>uo(e,t,co))],ao),an.bindForce(to).to(ao),window.rhoServices={tradingAssetService:an.get(dn),assetsMarqueeService:an.get(to)}});