@uxland/primary-shell 7.37.1 → 7.37.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { E as s, f as e, x as r, z as t, c as n, d as o, P as l, Q as c, p as g, q as p, o as m, e as P, v, j as E, u as h, g as u, w as R, l as S, m as y, a as d, n as w, y as C } from "./index-B-kHRe1g.js";
1
+ import { E as s, f as e, x as r, z as t, c as n, d as o, P as l, Q as c, p as g, q as p, o as m, e as P, v, j as E, u as h, g as u, w as R, l as S, m as y, a as d, n as w, y as C } from "./index-CXxEmHmi.js";
2
2
  export {
3
3
  s as EcapEventManager,
4
4
  e as ExitShell,
@@ -260,7 +260,7 @@ Registered bindings:`,re.forEach(function(oe){var ne="Object";oe.implementationT
260
260
  `+ne,oe.constraint.metaData&&(te=te+" - "+oe.constraint.metaData)})),te}function alreadyDependencyChain(X,W){return X.parentRequest===null?!1:X.parentRequest.serviceIdentifier===W?!0:alreadyDependencyChain(X.parentRequest,W)}function dependencyChainToString(X){function W(te,re){re===void 0&&(re=[]);var oe=getServiceIdentifierAsString(te.serviceIdentifier);return re.push(oe),te.parentRequest!==null?W(te.parentRequest,re):re}var J=W(X);return J.reverse().join(" --> ")}function circularDependencyToException(X){X.childRequests.forEach(function(W){if(alreadyDependencyChain(W,W.serviceIdentifier)){var J=dependencyChainToString(W);throw new Error(CIRCULAR_DEPENDENCY+" "+J)}else circularDependencyToException(W)})}function listMetadataForTarget(X,W){if(W.isTagged()||W.isNamed()){var J="",te=W.getNamedTag(),re=W.getCustomTags();return te!==null&&(J+=te.toString()+`
261
261
  `),re!==null&&re.forEach(function(oe){J+=oe.toString()+`
262
262
  `})," "+X+`
263
- `+X+" - "+J}else return" "+X}function getFunctionName(X){if(X.name)return X.name;var W=X.toString(),J=W.match(/^function\s*([^\s(]+)/);return J?J[1]:"Anonymous function: "+W}function getSymbolDescription(X){return X.toString().slice(7,-1)}var Context=(function(){function X(W){this.id=id(),this.container=W}return X.prototype.addPlan=function(W){this.plan=W},X.prototype.setCurrentRequest=function(W){this.currentRequest=W},X})(),Metadata=(function(){function X(W,J){this.key=W,this.value=J}return X.prototype.toString=function(){return this.key===NAMED_TAG?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},X})(),Plan=(function(){function X(W,J){this.parentContext=W,this.rootRequest=J}return X})(),LazyServiceIdentifier=(function(){function X(W){this._cb=W}return X.prototype.unwrap=function(){return this._cb()},X})(),QueryableString=(function(){function X(W){this.str=W}return X.prototype.startsWith=function(W){return this.str.indexOf(W)===0},X.prototype.endsWith=function(W){var J="",te=W.split("").reverse().join("");return J=this.str.split("").reverse().join(""),this.startsWith.call({str:J},te)},X.prototype.contains=function(W){return this.str.indexOf(W)!==-1},X.prototype.equals=function(W){return this.str===W},X.prototype.value=function(){return this.str},X})(),Target=(function(){function X(W,J,te,re){this.id=id(),this.type=W,this.serviceIdentifier=te;var oe=typeof J=="symbol"?getSymbolDescription(J):J;this.name=new QueryableString(oe||""),this.identifier=J,this.metadata=new Array;var ne=null;typeof re=="string"?ne=new Metadata(NAMED_TAG,re):re instanceof Metadata&&(ne=re),ne!==null&&this.metadata.push(ne)}return X.prototype.hasTag=function(W){for(var J=0,te=this.metadata;J<te.length;J++){var re=te[J];if(re.key===W)return!0}return!1},X.prototype.isArray=function(){return this.hasTag(MULTI_INJECT_TAG)},X.prototype.matchesArray=function(W){return this.matchesTag(MULTI_INJECT_TAG)(W)},X.prototype.isNamed=function(){return this.hasTag(NAMED_TAG)},X.prototype.isTagged=function(){return this.metadata.some(function(W){return NON_CUSTOM_TAG_KEYS.every(function(J){return W.key!==J})})},X.prototype.isOptional=function(){return this.matchesTag(OPTIONAL_TAG)(!0)},X.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter(function(W){return W.key===NAMED_TAG})[0]:null},X.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter(function(W){return NON_CUSTOM_TAG_KEYS.every(function(J){return W.key!==J})}):null},X.prototype.matchesNamedTag=function(W){return this.matchesTag(NAMED_TAG)(W)},X.prototype.matchesTag=function(W){var J=this;return function(te){for(var re=0,oe=J.metadata;re<oe.length;re++){var ne=oe[re];if(ne.key===W&&ne.value===te)return!0}return!1}},X})(),__spreadArray$2=function(X,W,J){if(J||arguments.length===2)for(var te=0,re=W.length,oe;te<re;te++)(oe||!(te in W))&&(oe||(oe=Array.prototype.slice.call(W,0,te)),oe[te]=W[te]);return X.concat(oe||Array.prototype.slice.call(W))};function getDependencies$1(X,W){var J=getFunctionName(W);return getTargets(X,J,W,!1)}function getTargets(X,W,J,te){var re=X.getConstructorMetadata(J),oe=re.compilerGeneratedMetadata;if(oe===void 0){var ne=MISSING_INJECTABLE_ANNOTATION+" "+W+".";throw new Error(ne)}var de=re.userGeneratedMetadata,ce=Object.keys(de),ue=J.length===0&&ce.length>0,he=ce.length>J.length,pe=ue||he?ce.length:J.length,fe=getConstructorArgsAsTargets(te,W,oe,de,pe),be=getClassPropsAsTargets(X,J,W),me=__spreadArray$2(__spreadArray$2([],fe,!0),be,!0);return me}function getConstructorArgsAsTarget(X,W,J,te,re){var oe=re[X.toString()]||[],ne=formatTargetMetadata(oe),de=ne.unmanaged!==!0,ce=te[X],ue=ne.inject||ne.multiInject;if(ce=ue||ce,ce instanceof LazyServiceIdentifier&&(ce=ce.unwrap()),de){var he=ce===Object,pe=ce===Function,fe=ce===void 0,be=he||pe||fe;if(!W&&be){var me=MISSING_INJECT_ANNOTATION+" argument "+X+" in class "+J+".";throw new Error(me)}var ge=new Target(TargetTypeEnum.ConstructorArgument,ne.targetName,ce);return ge.metadata=oe,ge}return null}function getConstructorArgsAsTargets(X,W,J,te,re){for(var oe=[],ne=0;ne<re;ne++){var de=ne,ce=getConstructorArgsAsTarget(de,X,W,J,te);ce!==null&&oe.push(ce)}return oe}function _getServiceIdentifierForProperty(X,W,J,te){var re=X||W;if(re===void 0){var oe=MISSING_INJECTABLE_ANNOTATION+" for property "+String(J)+" in class "+te+".";throw new Error(oe)}return re}function getClassPropsAsTargets(X,W,J){for(var te=X.getPropertiesMetadata(W),re=[],oe=Object.getOwnPropertySymbols(te),ne=Object.keys(te),de=ne.concat(oe),ce=0,ue=de;ce<ue.length;ce++){var he=ue[ce],pe=te[he],fe=formatTargetMetadata(pe),be=fe.targetName||he,me=_getServiceIdentifierForProperty(fe.inject,fe.multiInject,he,J),ge=new Target(TargetTypeEnum.ClassProperty,be,me);ge.metadata=pe,re.push(ge)}var ve=Object.getPrototypeOf(W.prototype).constructor;if(ve!==Object){var _e=getClassPropsAsTargets(X,ve,J);re=__spreadArray$2(__spreadArray$2([],re,!0),_e,!0)}return re}function getBaseClassDependencyCount(X,W){var J=Object.getPrototypeOf(W.prototype).constructor;if(J!==Object){var te=getFunctionName(J),re=getTargets(X,te,J,!0),oe=re.map(function(ce){return ce.metadata.filter(function(ue){return ue.key===UNMANAGED_TAG})}),ne=[].concat.apply([],oe).length,de=re.length-ne;return de>0?de:getBaseClassDependencyCount(X,J)}else return 0}function formatTargetMetadata(X){var W={};return X.forEach(function(J){W[J.key.toString()]=J.value}),{inject:W[INJECT_TAG],multiInject:W[MULTI_INJECT_TAG],targetName:W[NAME_TAG],unmanaged:W[UNMANAGED_TAG]}}var Request=(function(){function X(W,J,te,re,oe){this.id=id(),this.serviceIdentifier=W,this.parentContext=J,this.parentRequest=te,this.target=oe,this.childRequests=[],this.bindings=Array.isArray(re)?re:[re],this.requestScope=te===null?new Map:null}return X.prototype.addChildRequest=function(W,J,te){var re=new X(W,this.parentContext,this,J,te);return this.childRequests.push(re),re},X})();function getBindingDictionary(X){return X._bindingDictionary}function _createTarget(X,W,J,te,re,oe){var ne=X?MULTI_INJECT_TAG:INJECT_TAG,de=new Metadata(ne,J),ce=new Target(W,te,J,de);if(re!==void 0){var ue=new Metadata(re,oe);ce.metadata.push(ue)}return ce}function _getActiveBindings(X,W,J,te,re){var oe=getBindings(J.container,re.serviceIdentifier),ne=[];return oe.length===BindingCount.NoBindingsAvailable&&J.container.options.autoBindInjectable&&typeof re.serviceIdentifier=="function"&&X.getConstructorMetadata(re.serviceIdentifier).compilerGeneratedMetadata&&(J.container.bind(re.serviceIdentifier).toSelf(),oe=getBindings(J.container,re.serviceIdentifier)),W?ne=oe:ne=oe.filter(function(de){var ce=new Request(de.serviceIdentifier,J,te,de,re);return de.constraint(ce)}),_validateActiveBindingCount(re.serviceIdentifier,ne,re,J.container),ne}function _validateActiveBindingCount(X,W,J,te){switch(W.length){case BindingCount.NoBindingsAvailable:if(J.isOptional())return W;var re=getServiceIdentifierAsString(X),oe=NOT_REGISTERED;throw oe+=listMetadataForTarget(re,J),oe+=listRegisteredBindingsForServiceIdentifier(te,re,getBindings),new Error(oe);case BindingCount.OnlyOneBindingAvailable:return W;case BindingCount.MultipleBindingsAvailable:default:if(J.isArray())return W;var re=getServiceIdentifierAsString(X),oe=AMBIGUOUS_MATCH+" "+re;throw oe+=listRegisteredBindingsForServiceIdentifier(te,re,getBindings),new Error(oe)}}function _createSubRequests(X,W,J,te,re,oe){var ne,de;if(re===null){ne=_getActiveBindings(X,W,te,null,oe),de=new Request(J,te,null,ne,oe);var ce=new Plan(te,de);te.addPlan(ce)}else ne=_getActiveBindings(X,W,te,re,oe),de=re.addChildRequest(oe.serviceIdentifier,ne,oe);ne.forEach(function(ue){var he=null;if(oe.isArray())he=de.addChildRequest(ue.serviceIdentifier,ue,oe);else{if(ue.cache)return;he=de}if(ue.type===BindingTypeEnum.Instance&&ue.implementationType!==null){var pe=getDependencies$1(X,ue.implementationType);if(!te.container.options.skipBaseClassChecks){var fe=getBaseClassDependencyCount(X,ue.implementationType);if(pe.length<fe){var be=ARGUMENTS_LENGTH_MISMATCH(getFunctionName(ue.implementationType));throw new Error(be)}}pe.forEach(function(me){_createSubRequests(X,!1,me.serviceIdentifier,te,he,me)})}})}function getBindings(X,W){var J=[],te=getBindingDictionary(X);return te.hasKey(W)?J=te.get(W):X.parent!==null&&(J=getBindings(X.parent,W)),J}function plan(X,W,J,te,re,oe,ne,de){de===void 0&&(de=!1);var ce=new Context(W),ue=_createTarget(J,te,re,"",oe,ne);try{return _createSubRequests(X,de,re,ce,null,ue),ce}catch(he){throw isStackOverflowExeption(he)&&circularDependencyToException(ce.plan.rootRequest),he}}function createMockRequest(X,W,J,te){var re=new Target(TargetTypeEnum.Variable,"",W,new Metadata(J,te)),oe=new Context(X),ne=new Request(W,oe,null,[],re);return ne}function isPromise(X){var W=typeof X=="object"&&X!==null||typeof X=="function";return W&&typeof X.then=="function"}function isPromiseOrContainsPromise(X){return isPromise(X)?!0:Array.isArray(X)&&X.some(isPromise)}var __awaiter$3=function(X,W,J,te){function re(oe){return oe instanceof J?oe:new J(function(ne){ne(oe)})}return new(J||(J=Promise))(function(oe,ne){function de(he){try{ue(te.next(he))}catch(pe){ne(pe)}}function ce(he){try{ue(te.throw(he))}catch(pe){ne(pe)}}function ue(he){he.done?oe(he.value):re(he.value).then(de,ce)}ue((te=te.apply(X,W||[])).next())})},__generator$3=function(X,W){var J={label:0,sent:function(){if(oe[0]&1)throw oe[1];return oe[1]},trys:[],ops:[]},te,re,oe,ne;return ne={next:de(0),throw:de(1),return:de(2)},typeof Symbol=="function"&&(ne[Symbol.iterator]=function(){return this}),ne;function de(ue){return function(he){return ce([ue,he])}}function ce(ue){if(te)throw new TypeError("Generator is already executing.");for(;J;)try{if(te=1,re&&(oe=ue[0]&2?re.return:ue[0]?re.throw||((oe=re.return)&&oe.call(re),0):re.next)&&!(oe=oe.call(re,ue[1])).done)return oe;switch(re=0,oe&&(ue=[ue[0]&2,oe.value]),ue[0]){case 0:case 1:oe=ue;break;case 4:return J.label++,{value:ue[1],done:!1};case 5:J.label++,re=ue[1],ue=[0];continue;case 7:ue=J.ops.pop(),J.trys.pop();continue;default:if(oe=J.trys,!(oe=oe.length>0&&oe[oe.length-1])&&(ue[0]===6||ue[0]===2)){J=0;continue}if(ue[0]===3&&(!oe||ue[1]>oe[0]&&ue[1]<oe[3])){J.label=ue[1];break}if(ue[0]===6&&J.label<oe[1]){J.label=oe[1],oe=ue;break}if(oe&&J.label<oe[2]){J.label=oe[2],J.ops.push(ue);break}oe[2]&&J.ops.pop(),J.trys.pop();continue}ue=W.call(X,J)}catch(he){ue=[6,he],re=0}finally{te=oe=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},tryGetFromScope=function(X,W){return W.scope===BindingScopeEnum.Singleton&&W.activated?W.cache:W.scope===BindingScopeEnum.Request&&X.has(W.id)?X.get(W.id):null},saveToScope=function(X,W,J){W.scope===BindingScopeEnum.Singleton&&_saveToSingletonScope(W,J),W.scope===BindingScopeEnum.Request&&_saveToRequestScope(X,W,J)},_saveToRequestScope=function(X,W,J){X.has(W.id)||X.set(W.id,J)},_saveToSingletonScope=function(X,W){X.cache=W,X.activated=!0,isPromise(W)&&_saveAsyncResultToSingletonScope(X,W)},_saveAsyncResultToSingletonScope=function(X,W){return __awaiter$3(void 0,void 0,void 0,function(){var J,te;return __generator$3(this,function(re){switch(re.label){case 0:return re.trys.push([0,2,,3]),[4,W];case 1:return J=re.sent(),X.cache=J,[3,3];case 2:throw te=re.sent(),X.cache=null,X.activated=!1,te;case 3:return[2]}})})},FactoryType;(function(X){X.DynamicValue="toDynamicValue",X.Factory="toFactory",X.Provider="toProvider"})(FactoryType||(FactoryType={}));var ensureFullyBound=function(X){var W=null;switch(X.type){case BindingTypeEnum.ConstantValue:case BindingTypeEnum.Function:W=X.cache;break;case BindingTypeEnum.Constructor:case BindingTypeEnum.Instance:W=X.implementationType;break;case BindingTypeEnum.DynamicValue:W=X.dynamicValue;break;case BindingTypeEnum.Provider:W=X.provider;break;case BindingTypeEnum.Factory:W=X.factory;break}if(W===null){var J=getServiceIdentifierAsString(X.serviceIdentifier);throw new Error(INVALID_BINDING_TYPE+" "+J)}},getFactoryDetails=function(X){switch(X.type){case BindingTypeEnum.Factory:return{factory:X.factory,factoryType:FactoryType.Factory};case BindingTypeEnum.Provider:return{factory:X.provider,factoryType:FactoryType.Provider};case BindingTypeEnum.DynamicValue:return{factory:X.dynamicValue,factoryType:FactoryType.DynamicValue};default:throw new Error("Unexpected factory type "+X.type)}},__assign$1=function(){return __assign$1=Object.assign||function(X){for(var W,J=1,te=arguments.length;J<te;J++){W=arguments[J];for(var re in W)Object.prototype.hasOwnProperty.call(W,re)&&(X[re]=W[re])}return X},__assign$1.apply(this,arguments)},__awaiter$2=function(X,W,J,te){function re(oe){return oe instanceof J?oe:new J(function(ne){ne(oe)})}return new(J||(J=Promise))(function(oe,ne){function de(he){try{ue(te.next(he))}catch(pe){ne(pe)}}function ce(he){try{ue(te.throw(he))}catch(pe){ne(pe)}}function ue(he){he.done?oe(he.value):re(he.value).then(de,ce)}ue((te=te.apply(X,W||[])).next())})},__generator$2=function(X,W){var J={label:0,sent:function(){if(oe[0]&1)throw oe[1];return oe[1]},trys:[],ops:[]},te,re,oe,ne;return ne={next:de(0),throw:de(1),return:de(2)},typeof Symbol=="function"&&(ne[Symbol.iterator]=function(){return this}),ne;function de(ue){return function(he){return ce([ue,he])}}function ce(ue){if(te)throw new TypeError("Generator is already executing.");for(;J;)try{if(te=1,re&&(oe=ue[0]&2?re.return:ue[0]?re.throw||((oe=re.return)&&oe.call(re),0):re.next)&&!(oe=oe.call(re,ue[1])).done)return oe;switch(re=0,oe&&(ue=[ue[0]&2,oe.value]),ue[0]){case 0:case 1:oe=ue;break;case 4:return J.label++,{value:ue[1],done:!1};case 5:J.label++,re=ue[1],ue=[0];continue;case 7:ue=J.ops.pop(),J.trys.pop();continue;default:if(oe=J.trys,!(oe=oe.length>0&&oe[oe.length-1])&&(ue[0]===6||ue[0]===2)){J=0;continue}if(ue[0]===3&&(!oe||ue[1]>oe[0]&&ue[1]<oe[3])){J.label=ue[1];break}if(ue[0]===6&&J.label<oe[1]){J.label=oe[1],oe=ue;break}if(oe&&J.label<oe[2]){J.label=oe[2],J.ops.push(ue);break}oe[2]&&J.ops.pop(),J.trys.pop();continue}ue=W.call(X,J)}catch(he){ue=[6,he],re=0}finally{te=oe=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},__spreadArray$1=function(X,W,J){if(J||arguments.length===2)for(var te=0,re=W.length,oe;te<re;te++)(oe||!(te in W))&&(oe||(oe=Array.prototype.slice.call(W,0,te)),oe[te]=W[te]);return X.concat(oe||Array.prototype.slice.call(W))};function _resolveRequests(X,W){return X.reduce(function(J,te){var re=W(te),oe=te.target.type;return oe===TargetTypeEnum.ConstructorArgument?J.constructorInjections.push(re):(J.propertyRequests.push(te),J.propertyInjections.push(re)),J.isAsync||(J.isAsync=isPromiseOrContainsPromise(re)),J},{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}function _createInstance(X,W,J){var te;if(W.length>0){var re=_resolveRequests(W,J),oe=__assign$1(__assign$1({},re),{constr:X});re.isAsync?te=createInstanceWithInjectionsAsync(oe):te=createInstanceWithInjections(oe)}else te=new X;return te}function createInstanceWithInjections(X){var W,J=new((W=X.constr).bind.apply(W,__spreadArray$1([void 0],X.constructorInjections,!1)));return X.propertyRequests.forEach(function(te,re){var oe=te.target.identifier,ne=X.propertyInjections[re];(!te.target.isOptional()||ne!==void 0)&&(J[oe]=ne)}),J}function createInstanceWithInjectionsAsync(X){return __awaiter$2(this,void 0,void 0,function(){var W,J;return __generator$2(this,function(te){switch(te.label){case 0:return[4,possiblyWaitInjections(X.constructorInjections)];case 1:return W=te.sent(),[4,possiblyWaitInjections(X.propertyInjections)];case 2:return J=te.sent(),[2,createInstanceWithInjections(__assign$1(__assign$1({},X),{constructorInjections:W,propertyInjections:J}))]}})})}function possiblyWaitInjections(X){return __awaiter$2(this,void 0,void 0,function(){var W,J,te,re;return __generator$2(this,function(oe){for(W=[],J=0,te=X;J<te.length;J++)re=te[J],Array.isArray(re)?W.push(Promise.all(re)):W.push(re);return[2,Promise.all(W)]})})}function _getInstanceAfterPostConstruct(X,W){var J=_postConstruct(X,W);return isPromise(J)?J.then(function(){return W}):W}function _postConstruct(X,W){var J,te;if(Reflect.hasMetadata(POST_CONSTRUCT,X)){var re=Reflect.getMetadata(POST_CONSTRUCT,X);try{return(te=(J=W)[re.value])===null||te===void 0?void 0:te.call(J)}catch(oe){if(oe instanceof Error)throw new Error(POST_CONSTRUCT_ERROR(X.name,oe.message))}}}function _validateInstanceResolution(X,W){X.scope!==BindingScopeEnum.Singleton&&_throwIfHandlingDeactivation(X,W)}function _throwIfHandlingDeactivation(X,W){var J="Class cannot be instantiated in "+(X.scope===BindingScopeEnum.Request?"request":"transient")+" scope.";if(typeof X.onDeactivation=="function")throw new Error(ON_DEACTIVATION_ERROR(W.name,J));if(Reflect.hasMetadata(PRE_DESTROY,W))throw new Error(PRE_DESTROY_ERROR(W.name,J))}function resolveInstance(X,W,J,te){_validateInstanceResolution(X,W);var re=_createInstance(W,J,te);return isPromise(re)?re.then(function(oe){return _getInstanceAfterPostConstruct(W,oe)}):_getInstanceAfterPostConstruct(W,re)}var __awaiter$1=function(X,W,J,te){function re(oe){return oe instanceof J?oe:new J(function(ne){ne(oe)})}return new(J||(J=Promise))(function(oe,ne){function de(he){try{ue(te.next(he))}catch(pe){ne(pe)}}function ce(he){try{ue(te.throw(he))}catch(pe){ne(pe)}}function ue(he){he.done?oe(he.value):re(he.value).then(de,ce)}ue((te=te.apply(X,W||[])).next())})},__generator$1=function(X,W){var J={label:0,sent:function(){if(oe[0]&1)throw oe[1];return oe[1]},trys:[],ops:[]},te,re,oe,ne;return ne={next:de(0),throw:de(1),return:de(2)},typeof Symbol=="function"&&(ne[Symbol.iterator]=function(){return this}),ne;function de(ue){return function(he){return ce([ue,he])}}function ce(ue){if(te)throw new TypeError("Generator is already executing.");for(;J;)try{if(te=1,re&&(oe=ue[0]&2?re.return:ue[0]?re.throw||((oe=re.return)&&oe.call(re),0):re.next)&&!(oe=oe.call(re,ue[1])).done)return oe;switch(re=0,oe&&(ue=[ue[0]&2,oe.value]),ue[0]){case 0:case 1:oe=ue;break;case 4:return J.label++,{value:ue[1],done:!1};case 5:J.label++,re=ue[1],ue=[0];continue;case 7:ue=J.ops.pop(),J.trys.pop();continue;default:if(oe=J.trys,!(oe=oe.length>0&&oe[oe.length-1])&&(ue[0]===6||ue[0]===2)){J=0;continue}if(ue[0]===3&&(!oe||ue[1]>oe[0]&&ue[1]<oe[3])){J.label=ue[1];break}if(ue[0]===6&&J.label<oe[1]){J.label=oe[1],oe=ue;break}if(oe&&J.label<oe[2]){J.label=oe[2],J.ops.push(ue);break}oe[2]&&J.ops.pop(),J.trys.pop();continue}ue=W.call(X,J)}catch(he){ue=[6,he],re=0}finally{te=oe=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},_resolveRequest=function(X){return function(W){W.parentContext.setCurrentRequest(W);var J=W.bindings,te=W.childRequests,re=W.target&&W.target.isArray(),oe=!W.parentRequest||!W.parentRequest.target||!W.target||!W.parentRequest.target.matchesArray(W.target.serviceIdentifier);if(re&&oe)return te.map(function(de){var ce=_resolveRequest(X);return ce(de)});if(W.target.isOptional()&&J.length===0)return;var ne=J[0];return _resolveBinding(X,W,ne)}},_resolveFactoryFromBinding=function(X,W){var J=getFactoryDetails(X);return tryAndThrowErrorIfStackOverflow(function(){return J.factory.bind(X)(W)},function(){return new Error(CIRCULAR_DEPENDENCY_IN_FACTORY(J.factoryType,W.currentRequest.serviceIdentifier.toString()))})},_getResolvedFromBinding=function(X,W,J){var te,re=W.childRequests;switch(ensureFullyBound(J),J.type){case BindingTypeEnum.ConstantValue:case BindingTypeEnum.Function:te=J.cache;break;case BindingTypeEnum.Constructor:te=J.implementationType;break;case BindingTypeEnum.Instance:te=resolveInstance(J,J.implementationType,re,_resolveRequest(X));break;default:te=_resolveFactoryFromBinding(J,W.parentContext)}return te},_resolveInScope=function(X,W,J){var te=tryGetFromScope(X,W);return te!==null||(te=J(),saveToScope(X,W,te)),te},_resolveBinding=function(X,W,J){return _resolveInScope(X,J,function(){var te=_getResolvedFromBinding(X,W,J);return isPromise(te)?te=te.then(function(re){return _onActivation(W,J,re)}):te=_onActivation(W,J,te),te})};function _onActivation(X,W,J){var te=_bindingActivation(X.parentContext,W,J),re=_getContainersIterator(X.parentContext.container),oe,ne=re.next();do{oe=ne.value;var de=X.parentContext,ce=X.serviceIdentifier,ue=_getContainerActivationsForService(oe,ce);isPromise(te)?te=_activateContainerAsync(ue,de,te):te=_activateContainer(ue,de,te),ne=re.next()}while(ne.done!==!0&&!getBindingDictionary(oe).hasKey(X.serviceIdentifier));return te}var _bindingActivation=function(X,W,J){var te;return typeof W.onActivation=="function"?te=W.onActivation(X,J):te=J,te},_activateContainer=function(X,W,J){for(var te=X.next();!te.done;){if(J=te.value(W,J),isPromise(J))return _activateContainerAsync(X,W,J);te=X.next()}return J},_activateContainerAsync=function(X,W,J){return __awaiter$1(void 0,void 0,void 0,function(){var te,re;return __generator$1(this,function(oe){switch(oe.label){case 0:return[4,J];case 1:te=oe.sent(),re=X.next(),oe.label=2;case 2:return re.done?[3,4]:[4,re.value(W,te)];case 3:return te=oe.sent(),re=X.next(),[3,2];case 4:return[2,te]}})})},_getContainerActivationsForService=function(X,W){var J=X._activations;return J.hasKey(W)?J.get(W).values():[].values()},_getContainersIterator=function(X){for(var W=[X],J=X.parent;J!==null;)W.push(J),J=J.parent;var te=function(){var oe=W.pop();return oe!==void 0?{done:!1,value:oe}:{done:!0,value:void 0}},re={next:te};return re};function resolve(X){var W=_resolveRequest(X.plan.rootRequest.requestScope);return W(X.plan.rootRequest)}var traverseAncerstors=function(X,W){var J=X.parentRequest;return J!==null?W(J)?!0:traverseAncerstors(J,W):!1},taggedConstraint=function(X){return function(W){var J=function(te){return te!==null&&te.target!==null&&te.target.matchesTag(X)(W)};return J.metaData=new Metadata(X,W),J}},namedConstraint=taggedConstraint(NAMED_TAG),typeConstraint=function(X){return function(W){var J=null;if(W!==null)if(J=W.bindings[0],typeof X=="string"){var te=J.serviceIdentifier;return te===X}else{var re=W.bindings[0].implementationType;return X===re}return!1}},BindingWhenSyntax=(function(){function X(W){this._binding=W}return X.prototype.when=function(W){return this._binding.constraint=W,new BindingOnSyntax(this._binding)},X.prototype.whenTargetNamed=function(W){return this._binding.constraint=namedConstraint(W),new BindingOnSyntax(this._binding)},X.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(W){if(W===null)return!1;var J=W.target!==null&&!W.target.isNamed()&&!W.target.isTagged();return J},new BindingOnSyntax(this._binding)},X.prototype.whenTargetTagged=function(W,J){return this._binding.constraint=taggedConstraint(W)(J),new BindingOnSyntax(this._binding)},X.prototype.whenInjectedInto=function(W){return this._binding.constraint=function(J){return J!==null&&typeConstraint(W)(J.parentRequest)},new BindingOnSyntax(this._binding)},X.prototype.whenParentNamed=function(W){return this._binding.constraint=function(J){return J!==null&&namedConstraint(W)(J.parentRequest)},new BindingOnSyntax(this._binding)},X.prototype.whenParentTagged=function(W,J){return this._binding.constraint=function(te){return te!==null&&taggedConstraint(W)(J)(te.parentRequest)},new BindingOnSyntax(this._binding)},X.prototype.whenAnyAncestorIs=function(W){return this._binding.constraint=function(J){return J!==null&&traverseAncerstors(J,typeConstraint(W))},new BindingOnSyntax(this._binding)},X.prototype.whenNoAncestorIs=function(W){return this._binding.constraint=function(J){return J!==null&&!traverseAncerstors(J,typeConstraint(W))},new BindingOnSyntax(this._binding)},X.prototype.whenAnyAncestorNamed=function(W){return this._binding.constraint=function(J){return J!==null&&traverseAncerstors(J,namedConstraint(W))},new BindingOnSyntax(this._binding)},X.prototype.whenNoAncestorNamed=function(W){return this._binding.constraint=function(J){return J!==null&&!traverseAncerstors(J,namedConstraint(W))},new BindingOnSyntax(this._binding)},X.prototype.whenAnyAncestorTagged=function(W,J){return this._binding.constraint=function(te){return te!==null&&traverseAncerstors(te,taggedConstraint(W)(J))},new BindingOnSyntax(this._binding)},X.prototype.whenNoAncestorTagged=function(W,J){return this._binding.constraint=function(te){return te!==null&&!traverseAncerstors(te,taggedConstraint(W)(J))},new BindingOnSyntax(this._binding)},X.prototype.whenAnyAncestorMatches=function(W){return this._binding.constraint=function(J){return J!==null&&traverseAncerstors(J,W)},new BindingOnSyntax(this._binding)},X.prototype.whenNoAncestorMatches=function(W){return this._binding.constraint=function(J){return J!==null&&!traverseAncerstors(J,W)},new BindingOnSyntax(this._binding)},X})(),BindingOnSyntax=(function(){function X(W){this._binding=W}return X.prototype.onActivation=function(W){return this._binding.onActivation=W,new BindingWhenSyntax(this._binding)},X.prototype.onDeactivation=function(W){return this._binding.onDeactivation=W,new BindingWhenSyntax(this._binding)},X})(),BindingWhenOnSyntax=(function(){function X(W){this._binding=W,this._bindingWhenSyntax=new BindingWhenSyntax(this._binding),this._bindingOnSyntax=new BindingOnSyntax(this._binding)}return X.prototype.when=function(W){return this._bindingWhenSyntax.when(W)},X.prototype.whenTargetNamed=function(W){return this._bindingWhenSyntax.whenTargetNamed(W)},X.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},X.prototype.whenTargetTagged=function(W,J){return this._bindingWhenSyntax.whenTargetTagged(W,J)},X.prototype.whenInjectedInto=function(W){return this._bindingWhenSyntax.whenInjectedInto(W)},X.prototype.whenParentNamed=function(W){return this._bindingWhenSyntax.whenParentNamed(W)},X.prototype.whenParentTagged=function(W,J){return this._bindingWhenSyntax.whenParentTagged(W,J)},X.prototype.whenAnyAncestorIs=function(W){return this._bindingWhenSyntax.whenAnyAncestorIs(W)},X.prototype.whenNoAncestorIs=function(W){return this._bindingWhenSyntax.whenNoAncestorIs(W)},X.prototype.whenAnyAncestorNamed=function(W){return this._bindingWhenSyntax.whenAnyAncestorNamed(W)},X.prototype.whenAnyAncestorTagged=function(W,J){return this._bindingWhenSyntax.whenAnyAncestorTagged(W,J)},X.prototype.whenNoAncestorNamed=function(W){return this._bindingWhenSyntax.whenNoAncestorNamed(W)},X.prototype.whenNoAncestorTagged=function(W,J){return this._bindingWhenSyntax.whenNoAncestorTagged(W,J)},X.prototype.whenAnyAncestorMatches=function(W){return this._bindingWhenSyntax.whenAnyAncestorMatches(W)},X.prototype.whenNoAncestorMatches=function(W){return this._bindingWhenSyntax.whenNoAncestorMatches(W)},X.prototype.onActivation=function(W){return this._bindingOnSyntax.onActivation(W)},X.prototype.onDeactivation=function(W){return this._bindingOnSyntax.onDeactivation(W)},X})(),BindingInSyntax=(function(){function X(W){this._binding=W}return X.prototype.inRequestScope=function(){return this._binding.scope=BindingScopeEnum.Request,new BindingWhenOnSyntax(this._binding)},X.prototype.inSingletonScope=function(){return this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.inTransientScope=function(){return this._binding.scope=BindingScopeEnum.Transient,new BindingWhenOnSyntax(this._binding)},X})(),BindingInWhenOnSyntax=(function(){function X(W){this._binding=W,this._bindingWhenSyntax=new BindingWhenSyntax(this._binding),this._bindingOnSyntax=new BindingOnSyntax(this._binding),this._bindingInSyntax=new BindingInSyntax(W)}return X.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},X.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},X.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},X.prototype.when=function(W){return this._bindingWhenSyntax.when(W)},X.prototype.whenTargetNamed=function(W){return this._bindingWhenSyntax.whenTargetNamed(W)},X.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},X.prototype.whenTargetTagged=function(W,J){return this._bindingWhenSyntax.whenTargetTagged(W,J)},X.prototype.whenInjectedInto=function(W){return this._bindingWhenSyntax.whenInjectedInto(W)},X.prototype.whenParentNamed=function(W){return this._bindingWhenSyntax.whenParentNamed(W)},X.prototype.whenParentTagged=function(W,J){return this._bindingWhenSyntax.whenParentTagged(W,J)},X.prototype.whenAnyAncestorIs=function(W){return this._bindingWhenSyntax.whenAnyAncestorIs(W)},X.prototype.whenNoAncestorIs=function(W){return this._bindingWhenSyntax.whenNoAncestorIs(W)},X.prototype.whenAnyAncestorNamed=function(W){return this._bindingWhenSyntax.whenAnyAncestorNamed(W)},X.prototype.whenAnyAncestorTagged=function(W,J){return this._bindingWhenSyntax.whenAnyAncestorTagged(W,J)},X.prototype.whenNoAncestorNamed=function(W){return this._bindingWhenSyntax.whenNoAncestorNamed(W)},X.prototype.whenNoAncestorTagged=function(W,J){return this._bindingWhenSyntax.whenNoAncestorTagged(W,J)},X.prototype.whenAnyAncestorMatches=function(W){return this._bindingWhenSyntax.whenAnyAncestorMatches(W)},X.prototype.whenNoAncestorMatches=function(W){return this._bindingWhenSyntax.whenNoAncestorMatches(W)},X.prototype.onActivation=function(W){return this._bindingOnSyntax.onActivation(W)},X.prototype.onDeactivation=function(W){return this._bindingOnSyntax.onDeactivation(W)},X})(),BindingToSyntax=(function(){function X(W){this._binding=W}return X.prototype.to=function(W){return this._binding.type=BindingTypeEnum.Instance,this._binding.implementationType=W,new BindingInWhenOnSyntax(this._binding)},X.prototype.toSelf=function(){if(typeof this._binding.serviceIdentifier!="function")throw new Error(""+INVALID_TO_SELF_VALUE);var W=this._binding.serviceIdentifier;return this.to(W)},X.prototype.toConstantValue=function(W){return this._binding.type=BindingTypeEnum.ConstantValue,this._binding.cache=W,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.toDynamicValue=function(W){return this._binding.type=BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=W,this._binding.implementationType=null,new BindingInWhenOnSyntax(this._binding)},X.prototype.toConstructor=function(W){return this._binding.type=BindingTypeEnum.Constructor,this._binding.implementationType=W,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.toFactory=function(W){return this._binding.type=BindingTypeEnum.Factory,this._binding.factory=W,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.toFunction=function(W){if(typeof W!="function")throw new Error(INVALID_FUNCTION_BINDING);var J=this.toConstantValue(W);return this._binding.type=BindingTypeEnum.Function,this._binding.scope=BindingScopeEnum.Singleton,J},X.prototype.toAutoFactory=function(W){return this._binding.type=BindingTypeEnum.Factory,this._binding.factory=function(J){var te=function(){return J.container.get(W)};return te},this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.toAutoNamedFactory=function(W){return this._binding.type=BindingTypeEnum.Factory,this._binding.factory=function(J){return function(te){return J.container.getNamed(W,te)}},new BindingWhenOnSyntax(this._binding)},X.prototype.toProvider=function(W){return this._binding.type=BindingTypeEnum.Provider,this._binding.provider=W,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.toService=function(W){this.toDynamicValue(function(J){return J.container.get(W)})},X})(),ContainerSnapshot=(function(){function X(){}return X.of=function(W,J,te,re,oe){var ne=new X;return ne.bindings=W,ne.middleware=J,ne.deactivations=re,ne.activations=te,ne.moduleActivationStore=oe,ne},X})();function isClonable(X){return typeof X=="object"&&X!==null&&"clone"in X&&typeof X.clone=="function"}var Lookup=(function(){function X(){this._map=new Map}return X.prototype.getMap=function(){return this._map},X.prototype.add=function(W,J){if(W==null)throw new Error(NULL_ARGUMENT);if(J==null)throw new Error(NULL_ARGUMENT);var te=this._map.get(W);te!==void 0?te.push(J):this._map.set(W,[J])},X.prototype.get=function(W){if(W==null)throw new Error(NULL_ARGUMENT);var J=this._map.get(W);if(J!==void 0)return J;throw new Error(KEY_NOT_FOUND)},X.prototype.remove=function(W){if(W==null)throw new Error(NULL_ARGUMENT);if(!this._map.delete(W))throw new Error(KEY_NOT_FOUND)},X.prototype.removeIntersection=function(W){var J=this;this.traverse(function(te,re){var oe=W.hasKey(te)?W.get(te):void 0;if(oe!==void 0){var ne=re.filter(function(de){return!oe.some(function(ce){return de===ce})});J._setValue(te,ne)}})},X.prototype.removeByCondition=function(W){var J=this,te=[];return this._map.forEach(function(re,oe){for(var ne=[],de=0,ce=re;de<ce.length;de++){var ue=ce[de],he=W(ue);he?te.push(ue):ne.push(ue)}J._setValue(oe,ne)}),te},X.prototype.hasKey=function(W){if(W==null)throw new Error(NULL_ARGUMENT);return this._map.has(W)},X.prototype.clone=function(){var W=new X;return this._map.forEach(function(J,te){J.forEach(function(re){return W.add(te,isClonable(re)?re.clone():re)})}),W},X.prototype.traverse=function(W){this._map.forEach(function(J,te){W(te,J)})},X.prototype._setValue=function(W,J){J.length>0?this._map.set(W,J):this._map.delete(W)},X})(),ModuleActivationStore=(function(){function X(){this._map=new Map}return X.prototype.remove=function(W){if(this._map.has(W)){var J=this._map.get(W);return this._map.delete(W),J}return this._getEmptyHandlersStore()},X.prototype.addDeactivation=function(W,J,te){this._getModuleActivationHandlers(W).onDeactivations.add(J,te)},X.prototype.addActivation=function(W,J,te){this._getModuleActivationHandlers(W).onActivations.add(J,te)},X.prototype.clone=function(){var W=new X;return this._map.forEach(function(J,te){W._map.set(te,{onActivations:J.onActivations.clone(),onDeactivations:J.onDeactivations.clone()})}),W},X.prototype._getModuleActivationHandlers=function(W){var J=this._map.get(W);return J===void 0&&(J=this._getEmptyHandlersStore(),this._map.set(W,J)),J},X.prototype._getEmptyHandlersStore=function(){var W={onActivations:new Lookup,onDeactivations:new Lookup};return W},X})(),__assign=function(){return __assign=Object.assign||function(X){for(var W,J=1,te=arguments.length;J<te;J++){W=arguments[J];for(var re in W)Object.prototype.hasOwnProperty.call(W,re)&&(X[re]=W[re])}return X},__assign.apply(this,arguments)},__awaiter=function(X,W,J,te){function re(oe){return oe instanceof J?oe:new J(function(ne){ne(oe)})}return new(J||(J=Promise))(function(oe,ne){function de(he){try{ue(te.next(he))}catch(pe){ne(pe)}}function ce(he){try{ue(te.throw(he))}catch(pe){ne(pe)}}function ue(he){he.done?oe(he.value):re(he.value).then(de,ce)}ue((te=te.apply(X,W||[])).next())})},__generator=function(X,W){var J={label:0,sent:function(){if(oe[0]&1)throw oe[1];return oe[1]},trys:[],ops:[]},te,re,oe,ne;return ne={next:de(0),throw:de(1),return:de(2)},typeof Symbol=="function"&&(ne[Symbol.iterator]=function(){return this}),ne;function de(ue){return function(he){return ce([ue,he])}}function ce(ue){if(te)throw new TypeError("Generator is already executing.");for(;J;)try{if(te=1,re&&(oe=ue[0]&2?re.return:ue[0]?re.throw||((oe=re.return)&&oe.call(re),0):re.next)&&!(oe=oe.call(re,ue[1])).done)return oe;switch(re=0,oe&&(ue=[ue[0]&2,oe.value]),ue[0]){case 0:case 1:oe=ue;break;case 4:return J.label++,{value:ue[1],done:!1};case 5:J.label++,re=ue[1],ue=[0];continue;case 7:ue=J.ops.pop(),J.trys.pop();continue;default:if(oe=J.trys,!(oe=oe.length>0&&oe[oe.length-1])&&(ue[0]===6||ue[0]===2)){J=0;continue}if(ue[0]===3&&(!oe||ue[1]>oe[0]&&ue[1]<oe[3])){J.label=ue[1];break}if(ue[0]===6&&J.label<oe[1]){J.label=oe[1],oe=ue;break}if(oe&&J.label<oe[2]){J.label=oe[2],J.ops.push(ue);break}oe[2]&&J.ops.pop(),J.trys.pop();continue}ue=W.call(X,J)}catch(he){ue=[6,he],re=0}finally{te=oe=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},__spreadArray=function(X,W,J){if(J||arguments.length===2)for(var te=0,re=W.length,oe;te<re;te++)(oe||!(te in W))&&(oe||(oe=Array.prototype.slice.call(W,0,te)),oe[te]=W[te]);return X.concat(oe||Array.prototype.slice.call(W))},Container=(function(){function X(W){var J=W||{};if(typeof J!="object")throw new Error(""+CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(J.defaultScope===void 0)J.defaultScope=BindingScopeEnum.Transient;else if(J.defaultScope!==BindingScopeEnum.Singleton&&J.defaultScope!==BindingScopeEnum.Transient&&J.defaultScope!==BindingScopeEnum.Request)throw new Error(""+CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(J.autoBindInjectable===void 0)J.autoBindInjectable=!1;else if(typeof J.autoBindInjectable!="boolean")throw new Error(""+CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(J.skipBaseClassChecks===void 0)J.skipBaseClassChecks=!1;else if(typeof J.skipBaseClassChecks!="boolean")throw new Error(""+CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:J.autoBindInjectable,defaultScope:J.defaultScope,skipBaseClassChecks:J.skipBaseClassChecks},this.id=id(),this._bindingDictionary=new Lookup,this._snapshots=[],this._middleware=null,this._activations=new Lookup,this._deactivations=new Lookup,this.parent=null,this._metadataReader=new MetadataReader,this._moduleActivationStore=new ModuleActivationStore}return X.merge=function(W,J){for(var te=[],re=2;re<arguments.length;re++)te[re-2]=arguments[re];var oe=new X,ne=__spreadArray([W,J],te,!0).map(function(ue){return getBindingDictionary(ue)}),de=getBindingDictionary(oe);function ce(ue,he){ue.traverse(function(pe,fe){fe.forEach(function(be){he.add(be.serviceIdentifier,be.clone())})})}return ne.forEach(function(ue){ce(ue,de)}),oe},X.prototype.load=function(){for(var W=[],J=0;J<arguments.length;J++)W[J]=arguments[J];for(var te=this._getContainerModuleHelpersFactory(),re=0,oe=W;re<oe.length;re++){var ne=oe[re],de=te(ne.id);ne.registry(de.bindFunction,de.unbindFunction,de.isboundFunction,de.rebindFunction,de.unbindAsyncFunction,de.onActivationFunction,de.onDeactivationFunction)}},X.prototype.loadAsync=function(){for(var W=[],J=0;J<arguments.length;J++)W[J]=arguments[J];return __awaiter(this,void 0,void 0,function(){var te,re,oe,ne,de;return __generator(this,function(ce){switch(ce.label){case 0:te=this._getContainerModuleHelpersFactory(),re=0,oe=W,ce.label=1;case 1:return re<oe.length?(ne=oe[re],de=te(ne.id),[4,ne.registry(de.bindFunction,de.unbindFunction,de.isboundFunction,de.rebindFunction,de.unbindAsyncFunction,de.onActivationFunction,de.onDeactivationFunction)]):[3,4];case 2:ce.sent(),ce.label=3;case 3:return re++,[3,1];case 4:return[2]}})})},X.prototype.unload=function(){for(var W=this,J=[],te=0;te<arguments.length;te++)J[te]=arguments[te];J.forEach(function(re){var oe=W._removeModuleBindings(re.id);W._deactivateSingletons(oe),W._removeModuleHandlers(re.id)})},X.prototype.unloadAsync=function(){for(var W=[],J=0;J<arguments.length;J++)W[J]=arguments[J];return __awaiter(this,void 0,void 0,function(){var te,re,oe,ne;return __generator(this,function(de){switch(de.label){case 0:te=0,re=W,de.label=1;case 1:return te<re.length?(oe=re[te],ne=this._removeModuleBindings(oe.id),[4,this._deactivateSingletonsAsync(ne)]):[3,4];case 2:de.sent(),this._removeModuleHandlers(oe.id),de.label=3;case 3:return te++,[3,1];case 4:return[2]}})})},X.prototype.bind=function(W){var J=this.options.defaultScope||BindingScopeEnum.Transient,te=new Binding(W,J);return this._bindingDictionary.add(W,te),new BindingToSyntax(te)},X.prototype.rebind=function(W){return this.unbind(W),this.bind(W)},X.prototype.rebindAsync=function(W){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(J){switch(J.label){case 0:return[4,this.unbindAsync(W)];case 1:return J.sent(),[2,this.bind(W)]}})})},X.prototype.unbind=function(W){if(this._bindingDictionary.hasKey(W)){var J=this._bindingDictionary.get(W);this._deactivateSingletons(J)}this._removeServiceFromDictionary(W)},X.prototype.unbindAsync=function(W){return __awaiter(this,void 0,void 0,function(){var J;return __generator(this,function(te){switch(te.label){case 0:return this._bindingDictionary.hasKey(W)?(J=this._bindingDictionary.get(W),[4,this._deactivateSingletonsAsync(J)]):[3,2];case 1:te.sent(),te.label=2;case 2:return this._removeServiceFromDictionary(W),[2]}})})},X.prototype.unbindAll=function(){var W=this;this._bindingDictionary.traverse(function(J,te){W._deactivateSingletons(te)}),this._bindingDictionary=new Lookup},X.prototype.unbindAllAsync=function(){return __awaiter(this,void 0,void 0,function(){var W,J=this;return __generator(this,function(te){switch(te.label){case 0:return W=[],this._bindingDictionary.traverse(function(re,oe){W.push(J._deactivateSingletonsAsync(oe))}),[4,Promise.all(W)];case 1:return te.sent(),this._bindingDictionary=new Lookup,[2]}})})},X.prototype.onActivation=function(W,J){this._activations.add(W,J)},X.prototype.onDeactivation=function(W,J){this._deactivations.add(W,J)},X.prototype.isBound=function(W){var J=this._bindingDictionary.hasKey(W);return!J&&this.parent&&(J=this.parent.isBound(W)),J},X.prototype.isCurrentBound=function(W){return this._bindingDictionary.hasKey(W)},X.prototype.isBoundNamed=function(W,J){return this.isBoundTagged(W,NAMED_TAG,J)},X.prototype.isBoundTagged=function(W,J,te){var re=!1;if(this._bindingDictionary.hasKey(W)){var oe=this._bindingDictionary.get(W),ne=createMockRequest(this,W,J,te);re=oe.some(function(de){return de.constraint(ne)})}return!re&&this.parent&&(re=this.parent.isBoundTagged(W,J,te)),re},X.prototype.snapshot=function(){this._snapshots.push(ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))},X.prototype.restore=function(){var W=this._snapshots.pop();if(W===void 0)throw new Error(NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=W.bindings,this._activations=W.activations,this._deactivations=W.deactivations,this._middleware=W.middleware,this._moduleActivationStore=W.moduleActivationStore},X.prototype.createChild=function(W){var J=new X(W||this.options);return J.parent=this,J},X.prototype.applyMiddleware=function(){for(var W=[],J=0;J<arguments.length;J++)W[J]=arguments[J];var te=this._middleware?this._middleware:this._planAndResolve();this._middleware=W.reduce(function(re,oe){return oe(re)},te)},X.prototype.applyCustomMetadataReader=function(W){this._metadataReader=W},X.prototype.get=function(W){var J=this._getNotAllArgs(W,!1);return this._getButThrowIfAsync(J)},X.prototype.getAsync=function(W){return __awaiter(this,void 0,void 0,function(){var J;return __generator(this,function(te){return J=this._getNotAllArgs(W,!1),[2,this._get(J)]})})},X.prototype.getTagged=function(W,J,te){var re=this._getNotAllArgs(W,!1,J,te);return this._getButThrowIfAsync(re)},X.prototype.getTaggedAsync=function(W,J,te){return __awaiter(this,void 0,void 0,function(){var re;return __generator(this,function(oe){return re=this._getNotAllArgs(W,!1,J,te),[2,this._get(re)]})})},X.prototype.getNamed=function(W,J){return this.getTagged(W,NAMED_TAG,J)},X.prototype.getNamedAsync=function(W,J){return this.getTaggedAsync(W,NAMED_TAG,J)},X.prototype.getAll=function(W){var J=this._getAllArgs(W);return this._getButThrowIfAsync(J)},X.prototype.getAllAsync=function(W){var J=this._getAllArgs(W);return this._getAll(J)},X.prototype.getAllTagged=function(W,J,te){var re=this._getNotAllArgs(W,!0,J,te);return this._getButThrowIfAsync(re)},X.prototype.getAllTaggedAsync=function(W,J,te){var re=this._getNotAllArgs(W,!0,J,te);return this._getAll(re)},X.prototype.getAllNamed=function(W,J){return this.getAllTagged(W,NAMED_TAG,J)},X.prototype.getAllNamedAsync=function(W,J){return this.getAllTaggedAsync(W,NAMED_TAG,J)},X.prototype.resolve=function(W){var J=this.isBound(W);J||this.bind(W).toSelf();var te=this.get(W);return J||this.unbind(W),te},X.prototype._preDestroy=function(W,J){var te,re;if(Reflect.hasMetadata(PRE_DESTROY,W)){var oe=Reflect.getMetadata(PRE_DESTROY,W);return(re=(te=J)[oe.value])===null||re===void 0?void 0:re.call(te)}},X.prototype._removeModuleHandlers=function(W){var J=this._moduleActivationStore.remove(W);this._activations.removeIntersection(J.onActivations),this._deactivations.removeIntersection(J.onDeactivations)},X.prototype._removeModuleBindings=function(W){return this._bindingDictionary.removeByCondition(function(J){return J.moduleId===W})},X.prototype._deactivate=function(W,J){var te=this,re=Object.getPrototypeOf(J).constructor;try{if(this._deactivations.hasKey(W.serviceIdentifier)){var oe=this._deactivateContainer(J,this._deactivations.get(W.serviceIdentifier).values());if(isPromise(oe))return this._handleDeactivationError(oe.then(function(){return te._propagateContainerDeactivationThenBindingAndPreDestroyAsync(W,J,re)}),re)}var ne=this._propagateContainerDeactivationThenBindingAndPreDestroy(W,J,re);if(isPromise(ne))return this._handleDeactivationError(ne,re)}catch(de){if(de instanceof Error)throw new Error(ON_DEACTIVATION_ERROR(re.name,de.message))}},X.prototype._handleDeactivationError=function(W,J){return __awaiter(this,void 0,void 0,function(){var te;return __generator(this,function(re){switch(re.label){case 0:return re.trys.push([0,2,,3]),[4,W];case 1:return re.sent(),[3,3];case 2:if(te=re.sent(),te instanceof Error)throw new Error(ON_DEACTIVATION_ERROR(J.name,te.message));return[3,3];case 3:return[2]}})})},X.prototype._deactivateContainer=function(W,J){for(var te=this,re=J.next();re.value;){var oe=re.value(W);if(isPromise(oe))return oe.then(function(){return te._deactivateContainerAsync(W,J)});re=J.next()}},X.prototype._deactivateContainerAsync=function(W,J){return __awaiter(this,void 0,void 0,function(){var te;return __generator(this,function(re){switch(re.label){case 0:te=J.next(),re.label=1;case 1:return te.value?[4,te.value(W)]:[3,3];case 2:return re.sent(),te=J.next(),[3,1];case 3:return[2]}})})},X.prototype._getContainerModuleHelpersFactory=function(){var W=this,J=function(he,pe){he._binding.moduleId=pe},te=function(he){return function(pe){var fe=W.bind(pe);return J(fe,he),fe}},re=function(){return function(he){return W.unbind(he)}},oe=function(){return function(he){return W.unbindAsync(he)}},ne=function(){return function(he){return W.isBound(he)}},de=function(he){return function(pe){var fe=W.rebind(pe);return J(fe,he),fe}},ce=function(he){return function(pe,fe){W._moduleActivationStore.addActivation(he,pe,fe),W.onActivation(pe,fe)}},ue=function(he){return function(pe,fe){W._moduleActivationStore.addDeactivation(he,pe,fe),W.onDeactivation(pe,fe)}};return function(he){return{bindFunction:te(he),isboundFunction:ne(),onActivationFunction:ce(he),onDeactivationFunction:ue(he),rebindFunction:de(he),unbindFunction:re(),unbindAsyncFunction:oe()}}},X.prototype._getAll=function(W){return Promise.all(this._get(W))},X.prototype._get=function(W){var J=__assign(__assign({},W),{contextInterceptor:function(re){return re},targetType:TargetTypeEnum.Variable});if(this._middleware){var te=this._middleware(J);if(te==null)throw new Error(INVALID_MIDDLEWARE_RETURN);return te}return this._planAndResolve()(J)},X.prototype._getButThrowIfAsync=function(W){var J=this._get(W);if(isPromiseOrContainsPromise(J))throw new Error(LAZY_IN_SYNC(W.serviceIdentifier));return J},X.prototype._getAllArgs=function(W){var J={avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:W};return J},X.prototype._getNotAllArgs=function(W,J,te,re){var oe={avoidConstraints:!1,isMultiInject:J,serviceIdentifier:W,key:te,value:re};return oe},X.prototype._planAndResolve=function(){var W=this;return function(J){var te=plan(W._metadataReader,W,J.isMultiInject,J.targetType,J.serviceIdentifier,J.key,J.value,J.avoidConstraints);te=J.contextInterceptor(te);var re=resolve(te);return re}},X.prototype._deactivateIfSingleton=function(W){var J=this;if(W.activated)return isPromise(W.cache)?W.cache.then(function(te){return J._deactivate(W,te)}):this._deactivate(W,W.cache)},X.prototype._deactivateSingletons=function(W){for(var J=0,te=W;J<te.length;J++){var re=te[J],oe=this._deactivateIfSingleton(re);if(isPromise(oe))throw new Error(ASYNC_UNBIND_REQUIRED)}},X.prototype._deactivateSingletonsAsync=function(W){return __awaiter(this,void 0,void 0,function(){var J=this;return __generator(this,function(te){switch(te.label){case 0:return[4,Promise.all(W.map(function(re){return J._deactivateIfSingleton(re)}))];case 1:return te.sent(),[2]}})})},X.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(W,J,te){return this.parent?this._deactivate.bind(this.parent)(W,J):this._bindingDeactivationAndPreDestroy(W,J,te)},X.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(W,J,te){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(re){switch(re.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(W,J)]:[3,2];case 1:return re.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(W,J,te)];case 3:re.sent(),re.label=4;case 4:return[2]}})})},X.prototype._removeServiceFromDictionary=function(W){try{this._bindingDictionary.remove(W)}catch{throw new Error(CANNOT_UNBIND+" "+getServiceIdentifierAsString(W))}},X.prototype._bindingDeactivationAndPreDestroy=function(W,J,te){var re=this;if(typeof W.onDeactivation=="function"){var oe=W.onDeactivation(J);if(isPromise(oe))return oe.then(function(){return re._preDestroy(te,J)})}return this._preDestroy(te,J)},X.prototype._bindingDeactivationAndPreDestroyAsync=function(W,J,te){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(re){switch(re.label){case 0:return typeof W.onDeactivation!="function"?[3,2]:[4,W.onDeactivation(J)];case 1:re.sent(),re.label=2;case 2:return[4,this._preDestroy(te,J)];case 3:return re.sent(),[2]}})})},X})();function getFirstArrayDuplicate(X){for(var W=new Set,J=0,te=X;J<te.length;J++){var re=te[J];if(W.has(re))return re;W.add(re)}}function targetIsConstructorFunction(X){return X.prototype!==void 0}function _throwIfMethodParameter(X){if(X!==void 0)throw new Error(INVALID_DECORATOR_OPERATION)}function tagParameter(X,W,J,te){_throwIfMethodParameter(W),_tagParameterOrProperty(TAGGED,X,J.toString(),te)}function tagProperty(X,W,J){if(targetIsConstructorFunction(X))throw new Error(INVALID_DECORATOR_OPERATION);_tagParameterOrProperty(TAGGED_PROP,X.constructor,W,J)}function _ensureNoMetadataKeyDuplicates(X){var W=[];if(Array.isArray(X)){W=X;var J=getFirstArrayDuplicate(W.map(function(te){return te.key}));if(J!==void 0)throw new Error(DUPLICATED_METADATA+" "+J.toString())}else W=[X];return W}function _tagParameterOrProperty(X,W,J,te){var re=_ensureNoMetadataKeyDuplicates(te),oe={};Reflect.hasOwnMetadata(X,W)&&(oe=Reflect.getMetadata(X,W));var ne=oe[J];if(ne===void 0)ne=[];else for(var de=function(pe){if(re.some(function(fe){return fe.key===pe.key}))throw new Error(DUPLICATED_METADATA+" "+pe.key.toString())},ce=0,ue=ne;ce<ue.length;ce++){var he=ue[ce];de(he)}ne.push.apply(ne,re),oe[J]=ne,Reflect.defineMetadata(X,oe,W)}function createTaggedDecorator(X){return function(W,J,te){typeof te=="number"?tagParameter(W,J,te,X):tagProperty(W,J,X)}}function injectable(){return function(X){if(Reflect.hasOwnMetadata(PARAM_TYPES,X))throw new Error(DUPLICATED_INJECTABLE_DECORATOR);var W=Reflect.getMetadata(DESIGN_PARAM_TYPES,X)||[];return Reflect.defineMetadata(PARAM_TYPES,W,X),X}}function injectBase(X){return function(W){return function(J,te,re){if(W===void 0){var oe=typeof J=="function"?J.name:J.constructor.name;throw new Error(UNDEFINED_INJECT_ANNOTATION(oe))}return createTaggedDecorator(new Metadata(X,W))(J,te,re)}}}var inject=injectBase(INJECT_TAG),INJECTION=Symbol.for("INJECTION");function _proxyGetter(X,W,J,te){function re(){return Reflect.hasMetadata(INJECTION,this,W)?Reflect.getMetadata(INJECTION,this,W):J()}function oe(ne){Reflect.defineMetadata(INJECTION,ne,this,W)}Object.defineProperty(X,W,{configurable:!0,enumerable:!0,get:re,set:oe})}function makePropertyInjectDecorator(X,W){return function(J){return function(te,re){var oe=function(){return X.get(J)};_proxyGetter(te,re,oe)}}}function makePropertyInjectNamedDecorator(X,W){return function(J,te){return function(re,oe){var ne=function(){return X.getNamed(J,te)};_proxyGetter(re,oe,ne)}}}function makePropertyInjectTaggedDecorator(X,W){return function(J,te,re){return function(oe,ne){var de=function(){return X.getTagged(J,te,re)};_proxyGetter(oe,ne,de)}}}function makePropertyMultiInjectDecorator(X,W){return function(J){return function(te,re){var oe=function(){return X.getAll(J)};_proxyGetter(te,re,oe)}}}function getDecorators(X,W){var J=makePropertyInjectDecorator(X),te=makePropertyInjectNamedDecorator(X),re=makePropertyInjectTaggedDecorator(X),oe=makePropertyMultiInjectDecorator(X);return{lazyInject:J,lazyInjectNamed:te,lazyInjectTagged:re,lazyMultiInject:oe}}const container$1=new Container,{lazyInject:lazyInject$1}=getDecorators(container$1),registerDep=X=>{container$1.bind(X).toSelf()},unregisterDep=X=>{container$1.isBound(X)&&container$1.unbind(X)},TYPES$1={primaryApi:Symbol.for("primaryApi")},styles$r=":host{min-height:1px;height:100%;width:100%;display:flex}iframe{border:none;flex:1;height:100%}.pdf-container{display:flex;justify-content:center;align-items:center;height:100%;flex:1;border:1px solid #ccc}.no-pdf{text-align:center;color:#666;font-size:1.2rem;font-weight:700}";var __defProp$t=Object.defineProperty,__decorateClass$y=(X,W,J,te)=>{for(var re=void 0,oe=X.length-1,ne;oe>=0;oe--)(ne=X[oe])&&(re=ne(W,J,re)||re);return re&&__defProp$t(W,J,re),re};const xs=class xs extends h$p{constructor(){super(...arguments),this.pdfList=[],this.activePdfs=[],this.subscriptions=[]}async connectedCallback(){super.connectedCallback(),this._initializePdfState(),this._subscribeEvents()}disconnectedCallback(){super.disconnectedCallback(),this._unsubscribeEvents()}_initializePdfState(){const W=this.api.pdfViewerManager.getPdfs?.()||[];this.pdfList=[...W],W.length===1?this.activePdfs=[W[0]]:W.length>=2&&(this.activePdfs=W.slice(-2))}_getPdfSrc(W){return W.data.url?W.data.url:W.data.b64?createUrlFromBase64(W.data.b64):""}_subscribeEvents(){[this.api.broker.subscribe(pdfViwerEvents.added,J=>this._onPdfAdded(J)),this.api.broker.subscribe(pdfViwerEvents.deleted,({id:J})=>this._onPdfDeleted({id:J}))].forEach(J=>this.subscriptions.push(J))}_unsubscribeEvents(){this.subscriptions.forEach(W=>W.dispose())}_onPdfAdded(W){this.pdfList=[...this.pdfList,W],this._updateActivePdfs(W.id)}_onPdfDeleted({id:W}){this.pdfList=this.pdfList.filter(J=>J.id!==W),this.activePdfs=this.activePdfs.filter(J=>J.id!==W),this.requestUpdate()}_removePdf(W){this.api.pdfViewerManager.delete(W),this.activePdfs=this.activePdfs.filter(J=>J.id!==W)}_updateActivePdfs(W){if(this.activePdfs.some(te=>te.id===W))this.activePdfs=this.activePdfs.filter(te=>te.id!==W);else{const te=this.pdfList.find(re=>re.id===W);if(!te)return;this.activePdfs.length===2?this.activePdfs=[this.activePdfs[1],te]:this.activePdfs=[...this.activePdfs,te]}this.requestUpdate()}render(){return ke$1`
263
+ `+X+" - "+J}else return" "+X}function getFunctionName(X){if(X.name)return X.name;var W=X.toString(),J=W.match(/^function\s*([^\s(]+)/);return J?J[1]:"Anonymous function: "+W}function getSymbolDescription(X){return X.toString().slice(7,-1)}var Context=(function(){function X(W){this.id=id(),this.container=W}return X.prototype.addPlan=function(W){this.plan=W},X.prototype.setCurrentRequest=function(W){this.currentRequest=W},X})(),Metadata=(function(){function X(W,J){this.key=W,this.value=J}return X.prototype.toString=function(){return this.key===NAMED_TAG?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},X})(),Plan=(function(){function X(W,J){this.parentContext=W,this.rootRequest=J}return X})(),LazyServiceIdentifier=(function(){function X(W){this._cb=W}return X.prototype.unwrap=function(){return this._cb()},X})(),QueryableString=(function(){function X(W){this.str=W}return X.prototype.startsWith=function(W){return this.str.indexOf(W)===0},X.prototype.endsWith=function(W){var J="",te=W.split("").reverse().join("");return J=this.str.split("").reverse().join(""),this.startsWith.call({str:J},te)},X.prototype.contains=function(W){return this.str.indexOf(W)!==-1},X.prototype.equals=function(W){return this.str===W},X.prototype.value=function(){return this.str},X})(),Target=(function(){function X(W,J,te,re){this.id=id(),this.type=W,this.serviceIdentifier=te;var oe=typeof J=="symbol"?getSymbolDescription(J):J;this.name=new QueryableString(oe||""),this.identifier=J,this.metadata=new Array;var ne=null;typeof re=="string"?ne=new Metadata(NAMED_TAG,re):re instanceof Metadata&&(ne=re),ne!==null&&this.metadata.push(ne)}return X.prototype.hasTag=function(W){for(var J=0,te=this.metadata;J<te.length;J++){var re=te[J];if(re.key===W)return!0}return!1},X.prototype.isArray=function(){return this.hasTag(MULTI_INJECT_TAG)},X.prototype.matchesArray=function(W){return this.matchesTag(MULTI_INJECT_TAG)(W)},X.prototype.isNamed=function(){return this.hasTag(NAMED_TAG)},X.prototype.isTagged=function(){return this.metadata.some(function(W){return NON_CUSTOM_TAG_KEYS.every(function(J){return W.key!==J})})},X.prototype.isOptional=function(){return this.matchesTag(OPTIONAL_TAG)(!0)},X.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter(function(W){return W.key===NAMED_TAG})[0]:null},X.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter(function(W){return NON_CUSTOM_TAG_KEYS.every(function(J){return W.key!==J})}):null},X.prototype.matchesNamedTag=function(W){return this.matchesTag(NAMED_TAG)(W)},X.prototype.matchesTag=function(W){var J=this;return function(te){for(var re=0,oe=J.metadata;re<oe.length;re++){var ne=oe[re];if(ne.key===W&&ne.value===te)return!0}return!1}},X})(),__spreadArray$2=function(X,W,J){if(J||arguments.length===2)for(var te=0,re=W.length,oe;te<re;te++)(oe||!(te in W))&&(oe||(oe=Array.prototype.slice.call(W,0,te)),oe[te]=W[te]);return X.concat(oe||Array.prototype.slice.call(W))};function getDependencies$1(X,W){var J=getFunctionName(W);return getTargets(X,J,W,!1)}function getTargets(X,W,J,te){var re=X.getConstructorMetadata(J),oe=re.compilerGeneratedMetadata;if(oe===void 0){var ne=MISSING_INJECTABLE_ANNOTATION+" "+W+".";throw new Error(ne)}var de=re.userGeneratedMetadata,ce=Object.keys(de),ue=J.length===0&&ce.length>0,he=ce.length>J.length,pe=ue||he?ce.length:J.length,fe=getConstructorArgsAsTargets(te,W,oe,de,pe),be=getClassPropsAsTargets(X,J,W),me=__spreadArray$2(__spreadArray$2([],fe,!0),be,!0);return me}function getConstructorArgsAsTarget(X,W,J,te,re){var oe=re[X.toString()]||[],ne=formatTargetMetadata(oe),de=ne.unmanaged!==!0,ce=te[X],ue=ne.inject||ne.multiInject;if(ce=ue||ce,ce instanceof LazyServiceIdentifier&&(ce=ce.unwrap()),de){var he=ce===Object,pe=ce===Function,fe=ce===void 0,be=he||pe||fe;if(!W&&be){var me=MISSING_INJECT_ANNOTATION+" argument "+X+" in class "+J+".";throw new Error(me)}var ge=new Target(TargetTypeEnum.ConstructorArgument,ne.targetName,ce);return ge.metadata=oe,ge}return null}function getConstructorArgsAsTargets(X,W,J,te,re){for(var oe=[],ne=0;ne<re;ne++){var de=ne,ce=getConstructorArgsAsTarget(de,X,W,J,te);ce!==null&&oe.push(ce)}return oe}function _getServiceIdentifierForProperty(X,W,J,te){var re=X||W;if(re===void 0){var oe=MISSING_INJECTABLE_ANNOTATION+" for property "+String(J)+" in class "+te+".";throw new Error(oe)}return re}function getClassPropsAsTargets(X,W,J){for(var te=X.getPropertiesMetadata(W),re=[],oe=Object.getOwnPropertySymbols(te),ne=Object.keys(te),de=ne.concat(oe),ce=0,ue=de;ce<ue.length;ce++){var he=ue[ce],pe=te[he],fe=formatTargetMetadata(pe),be=fe.targetName||he,me=_getServiceIdentifierForProperty(fe.inject,fe.multiInject,he,J),ge=new Target(TargetTypeEnum.ClassProperty,be,me);ge.metadata=pe,re.push(ge)}var ve=Object.getPrototypeOf(W.prototype).constructor;if(ve!==Object){var _e=getClassPropsAsTargets(X,ve,J);re=__spreadArray$2(__spreadArray$2([],re,!0),_e,!0)}return re}function getBaseClassDependencyCount(X,W){var J=Object.getPrototypeOf(W.prototype).constructor;if(J!==Object){var te=getFunctionName(J),re=getTargets(X,te,J,!0),oe=re.map(function(ce){return ce.metadata.filter(function(ue){return ue.key===UNMANAGED_TAG})}),ne=[].concat.apply([],oe).length,de=re.length-ne;return de>0?de:getBaseClassDependencyCount(X,J)}else return 0}function formatTargetMetadata(X){var W={};return X.forEach(function(J){W[J.key.toString()]=J.value}),{inject:W[INJECT_TAG],multiInject:W[MULTI_INJECT_TAG],targetName:W[NAME_TAG],unmanaged:W[UNMANAGED_TAG]}}var Request=(function(){function X(W,J,te,re,oe){this.id=id(),this.serviceIdentifier=W,this.parentContext=J,this.parentRequest=te,this.target=oe,this.childRequests=[],this.bindings=Array.isArray(re)?re:[re],this.requestScope=te===null?new Map:null}return X.prototype.addChildRequest=function(W,J,te){var re=new X(W,this.parentContext,this,J,te);return this.childRequests.push(re),re},X})();function getBindingDictionary(X){return X._bindingDictionary}function _createTarget(X,W,J,te,re,oe){var ne=X?MULTI_INJECT_TAG:INJECT_TAG,de=new Metadata(ne,J),ce=new Target(W,te,J,de);if(re!==void 0){var ue=new Metadata(re,oe);ce.metadata.push(ue)}return ce}function _getActiveBindings(X,W,J,te,re){var oe=getBindings(J.container,re.serviceIdentifier),ne=[];return oe.length===BindingCount.NoBindingsAvailable&&J.container.options.autoBindInjectable&&typeof re.serviceIdentifier=="function"&&X.getConstructorMetadata(re.serviceIdentifier).compilerGeneratedMetadata&&(J.container.bind(re.serviceIdentifier).toSelf(),oe=getBindings(J.container,re.serviceIdentifier)),W?ne=oe:ne=oe.filter(function(de){var ce=new Request(de.serviceIdentifier,J,te,de,re);return de.constraint(ce)}),_validateActiveBindingCount(re.serviceIdentifier,ne,re,J.container),ne}function _validateActiveBindingCount(X,W,J,te){switch(W.length){case BindingCount.NoBindingsAvailable:if(J.isOptional())return W;var re=getServiceIdentifierAsString(X),oe=NOT_REGISTERED;throw oe+=listMetadataForTarget(re,J),oe+=listRegisteredBindingsForServiceIdentifier(te,re,getBindings),new Error(oe);case BindingCount.OnlyOneBindingAvailable:return W;case BindingCount.MultipleBindingsAvailable:default:if(J.isArray())return W;var re=getServiceIdentifierAsString(X),oe=AMBIGUOUS_MATCH+" "+re;throw oe+=listRegisteredBindingsForServiceIdentifier(te,re,getBindings),new Error(oe)}}function _createSubRequests(X,W,J,te,re,oe){var ne,de;if(re===null){ne=_getActiveBindings(X,W,te,null,oe),de=new Request(J,te,null,ne,oe);var ce=new Plan(te,de);te.addPlan(ce)}else ne=_getActiveBindings(X,W,te,re,oe),de=re.addChildRequest(oe.serviceIdentifier,ne,oe);ne.forEach(function(ue){var he=null;if(oe.isArray())he=de.addChildRequest(ue.serviceIdentifier,ue,oe);else{if(ue.cache)return;he=de}if(ue.type===BindingTypeEnum.Instance&&ue.implementationType!==null){var pe=getDependencies$1(X,ue.implementationType);if(!te.container.options.skipBaseClassChecks){var fe=getBaseClassDependencyCount(X,ue.implementationType);if(pe.length<fe){var be=ARGUMENTS_LENGTH_MISMATCH(getFunctionName(ue.implementationType));throw new Error(be)}}pe.forEach(function(me){_createSubRequests(X,!1,me.serviceIdentifier,te,he,me)})}})}function getBindings(X,W){var J=[],te=getBindingDictionary(X);return te.hasKey(W)?J=te.get(W):X.parent!==null&&(J=getBindings(X.parent,W)),J}function plan(X,W,J,te,re,oe,ne,de){de===void 0&&(de=!1);var ce=new Context(W),ue=_createTarget(J,te,re,"",oe,ne);try{return _createSubRequests(X,de,re,ce,null,ue),ce}catch(he){throw isStackOverflowExeption(he)&&circularDependencyToException(ce.plan.rootRequest),he}}function createMockRequest(X,W,J,te){var re=new Target(TargetTypeEnum.Variable,"",W,new Metadata(J,te)),oe=new Context(X),ne=new Request(W,oe,null,[],re);return ne}function isPromise(X){var W=typeof X=="object"&&X!==null||typeof X=="function";return W&&typeof X.then=="function"}function isPromiseOrContainsPromise(X){return isPromise(X)?!0:Array.isArray(X)&&X.some(isPromise)}var __awaiter$3=function(X,W,J,te){function re(oe){return oe instanceof J?oe:new J(function(ne){ne(oe)})}return new(J||(J=Promise))(function(oe,ne){function de(he){try{ue(te.next(he))}catch(pe){ne(pe)}}function ce(he){try{ue(te.throw(he))}catch(pe){ne(pe)}}function ue(he){he.done?oe(he.value):re(he.value).then(de,ce)}ue((te=te.apply(X,W||[])).next())})},__generator$3=function(X,W){var J={label:0,sent:function(){if(oe[0]&1)throw oe[1];return oe[1]},trys:[],ops:[]},te,re,oe,ne;return ne={next:de(0),throw:de(1),return:de(2)},typeof Symbol=="function"&&(ne[Symbol.iterator]=function(){return this}),ne;function de(ue){return function(he){return ce([ue,he])}}function ce(ue){if(te)throw new TypeError("Generator is already executing.");for(;J;)try{if(te=1,re&&(oe=ue[0]&2?re.return:ue[0]?re.throw||((oe=re.return)&&oe.call(re),0):re.next)&&!(oe=oe.call(re,ue[1])).done)return oe;switch(re=0,oe&&(ue=[ue[0]&2,oe.value]),ue[0]){case 0:case 1:oe=ue;break;case 4:return J.label++,{value:ue[1],done:!1};case 5:J.label++,re=ue[1],ue=[0];continue;case 7:ue=J.ops.pop(),J.trys.pop();continue;default:if(oe=J.trys,!(oe=oe.length>0&&oe[oe.length-1])&&(ue[0]===6||ue[0]===2)){J=0;continue}if(ue[0]===3&&(!oe||ue[1]>oe[0]&&ue[1]<oe[3])){J.label=ue[1];break}if(ue[0]===6&&J.label<oe[1]){J.label=oe[1],oe=ue;break}if(oe&&J.label<oe[2]){J.label=oe[2],J.ops.push(ue);break}oe[2]&&J.ops.pop(),J.trys.pop();continue}ue=W.call(X,J)}catch(he){ue=[6,he],re=0}finally{te=oe=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},tryGetFromScope=function(X,W){return W.scope===BindingScopeEnum.Singleton&&W.activated?W.cache:W.scope===BindingScopeEnum.Request&&X.has(W.id)?X.get(W.id):null},saveToScope=function(X,W,J){W.scope===BindingScopeEnum.Singleton&&_saveToSingletonScope(W,J),W.scope===BindingScopeEnum.Request&&_saveToRequestScope(X,W,J)},_saveToRequestScope=function(X,W,J){X.has(W.id)||X.set(W.id,J)},_saveToSingletonScope=function(X,W){X.cache=W,X.activated=!0,isPromise(W)&&_saveAsyncResultToSingletonScope(X,W)},_saveAsyncResultToSingletonScope=function(X,W){return __awaiter$3(void 0,void 0,void 0,function(){var J,te;return __generator$3(this,function(re){switch(re.label){case 0:return re.trys.push([0,2,,3]),[4,W];case 1:return J=re.sent(),X.cache=J,[3,3];case 2:throw te=re.sent(),X.cache=null,X.activated=!1,te;case 3:return[2]}})})},FactoryType;(function(X){X.DynamicValue="toDynamicValue",X.Factory="toFactory",X.Provider="toProvider"})(FactoryType||(FactoryType={}));var ensureFullyBound=function(X){var W=null;switch(X.type){case BindingTypeEnum.ConstantValue:case BindingTypeEnum.Function:W=X.cache;break;case BindingTypeEnum.Constructor:case BindingTypeEnum.Instance:W=X.implementationType;break;case BindingTypeEnum.DynamicValue:W=X.dynamicValue;break;case BindingTypeEnum.Provider:W=X.provider;break;case BindingTypeEnum.Factory:W=X.factory;break}if(W===null){var J=getServiceIdentifierAsString(X.serviceIdentifier);throw new Error(INVALID_BINDING_TYPE+" "+J)}},getFactoryDetails=function(X){switch(X.type){case BindingTypeEnum.Factory:return{factory:X.factory,factoryType:FactoryType.Factory};case BindingTypeEnum.Provider:return{factory:X.provider,factoryType:FactoryType.Provider};case BindingTypeEnum.DynamicValue:return{factory:X.dynamicValue,factoryType:FactoryType.DynamicValue};default:throw new Error("Unexpected factory type "+X.type)}},__assign$1=function(){return __assign$1=Object.assign||function(X){for(var W,J=1,te=arguments.length;J<te;J++){W=arguments[J];for(var re in W)Object.prototype.hasOwnProperty.call(W,re)&&(X[re]=W[re])}return X},__assign$1.apply(this,arguments)},__awaiter$2=function(X,W,J,te){function re(oe){return oe instanceof J?oe:new J(function(ne){ne(oe)})}return new(J||(J=Promise))(function(oe,ne){function de(he){try{ue(te.next(he))}catch(pe){ne(pe)}}function ce(he){try{ue(te.throw(he))}catch(pe){ne(pe)}}function ue(he){he.done?oe(he.value):re(he.value).then(de,ce)}ue((te=te.apply(X,W||[])).next())})},__generator$2=function(X,W){var J={label:0,sent:function(){if(oe[0]&1)throw oe[1];return oe[1]},trys:[],ops:[]},te,re,oe,ne;return ne={next:de(0),throw:de(1),return:de(2)},typeof Symbol=="function"&&(ne[Symbol.iterator]=function(){return this}),ne;function de(ue){return function(he){return ce([ue,he])}}function ce(ue){if(te)throw new TypeError("Generator is already executing.");for(;J;)try{if(te=1,re&&(oe=ue[0]&2?re.return:ue[0]?re.throw||((oe=re.return)&&oe.call(re),0):re.next)&&!(oe=oe.call(re,ue[1])).done)return oe;switch(re=0,oe&&(ue=[ue[0]&2,oe.value]),ue[0]){case 0:case 1:oe=ue;break;case 4:return J.label++,{value:ue[1],done:!1};case 5:J.label++,re=ue[1],ue=[0];continue;case 7:ue=J.ops.pop(),J.trys.pop();continue;default:if(oe=J.trys,!(oe=oe.length>0&&oe[oe.length-1])&&(ue[0]===6||ue[0]===2)){J=0;continue}if(ue[0]===3&&(!oe||ue[1]>oe[0]&&ue[1]<oe[3])){J.label=ue[1];break}if(ue[0]===6&&J.label<oe[1]){J.label=oe[1],oe=ue;break}if(oe&&J.label<oe[2]){J.label=oe[2],J.ops.push(ue);break}oe[2]&&J.ops.pop(),J.trys.pop();continue}ue=W.call(X,J)}catch(he){ue=[6,he],re=0}finally{te=oe=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},__spreadArray$1=function(X,W,J){if(J||arguments.length===2)for(var te=0,re=W.length,oe;te<re;te++)(oe||!(te in W))&&(oe||(oe=Array.prototype.slice.call(W,0,te)),oe[te]=W[te]);return X.concat(oe||Array.prototype.slice.call(W))};function _resolveRequests(X,W){return X.reduce(function(J,te){var re=W(te),oe=te.target.type;return oe===TargetTypeEnum.ConstructorArgument?J.constructorInjections.push(re):(J.propertyRequests.push(te),J.propertyInjections.push(re)),J.isAsync||(J.isAsync=isPromiseOrContainsPromise(re)),J},{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}function _createInstance(X,W,J){var te;if(W.length>0){var re=_resolveRequests(W,J),oe=__assign$1(__assign$1({},re),{constr:X});re.isAsync?te=createInstanceWithInjectionsAsync(oe):te=createInstanceWithInjections(oe)}else te=new X;return te}function createInstanceWithInjections(X){var W,J=new((W=X.constr).bind.apply(W,__spreadArray$1([void 0],X.constructorInjections,!1)));return X.propertyRequests.forEach(function(te,re){var oe=te.target.identifier,ne=X.propertyInjections[re];(!te.target.isOptional()||ne!==void 0)&&(J[oe]=ne)}),J}function createInstanceWithInjectionsAsync(X){return __awaiter$2(this,void 0,void 0,function(){var W,J;return __generator$2(this,function(te){switch(te.label){case 0:return[4,possiblyWaitInjections(X.constructorInjections)];case 1:return W=te.sent(),[4,possiblyWaitInjections(X.propertyInjections)];case 2:return J=te.sent(),[2,createInstanceWithInjections(__assign$1(__assign$1({},X),{constructorInjections:W,propertyInjections:J}))]}})})}function possiblyWaitInjections(X){return __awaiter$2(this,void 0,void 0,function(){var W,J,te,re;return __generator$2(this,function(oe){for(W=[],J=0,te=X;J<te.length;J++)re=te[J],Array.isArray(re)?W.push(Promise.all(re)):W.push(re);return[2,Promise.all(W)]})})}function _getInstanceAfterPostConstruct(X,W){var J=_postConstruct(X,W);return isPromise(J)?J.then(function(){return W}):W}function _postConstruct(X,W){var J,te;if(Reflect.hasMetadata(POST_CONSTRUCT,X)){var re=Reflect.getMetadata(POST_CONSTRUCT,X);try{return(te=(J=W)[re.value])===null||te===void 0?void 0:te.call(J)}catch(oe){if(oe instanceof Error)throw new Error(POST_CONSTRUCT_ERROR(X.name,oe.message))}}}function _validateInstanceResolution(X,W){X.scope!==BindingScopeEnum.Singleton&&_throwIfHandlingDeactivation(X,W)}function _throwIfHandlingDeactivation(X,W){var J="Class cannot be instantiated in "+(X.scope===BindingScopeEnum.Request?"request":"transient")+" scope.";if(typeof X.onDeactivation=="function")throw new Error(ON_DEACTIVATION_ERROR(W.name,J));if(Reflect.hasMetadata(PRE_DESTROY,W))throw new Error(PRE_DESTROY_ERROR(W.name,J))}function resolveInstance(X,W,J,te){_validateInstanceResolution(X,W);var re=_createInstance(W,J,te);return isPromise(re)?re.then(function(oe){return _getInstanceAfterPostConstruct(W,oe)}):_getInstanceAfterPostConstruct(W,re)}var __awaiter$1=function(X,W,J,te){function re(oe){return oe instanceof J?oe:new J(function(ne){ne(oe)})}return new(J||(J=Promise))(function(oe,ne){function de(he){try{ue(te.next(he))}catch(pe){ne(pe)}}function ce(he){try{ue(te.throw(he))}catch(pe){ne(pe)}}function ue(he){he.done?oe(he.value):re(he.value).then(de,ce)}ue((te=te.apply(X,W||[])).next())})},__generator$1=function(X,W){var J={label:0,sent:function(){if(oe[0]&1)throw oe[1];return oe[1]},trys:[],ops:[]},te,re,oe,ne;return ne={next:de(0),throw:de(1),return:de(2)},typeof Symbol=="function"&&(ne[Symbol.iterator]=function(){return this}),ne;function de(ue){return function(he){return ce([ue,he])}}function ce(ue){if(te)throw new TypeError("Generator is already executing.");for(;J;)try{if(te=1,re&&(oe=ue[0]&2?re.return:ue[0]?re.throw||((oe=re.return)&&oe.call(re),0):re.next)&&!(oe=oe.call(re,ue[1])).done)return oe;switch(re=0,oe&&(ue=[ue[0]&2,oe.value]),ue[0]){case 0:case 1:oe=ue;break;case 4:return J.label++,{value:ue[1],done:!1};case 5:J.label++,re=ue[1],ue=[0];continue;case 7:ue=J.ops.pop(),J.trys.pop();continue;default:if(oe=J.trys,!(oe=oe.length>0&&oe[oe.length-1])&&(ue[0]===6||ue[0]===2)){J=0;continue}if(ue[0]===3&&(!oe||ue[1]>oe[0]&&ue[1]<oe[3])){J.label=ue[1];break}if(ue[0]===6&&J.label<oe[1]){J.label=oe[1],oe=ue;break}if(oe&&J.label<oe[2]){J.label=oe[2],J.ops.push(ue);break}oe[2]&&J.ops.pop(),J.trys.pop();continue}ue=W.call(X,J)}catch(he){ue=[6,he],re=0}finally{te=oe=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},_resolveRequest=function(X){return function(W){W.parentContext.setCurrentRequest(W);var J=W.bindings,te=W.childRequests,re=W.target&&W.target.isArray(),oe=!W.parentRequest||!W.parentRequest.target||!W.target||!W.parentRequest.target.matchesArray(W.target.serviceIdentifier);if(re&&oe)return te.map(function(de){var ce=_resolveRequest(X);return ce(de)});if(W.target.isOptional()&&J.length===0)return;var ne=J[0];return _resolveBinding(X,W,ne)}},_resolveFactoryFromBinding=function(X,W){var J=getFactoryDetails(X);return tryAndThrowErrorIfStackOverflow(function(){return J.factory.bind(X)(W)},function(){return new Error(CIRCULAR_DEPENDENCY_IN_FACTORY(J.factoryType,W.currentRequest.serviceIdentifier.toString()))})},_getResolvedFromBinding=function(X,W,J){var te,re=W.childRequests;switch(ensureFullyBound(J),J.type){case BindingTypeEnum.ConstantValue:case BindingTypeEnum.Function:te=J.cache;break;case BindingTypeEnum.Constructor:te=J.implementationType;break;case BindingTypeEnum.Instance:te=resolveInstance(J,J.implementationType,re,_resolveRequest(X));break;default:te=_resolveFactoryFromBinding(J,W.parentContext)}return te},_resolveInScope=function(X,W,J){var te=tryGetFromScope(X,W);return te!==null||(te=J(),saveToScope(X,W,te)),te},_resolveBinding=function(X,W,J){return _resolveInScope(X,J,function(){var te=_getResolvedFromBinding(X,W,J);return isPromise(te)?te=te.then(function(re){return _onActivation(W,J,re)}):te=_onActivation(W,J,te),te})};function _onActivation(X,W,J){var te=_bindingActivation(X.parentContext,W,J),re=_getContainersIterator(X.parentContext.container),oe,ne=re.next();do{oe=ne.value;var de=X.parentContext,ce=X.serviceIdentifier,ue=_getContainerActivationsForService(oe,ce);isPromise(te)?te=_activateContainerAsync(ue,de,te):te=_activateContainer(ue,de,te),ne=re.next()}while(ne.done!==!0&&!getBindingDictionary(oe).hasKey(X.serviceIdentifier));return te}var _bindingActivation=function(X,W,J){var te;return typeof W.onActivation=="function"?te=W.onActivation(X,J):te=J,te},_activateContainer=function(X,W,J){for(var te=X.next();!te.done;){if(J=te.value(W,J),isPromise(J))return _activateContainerAsync(X,W,J);te=X.next()}return J},_activateContainerAsync=function(X,W,J){return __awaiter$1(void 0,void 0,void 0,function(){var te,re;return __generator$1(this,function(oe){switch(oe.label){case 0:return[4,J];case 1:te=oe.sent(),re=X.next(),oe.label=2;case 2:return re.done?[3,4]:[4,re.value(W,te)];case 3:return te=oe.sent(),re=X.next(),[3,2];case 4:return[2,te]}})})},_getContainerActivationsForService=function(X,W){var J=X._activations;return J.hasKey(W)?J.get(W).values():[].values()},_getContainersIterator=function(X){for(var W=[X],J=X.parent;J!==null;)W.push(J),J=J.parent;var te=function(){var oe=W.pop();return oe!==void 0?{done:!1,value:oe}:{done:!0,value:void 0}},re={next:te};return re};function resolve(X){var W=_resolveRequest(X.plan.rootRequest.requestScope);return W(X.plan.rootRequest)}var traverseAncerstors=function(X,W){var J=X.parentRequest;return J!==null?W(J)?!0:traverseAncerstors(J,W):!1},taggedConstraint=function(X){return function(W){var J=function(te){return te!==null&&te.target!==null&&te.target.matchesTag(X)(W)};return J.metaData=new Metadata(X,W),J}},namedConstraint=taggedConstraint(NAMED_TAG),typeConstraint=function(X){return function(W){var J=null;if(W!==null)if(J=W.bindings[0],typeof X=="string"){var te=J.serviceIdentifier;return te===X}else{var re=W.bindings[0].implementationType;return X===re}return!1}},BindingWhenSyntax=(function(){function X(W){this._binding=W}return X.prototype.when=function(W){return this._binding.constraint=W,new BindingOnSyntax(this._binding)},X.prototype.whenTargetNamed=function(W){return this._binding.constraint=namedConstraint(W),new BindingOnSyntax(this._binding)},X.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(W){if(W===null)return!1;var J=W.target!==null&&!W.target.isNamed()&&!W.target.isTagged();return J},new BindingOnSyntax(this._binding)},X.prototype.whenTargetTagged=function(W,J){return this._binding.constraint=taggedConstraint(W)(J),new BindingOnSyntax(this._binding)},X.prototype.whenInjectedInto=function(W){return this._binding.constraint=function(J){return J!==null&&typeConstraint(W)(J.parentRequest)},new BindingOnSyntax(this._binding)},X.prototype.whenParentNamed=function(W){return this._binding.constraint=function(J){return J!==null&&namedConstraint(W)(J.parentRequest)},new BindingOnSyntax(this._binding)},X.prototype.whenParentTagged=function(W,J){return this._binding.constraint=function(te){return te!==null&&taggedConstraint(W)(J)(te.parentRequest)},new BindingOnSyntax(this._binding)},X.prototype.whenAnyAncestorIs=function(W){return this._binding.constraint=function(J){return J!==null&&traverseAncerstors(J,typeConstraint(W))},new BindingOnSyntax(this._binding)},X.prototype.whenNoAncestorIs=function(W){return this._binding.constraint=function(J){return J!==null&&!traverseAncerstors(J,typeConstraint(W))},new BindingOnSyntax(this._binding)},X.prototype.whenAnyAncestorNamed=function(W){return this._binding.constraint=function(J){return J!==null&&traverseAncerstors(J,namedConstraint(W))},new BindingOnSyntax(this._binding)},X.prototype.whenNoAncestorNamed=function(W){return this._binding.constraint=function(J){return J!==null&&!traverseAncerstors(J,namedConstraint(W))},new BindingOnSyntax(this._binding)},X.prototype.whenAnyAncestorTagged=function(W,J){return this._binding.constraint=function(te){return te!==null&&traverseAncerstors(te,taggedConstraint(W)(J))},new BindingOnSyntax(this._binding)},X.prototype.whenNoAncestorTagged=function(W,J){return this._binding.constraint=function(te){return te!==null&&!traverseAncerstors(te,taggedConstraint(W)(J))},new BindingOnSyntax(this._binding)},X.prototype.whenAnyAncestorMatches=function(W){return this._binding.constraint=function(J){return J!==null&&traverseAncerstors(J,W)},new BindingOnSyntax(this._binding)},X.prototype.whenNoAncestorMatches=function(W){return this._binding.constraint=function(J){return J!==null&&!traverseAncerstors(J,W)},new BindingOnSyntax(this._binding)},X})(),BindingOnSyntax=(function(){function X(W){this._binding=W}return X.prototype.onActivation=function(W){return this._binding.onActivation=W,new BindingWhenSyntax(this._binding)},X.prototype.onDeactivation=function(W){return this._binding.onDeactivation=W,new BindingWhenSyntax(this._binding)},X})(),BindingWhenOnSyntax=(function(){function X(W){this._binding=W,this._bindingWhenSyntax=new BindingWhenSyntax(this._binding),this._bindingOnSyntax=new BindingOnSyntax(this._binding)}return X.prototype.when=function(W){return this._bindingWhenSyntax.when(W)},X.prototype.whenTargetNamed=function(W){return this._bindingWhenSyntax.whenTargetNamed(W)},X.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},X.prototype.whenTargetTagged=function(W,J){return this._bindingWhenSyntax.whenTargetTagged(W,J)},X.prototype.whenInjectedInto=function(W){return this._bindingWhenSyntax.whenInjectedInto(W)},X.prototype.whenParentNamed=function(W){return this._bindingWhenSyntax.whenParentNamed(W)},X.prototype.whenParentTagged=function(W,J){return this._bindingWhenSyntax.whenParentTagged(W,J)},X.prototype.whenAnyAncestorIs=function(W){return this._bindingWhenSyntax.whenAnyAncestorIs(W)},X.prototype.whenNoAncestorIs=function(W){return this._bindingWhenSyntax.whenNoAncestorIs(W)},X.prototype.whenAnyAncestorNamed=function(W){return this._bindingWhenSyntax.whenAnyAncestorNamed(W)},X.prototype.whenAnyAncestorTagged=function(W,J){return this._bindingWhenSyntax.whenAnyAncestorTagged(W,J)},X.prototype.whenNoAncestorNamed=function(W){return this._bindingWhenSyntax.whenNoAncestorNamed(W)},X.prototype.whenNoAncestorTagged=function(W,J){return this._bindingWhenSyntax.whenNoAncestorTagged(W,J)},X.prototype.whenAnyAncestorMatches=function(W){return this._bindingWhenSyntax.whenAnyAncestorMatches(W)},X.prototype.whenNoAncestorMatches=function(W){return this._bindingWhenSyntax.whenNoAncestorMatches(W)},X.prototype.onActivation=function(W){return this._bindingOnSyntax.onActivation(W)},X.prototype.onDeactivation=function(W){return this._bindingOnSyntax.onDeactivation(W)},X})(),BindingInSyntax=(function(){function X(W){this._binding=W}return X.prototype.inRequestScope=function(){return this._binding.scope=BindingScopeEnum.Request,new BindingWhenOnSyntax(this._binding)},X.prototype.inSingletonScope=function(){return this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.inTransientScope=function(){return this._binding.scope=BindingScopeEnum.Transient,new BindingWhenOnSyntax(this._binding)},X})(),BindingInWhenOnSyntax=(function(){function X(W){this._binding=W,this._bindingWhenSyntax=new BindingWhenSyntax(this._binding),this._bindingOnSyntax=new BindingOnSyntax(this._binding),this._bindingInSyntax=new BindingInSyntax(W)}return X.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},X.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},X.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},X.prototype.when=function(W){return this._bindingWhenSyntax.when(W)},X.prototype.whenTargetNamed=function(W){return this._bindingWhenSyntax.whenTargetNamed(W)},X.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},X.prototype.whenTargetTagged=function(W,J){return this._bindingWhenSyntax.whenTargetTagged(W,J)},X.prototype.whenInjectedInto=function(W){return this._bindingWhenSyntax.whenInjectedInto(W)},X.prototype.whenParentNamed=function(W){return this._bindingWhenSyntax.whenParentNamed(W)},X.prototype.whenParentTagged=function(W,J){return this._bindingWhenSyntax.whenParentTagged(W,J)},X.prototype.whenAnyAncestorIs=function(W){return this._bindingWhenSyntax.whenAnyAncestorIs(W)},X.prototype.whenNoAncestorIs=function(W){return this._bindingWhenSyntax.whenNoAncestorIs(W)},X.prototype.whenAnyAncestorNamed=function(W){return this._bindingWhenSyntax.whenAnyAncestorNamed(W)},X.prototype.whenAnyAncestorTagged=function(W,J){return this._bindingWhenSyntax.whenAnyAncestorTagged(W,J)},X.prototype.whenNoAncestorNamed=function(W){return this._bindingWhenSyntax.whenNoAncestorNamed(W)},X.prototype.whenNoAncestorTagged=function(W,J){return this._bindingWhenSyntax.whenNoAncestorTagged(W,J)},X.prototype.whenAnyAncestorMatches=function(W){return this._bindingWhenSyntax.whenAnyAncestorMatches(W)},X.prototype.whenNoAncestorMatches=function(W){return this._bindingWhenSyntax.whenNoAncestorMatches(W)},X.prototype.onActivation=function(W){return this._bindingOnSyntax.onActivation(W)},X.prototype.onDeactivation=function(W){return this._bindingOnSyntax.onDeactivation(W)},X})(),BindingToSyntax=(function(){function X(W){this._binding=W}return X.prototype.to=function(W){return this._binding.type=BindingTypeEnum.Instance,this._binding.implementationType=W,new BindingInWhenOnSyntax(this._binding)},X.prototype.toSelf=function(){if(typeof this._binding.serviceIdentifier!="function")throw new Error(""+INVALID_TO_SELF_VALUE);var W=this._binding.serviceIdentifier;return this.to(W)},X.prototype.toConstantValue=function(W){return this._binding.type=BindingTypeEnum.ConstantValue,this._binding.cache=W,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.toDynamicValue=function(W){return this._binding.type=BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=W,this._binding.implementationType=null,new BindingInWhenOnSyntax(this._binding)},X.prototype.toConstructor=function(W){return this._binding.type=BindingTypeEnum.Constructor,this._binding.implementationType=W,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.toFactory=function(W){return this._binding.type=BindingTypeEnum.Factory,this._binding.factory=W,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.toFunction=function(W){if(typeof W!="function")throw new Error(INVALID_FUNCTION_BINDING);var J=this.toConstantValue(W);return this._binding.type=BindingTypeEnum.Function,this._binding.scope=BindingScopeEnum.Singleton,J},X.prototype.toAutoFactory=function(W){return this._binding.type=BindingTypeEnum.Factory,this._binding.factory=function(J){var te=function(){return J.container.get(W)};return te},this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.toAutoNamedFactory=function(W){return this._binding.type=BindingTypeEnum.Factory,this._binding.factory=function(J){return function(te){return J.container.getNamed(W,te)}},new BindingWhenOnSyntax(this._binding)},X.prototype.toProvider=function(W){return this._binding.type=BindingTypeEnum.Provider,this._binding.provider=W,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},X.prototype.toService=function(W){this.toDynamicValue(function(J){return J.container.get(W)})},X})(),ContainerSnapshot=(function(){function X(){}return X.of=function(W,J,te,re,oe){var ne=new X;return ne.bindings=W,ne.middleware=J,ne.deactivations=re,ne.activations=te,ne.moduleActivationStore=oe,ne},X})();function isClonable(X){return typeof X=="object"&&X!==null&&"clone"in X&&typeof X.clone=="function"}var Lookup=(function(){function X(){this._map=new Map}return X.prototype.getMap=function(){return this._map},X.prototype.add=function(W,J){if(W==null)throw new Error(NULL_ARGUMENT);if(J==null)throw new Error(NULL_ARGUMENT);var te=this._map.get(W);te!==void 0?te.push(J):this._map.set(W,[J])},X.prototype.get=function(W){if(W==null)throw new Error(NULL_ARGUMENT);var J=this._map.get(W);if(J!==void 0)return J;throw new Error(KEY_NOT_FOUND)},X.prototype.remove=function(W){if(W==null)throw new Error(NULL_ARGUMENT);if(!this._map.delete(W))throw new Error(KEY_NOT_FOUND)},X.prototype.removeIntersection=function(W){var J=this;this.traverse(function(te,re){var oe=W.hasKey(te)?W.get(te):void 0;if(oe!==void 0){var ne=re.filter(function(de){return!oe.some(function(ce){return de===ce})});J._setValue(te,ne)}})},X.prototype.removeByCondition=function(W){var J=this,te=[];return this._map.forEach(function(re,oe){for(var ne=[],de=0,ce=re;de<ce.length;de++){var ue=ce[de],he=W(ue);he?te.push(ue):ne.push(ue)}J._setValue(oe,ne)}),te},X.prototype.hasKey=function(W){if(W==null)throw new Error(NULL_ARGUMENT);return this._map.has(W)},X.prototype.clone=function(){var W=new X;return this._map.forEach(function(J,te){J.forEach(function(re){return W.add(te,isClonable(re)?re.clone():re)})}),W},X.prototype.traverse=function(W){this._map.forEach(function(J,te){W(te,J)})},X.prototype._setValue=function(W,J){J.length>0?this._map.set(W,J):this._map.delete(W)},X})(),ModuleActivationStore=(function(){function X(){this._map=new Map}return X.prototype.remove=function(W){if(this._map.has(W)){var J=this._map.get(W);return this._map.delete(W),J}return this._getEmptyHandlersStore()},X.prototype.addDeactivation=function(W,J,te){this._getModuleActivationHandlers(W).onDeactivations.add(J,te)},X.prototype.addActivation=function(W,J,te){this._getModuleActivationHandlers(W).onActivations.add(J,te)},X.prototype.clone=function(){var W=new X;return this._map.forEach(function(J,te){W._map.set(te,{onActivations:J.onActivations.clone(),onDeactivations:J.onDeactivations.clone()})}),W},X.prototype._getModuleActivationHandlers=function(W){var J=this._map.get(W);return J===void 0&&(J=this._getEmptyHandlersStore(),this._map.set(W,J)),J},X.prototype._getEmptyHandlersStore=function(){var W={onActivations:new Lookup,onDeactivations:new Lookup};return W},X})(),__assign=function(){return __assign=Object.assign||function(X){for(var W,J=1,te=arguments.length;J<te;J++){W=arguments[J];for(var re in W)Object.prototype.hasOwnProperty.call(W,re)&&(X[re]=W[re])}return X},__assign.apply(this,arguments)},__awaiter=function(X,W,J,te){function re(oe){return oe instanceof J?oe:new J(function(ne){ne(oe)})}return new(J||(J=Promise))(function(oe,ne){function de(he){try{ue(te.next(he))}catch(pe){ne(pe)}}function ce(he){try{ue(te.throw(he))}catch(pe){ne(pe)}}function ue(he){he.done?oe(he.value):re(he.value).then(de,ce)}ue((te=te.apply(X,W||[])).next())})},__generator=function(X,W){var J={label:0,sent:function(){if(oe[0]&1)throw oe[1];return oe[1]},trys:[],ops:[]},te,re,oe,ne;return ne={next:de(0),throw:de(1),return:de(2)},typeof Symbol=="function"&&(ne[Symbol.iterator]=function(){return this}),ne;function de(ue){return function(he){return ce([ue,he])}}function ce(ue){if(te)throw new TypeError("Generator is already executing.");for(;J;)try{if(te=1,re&&(oe=ue[0]&2?re.return:ue[0]?re.throw||((oe=re.return)&&oe.call(re),0):re.next)&&!(oe=oe.call(re,ue[1])).done)return oe;switch(re=0,oe&&(ue=[ue[0]&2,oe.value]),ue[0]){case 0:case 1:oe=ue;break;case 4:return J.label++,{value:ue[1],done:!1};case 5:J.label++,re=ue[1],ue=[0];continue;case 7:ue=J.ops.pop(),J.trys.pop();continue;default:if(oe=J.trys,!(oe=oe.length>0&&oe[oe.length-1])&&(ue[0]===6||ue[0]===2)){J=0;continue}if(ue[0]===3&&(!oe||ue[1]>oe[0]&&ue[1]<oe[3])){J.label=ue[1];break}if(ue[0]===6&&J.label<oe[1]){J.label=oe[1],oe=ue;break}if(oe&&J.label<oe[2]){J.label=oe[2],J.ops.push(ue);break}oe[2]&&J.ops.pop(),J.trys.pop();continue}ue=W.call(X,J)}catch(he){ue=[6,he],re=0}finally{te=oe=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},__spreadArray=function(X,W,J){if(J||arguments.length===2)for(var te=0,re=W.length,oe;te<re;te++)(oe||!(te in W))&&(oe||(oe=Array.prototype.slice.call(W,0,te)),oe[te]=W[te]);return X.concat(oe||Array.prototype.slice.call(W))},Container=(function(){function X(W){var J=W||{};if(typeof J!="object")throw new Error(""+CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(J.defaultScope===void 0)J.defaultScope=BindingScopeEnum.Transient;else if(J.defaultScope!==BindingScopeEnum.Singleton&&J.defaultScope!==BindingScopeEnum.Transient&&J.defaultScope!==BindingScopeEnum.Request)throw new Error(""+CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(J.autoBindInjectable===void 0)J.autoBindInjectable=!1;else if(typeof J.autoBindInjectable!="boolean")throw new Error(""+CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(J.skipBaseClassChecks===void 0)J.skipBaseClassChecks=!1;else if(typeof J.skipBaseClassChecks!="boolean")throw new Error(""+CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:J.autoBindInjectable,defaultScope:J.defaultScope,skipBaseClassChecks:J.skipBaseClassChecks},this.id=id(),this._bindingDictionary=new Lookup,this._snapshots=[],this._middleware=null,this._activations=new Lookup,this._deactivations=new Lookup,this.parent=null,this._metadataReader=new MetadataReader,this._moduleActivationStore=new ModuleActivationStore}return X.merge=function(W,J){for(var te=[],re=2;re<arguments.length;re++)te[re-2]=arguments[re];var oe=new X,ne=__spreadArray([W,J],te,!0).map(function(ue){return getBindingDictionary(ue)}),de=getBindingDictionary(oe);function ce(ue,he){ue.traverse(function(pe,fe){fe.forEach(function(be){he.add(be.serviceIdentifier,be.clone())})})}return ne.forEach(function(ue){ce(ue,de)}),oe},X.prototype.load=function(){for(var W=[],J=0;J<arguments.length;J++)W[J]=arguments[J];for(var te=this._getContainerModuleHelpersFactory(),re=0,oe=W;re<oe.length;re++){var ne=oe[re],de=te(ne.id);ne.registry(de.bindFunction,de.unbindFunction,de.isboundFunction,de.rebindFunction,de.unbindAsyncFunction,de.onActivationFunction,de.onDeactivationFunction)}},X.prototype.loadAsync=function(){for(var W=[],J=0;J<arguments.length;J++)W[J]=arguments[J];return __awaiter(this,void 0,void 0,function(){var te,re,oe,ne,de;return __generator(this,function(ce){switch(ce.label){case 0:te=this._getContainerModuleHelpersFactory(),re=0,oe=W,ce.label=1;case 1:return re<oe.length?(ne=oe[re],de=te(ne.id),[4,ne.registry(de.bindFunction,de.unbindFunction,de.isboundFunction,de.rebindFunction,de.unbindAsyncFunction,de.onActivationFunction,de.onDeactivationFunction)]):[3,4];case 2:ce.sent(),ce.label=3;case 3:return re++,[3,1];case 4:return[2]}})})},X.prototype.unload=function(){for(var W=this,J=[],te=0;te<arguments.length;te++)J[te]=arguments[te];J.forEach(function(re){var oe=W._removeModuleBindings(re.id);W._deactivateSingletons(oe),W._removeModuleHandlers(re.id)})},X.prototype.unloadAsync=function(){for(var W=[],J=0;J<arguments.length;J++)W[J]=arguments[J];return __awaiter(this,void 0,void 0,function(){var te,re,oe,ne;return __generator(this,function(de){switch(de.label){case 0:te=0,re=W,de.label=1;case 1:return te<re.length?(oe=re[te],ne=this._removeModuleBindings(oe.id),[4,this._deactivateSingletonsAsync(ne)]):[3,4];case 2:de.sent(),this._removeModuleHandlers(oe.id),de.label=3;case 3:return te++,[3,1];case 4:return[2]}})})},X.prototype.bind=function(W){var J=this.options.defaultScope||BindingScopeEnum.Transient,te=new Binding(W,J);return this._bindingDictionary.add(W,te),new BindingToSyntax(te)},X.prototype.rebind=function(W){return this.unbind(W),this.bind(W)},X.prototype.rebindAsync=function(W){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(J){switch(J.label){case 0:return[4,this.unbindAsync(W)];case 1:return J.sent(),[2,this.bind(W)]}})})},X.prototype.unbind=function(W){if(this._bindingDictionary.hasKey(W)){var J=this._bindingDictionary.get(W);this._deactivateSingletons(J)}this._removeServiceFromDictionary(W)},X.prototype.unbindAsync=function(W){return __awaiter(this,void 0,void 0,function(){var J;return __generator(this,function(te){switch(te.label){case 0:return this._bindingDictionary.hasKey(W)?(J=this._bindingDictionary.get(W),[4,this._deactivateSingletonsAsync(J)]):[3,2];case 1:te.sent(),te.label=2;case 2:return this._removeServiceFromDictionary(W),[2]}})})},X.prototype.unbindAll=function(){var W=this;this._bindingDictionary.traverse(function(J,te){W._deactivateSingletons(te)}),this._bindingDictionary=new Lookup},X.prototype.unbindAllAsync=function(){return __awaiter(this,void 0,void 0,function(){var W,J=this;return __generator(this,function(te){switch(te.label){case 0:return W=[],this._bindingDictionary.traverse(function(re,oe){W.push(J._deactivateSingletonsAsync(oe))}),[4,Promise.all(W)];case 1:return te.sent(),this._bindingDictionary=new Lookup,[2]}})})},X.prototype.onActivation=function(W,J){this._activations.add(W,J)},X.prototype.onDeactivation=function(W,J){this._deactivations.add(W,J)},X.prototype.isBound=function(W){var J=this._bindingDictionary.hasKey(W);return!J&&this.parent&&(J=this.parent.isBound(W)),J},X.prototype.isCurrentBound=function(W){return this._bindingDictionary.hasKey(W)},X.prototype.isBoundNamed=function(W,J){return this.isBoundTagged(W,NAMED_TAG,J)},X.prototype.isBoundTagged=function(W,J,te){var re=!1;if(this._bindingDictionary.hasKey(W)){var oe=this._bindingDictionary.get(W),ne=createMockRequest(this,W,J,te);re=oe.some(function(de){return de.constraint(ne)})}return!re&&this.parent&&(re=this.parent.isBoundTagged(W,J,te)),re},X.prototype.snapshot=function(){this._snapshots.push(ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))},X.prototype.restore=function(){var W=this._snapshots.pop();if(W===void 0)throw new Error(NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=W.bindings,this._activations=W.activations,this._deactivations=W.deactivations,this._middleware=W.middleware,this._moduleActivationStore=W.moduleActivationStore},X.prototype.createChild=function(W){var J=new X(W||this.options);return J.parent=this,J},X.prototype.applyMiddleware=function(){for(var W=[],J=0;J<arguments.length;J++)W[J]=arguments[J];var te=this._middleware?this._middleware:this._planAndResolve();this._middleware=W.reduce(function(re,oe){return oe(re)},te)},X.prototype.applyCustomMetadataReader=function(W){this._metadataReader=W},X.prototype.get=function(W){var J=this._getNotAllArgs(W,!1);return this._getButThrowIfAsync(J)},X.prototype.getAsync=function(W){return __awaiter(this,void 0,void 0,function(){var J;return __generator(this,function(te){return J=this._getNotAllArgs(W,!1),[2,this._get(J)]})})},X.prototype.getTagged=function(W,J,te){var re=this._getNotAllArgs(W,!1,J,te);return this._getButThrowIfAsync(re)},X.prototype.getTaggedAsync=function(W,J,te){return __awaiter(this,void 0,void 0,function(){var re;return __generator(this,function(oe){return re=this._getNotAllArgs(W,!1,J,te),[2,this._get(re)]})})},X.prototype.getNamed=function(W,J){return this.getTagged(W,NAMED_TAG,J)},X.prototype.getNamedAsync=function(W,J){return this.getTaggedAsync(W,NAMED_TAG,J)},X.prototype.getAll=function(W){var J=this._getAllArgs(W);return this._getButThrowIfAsync(J)},X.prototype.getAllAsync=function(W){var J=this._getAllArgs(W);return this._getAll(J)},X.prototype.getAllTagged=function(W,J,te){var re=this._getNotAllArgs(W,!0,J,te);return this._getButThrowIfAsync(re)},X.prototype.getAllTaggedAsync=function(W,J,te){var re=this._getNotAllArgs(W,!0,J,te);return this._getAll(re)},X.prototype.getAllNamed=function(W,J){return this.getAllTagged(W,NAMED_TAG,J)},X.prototype.getAllNamedAsync=function(W,J){return this.getAllTaggedAsync(W,NAMED_TAG,J)},X.prototype.resolve=function(W){var J=this.isBound(W);J||this.bind(W).toSelf();var te=this.get(W);return J||this.unbind(W),te},X.prototype._preDestroy=function(W,J){var te,re;if(Reflect.hasMetadata(PRE_DESTROY,W)){var oe=Reflect.getMetadata(PRE_DESTROY,W);return(re=(te=J)[oe.value])===null||re===void 0?void 0:re.call(te)}},X.prototype._removeModuleHandlers=function(W){var J=this._moduleActivationStore.remove(W);this._activations.removeIntersection(J.onActivations),this._deactivations.removeIntersection(J.onDeactivations)},X.prototype._removeModuleBindings=function(W){return this._bindingDictionary.removeByCondition(function(J){return J.moduleId===W})},X.prototype._deactivate=function(W,J){var te=this,re=Object.getPrototypeOf(J).constructor;try{if(this._deactivations.hasKey(W.serviceIdentifier)){var oe=this._deactivateContainer(J,this._deactivations.get(W.serviceIdentifier).values());if(isPromise(oe))return this._handleDeactivationError(oe.then(function(){return te._propagateContainerDeactivationThenBindingAndPreDestroyAsync(W,J,re)}),re)}var ne=this._propagateContainerDeactivationThenBindingAndPreDestroy(W,J,re);if(isPromise(ne))return this._handleDeactivationError(ne,re)}catch(de){if(de instanceof Error)throw new Error(ON_DEACTIVATION_ERROR(re.name,de.message))}},X.prototype._handleDeactivationError=function(W,J){return __awaiter(this,void 0,void 0,function(){var te;return __generator(this,function(re){switch(re.label){case 0:return re.trys.push([0,2,,3]),[4,W];case 1:return re.sent(),[3,3];case 2:if(te=re.sent(),te instanceof Error)throw new Error(ON_DEACTIVATION_ERROR(J.name,te.message));return[3,3];case 3:return[2]}})})},X.prototype._deactivateContainer=function(W,J){for(var te=this,re=J.next();re.value;){var oe=re.value(W);if(isPromise(oe))return oe.then(function(){return te._deactivateContainerAsync(W,J)});re=J.next()}},X.prototype._deactivateContainerAsync=function(W,J){return __awaiter(this,void 0,void 0,function(){var te;return __generator(this,function(re){switch(re.label){case 0:te=J.next(),re.label=1;case 1:return te.value?[4,te.value(W)]:[3,3];case 2:return re.sent(),te=J.next(),[3,1];case 3:return[2]}})})},X.prototype._getContainerModuleHelpersFactory=function(){var W=this,J=function(he,pe){he._binding.moduleId=pe},te=function(he){return function(pe){var fe=W.bind(pe);return J(fe,he),fe}},re=function(){return function(he){return W.unbind(he)}},oe=function(){return function(he){return W.unbindAsync(he)}},ne=function(){return function(he){return W.isBound(he)}},de=function(he){return function(pe){var fe=W.rebind(pe);return J(fe,he),fe}},ce=function(he){return function(pe,fe){W._moduleActivationStore.addActivation(he,pe,fe),W.onActivation(pe,fe)}},ue=function(he){return function(pe,fe){W._moduleActivationStore.addDeactivation(he,pe,fe),W.onDeactivation(pe,fe)}};return function(he){return{bindFunction:te(he),isboundFunction:ne(),onActivationFunction:ce(he),onDeactivationFunction:ue(he),rebindFunction:de(he),unbindFunction:re(),unbindAsyncFunction:oe()}}},X.prototype._getAll=function(W){return Promise.all(this._get(W))},X.prototype._get=function(W){var J=__assign(__assign({},W),{contextInterceptor:function(re){return re},targetType:TargetTypeEnum.Variable});if(this._middleware){var te=this._middleware(J);if(te==null)throw new Error(INVALID_MIDDLEWARE_RETURN);return te}return this._planAndResolve()(J)},X.prototype._getButThrowIfAsync=function(W){var J=this._get(W);if(isPromiseOrContainsPromise(J))throw new Error(LAZY_IN_SYNC(W.serviceIdentifier));return J},X.prototype._getAllArgs=function(W){var J={avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:W};return J},X.prototype._getNotAllArgs=function(W,J,te,re){var oe={avoidConstraints:!1,isMultiInject:J,serviceIdentifier:W,key:te,value:re};return oe},X.prototype._planAndResolve=function(){var W=this;return function(J){var te=plan(W._metadataReader,W,J.isMultiInject,J.targetType,J.serviceIdentifier,J.key,J.value,J.avoidConstraints);te=J.contextInterceptor(te);var re=resolve(te);return re}},X.prototype._deactivateIfSingleton=function(W){var J=this;if(W.activated)return isPromise(W.cache)?W.cache.then(function(te){return J._deactivate(W,te)}):this._deactivate(W,W.cache)},X.prototype._deactivateSingletons=function(W){for(var J=0,te=W;J<te.length;J++){var re=te[J],oe=this._deactivateIfSingleton(re);if(isPromise(oe))throw new Error(ASYNC_UNBIND_REQUIRED)}},X.prototype._deactivateSingletonsAsync=function(W){return __awaiter(this,void 0,void 0,function(){var J=this;return __generator(this,function(te){switch(te.label){case 0:return[4,Promise.all(W.map(function(re){return J._deactivateIfSingleton(re)}))];case 1:return te.sent(),[2]}})})},X.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(W,J,te){return this.parent?this._deactivate.bind(this.parent)(W,J):this._bindingDeactivationAndPreDestroy(W,J,te)},X.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(W,J,te){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(re){switch(re.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(W,J)]:[3,2];case 1:return re.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(W,J,te)];case 3:re.sent(),re.label=4;case 4:return[2]}})})},X.prototype._removeServiceFromDictionary=function(W){try{this._bindingDictionary.remove(W)}catch{throw new Error(CANNOT_UNBIND+" "+getServiceIdentifierAsString(W))}},X.prototype._bindingDeactivationAndPreDestroy=function(W,J,te){var re=this;if(typeof W.onDeactivation=="function"){var oe=W.onDeactivation(J);if(isPromise(oe))return oe.then(function(){return re._preDestroy(te,J)})}return this._preDestroy(te,J)},X.prototype._bindingDeactivationAndPreDestroyAsync=function(W,J,te){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(re){switch(re.label){case 0:return typeof W.onDeactivation!="function"?[3,2]:[4,W.onDeactivation(J)];case 1:re.sent(),re.label=2;case 2:return[4,this._preDestroy(te,J)];case 3:return re.sent(),[2]}})})},X})();function getFirstArrayDuplicate(X){for(var W=new Set,J=0,te=X;J<te.length;J++){var re=te[J];if(W.has(re))return re;W.add(re)}}function targetIsConstructorFunction(X){return X.prototype!==void 0}function _throwIfMethodParameter(X){if(X!==void 0)throw new Error(INVALID_DECORATOR_OPERATION)}function tagParameter(X,W,J,te){_throwIfMethodParameter(W),_tagParameterOrProperty(TAGGED,X,J.toString(),te)}function tagProperty(X,W,J){if(targetIsConstructorFunction(X))throw new Error(INVALID_DECORATOR_OPERATION);_tagParameterOrProperty(TAGGED_PROP,X.constructor,W,J)}function _ensureNoMetadataKeyDuplicates(X){var W=[];if(Array.isArray(X)){W=X;var J=getFirstArrayDuplicate(W.map(function(te){return te.key}));if(J!==void 0)throw new Error(DUPLICATED_METADATA+" "+J.toString())}else W=[X];return W}function _tagParameterOrProperty(X,W,J,te){var re=_ensureNoMetadataKeyDuplicates(te),oe={};Reflect.hasOwnMetadata(X,W)&&(oe=Reflect.getMetadata(X,W));var ne=oe[J];if(ne===void 0)ne=[];else for(var de=function(pe){if(re.some(function(fe){return fe.key===pe.key}))throw new Error(DUPLICATED_METADATA+" "+pe.key.toString())},ce=0,ue=ne;ce<ue.length;ce++){var he=ue[ce];de(he)}ne.push.apply(ne,re),oe[J]=ne,Reflect.defineMetadata(X,oe,W)}function createTaggedDecorator(X){return function(W,J,te){typeof te=="number"?tagParameter(W,J,te,X):tagProperty(W,J,X)}}function injectable(){return function(X){if(Reflect.hasOwnMetadata(PARAM_TYPES,X))throw new Error(DUPLICATED_INJECTABLE_DECORATOR);var W=Reflect.getMetadata(DESIGN_PARAM_TYPES,X)||[];return Reflect.defineMetadata(PARAM_TYPES,W,X),X}}function injectBase(X){return function(W){return function(J,te,re){if(W===void 0){var oe=typeof J=="function"?J.name:J.constructor.name;throw new Error(UNDEFINED_INJECT_ANNOTATION(oe))}return createTaggedDecorator(new Metadata(X,W))(J,te,re)}}}var inject=injectBase(INJECT_TAG),INJECTION=Symbol.for("INJECTION");function _proxyGetter(X,W,J,te){function re(){return Reflect.hasMetadata(INJECTION,this,W)?Reflect.getMetadata(INJECTION,this,W):J()}function oe(ne){Reflect.defineMetadata(INJECTION,ne,this,W)}Object.defineProperty(X,W,{configurable:!0,enumerable:!0,get:re,set:oe})}function makePropertyInjectDecorator(X,W){return function(J){return function(te,re){var oe=function(){return X.get(J)};_proxyGetter(te,re,oe)}}}function makePropertyInjectNamedDecorator(X,W){return function(J,te){return function(re,oe){var ne=function(){return X.getNamed(J,te)};_proxyGetter(re,oe,ne)}}}function makePropertyInjectTaggedDecorator(X,W){return function(J,te,re){return function(oe,ne){var de=function(){return X.getTagged(J,te,re)};_proxyGetter(oe,ne,de)}}}function makePropertyMultiInjectDecorator(X,W){return function(J){return function(te,re){var oe=function(){return X.getAll(J)};_proxyGetter(te,re,oe)}}}function getDecorators(X,W){var J=makePropertyInjectDecorator(X),te=makePropertyInjectNamedDecorator(X),re=makePropertyInjectTaggedDecorator(X),oe=makePropertyMultiInjectDecorator(X);return{lazyInject:J,lazyInjectNamed:te,lazyInjectTagged:re,lazyMultiInject:oe}}const container$1=new Container,{lazyInject:lazyInject$1}=getDecorators(container$1),registerDep=X=>{container$1.bind(X).toSelf()},unregisterDep=X=>{container$1.isBound(X)&&container$1.unbind(X)},TYPES$1={primaryApi:Symbol.for("primaryApi")},styles$r=":host{min-height:1px;height:100%;width:100%;display:flex}iframe{border:none;flex:1;height:100%}.pdf-container{display:flex;justify-content:center;align-items:center;height:100%;flex:1;border:1px solid #ccc}.no-pdf{text-align:center;color:#666;font-size:1.2rem;font-weight:700}";var __defProp$t=Object.defineProperty,__decorateClass$y=(X,W,J,te)=>{for(var re=void 0,oe=X.length-1,ne;oe>=0;oe--)(ne=X[oe])&&(re=ne(W,J,re)||re);return re&&__defProp$t(W,J,re),re};const xs=class xs extends h$p{constructor(){super(...arguments),this.pdfList=[],this.activePdfs=[],this.subscriptions=[]}async connectedCallback(){super.connectedCallback(),this._initializePdfState(),this._subscribeEvents()}disconnectedCallback(){super.disconnectedCallback(),this._unsubscribeEvents()}_initializePdfState(){const W=this.api.pdfViewerManager.getPdfs?.()||[];this.pdfList=[...W],W.length===1?this.activePdfs=[W[0]]:W.length>=2&&(this.activePdfs=W.slice(-2))}_getPdfSrc(W){const J=W.data.url||(W.data.b64?createUrlFromBase64(W.data.b64):"")||"";if(!J)return"";const te=J.includes("#")?"&":"#";return`${J}${te}navpanes=0`}_subscribeEvents(){[this.api.broker.subscribe(pdfViwerEvents.added,J=>this._onPdfAdded(J)),this.api.broker.subscribe(pdfViwerEvents.deleted,({id:J})=>this._onPdfDeleted({id:J}))].forEach(J=>this.subscriptions.push(J))}_unsubscribeEvents(){this.subscriptions.forEach(W=>W.dispose())}_onPdfAdded(W){this.pdfList=[...this.pdfList,W],this._updateActivePdfs(W.id)}_onPdfDeleted({id:W}){this.pdfList=this.pdfList.filter(J=>J.id!==W),this.activePdfs=this.activePdfs.filter(J=>J.id!==W),this.requestUpdate()}_removePdf(W){this.api.pdfViewerManager.delete(W),this.activePdfs=this.activePdfs.filter(J=>J.id!==W)}_updateActivePdfs(W){if(this.activePdfs.some(te=>te.id===W))this.activePdfs=this.activePdfs.filter(te=>te.id!==W);else{const te=this.pdfList.find(re=>re.id===W);if(!te)return;this.activePdfs.length===2?this.activePdfs=[this.activePdfs[1],te]:this.activePdfs=[...this.activePdfs,te]}this.requestUpdate()}render(){return ke$1`
264
264
  <div class="pdf-container">
265
265
  ${this.activePdfs.length>0?this.activePdfs.map(W=>ke$1`<iframe height="100%" src=${this._getPdfSrc(W)} frameborder="0"></iframe>`):ke$1`
266
266
  <div class="no-pdf">