@uxland/primary-shell 5.4.3 → 5.4.4

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.
@@ -207,7 +207,7 @@ Registered bindings:`,ne.forEach(function(oe){var de="Object";oe.implementationT
207
207
  `+de,oe.constraint.metaData&&(re=re+" - "+oe.constraint.metaData)})),re}function alreadyDependencyChain(te,J){return te.parentRequest===null?!1:te.parentRequest.serviceIdentifier===J?!0:alreadyDependencyChain(te.parentRequest,J)}function dependencyChainToString(te){function J(re,ne){ne===void 0&&(ne=[]);var oe=getServiceIdentifierAsString(re.serviceIdentifier);return ne.push(oe),re.parentRequest!==null?J(re.parentRequest,ne):ne}var X=J(te);return X.reverse().join(" --> ")}function circularDependencyToException(te){te.childRequests.forEach(function(J){if(alreadyDependencyChain(J,J.serviceIdentifier)){var X=dependencyChainToString(J);throw new Error(CIRCULAR_DEPENDENCY+" "+X)}else circularDependencyToException(J)})}function listMetadataForTarget(te,J){if(J.isTagged()||J.isNamed()){var X="",re=J.getNamedTag(),ne=J.getCustomTags();return re!==null&&(X+=re.toString()+`
208
208
  `),ne!==null&&ne.forEach(function(oe){X+=oe.toString()+`
209
209
  `})," "+te+`
210
- `+te+" - "+X}else return" "+te}function getFunctionName(te){if(te.name)return te.name;var J=te.toString(),X=J.match(/^function\s*([^\s(]+)/);return X?X[1]:"Anonymous function: "+J}function getSymbolDescription(te){return te.toString().slice(7,-1)}var Context=function(){function te(J){this.id=id(),this.container=J}return te.prototype.addPlan=function(J){this.plan=J},te.prototype.setCurrentRequest=function(J){this.currentRequest=J},te}(),Metadata=function(){function te(J,X){this.key=J,this.value=X}return te.prototype.toString=function(){return this.key===NAMED_TAG?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},te}(),Plan=function(){function te(J,X){this.parentContext=J,this.rootRequest=X}return te}(),LazyServiceIdentifier=function(){function te(J){this._cb=J}return te.prototype.unwrap=function(){return this._cb()},te}(),QueryableString=function(){function te(J){this.str=J}return te.prototype.startsWith=function(J){return this.str.indexOf(J)===0},te.prototype.endsWith=function(J){var X="",re=J.split("").reverse().join("");return X=this.str.split("").reverse().join(""),this.startsWith.call({str:X},re)},te.prototype.contains=function(J){return this.str.indexOf(J)!==-1},te.prototype.equals=function(J){return this.str===J},te.prototype.value=function(){return this.str},te}(),Target=function(){function te(J,X,re,ne){this.id=id(),this.type=J,this.serviceIdentifier=re;var oe=typeof X=="symbol"?getSymbolDescription(X):X;this.name=new QueryableString(oe||""),this.identifier=X,this.metadata=new Array;var de=null;typeof ne=="string"?de=new Metadata(NAMED_TAG,ne):ne instanceof Metadata&&(de=ne),de!==null&&this.metadata.push(de)}return te.prototype.hasTag=function(J){for(var X=0,re=this.metadata;X<re.length;X++){var ne=re[X];if(ne.key===J)return!0}return!1},te.prototype.isArray=function(){return this.hasTag(MULTI_INJECT_TAG)},te.prototype.matchesArray=function(J){return this.matchesTag(MULTI_INJECT_TAG)(J)},te.prototype.isNamed=function(){return this.hasTag(NAMED_TAG)},te.prototype.isTagged=function(){return this.metadata.some(function(J){return NON_CUSTOM_TAG_KEYS.every(function(X){return J.key!==X})})},te.prototype.isOptional=function(){return this.matchesTag(OPTIONAL_TAG)(!0)},te.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter(function(J){return J.key===NAMED_TAG})[0]:null},te.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter(function(J){return NON_CUSTOM_TAG_KEYS.every(function(X){return J.key!==X})}):null},te.prototype.matchesNamedTag=function(J){return this.matchesTag(NAMED_TAG)(J)},te.prototype.matchesTag=function(J){var X=this;return function(re){for(var ne=0,oe=X.metadata;ne<oe.length;ne++){var de=oe[ne];if(de.key===J&&de.value===re)return!0}return!1}},te}(),__spreadArray$2=function(te,J,X){if(X||arguments.length===2)for(var re=0,ne=J.length,oe;re<ne;re++)(oe||!(re in J))&&(oe||(oe=Array.prototype.slice.call(J,0,re)),oe[re]=J[re]);return te.concat(oe||Array.prototype.slice.call(J))};function getDependencies$1(te,J){var X=getFunctionName(J);return getTargets(te,X,J,!1)}function getTargets(te,J,X,re){var ne=te.getConstructorMetadata(X),oe=ne.compilerGeneratedMetadata;if(oe===void 0){var de=MISSING_INJECTABLE_ANNOTATION+" "+J+".";throw new Error(de)}var ce=ne.userGeneratedMetadata,he=Object.keys(ce),ue=X.length===0&&he.length>0,pe=he.length>X.length,fe=ue||pe?he.length:X.length,ge=getConstructorArgsAsTargets(re,J,oe,ce,fe),me=getClassPropsAsTargets(te,X,J),ve=__spreadArray$2(__spreadArray$2([],ge,!0),me,!0);return ve}function getConstructorArgsAsTarget(te,J,X,re,ne){var oe=ne[te.toString()]||[],de=formatTargetMetadata(oe),ce=de.unmanaged!==!0,he=re[te],ue=de.inject||de.multiInject;if(he=ue||he,he instanceof LazyServiceIdentifier&&(he=he.unwrap()),ce){var pe=he===Object,fe=he===Function,ge=he===void 0,me=pe||fe||ge;if(!J&&me){var ve=MISSING_INJECT_ANNOTATION+" argument "+te+" in class "+X+".";throw new Error(ve)}var be=new Target(TargetTypeEnum.ConstructorArgument,de.targetName,he);return be.metadata=oe,be}return null}function getConstructorArgsAsTargets(te,J,X,re,ne){for(var oe=[],de=0;de<ne;de++){var ce=de,he=getConstructorArgsAsTarget(ce,te,J,X,re);he!==null&&oe.push(he)}return oe}function _getServiceIdentifierForProperty(te,J,X,re){var ne=te||J;if(ne===void 0){var oe=MISSING_INJECTABLE_ANNOTATION+" for property "+String(X)+" in class "+re+".";throw new Error(oe)}return ne}function getClassPropsAsTargets(te,J,X){for(var re=te.getPropertiesMetadata(J),ne=[],oe=Object.getOwnPropertySymbols(re),de=Object.keys(re),ce=de.concat(oe),he=0,ue=ce;he<ue.length;he++){var pe=ue[he],fe=re[pe],ge=formatTargetMetadata(fe),me=ge.targetName||pe,ve=_getServiceIdentifierForProperty(ge.inject,ge.multiInject,pe,X),be=new Target(TargetTypeEnum.ClassProperty,me,ve);be.metadata=fe,ne.push(be)}var _e=Object.getPrototypeOf(J.prototype).constructor;if(_e!==Object){var we=getClassPropsAsTargets(te,_e,X);ne=__spreadArray$2(__spreadArray$2([],ne,!0),we,!0)}return ne}function getBaseClassDependencyCount(te,J){var X=Object.getPrototypeOf(J.prototype).constructor;if(X!==Object){var re=getFunctionName(X),ne=getTargets(te,re,X,!0),oe=ne.map(function(he){return he.metadata.filter(function(ue){return ue.key===UNMANAGED_TAG})}),de=[].concat.apply([],oe).length,ce=ne.length-de;return ce>0?ce:getBaseClassDependencyCount(te,X)}else return 0}function formatTargetMetadata(te){var J={};return te.forEach(function(X){J[X.key.toString()]=X.value}),{inject:J[INJECT_TAG],multiInject:J[MULTI_INJECT_TAG],targetName:J[NAME_TAG],unmanaged:J[UNMANAGED_TAG]}}var Request$1=function(){function te(J,X,re,ne,oe){this.id=id(),this.serviceIdentifier=J,this.parentContext=X,this.parentRequest=re,this.target=oe,this.childRequests=[],this.bindings=Array.isArray(ne)?ne:[ne],this.requestScope=re===null?new Map:null}return te.prototype.addChildRequest=function(J,X,re){var ne=new te(J,this.parentContext,this,X,re);return this.childRequests.push(ne),ne},te}();function getBindingDictionary(te){return te._bindingDictionary}function _createTarget(te,J,X,re,ne,oe){var de=te?MULTI_INJECT_TAG:INJECT_TAG,ce=new Metadata(de,X),he=new Target(J,re,X,ce);if(ne!==void 0){var ue=new Metadata(ne,oe);he.metadata.push(ue)}return he}function _getActiveBindings(te,J,X,re,ne){var oe=getBindings(X.container,ne.serviceIdentifier),de=[];return oe.length===BindingCount.NoBindingsAvailable&&X.container.options.autoBindInjectable&&typeof ne.serviceIdentifier=="function"&&te.getConstructorMetadata(ne.serviceIdentifier).compilerGeneratedMetadata&&(X.container.bind(ne.serviceIdentifier).toSelf(),oe=getBindings(X.container,ne.serviceIdentifier)),J?de=oe:de=oe.filter(function(ce){var he=new Request$1(ce.serviceIdentifier,X,re,ce,ne);return ce.constraint(he)}),_validateActiveBindingCount(ne.serviceIdentifier,de,ne,X.container),de}function _validateActiveBindingCount(te,J,X,re){switch(J.length){case BindingCount.NoBindingsAvailable:if(X.isOptional())return J;var ne=getServiceIdentifierAsString(te),oe=NOT_REGISTERED;throw oe+=listMetadataForTarget(ne,X),oe+=listRegisteredBindingsForServiceIdentifier(re,ne,getBindings),new Error(oe);case BindingCount.OnlyOneBindingAvailable:return J;case BindingCount.MultipleBindingsAvailable:default:if(X.isArray())return J;var ne=getServiceIdentifierAsString(te),oe=AMBIGUOUS_MATCH+" "+ne;throw oe+=listRegisteredBindingsForServiceIdentifier(re,ne,getBindings),new Error(oe)}}function _createSubRequests(te,J,X,re,ne,oe){var de,ce;if(ne===null){de=_getActiveBindings(te,J,re,null,oe),ce=new Request$1(X,re,null,de,oe);var he=new Plan(re,ce);re.addPlan(he)}else de=_getActiveBindings(te,J,re,ne,oe),ce=ne.addChildRequest(oe.serviceIdentifier,de,oe);de.forEach(function(ue){var pe=null;if(oe.isArray())pe=ce.addChildRequest(ue.serviceIdentifier,ue,oe);else{if(ue.cache)return;pe=ce}if(ue.type===BindingTypeEnum.Instance&&ue.implementationType!==null){var fe=getDependencies$1(te,ue.implementationType);if(!re.container.options.skipBaseClassChecks){var ge=getBaseClassDependencyCount(te,ue.implementationType);if(fe.length<ge){var me=ARGUMENTS_LENGTH_MISMATCH(getFunctionName(ue.implementationType));throw new Error(me)}}fe.forEach(function(ve){_createSubRequests(te,!1,ve.serviceIdentifier,re,pe,ve)})}})}function getBindings(te,J){var X=[],re=getBindingDictionary(te);return re.hasKey(J)?X=re.get(J):te.parent!==null&&(X=getBindings(te.parent,J)),X}function plan(te,J,X,re,ne,oe,de,ce){ce===void 0&&(ce=!1);var he=new Context(J),ue=_createTarget(X,re,ne,"",oe,de);try{return _createSubRequests(te,ce,ne,he,null,ue),he}catch(pe){throw isStackOverflowExeption(pe)&&circularDependencyToException(he.plan.rootRequest),pe}}function createMockRequest(te,J,X,re){var ne=new Target(TargetTypeEnum.Variable,"",J,new Metadata(X,re)),oe=new Context(te),de=new Request$1(J,oe,null,[],ne);return de}function isPromise(te){var J=typeof te=="object"&&te!==null||typeof te=="function";return J&&typeof te.then=="function"}function isPromiseOrContainsPromise(te){return isPromise(te)?!0:Array.isArray(te)&&te.some(isPromise)}var __awaiter$3=function(te,J,X,re){function ne(oe){return oe instanceof X?oe:new X(function(de){de(oe)})}return new(X||(X=Promise))(function(oe,de){function ce(pe){try{ue(re.next(pe))}catch(fe){de(fe)}}function he(pe){try{ue(re.throw(pe))}catch(fe){de(fe)}}function ue(pe){pe.done?oe(pe.value):ne(pe.value).then(ce,he)}ue((re=re.apply(te,J||[])).next())})},__generator$3=function(te,J){var X={label:0,sent:function(){if(oe[0]&1)throw oe[1];return oe[1]},trys:[],ops:[]},re,ne,oe,de;return de={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function ce(ue){return function(pe){return he([ue,pe])}}function he(ue){if(re)throw new TypeError("Generator is already executing.");for(;X;)try{if(re=1,ne&&(oe=ue[0]&2?ne.return:ue[0]?ne.throw||((oe=ne.return)&&oe.call(ne),0):ne.next)&&!(oe=oe.call(ne,ue[1])).done)return oe;switch(ne=0,oe&&(ue=[ue[0]&2,oe.value]),ue[0]){case 0:case 1:oe=ue;break;case 4:return X.label++,{value:ue[1],done:!1};case 5:X.label++,ne=ue[1],ue=[0];continue;case 7:ue=X.ops.pop(),X.trys.pop();continue;default:if(oe=X.trys,!(oe=oe.length>0&&oe[oe.length-1])&&(ue[0]===6||ue[0]===2)){X=0;continue}if(ue[0]===3&&(!oe||ue[1]>oe[0]&&ue[1]<oe[3])){X.label=ue[1];break}if(ue[0]===6&&X.label<oe[1]){X.label=oe[1],oe=ue;break}if(oe&&X.label<oe[2]){X.label=oe[2],X.ops.push(ue);break}oe[2]&&X.ops.pop(),X.trys.pop();continue}ue=J.call(te,X)}catch(pe){ue=[6,pe],ne=0}finally{re=oe=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},tryGetFromScope=function(te,J){return J.scope===BindingScopeEnum.Singleton&&J.activated?J.cache:J.scope===BindingScopeEnum.Request&&te.has(J.id)?te.get(J.id):null},saveToScope=function(te,J,X){J.scope===BindingScopeEnum.Singleton&&_saveToSingletonScope(J,X),J.scope===BindingScopeEnum.Request&&_saveToRequestScope(te,J,X)},_saveToRequestScope=function(te,J,X){te.has(J.id)||te.set(J.id,X)},_saveToSingletonScope=function(te,J){te.cache=J,te.activated=!0,isPromise(J)&&_saveAsyncResultToSingletonScope(te,J)},_saveAsyncResultToSingletonScope=function(te,J){return __awaiter$3(void 0,void 0,void 0,function(){var X,re;return __generator$3(this,function(ne){switch(ne.label){case 0:return ne.trys.push([0,2,,3]),[4,J];case 1:return X=ne.sent(),te.cache=X,[3,3];case 2:throw re=ne.sent(),te.cache=null,te.activated=!1,re;case 3:return[2]}})})},FactoryType;(function(te){te.DynamicValue="toDynamicValue",te.Factory="toFactory",te.Provider="toProvider"})(FactoryType||(FactoryType={}));var ensureFullyBound=function(te){var J=null;switch(te.type){case BindingTypeEnum.ConstantValue:case BindingTypeEnum.Function:J=te.cache;break;case BindingTypeEnum.Constructor:case BindingTypeEnum.Instance:J=te.implementationType;break;case BindingTypeEnum.DynamicValue:J=te.dynamicValue;break;case BindingTypeEnum.Provider:J=te.provider;break;case BindingTypeEnum.Factory:J=te.factory;break}if(J===null){var X=getServiceIdentifierAsString(te.serviceIdentifier);throw new Error(INVALID_BINDING_TYPE+" "+X)}},getFactoryDetails=function(te){switch(te.type){case BindingTypeEnum.Factory:return{factory:te.factory,factoryType:FactoryType.Factory};case BindingTypeEnum.Provider:return{factory:te.provider,factoryType:FactoryType.Provider};case BindingTypeEnum.DynamicValue:return{factory:te.dynamicValue,factoryType:FactoryType.DynamicValue};default:throw new Error("Unexpected factory type "+te.type)}},__assign$1=function(){return __assign$1=Object.assign||function(te){for(var J,X=1,re=arguments.length;X<re;X++){J=arguments[X];for(var ne in J)Object.prototype.hasOwnProperty.call(J,ne)&&(te[ne]=J[ne])}return te},__assign$1.apply(this,arguments)},__awaiter$2=function(te,J,X,re){function ne(oe){return oe instanceof X?oe:new X(function(de){de(oe)})}return new(X||(X=Promise))(function(oe,de){function ce(pe){try{ue(re.next(pe))}catch(fe){de(fe)}}function he(pe){try{ue(re.throw(pe))}catch(fe){de(fe)}}function ue(pe){pe.done?oe(pe.value):ne(pe.value).then(ce,he)}ue((re=re.apply(te,J||[])).next())})},__generator$2=function(te,J){var X={label:0,sent:function(){if(oe[0]&1)throw oe[1];return oe[1]},trys:[],ops:[]},re,ne,oe,de;return de={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function ce(ue){return function(pe){return he([ue,pe])}}function he(ue){if(re)throw new TypeError("Generator is already executing.");for(;X;)try{if(re=1,ne&&(oe=ue[0]&2?ne.return:ue[0]?ne.throw||((oe=ne.return)&&oe.call(ne),0):ne.next)&&!(oe=oe.call(ne,ue[1])).done)return oe;switch(ne=0,oe&&(ue=[ue[0]&2,oe.value]),ue[0]){case 0:case 1:oe=ue;break;case 4:return X.label++,{value:ue[1],done:!1};case 5:X.label++,ne=ue[1],ue=[0];continue;case 7:ue=X.ops.pop(),X.trys.pop();continue;default:if(oe=X.trys,!(oe=oe.length>0&&oe[oe.length-1])&&(ue[0]===6||ue[0]===2)){X=0;continue}if(ue[0]===3&&(!oe||ue[1]>oe[0]&&ue[1]<oe[3])){X.label=ue[1];break}if(ue[0]===6&&X.label<oe[1]){X.label=oe[1],oe=ue;break}if(oe&&X.label<oe[2]){X.label=oe[2],X.ops.push(ue);break}oe[2]&&X.ops.pop(),X.trys.pop();continue}ue=J.call(te,X)}catch(pe){ue=[6,pe],ne=0}finally{re=oe=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},__spreadArray$1=function(te,J,X){if(X||arguments.length===2)for(var re=0,ne=J.length,oe;re<ne;re++)(oe||!(re in J))&&(oe||(oe=Array.prototype.slice.call(J,0,re)),oe[re]=J[re]);return te.concat(oe||Array.prototype.slice.call(J))};function _resolveRequests(te,J){return te.reduce(function(X,re){var ne=J(re),oe=re.target.type;return oe===TargetTypeEnum.ConstructorArgument?X.constructorInjections.push(ne):(X.propertyRequests.push(re),X.propertyInjections.push(ne)),X.isAsync||(X.isAsync=isPromiseOrContainsPromise(ne)),X},{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}function _createInstance(te,J,X){var re;if(J.length>0){var ne=_resolveRequests(J,X),oe=__assign$1(__assign$1({},ne),{constr:te});ne.isAsync?re=createInstanceWithInjectionsAsync(oe):re=createInstanceWithInjections(oe)}else re=new te;return re}function createInstanceWithInjections(te){var J,X=new((J=te.constr).bind.apply(J,__spreadArray$1([void 0],te.constructorInjections,!1)));return te.propertyRequests.forEach(function(re,ne){var oe=re.target.identifier,de=te.propertyInjections[ne];(!re.target.isOptional()||de!==void 0)&&(X[oe]=de)}),X}function createInstanceWithInjectionsAsync(te){return __awaiter$2(this,void 0,void 0,function(){var J,X;return __generator$2(this,function(re){switch(re.label){case 0:return[4,possiblyWaitInjections(te.constructorInjections)];case 1:return J=re.sent(),[4,possiblyWaitInjections(te.propertyInjections)];case 2:return X=re.sent(),[2,createInstanceWithInjections(__assign$1(__assign$1({},te),{constructorInjections:J,propertyInjections:X}))]}})})}function possiblyWaitInjections(te){return __awaiter$2(this,void 0,void 0,function(){var J,X,re,ne;return __generator$2(this,function(oe){for(J=[],X=0,re=te;X<re.length;X++)ne=re[X],Array.isArray(ne)?J.push(Promise.all(ne)):J.push(ne);return[2,Promise.all(J)]})})}function _getInstanceAfterPostConstruct(te,J){var X=_postConstruct(te,J);return isPromise(X)?X.then(function(){return J}):J}function _postConstruct(te,J){var X,re;if(Reflect.hasMetadata(POST_CONSTRUCT,te)){var ne=Reflect.getMetadata(POST_CONSTRUCT,te);try{return(re=(X=J)[ne.value])===null||re===void 0?void 0:re.call(X)}catch(oe){if(oe instanceof Error)throw new Error(POST_CONSTRUCT_ERROR(te.name,oe.message))}}}function _validateInstanceResolution(te,J){te.scope!==BindingScopeEnum.Singleton&&_throwIfHandlingDeactivation(te,J)}function _throwIfHandlingDeactivation(te,J){var X="Class cannot be instantiated in "+(te.scope===BindingScopeEnum.Request?"request":"transient")+" scope.";if(typeof te.onDeactivation=="function")throw new Error(ON_DEACTIVATION_ERROR(J.name,X));if(Reflect.hasMetadata(PRE_DESTROY,J))throw new Error(PRE_DESTROY_ERROR(J.name,X))}function resolveInstance(te,J,X,re){_validateInstanceResolution(te,J);var ne=_createInstance(J,X,re);return isPromise(ne)?ne.then(function(oe){return _getInstanceAfterPostConstruct(J,oe)}):_getInstanceAfterPostConstruct(J,ne)}var __awaiter$1=function(te,J,X,re){function ne(oe){return oe instanceof X?oe:new X(function(de){de(oe)})}return new(X||(X=Promise))(function(oe,de){function ce(pe){try{ue(re.next(pe))}catch(fe){de(fe)}}function he(pe){try{ue(re.throw(pe))}catch(fe){de(fe)}}function ue(pe){pe.done?oe(pe.value):ne(pe.value).then(ce,he)}ue((re=re.apply(te,J||[])).next())})},__generator$1=function(te,J){var X={label:0,sent:function(){if(oe[0]&1)throw oe[1];return oe[1]},trys:[],ops:[]},re,ne,oe,de;return de={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function ce(ue){return function(pe){return he([ue,pe])}}function he(ue){if(re)throw new TypeError("Generator is already executing.");for(;X;)try{if(re=1,ne&&(oe=ue[0]&2?ne.return:ue[0]?ne.throw||((oe=ne.return)&&oe.call(ne),0):ne.next)&&!(oe=oe.call(ne,ue[1])).done)return oe;switch(ne=0,oe&&(ue=[ue[0]&2,oe.value]),ue[0]){case 0:case 1:oe=ue;break;case 4:return X.label++,{value:ue[1],done:!1};case 5:X.label++,ne=ue[1],ue=[0];continue;case 7:ue=X.ops.pop(),X.trys.pop();continue;default:if(oe=X.trys,!(oe=oe.length>0&&oe[oe.length-1])&&(ue[0]===6||ue[0]===2)){X=0;continue}if(ue[0]===3&&(!oe||ue[1]>oe[0]&&ue[1]<oe[3])){X.label=ue[1];break}if(ue[0]===6&&X.label<oe[1]){X.label=oe[1],oe=ue;break}if(oe&&X.label<oe[2]){X.label=oe[2],X.ops.push(ue);break}oe[2]&&X.ops.pop(),X.trys.pop();continue}ue=J.call(te,X)}catch(pe){ue=[6,pe],ne=0}finally{re=oe=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},_resolveRequest=function(te){return function(J){J.parentContext.setCurrentRequest(J);var X=J.bindings,re=J.childRequests,ne=J.target&&J.target.isArray(),oe=!J.parentRequest||!J.parentRequest.target||!J.target||!J.parentRequest.target.matchesArray(J.target.serviceIdentifier);if(ne&&oe)return re.map(function(ce){var he=_resolveRequest(te);return he(ce)});if(J.target.isOptional()&&X.length===0)return;var de=X[0];return _resolveBinding(te,J,de)}},_resolveFactoryFromBinding=function(te,J){var X=getFactoryDetails(te);return tryAndThrowErrorIfStackOverflow(function(){return X.factory.bind(te)(J)},function(){return new Error(CIRCULAR_DEPENDENCY_IN_FACTORY(X.factoryType,J.currentRequest.serviceIdentifier.toString()))})},_getResolvedFromBinding=function(te,J,X){var re,ne=J.childRequests;switch(ensureFullyBound(X),X.type){case BindingTypeEnum.ConstantValue:case BindingTypeEnum.Function:re=X.cache;break;case BindingTypeEnum.Constructor:re=X.implementationType;break;case BindingTypeEnum.Instance:re=resolveInstance(X,X.implementationType,ne,_resolveRequest(te));break;default:re=_resolveFactoryFromBinding(X,J.parentContext)}return re},_resolveInScope=function(te,J,X){var re=tryGetFromScope(te,J);return re!==null||(re=X(),saveToScope(te,J,re)),re},_resolveBinding=function(te,J,X){return _resolveInScope(te,X,function(){var re=_getResolvedFromBinding(te,J,X);return isPromise(re)?re=re.then(function(ne){return _onActivation(J,X,ne)}):re=_onActivation(J,X,re),re})};function _onActivation(te,J,X){var re=_bindingActivation(te.parentContext,J,X),ne=_getContainersIterator(te.parentContext.container),oe,de=ne.next();do{oe=de.value;var ce=te.parentContext,he=te.serviceIdentifier,ue=_getContainerActivationsForService(oe,he);isPromise(re)?re=_activateContainerAsync(ue,ce,re):re=_activateContainer(ue,ce,re),de=ne.next()}while(de.done!==!0&&!getBindingDictionary(oe).hasKey(te.serviceIdentifier));return re}var _bindingActivation=function(te,J,X){var re;return typeof J.onActivation=="function"?re=J.onActivation(te,X):re=X,re},_activateContainer=function(te,J,X){for(var re=te.next();!re.done;){if(X=re.value(J,X),isPromise(X))return _activateContainerAsync(te,J,X);re=te.next()}return X},_activateContainerAsync=function(te,J,X){return __awaiter$1(void 0,void 0,void 0,function(){var re,ne;return __generator$1(this,function(oe){switch(oe.label){case 0:return[4,X];case 1:re=oe.sent(),ne=te.next(),oe.label=2;case 2:return ne.done?[3,4]:[4,ne.value(J,re)];case 3:return re=oe.sent(),ne=te.next(),[3,2];case 4:return[2,re]}})})},_getContainerActivationsForService=function(te,J){var X=te._activations;return X.hasKey(J)?X.get(J).values():[].values()},_getContainersIterator=function(te){for(var J=[te],X=te.parent;X!==null;)J.push(X),X=X.parent;var re=function(){var oe=J.pop();return oe!==void 0?{done:!1,value:oe}:{done:!0,value:void 0}},ne={next:re};return ne};function resolve(te){var J=_resolveRequest(te.plan.rootRequest.requestScope);return J(te.plan.rootRequest)}var traverseAncerstors=function(te,J){var X=te.parentRequest;return X!==null?J(X)?!0:traverseAncerstors(X,J):!1},taggedConstraint=function(te){return function(J){var X=function(re){return re!==null&&re.target!==null&&re.target.matchesTag(te)(J)};return X.metaData=new Metadata(te,J),X}},namedConstraint=taggedConstraint(NAMED_TAG),typeConstraint=function(te){return function(J){var X=null;if(J!==null)if(X=J.bindings[0],typeof te=="string"){var re=X.serviceIdentifier;return re===te}else{var ne=J.bindings[0].implementationType;return te===ne}return!1}},BindingWhenSyntax=function(){function te(J){this._binding=J}return te.prototype.when=function(J){return this._binding.constraint=J,new BindingOnSyntax(this._binding)},te.prototype.whenTargetNamed=function(J){return this._binding.constraint=namedConstraint(J),new BindingOnSyntax(this._binding)},te.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(J){if(J===null)return!1;var X=J.target!==null&&!J.target.isNamed()&&!J.target.isTagged();return X},new BindingOnSyntax(this._binding)},te.prototype.whenTargetTagged=function(J,X){return this._binding.constraint=taggedConstraint(J)(X),new BindingOnSyntax(this._binding)},te.prototype.whenInjectedInto=function(J){return this._binding.constraint=function(X){return X!==null&&typeConstraint(J)(X.parentRequest)},new BindingOnSyntax(this._binding)},te.prototype.whenParentNamed=function(J){return this._binding.constraint=function(X){return X!==null&&namedConstraint(J)(X.parentRequest)},new BindingOnSyntax(this._binding)},te.prototype.whenParentTagged=function(J,X){return this._binding.constraint=function(re){return re!==null&&taggedConstraint(J)(X)(re.parentRequest)},new BindingOnSyntax(this._binding)},te.prototype.whenAnyAncestorIs=function(J){return this._binding.constraint=function(X){return X!==null&&traverseAncerstors(X,typeConstraint(J))},new BindingOnSyntax(this._binding)},te.prototype.whenNoAncestorIs=function(J){return this._binding.constraint=function(X){return X!==null&&!traverseAncerstors(X,typeConstraint(J))},new BindingOnSyntax(this._binding)},te.prototype.whenAnyAncestorNamed=function(J){return this._binding.constraint=function(X){return X!==null&&traverseAncerstors(X,namedConstraint(J))},new BindingOnSyntax(this._binding)},te.prototype.whenNoAncestorNamed=function(J){return this._binding.constraint=function(X){return X!==null&&!traverseAncerstors(X,namedConstraint(J))},new BindingOnSyntax(this._binding)},te.prototype.whenAnyAncestorTagged=function(J,X){return this._binding.constraint=function(re){return re!==null&&traverseAncerstors(re,taggedConstraint(J)(X))},new BindingOnSyntax(this._binding)},te.prototype.whenNoAncestorTagged=function(J,X){return this._binding.constraint=function(re){return re!==null&&!traverseAncerstors(re,taggedConstraint(J)(X))},new BindingOnSyntax(this._binding)},te.prototype.whenAnyAncestorMatches=function(J){return this._binding.constraint=function(X){return X!==null&&traverseAncerstors(X,J)},new BindingOnSyntax(this._binding)},te.prototype.whenNoAncestorMatches=function(J){return this._binding.constraint=function(X){return X!==null&&!traverseAncerstors(X,J)},new BindingOnSyntax(this._binding)},te}(),BindingOnSyntax=function(){function te(J){this._binding=J}return te.prototype.onActivation=function(J){return this._binding.onActivation=J,new BindingWhenSyntax(this._binding)},te.prototype.onDeactivation=function(J){return this._binding.onDeactivation=J,new BindingWhenSyntax(this._binding)},te}(),BindingWhenOnSyntax=function(){function te(J){this._binding=J,this._bindingWhenSyntax=new BindingWhenSyntax(this._binding),this._bindingOnSyntax=new BindingOnSyntax(this._binding)}return te.prototype.when=function(J){return this._bindingWhenSyntax.when(J)},te.prototype.whenTargetNamed=function(J){return this._bindingWhenSyntax.whenTargetNamed(J)},te.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},te.prototype.whenTargetTagged=function(J,X){return this._bindingWhenSyntax.whenTargetTagged(J,X)},te.prototype.whenInjectedInto=function(J){return this._bindingWhenSyntax.whenInjectedInto(J)},te.prototype.whenParentNamed=function(J){return this._bindingWhenSyntax.whenParentNamed(J)},te.prototype.whenParentTagged=function(J,X){return this._bindingWhenSyntax.whenParentTagged(J,X)},te.prototype.whenAnyAncestorIs=function(J){return this._bindingWhenSyntax.whenAnyAncestorIs(J)},te.prototype.whenNoAncestorIs=function(J){return this._bindingWhenSyntax.whenNoAncestorIs(J)},te.prototype.whenAnyAncestorNamed=function(J){return this._bindingWhenSyntax.whenAnyAncestorNamed(J)},te.prototype.whenAnyAncestorTagged=function(J,X){return this._bindingWhenSyntax.whenAnyAncestorTagged(J,X)},te.prototype.whenNoAncestorNamed=function(J){return this._bindingWhenSyntax.whenNoAncestorNamed(J)},te.prototype.whenNoAncestorTagged=function(J,X){return this._bindingWhenSyntax.whenNoAncestorTagged(J,X)},te.prototype.whenAnyAncestorMatches=function(J){return this._bindingWhenSyntax.whenAnyAncestorMatches(J)},te.prototype.whenNoAncestorMatches=function(J){return this._bindingWhenSyntax.whenNoAncestorMatches(J)},te.prototype.onActivation=function(J){return this._bindingOnSyntax.onActivation(J)},te.prototype.onDeactivation=function(J){return this._bindingOnSyntax.onDeactivation(J)},te}(),BindingInSyntax=function(){function te(J){this._binding=J}return te.prototype.inRequestScope=function(){return this._binding.scope=BindingScopeEnum.Request,new BindingWhenOnSyntax(this._binding)},te.prototype.inSingletonScope=function(){return this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},te.prototype.inTransientScope=function(){return this._binding.scope=BindingScopeEnum.Transient,new BindingWhenOnSyntax(this._binding)},te}(),BindingInWhenOnSyntax=function(){function te(J){this._binding=J,this._bindingWhenSyntax=new BindingWhenSyntax(this._binding),this._bindingOnSyntax=new BindingOnSyntax(this._binding),this._bindingInSyntax=new BindingInSyntax(J)}return te.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},te.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},te.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},te.prototype.when=function(J){return this._bindingWhenSyntax.when(J)},te.prototype.whenTargetNamed=function(J){return this._bindingWhenSyntax.whenTargetNamed(J)},te.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},te.prototype.whenTargetTagged=function(J,X){return this._bindingWhenSyntax.whenTargetTagged(J,X)},te.prototype.whenInjectedInto=function(J){return this._bindingWhenSyntax.whenInjectedInto(J)},te.prototype.whenParentNamed=function(J){return this._bindingWhenSyntax.whenParentNamed(J)},te.prototype.whenParentTagged=function(J,X){return this._bindingWhenSyntax.whenParentTagged(J,X)},te.prototype.whenAnyAncestorIs=function(J){return this._bindingWhenSyntax.whenAnyAncestorIs(J)},te.prototype.whenNoAncestorIs=function(J){return this._bindingWhenSyntax.whenNoAncestorIs(J)},te.prototype.whenAnyAncestorNamed=function(J){return this._bindingWhenSyntax.whenAnyAncestorNamed(J)},te.prototype.whenAnyAncestorTagged=function(J,X){return this._bindingWhenSyntax.whenAnyAncestorTagged(J,X)},te.prototype.whenNoAncestorNamed=function(J){return this._bindingWhenSyntax.whenNoAncestorNamed(J)},te.prototype.whenNoAncestorTagged=function(J,X){return this._bindingWhenSyntax.whenNoAncestorTagged(J,X)},te.prototype.whenAnyAncestorMatches=function(J){return this._bindingWhenSyntax.whenAnyAncestorMatches(J)},te.prototype.whenNoAncestorMatches=function(J){return this._bindingWhenSyntax.whenNoAncestorMatches(J)},te.prototype.onActivation=function(J){return this._bindingOnSyntax.onActivation(J)},te.prototype.onDeactivation=function(J){return this._bindingOnSyntax.onDeactivation(J)},te}(),BindingToSyntax=function(){function te(J){this._binding=J}return te.prototype.to=function(J){return this._binding.type=BindingTypeEnum.Instance,this._binding.implementationType=J,new BindingInWhenOnSyntax(this._binding)},te.prototype.toSelf=function(){if(typeof this._binding.serviceIdentifier!="function")throw new Error(""+INVALID_TO_SELF_VALUE);var J=this._binding.serviceIdentifier;return this.to(J)},te.prototype.toConstantValue=function(J){return this._binding.type=BindingTypeEnum.ConstantValue,this._binding.cache=J,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},te.prototype.toDynamicValue=function(J){return this._binding.type=BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=J,this._binding.implementationType=null,new BindingInWhenOnSyntax(this._binding)},te.prototype.toConstructor=function(J){return this._binding.type=BindingTypeEnum.Constructor,this._binding.implementationType=J,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},te.prototype.toFactory=function(J){return this._binding.type=BindingTypeEnum.Factory,this._binding.factory=J,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},te.prototype.toFunction=function(J){if(typeof J!="function")throw new Error(INVALID_FUNCTION_BINDING);var X=this.toConstantValue(J);return this._binding.type=BindingTypeEnum.Function,this._binding.scope=BindingScopeEnum.Singleton,X},te.prototype.toAutoFactory=function(J){return this._binding.type=BindingTypeEnum.Factory,this._binding.factory=function(X){var re=function(){return X.container.get(J)};return re},this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},te.prototype.toAutoNamedFactory=function(J){return this._binding.type=BindingTypeEnum.Factory,this._binding.factory=function(X){return function(re){return X.container.getNamed(J,re)}},new BindingWhenOnSyntax(this._binding)},te.prototype.toProvider=function(J){return this._binding.type=BindingTypeEnum.Provider,this._binding.provider=J,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},te.prototype.toService=function(J){this.toDynamicValue(function(X){return X.container.get(J)})},te}(),ContainerSnapshot=function(){function te(){}return te.of=function(J,X,re,ne,oe){var de=new te;return de.bindings=J,de.middleware=X,de.deactivations=ne,de.activations=re,de.moduleActivationStore=oe,de},te}();function isClonable(te){return typeof te=="object"&&te!==null&&"clone"in te&&typeof te.clone=="function"}var Lookup=function(){function te(){this._map=new Map}return te.prototype.getMap=function(){return this._map},te.prototype.add=function(J,X){if(J==null)throw new Error(NULL_ARGUMENT);if(X==null)throw new Error(NULL_ARGUMENT);var re=this._map.get(J);re!==void 0?re.push(X):this._map.set(J,[X])},te.prototype.get=function(J){if(J==null)throw new Error(NULL_ARGUMENT);var X=this._map.get(J);if(X!==void 0)return X;throw new Error(KEY_NOT_FOUND)},te.prototype.remove=function(J){if(J==null)throw new Error(NULL_ARGUMENT);if(!this._map.delete(J))throw new Error(KEY_NOT_FOUND)},te.prototype.removeIntersection=function(J){var X=this;this.traverse(function(re,ne){var oe=J.hasKey(re)?J.get(re):void 0;if(oe!==void 0){var de=ne.filter(function(ce){return!oe.some(function(he){return ce===he})});X._setValue(re,de)}})},te.prototype.removeByCondition=function(J){var X=this,re=[];return this._map.forEach(function(ne,oe){for(var de=[],ce=0,he=ne;ce<he.length;ce++){var ue=he[ce],pe=J(ue);pe?re.push(ue):de.push(ue)}X._setValue(oe,de)}),re},te.prototype.hasKey=function(J){if(J==null)throw new Error(NULL_ARGUMENT);return this._map.has(J)},te.prototype.clone=function(){var J=new te;return this._map.forEach(function(X,re){X.forEach(function(ne){return J.add(re,isClonable(ne)?ne.clone():ne)})}),J},te.prototype.traverse=function(J){this._map.forEach(function(X,re){J(re,X)})},te.prototype._setValue=function(J,X){X.length>0?this._map.set(J,X):this._map.delete(J)},te}(),ModuleActivationStore=function(){function te(){this._map=new Map}return te.prototype.remove=function(J){if(this._map.has(J)){var X=this._map.get(J);return this._map.delete(J),X}return this._getEmptyHandlersStore()},te.prototype.addDeactivation=function(J,X,re){this._getModuleActivationHandlers(J).onDeactivations.add(X,re)},te.prototype.addActivation=function(J,X,re){this._getModuleActivationHandlers(J).onActivations.add(X,re)},te.prototype.clone=function(){var J=new te;return this._map.forEach(function(X,re){J._map.set(re,{onActivations:X.onActivations.clone(),onDeactivations:X.onDeactivations.clone()})}),J},te.prototype._getModuleActivationHandlers=function(J){var X=this._map.get(J);return X===void 0&&(X=this._getEmptyHandlersStore(),this._map.set(J,X)),X},te.prototype._getEmptyHandlersStore=function(){var J={onActivations:new Lookup,onDeactivations:new Lookup};return J},te}(),__assign=function(){return __assign=Object.assign||function(te){for(var J,X=1,re=arguments.length;X<re;X++){J=arguments[X];for(var ne in J)Object.prototype.hasOwnProperty.call(J,ne)&&(te[ne]=J[ne])}return te},__assign.apply(this,arguments)},__awaiter=function(te,J,X,re){function ne(oe){return oe instanceof X?oe:new X(function(de){de(oe)})}return new(X||(X=Promise))(function(oe,de){function ce(pe){try{ue(re.next(pe))}catch(fe){de(fe)}}function he(pe){try{ue(re.throw(pe))}catch(fe){de(fe)}}function ue(pe){pe.done?oe(pe.value):ne(pe.value).then(ce,he)}ue((re=re.apply(te,J||[])).next())})},__generator=function(te,J){var X={label:0,sent:function(){if(oe[0]&1)throw oe[1];return oe[1]},trys:[],ops:[]},re,ne,oe,de;return de={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function ce(ue){return function(pe){return he([ue,pe])}}function he(ue){if(re)throw new TypeError("Generator is already executing.");for(;X;)try{if(re=1,ne&&(oe=ue[0]&2?ne.return:ue[0]?ne.throw||((oe=ne.return)&&oe.call(ne),0):ne.next)&&!(oe=oe.call(ne,ue[1])).done)return oe;switch(ne=0,oe&&(ue=[ue[0]&2,oe.value]),ue[0]){case 0:case 1:oe=ue;break;case 4:return X.label++,{value:ue[1],done:!1};case 5:X.label++,ne=ue[1],ue=[0];continue;case 7:ue=X.ops.pop(),X.trys.pop();continue;default:if(oe=X.trys,!(oe=oe.length>0&&oe[oe.length-1])&&(ue[0]===6||ue[0]===2)){X=0;continue}if(ue[0]===3&&(!oe||ue[1]>oe[0]&&ue[1]<oe[3])){X.label=ue[1];break}if(ue[0]===6&&X.label<oe[1]){X.label=oe[1],oe=ue;break}if(oe&&X.label<oe[2]){X.label=oe[2],X.ops.push(ue);break}oe[2]&&X.ops.pop(),X.trys.pop();continue}ue=J.call(te,X)}catch(pe){ue=[6,pe],ne=0}finally{re=oe=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},__spreadArray=function(te,J,X){if(X||arguments.length===2)for(var re=0,ne=J.length,oe;re<ne;re++)(oe||!(re in J))&&(oe||(oe=Array.prototype.slice.call(J,0,re)),oe[re]=J[re]);return te.concat(oe||Array.prototype.slice.call(J))},Container=function(){function te(J){var X=J||{};if(typeof X!="object")throw new Error(""+CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(X.defaultScope===void 0)X.defaultScope=BindingScopeEnum.Transient;else if(X.defaultScope!==BindingScopeEnum.Singleton&&X.defaultScope!==BindingScopeEnum.Transient&&X.defaultScope!==BindingScopeEnum.Request)throw new Error(""+CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(X.autoBindInjectable===void 0)X.autoBindInjectable=!1;else if(typeof X.autoBindInjectable!="boolean")throw new Error(""+CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(X.skipBaseClassChecks===void 0)X.skipBaseClassChecks=!1;else if(typeof X.skipBaseClassChecks!="boolean")throw new Error(""+CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:X.autoBindInjectable,defaultScope:X.defaultScope,skipBaseClassChecks:X.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 te.merge=function(J,X){for(var re=[],ne=2;ne<arguments.length;ne++)re[ne-2]=arguments[ne];var oe=new te,de=__spreadArray([J,X],re,!0).map(function(ue){return getBindingDictionary(ue)}),ce=getBindingDictionary(oe);function he(ue,pe){ue.traverse(function(fe,ge){ge.forEach(function(me){pe.add(me.serviceIdentifier,me.clone())})})}return de.forEach(function(ue){he(ue,ce)}),oe},te.prototype.load=function(){for(var J=[],X=0;X<arguments.length;X++)J[X]=arguments[X];for(var re=this._getContainerModuleHelpersFactory(),ne=0,oe=J;ne<oe.length;ne++){var de=oe[ne],ce=re(de.id);de.registry(ce.bindFunction,ce.unbindFunction,ce.isboundFunction,ce.rebindFunction,ce.unbindAsyncFunction,ce.onActivationFunction,ce.onDeactivationFunction)}},te.prototype.loadAsync=function(){for(var J=[],X=0;X<arguments.length;X++)J[X]=arguments[X];return __awaiter(this,void 0,void 0,function(){var re,ne,oe,de,ce;return __generator(this,function(he){switch(he.label){case 0:re=this._getContainerModuleHelpersFactory(),ne=0,oe=J,he.label=1;case 1:return ne<oe.length?(de=oe[ne],ce=re(de.id),[4,de.registry(ce.bindFunction,ce.unbindFunction,ce.isboundFunction,ce.rebindFunction,ce.unbindAsyncFunction,ce.onActivationFunction,ce.onDeactivationFunction)]):[3,4];case 2:he.sent(),he.label=3;case 3:return ne++,[3,1];case 4:return[2]}})})},te.prototype.unload=function(){for(var J=this,X=[],re=0;re<arguments.length;re++)X[re]=arguments[re];X.forEach(function(ne){var oe=J._removeModuleBindings(ne.id);J._deactivateSingletons(oe),J._removeModuleHandlers(ne.id)})},te.prototype.unloadAsync=function(){for(var J=[],X=0;X<arguments.length;X++)J[X]=arguments[X];return __awaiter(this,void 0,void 0,function(){var re,ne,oe,de;return __generator(this,function(ce){switch(ce.label){case 0:re=0,ne=J,ce.label=1;case 1:return re<ne.length?(oe=ne[re],de=this._removeModuleBindings(oe.id),[4,this._deactivateSingletonsAsync(de)]):[3,4];case 2:ce.sent(),this._removeModuleHandlers(oe.id),ce.label=3;case 3:return re++,[3,1];case 4:return[2]}})})},te.prototype.bind=function(J){var X=this.options.defaultScope||BindingScopeEnum.Transient,re=new Binding(J,X);return this._bindingDictionary.add(J,re),new BindingToSyntax(re)},te.prototype.rebind=function(J){return this.unbind(J),this.bind(J)},te.prototype.rebindAsync=function(J){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(X){switch(X.label){case 0:return[4,this.unbindAsync(J)];case 1:return X.sent(),[2,this.bind(J)]}})})},te.prototype.unbind=function(J){if(this._bindingDictionary.hasKey(J)){var X=this._bindingDictionary.get(J);this._deactivateSingletons(X)}this._removeServiceFromDictionary(J)},te.prototype.unbindAsync=function(J){return __awaiter(this,void 0,void 0,function(){var X;return __generator(this,function(re){switch(re.label){case 0:return this._bindingDictionary.hasKey(J)?(X=this._bindingDictionary.get(J),[4,this._deactivateSingletonsAsync(X)]):[3,2];case 1:re.sent(),re.label=2;case 2:return this._removeServiceFromDictionary(J),[2]}})})},te.prototype.unbindAll=function(){var J=this;this._bindingDictionary.traverse(function(X,re){J._deactivateSingletons(re)}),this._bindingDictionary=new Lookup},te.prototype.unbindAllAsync=function(){return __awaiter(this,void 0,void 0,function(){var J,X=this;return __generator(this,function(re){switch(re.label){case 0:return J=[],this._bindingDictionary.traverse(function(ne,oe){J.push(X._deactivateSingletonsAsync(oe))}),[4,Promise.all(J)];case 1:return re.sent(),this._bindingDictionary=new Lookup,[2]}})})},te.prototype.onActivation=function(J,X){this._activations.add(J,X)},te.prototype.onDeactivation=function(J,X){this._deactivations.add(J,X)},te.prototype.isBound=function(J){var X=this._bindingDictionary.hasKey(J);return!X&&this.parent&&(X=this.parent.isBound(J)),X},te.prototype.isCurrentBound=function(J){return this._bindingDictionary.hasKey(J)},te.prototype.isBoundNamed=function(J,X){return this.isBoundTagged(J,NAMED_TAG,X)},te.prototype.isBoundTagged=function(J,X,re){var ne=!1;if(this._bindingDictionary.hasKey(J)){var oe=this._bindingDictionary.get(J),de=createMockRequest(this,J,X,re);ne=oe.some(function(ce){return ce.constraint(de)})}return!ne&&this.parent&&(ne=this.parent.isBoundTagged(J,X,re)),ne},te.prototype.snapshot=function(){this._snapshots.push(ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))},te.prototype.restore=function(){var J=this._snapshots.pop();if(J===void 0)throw new Error(NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=J.bindings,this._activations=J.activations,this._deactivations=J.deactivations,this._middleware=J.middleware,this._moduleActivationStore=J.moduleActivationStore},te.prototype.createChild=function(J){var X=new te(J||this.options);return X.parent=this,X},te.prototype.applyMiddleware=function(){for(var J=[],X=0;X<arguments.length;X++)J[X]=arguments[X];var re=this._middleware?this._middleware:this._planAndResolve();this._middleware=J.reduce(function(ne,oe){return oe(ne)},re)},te.prototype.applyCustomMetadataReader=function(J){this._metadataReader=J},te.prototype.get=function(J){var X=this._getNotAllArgs(J,!1);return this._getButThrowIfAsync(X)},te.prototype.getAsync=function(J){return __awaiter(this,void 0,void 0,function(){var X;return __generator(this,function(re){return X=this._getNotAllArgs(J,!1),[2,this._get(X)]})})},te.prototype.getTagged=function(J,X,re){var ne=this._getNotAllArgs(J,!1,X,re);return this._getButThrowIfAsync(ne)},te.prototype.getTaggedAsync=function(J,X,re){return __awaiter(this,void 0,void 0,function(){var ne;return __generator(this,function(oe){return ne=this._getNotAllArgs(J,!1,X,re),[2,this._get(ne)]})})},te.prototype.getNamed=function(J,X){return this.getTagged(J,NAMED_TAG,X)},te.prototype.getNamedAsync=function(J,X){return this.getTaggedAsync(J,NAMED_TAG,X)},te.prototype.getAll=function(J){var X=this._getAllArgs(J);return this._getButThrowIfAsync(X)},te.prototype.getAllAsync=function(J){var X=this._getAllArgs(J);return this._getAll(X)},te.prototype.getAllTagged=function(J,X,re){var ne=this._getNotAllArgs(J,!0,X,re);return this._getButThrowIfAsync(ne)},te.prototype.getAllTaggedAsync=function(J,X,re){var ne=this._getNotAllArgs(J,!0,X,re);return this._getAll(ne)},te.prototype.getAllNamed=function(J,X){return this.getAllTagged(J,NAMED_TAG,X)},te.prototype.getAllNamedAsync=function(J,X){return this.getAllTaggedAsync(J,NAMED_TAG,X)},te.prototype.resolve=function(J){var X=this.isBound(J);X||this.bind(J).toSelf();var re=this.get(J);return X||this.unbind(J),re},te.prototype._preDestroy=function(J,X){var re,ne;if(Reflect.hasMetadata(PRE_DESTROY,J)){var oe=Reflect.getMetadata(PRE_DESTROY,J);return(ne=(re=X)[oe.value])===null||ne===void 0?void 0:ne.call(re)}},te.prototype._removeModuleHandlers=function(J){var X=this._moduleActivationStore.remove(J);this._activations.removeIntersection(X.onActivations),this._deactivations.removeIntersection(X.onDeactivations)},te.prototype._removeModuleBindings=function(J){return this._bindingDictionary.removeByCondition(function(X){return X.moduleId===J})},te.prototype._deactivate=function(J,X){var re=this,ne=Object.getPrototypeOf(X).constructor;try{if(this._deactivations.hasKey(J.serviceIdentifier)){var oe=this._deactivateContainer(X,this._deactivations.get(J.serviceIdentifier).values());if(isPromise(oe))return this._handleDeactivationError(oe.then(function(){return re._propagateContainerDeactivationThenBindingAndPreDestroyAsync(J,X,ne)}),ne)}var de=this._propagateContainerDeactivationThenBindingAndPreDestroy(J,X,ne);if(isPromise(de))return this._handleDeactivationError(de,ne)}catch(ce){if(ce instanceof Error)throw new Error(ON_DEACTIVATION_ERROR(ne.name,ce.message))}},te.prototype._handleDeactivationError=function(J,X){return __awaiter(this,void 0,void 0,function(){var re;return __generator(this,function(ne){switch(ne.label){case 0:return ne.trys.push([0,2,,3]),[4,J];case 1:return ne.sent(),[3,3];case 2:if(re=ne.sent(),re instanceof Error)throw new Error(ON_DEACTIVATION_ERROR(X.name,re.message));return[3,3];case 3:return[2]}})})},te.prototype._deactivateContainer=function(J,X){for(var re=this,ne=X.next();ne.value;){var oe=ne.value(J);if(isPromise(oe))return oe.then(function(){return re._deactivateContainerAsync(J,X)});ne=X.next()}},te.prototype._deactivateContainerAsync=function(J,X){return __awaiter(this,void 0,void 0,function(){var re;return __generator(this,function(ne){switch(ne.label){case 0:re=X.next(),ne.label=1;case 1:return re.value?[4,re.value(J)]:[3,3];case 2:return ne.sent(),re=X.next(),[3,1];case 3:return[2]}})})},te.prototype._getContainerModuleHelpersFactory=function(){var J=this,X=function(pe,fe){pe._binding.moduleId=fe},re=function(pe){return function(fe){var ge=J.bind(fe);return X(ge,pe),ge}},ne=function(){return function(pe){return J.unbind(pe)}},oe=function(){return function(pe){return J.unbindAsync(pe)}},de=function(){return function(pe){return J.isBound(pe)}},ce=function(pe){return function(fe){var ge=J.rebind(fe);return X(ge,pe),ge}},he=function(pe){return function(fe,ge){J._moduleActivationStore.addActivation(pe,fe,ge),J.onActivation(fe,ge)}},ue=function(pe){return function(fe,ge){J._moduleActivationStore.addDeactivation(pe,fe,ge),J.onDeactivation(fe,ge)}};return function(pe){return{bindFunction:re(pe),isboundFunction:de(),onActivationFunction:he(pe),onDeactivationFunction:ue(pe),rebindFunction:ce(pe),unbindFunction:ne(),unbindAsyncFunction:oe()}}},te.prototype._getAll=function(J){return Promise.all(this._get(J))},te.prototype._get=function(J){var X=__assign(__assign({},J),{contextInterceptor:function(ne){return ne},targetType:TargetTypeEnum.Variable});if(this._middleware){var re=this._middleware(X);if(re==null)throw new Error(INVALID_MIDDLEWARE_RETURN);return re}return this._planAndResolve()(X)},te.prototype._getButThrowIfAsync=function(J){var X=this._get(J);if(isPromiseOrContainsPromise(X))throw new Error(LAZY_IN_SYNC(J.serviceIdentifier));return X},te.prototype._getAllArgs=function(J){var X={avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:J};return X},te.prototype._getNotAllArgs=function(J,X,re,ne){var oe={avoidConstraints:!1,isMultiInject:X,serviceIdentifier:J,key:re,value:ne};return oe},te.prototype._planAndResolve=function(){var J=this;return function(X){var re=plan(J._metadataReader,J,X.isMultiInject,X.targetType,X.serviceIdentifier,X.key,X.value,X.avoidConstraints);re=X.contextInterceptor(re);var ne=resolve(re);return ne}},te.prototype._deactivateIfSingleton=function(J){var X=this;if(J.activated)return isPromise(J.cache)?J.cache.then(function(re){return X._deactivate(J,re)}):this._deactivate(J,J.cache)},te.prototype._deactivateSingletons=function(J){for(var X=0,re=J;X<re.length;X++){var ne=re[X],oe=this._deactivateIfSingleton(ne);if(isPromise(oe))throw new Error(ASYNC_UNBIND_REQUIRED)}},te.prototype._deactivateSingletonsAsync=function(J){return __awaiter(this,void 0,void 0,function(){var X=this;return __generator(this,function(re){switch(re.label){case 0:return[4,Promise.all(J.map(function(ne){return X._deactivateIfSingleton(ne)}))];case 1:return re.sent(),[2]}})})},te.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(J,X,re){return this.parent?this._deactivate.bind(this.parent)(J,X):this._bindingDeactivationAndPreDestroy(J,X,re)},te.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(J,X,re){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(ne){switch(ne.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(J,X)]:[3,2];case 1:return ne.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(J,X,re)];case 3:ne.sent(),ne.label=4;case 4:return[2]}})})},te.prototype._removeServiceFromDictionary=function(J){try{this._bindingDictionary.remove(J)}catch{throw new Error(CANNOT_UNBIND+" "+getServiceIdentifierAsString(J))}},te.prototype._bindingDeactivationAndPreDestroy=function(J,X,re){var ne=this;if(typeof J.onDeactivation=="function"){var oe=J.onDeactivation(X);if(isPromise(oe))return oe.then(function(){return ne._preDestroy(re,X)})}return this._preDestroy(re,X)},te.prototype._bindingDeactivationAndPreDestroyAsync=function(J,X,re){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(ne){switch(ne.label){case 0:return typeof J.onDeactivation!="function"?[3,2]:[4,J.onDeactivation(X)];case 1:ne.sent(),ne.label=2;case 2:return[4,this._preDestroy(re,X)];case 3:return ne.sent(),[2]}})})},te}();function getFirstArrayDuplicate(te){for(var J=new Set,X=0,re=te;X<re.length;X++){var ne=re[X];if(J.has(ne))return ne;J.add(ne)}}function targetIsConstructorFunction(te){return te.prototype!==void 0}function _throwIfMethodParameter(te){if(te!==void 0)throw new Error(INVALID_DECORATOR_OPERATION)}function tagParameter(te,J,X,re){_throwIfMethodParameter(J),_tagParameterOrProperty(TAGGED,te,X.toString(),re)}function tagProperty(te,J,X){if(targetIsConstructorFunction(te))throw new Error(INVALID_DECORATOR_OPERATION);_tagParameterOrProperty(TAGGED_PROP,te.constructor,J,X)}function _ensureNoMetadataKeyDuplicates(te){var J=[];if(Array.isArray(te)){J=te;var X=getFirstArrayDuplicate(J.map(function(re){return re.key}));if(X!==void 0)throw new Error(DUPLICATED_METADATA+" "+X.toString())}else J=[te];return J}function _tagParameterOrProperty(te,J,X,re){var ne=_ensureNoMetadataKeyDuplicates(re),oe={};Reflect.hasOwnMetadata(te,J)&&(oe=Reflect.getMetadata(te,J));var de=oe[X];if(de===void 0)de=[];else for(var ce=function(fe){if(ne.some(function(ge){return ge.key===fe.key}))throw new Error(DUPLICATED_METADATA+" "+fe.key.toString())},he=0,ue=de;he<ue.length;he++){var pe=ue[he];ce(pe)}de.push.apply(de,ne),oe[X]=de,Reflect.defineMetadata(te,oe,J)}function createTaggedDecorator(te){return function(J,X,re){typeof re=="number"?tagParameter(J,X,re,te):tagProperty(J,X,te)}}function injectable(){return function(te){if(Reflect.hasOwnMetadata(PARAM_TYPES,te))throw new Error(DUPLICATED_INJECTABLE_DECORATOR);var J=Reflect.getMetadata(DESIGN_PARAM_TYPES,te)||[];return Reflect.defineMetadata(PARAM_TYPES,J,te),te}}function injectBase(te){return function(J){return function(X,re,ne){if(J===void 0){var oe=typeof X=="function"?X.name:X.constructor.name;throw new Error(UNDEFINED_INJECT_ANNOTATION(oe))}return createTaggedDecorator(new Metadata(te,J))(X,re,ne)}}}var inject=injectBase(INJECT_TAG);const registerRequest$1=(te,J)=>(X,re)=>{J.bind(re).to(re).inTransientScope(),injectable()(re);const ne=te.broker.registerRequest(X,oe=>J.get(re).handle(oe));return{dispose:()=>{J.isBound(re)&&J.unbind(re),ne.dispose()}}},brokerExtensions=(te,J)=>({registerRequest:registerRequest$1(te,J)});function rand(te){const J=Math.random()*16|0;return(te==="x"?J:J&3|8).toString(16)}function generateId(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,rand)}const mapArrayToLabelValue=(te,J,X)=>te.map(re=>({label:re[J],value:re[X]}));function createConnectToStoreDecorator(te){return function(X){return(re,ne)=>{Object.defineProperty(re,ne,{get(){return this[`__${ne}`]},set(ce){this[`__${ne}`]!==ce&&(this[`__${ne}`]=Array.isArray(ce)?[...ce]:typeof ce=="object"&&ce!==null?{...ce}:ce,this.requestUpdate(ne))},configurable:!0,enumerable:!0});const oe=re.connectedCallback,de=re.disconnectedCallback;re.connectedCallback=function(){oe&&oe.call(this),this[ne]=X(te.getState()),this[`__unsubscribe__${ne}`]=te.subscribe(()=>{const ce=X(te.getState());this[ne]=Array.isArray(ce)?[...ce]:typeof ce=="object"&&ce!==null?{...ce}:ce})},re.disconnectedCallback=function(){de&&de.call(this),this[`__unsubscribe__${ne}`]&&this[`__unsubscribe__${ne}`]()}}}}function createConnectedProperty(te){return(J,X={})=>{const re=createConnectToStoreDecorator(te);return(ne,oe)=>{n$x(X)(ne,oe),re(J)(ne,oe)}}}const pdfViewerId="pdf-viewer";let shellLocaleManager;const useLocalization=async te=>{L$3("ca"),shellLocaleManager=await te.createLocaleManager(locales$1)},translate$1=te=>shellLocaleManager?shellLocaleManager.translate(te):te,locales$1={ca:{[primariaShellId]:{title:"Estació de Treball Clínica",actions:{create:"Crear",toggleMenuClose:"Tancar menú",toggleMenuOpen:"Expandir menú",askExit:"Atenció, vols sortir igualment?",finalizeVisit:"Finalitzar visita"},clinicalMonitoring:{title:"Seguiment clínic"},errors:{session:"Hi ha hagut un error amb la sessió. Siusplau, tanca i torna a obrir l'aplicació.",invalidPatient:"El pacient actual no és vàlid. Siusplau, tanca i torna a obrir l'aplicació."},header:{workCenter:"Centre treball",role:"Rol",speciality:"Àmbit treball"},busyManager:{title:"Tasques pendents a desar:"},pdfManager:{uploaded:"Document disponible al visor de resultats",alreadyUploaded:"Ja s'ha carregat un document amb aquest nom",navButtonLabel:"Visor PDF",missingData:"Es necesita un document o URL per enviar al visor de resultats",duplicatedSource:"Només pots envar un document o URL a la vegada"},pdfVisor:{noPdfSelected:"No hi ha cap PDF seleccionat"}}}},styles$l=".item{display:flex;cursor:pointer;border-radius:8px;padding:8px;justify-content:center;transition:background-color .3s ease}.item[expanded]{justify-content:space-between}.item:hover{background-color:var(--color-primary-900);color:#fff}.item .icon-label{display:flex;gap:8px;transition:background-color .3s}.item.active{outline:2px solid white}";/**
210
+ `+te+" - "+X}else return" "+te}function getFunctionName(te){if(te.name)return te.name;var J=te.toString(),X=J.match(/^function\s*([^\s(]+)/);return X?X[1]:"Anonymous function: "+J}function getSymbolDescription(te){return te.toString().slice(7,-1)}var Context=function(){function te(J){this.id=id(),this.container=J}return te.prototype.addPlan=function(J){this.plan=J},te.prototype.setCurrentRequest=function(J){this.currentRequest=J},te}(),Metadata=function(){function te(J,X){this.key=J,this.value=X}return te.prototype.toString=function(){return this.key===NAMED_TAG?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},te}(),Plan=function(){function te(J,X){this.parentContext=J,this.rootRequest=X}return te}(),LazyServiceIdentifier=function(){function te(J){this._cb=J}return te.prototype.unwrap=function(){return this._cb()},te}(),QueryableString=function(){function te(J){this.str=J}return te.prototype.startsWith=function(J){return this.str.indexOf(J)===0},te.prototype.endsWith=function(J){var X="",re=J.split("").reverse().join("");return X=this.str.split("").reverse().join(""),this.startsWith.call({str:X},re)},te.prototype.contains=function(J){return this.str.indexOf(J)!==-1},te.prototype.equals=function(J){return this.str===J},te.prototype.value=function(){return this.str},te}(),Target=function(){function te(J,X,re,ne){this.id=id(),this.type=J,this.serviceIdentifier=re;var oe=typeof X=="symbol"?getSymbolDescription(X):X;this.name=new QueryableString(oe||""),this.identifier=X,this.metadata=new Array;var de=null;typeof ne=="string"?de=new Metadata(NAMED_TAG,ne):ne instanceof Metadata&&(de=ne),de!==null&&this.metadata.push(de)}return te.prototype.hasTag=function(J){for(var X=0,re=this.metadata;X<re.length;X++){var ne=re[X];if(ne.key===J)return!0}return!1},te.prototype.isArray=function(){return this.hasTag(MULTI_INJECT_TAG)},te.prototype.matchesArray=function(J){return this.matchesTag(MULTI_INJECT_TAG)(J)},te.prototype.isNamed=function(){return this.hasTag(NAMED_TAG)},te.prototype.isTagged=function(){return this.metadata.some(function(J){return NON_CUSTOM_TAG_KEYS.every(function(X){return J.key!==X})})},te.prototype.isOptional=function(){return this.matchesTag(OPTIONAL_TAG)(!0)},te.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter(function(J){return J.key===NAMED_TAG})[0]:null},te.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter(function(J){return NON_CUSTOM_TAG_KEYS.every(function(X){return J.key!==X})}):null},te.prototype.matchesNamedTag=function(J){return this.matchesTag(NAMED_TAG)(J)},te.prototype.matchesTag=function(J){var X=this;return function(re){for(var ne=0,oe=X.metadata;ne<oe.length;ne++){var de=oe[ne];if(de.key===J&&de.value===re)return!0}return!1}},te}(),__spreadArray$2=function(te,J,X){if(X||arguments.length===2)for(var re=0,ne=J.length,oe;re<ne;re++)(oe||!(re in J))&&(oe||(oe=Array.prototype.slice.call(J,0,re)),oe[re]=J[re]);return te.concat(oe||Array.prototype.slice.call(J))};function getDependencies$1(te,J){var X=getFunctionName(J);return getTargets(te,X,J,!1)}function getTargets(te,J,X,re){var ne=te.getConstructorMetadata(X),oe=ne.compilerGeneratedMetadata;if(oe===void 0){var de=MISSING_INJECTABLE_ANNOTATION+" "+J+".";throw new Error(de)}var ce=ne.userGeneratedMetadata,he=Object.keys(ce),ue=X.length===0&&he.length>0,pe=he.length>X.length,fe=ue||pe?he.length:X.length,ge=getConstructorArgsAsTargets(re,J,oe,ce,fe),me=getClassPropsAsTargets(te,X,J),ve=__spreadArray$2(__spreadArray$2([],ge,!0),me,!0);return ve}function getConstructorArgsAsTarget(te,J,X,re,ne){var oe=ne[te.toString()]||[],de=formatTargetMetadata(oe),ce=de.unmanaged!==!0,he=re[te],ue=de.inject||de.multiInject;if(he=ue||he,he instanceof LazyServiceIdentifier&&(he=he.unwrap()),ce){var pe=he===Object,fe=he===Function,ge=he===void 0,me=pe||fe||ge;if(!J&&me){var ve=MISSING_INJECT_ANNOTATION+" argument "+te+" in class "+X+".";throw new Error(ve)}var be=new Target(TargetTypeEnum.ConstructorArgument,de.targetName,he);return be.metadata=oe,be}return null}function getConstructorArgsAsTargets(te,J,X,re,ne){for(var oe=[],de=0;de<ne;de++){var ce=de,he=getConstructorArgsAsTarget(ce,te,J,X,re);he!==null&&oe.push(he)}return oe}function _getServiceIdentifierForProperty(te,J,X,re){var ne=te||J;if(ne===void 0){var oe=MISSING_INJECTABLE_ANNOTATION+" for property "+String(X)+" in class "+re+".";throw new Error(oe)}return ne}function getClassPropsAsTargets(te,J,X){for(var re=te.getPropertiesMetadata(J),ne=[],oe=Object.getOwnPropertySymbols(re),de=Object.keys(re),ce=de.concat(oe),he=0,ue=ce;he<ue.length;he++){var pe=ue[he],fe=re[pe],ge=formatTargetMetadata(fe),me=ge.targetName||pe,ve=_getServiceIdentifierForProperty(ge.inject,ge.multiInject,pe,X),be=new Target(TargetTypeEnum.ClassProperty,me,ve);be.metadata=fe,ne.push(be)}var _e=Object.getPrototypeOf(J.prototype).constructor;if(_e!==Object){var we=getClassPropsAsTargets(te,_e,X);ne=__spreadArray$2(__spreadArray$2([],ne,!0),we,!0)}return ne}function getBaseClassDependencyCount(te,J){var X=Object.getPrototypeOf(J.prototype).constructor;if(X!==Object){var re=getFunctionName(X),ne=getTargets(te,re,X,!0),oe=ne.map(function(he){return he.metadata.filter(function(ue){return ue.key===UNMANAGED_TAG})}),de=[].concat.apply([],oe).length,ce=ne.length-de;return ce>0?ce:getBaseClassDependencyCount(te,X)}else return 0}function formatTargetMetadata(te){var J={};return te.forEach(function(X){J[X.key.toString()]=X.value}),{inject:J[INJECT_TAG],multiInject:J[MULTI_INJECT_TAG],targetName:J[NAME_TAG],unmanaged:J[UNMANAGED_TAG]}}var Request$1=function(){function te(J,X,re,ne,oe){this.id=id(),this.serviceIdentifier=J,this.parentContext=X,this.parentRequest=re,this.target=oe,this.childRequests=[],this.bindings=Array.isArray(ne)?ne:[ne],this.requestScope=re===null?new Map:null}return te.prototype.addChildRequest=function(J,X,re){var ne=new te(J,this.parentContext,this,X,re);return this.childRequests.push(ne),ne},te}();function getBindingDictionary(te){return te._bindingDictionary}function _createTarget(te,J,X,re,ne,oe){var de=te?MULTI_INJECT_TAG:INJECT_TAG,ce=new Metadata(de,X),he=new Target(J,re,X,ce);if(ne!==void 0){var ue=new Metadata(ne,oe);he.metadata.push(ue)}return he}function _getActiveBindings(te,J,X,re,ne){var oe=getBindings(X.container,ne.serviceIdentifier),de=[];return oe.length===BindingCount.NoBindingsAvailable&&X.container.options.autoBindInjectable&&typeof ne.serviceIdentifier=="function"&&te.getConstructorMetadata(ne.serviceIdentifier).compilerGeneratedMetadata&&(X.container.bind(ne.serviceIdentifier).toSelf(),oe=getBindings(X.container,ne.serviceIdentifier)),J?de=oe:de=oe.filter(function(ce){var he=new Request$1(ce.serviceIdentifier,X,re,ce,ne);return ce.constraint(he)}),_validateActiveBindingCount(ne.serviceIdentifier,de,ne,X.container),de}function _validateActiveBindingCount(te,J,X,re){switch(J.length){case BindingCount.NoBindingsAvailable:if(X.isOptional())return J;var ne=getServiceIdentifierAsString(te),oe=NOT_REGISTERED;throw oe+=listMetadataForTarget(ne,X),oe+=listRegisteredBindingsForServiceIdentifier(re,ne,getBindings),new Error(oe);case BindingCount.OnlyOneBindingAvailable:return J;case BindingCount.MultipleBindingsAvailable:default:if(X.isArray())return J;var ne=getServiceIdentifierAsString(te),oe=AMBIGUOUS_MATCH+" "+ne;throw oe+=listRegisteredBindingsForServiceIdentifier(re,ne,getBindings),new Error(oe)}}function _createSubRequests(te,J,X,re,ne,oe){var de,ce;if(ne===null){de=_getActiveBindings(te,J,re,null,oe),ce=new Request$1(X,re,null,de,oe);var he=new Plan(re,ce);re.addPlan(he)}else de=_getActiveBindings(te,J,re,ne,oe),ce=ne.addChildRequest(oe.serviceIdentifier,de,oe);de.forEach(function(ue){var pe=null;if(oe.isArray())pe=ce.addChildRequest(ue.serviceIdentifier,ue,oe);else{if(ue.cache)return;pe=ce}if(ue.type===BindingTypeEnum.Instance&&ue.implementationType!==null){var fe=getDependencies$1(te,ue.implementationType);if(!re.container.options.skipBaseClassChecks){var ge=getBaseClassDependencyCount(te,ue.implementationType);if(fe.length<ge){var me=ARGUMENTS_LENGTH_MISMATCH(getFunctionName(ue.implementationType));throw new Error(me)}}fe.forEach(function(ve){_createSubRequests(te,!1,ve.serviceIdentifier,re,pe,ve)})}})}function getBindings(te,J){var X=[],re=getBindingDictionary(te);return re.hasKey(J)?X=re.get(J):te.parent!==null&&(X=getBindings(te.parent,J)),X}function plan(te,J,X,re,ne,oe,de,ce){ce===void 0&&(ce=!1);var he=new Context(J),ue=_createTarget(X,re,ne,"",oe,de);try{return _createSubRequests(te,ce,ne,he,null,ue),he}catch(pe){throw isStackOverflowExeption(pe)&&circularDependencyToException(he.plan.rootRequest),pe}}function createMockRequest(te,J,X,re){var ne=new Target(TargetTypeEnum.Variable,"",J,new Metadata(X,re)),oe=new Context(te),de=new Request$1(J,oe,null,[],ne);return de}function isPromise(te){var J=typeof te=="object"&&te!==null||typeof te=="function";return J&&typeof te.then=="function"}function isPromiseOrContainsPromise(te){return isPromise(te)?!0:Array.isArray(te)&&te.some(isPromise)}var __awaiter$3=function(te,J,X,re){function ne(oe){return oe instanceof X?oe:new X(function(de){de(oe)})}return new(X||(X=Promise))(function(oe,de){function ce(pe){try{ue(re.next(pe))}catch(fe){de(fe)}}function he(pe){try{ue(re.throw(pe))}catch(fe){de(fe)}}function ue(pe){pe.done?oe(pe.value):ne(pe.value).then(ce,he)}ue((re=re.apply(te,J||[])).next())})},__generator$3=function(te,J){var X={label:0,sent:function(){if(oe[0]&1)throw oe[1];return oe[1]},trys:[],ops:[]},re,ne,oe,de;return de={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function ce(ue){return function(pe){return he([ue,pe])}}function he(ue){if(re)throw new TypeError("Generator is already executing.");for(;X;)try{if(re=1,ne&&(oe=ue[0]&2?ne.return:ue[0]?ne.throw||((oe=ne.return)&&oe.call(ne),0):ne.next)&&!(oe=oe.call(ne,ue[1])).done)return oe;switch(ne=0,oe&&(ue=[ue[0]&2,oe.value]),ue[0]){case 0:case 1:oe=ue;break;case 4:return X.label++,{value:ue[1],done:!1};case 5:X.label++,ne=ue[1],ue=[0];continue;case 7:ue=X.ops.pop(),X.trys.pop();continue;default:if(oe=X.trys,!(oe=oe.length>0&&oe[oe.length-1])&&(ue[0]===6||ue[0]===2)){X=0;continue}if(ue[0]===3&&(!oe||ue[1]>oe[0]&&ue[1]<oe[3])){X.label=ue[1];break}if(ue[0]===6&&X.label<oe[1]){X.label=oe[1],oe=ue;break}if(oe&&X.label<oe[2]){X.label=oe[2],X.ops.push(ue);break}oe[2]&&X.ops.pop(),X.trys.pop();continue}ue=J.call(te,X)}catch(pe){ue=[6,pe],ne=0}finally{re=oe=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},tryGetFromScope=function(te,J){return J.scope===BindingScopeEnum.Singleton&&J.activated?J.cache:J.scope===BindingScopeEnum.Request&&te.has(J.id)?te.get(J.id):null},saveToScope=function(te,J,X){J.scope===BindingScopeEnum.Singleton&&_saveToSingletonScope(J,X),J.scope===BindingScopeEnum.Request&&_saveToRequestScope(te,J,X)},_saveToRequestScope=function(te,J,X){te.has(J.id)||te.set(J.id,X)},_saveToSingletonScope=function(te,J){te.cache=J,te.activated=!0,isPromise(J)&&_saveAsyncResultToSingletonScope(te,J)},_saveAsyncResultToSingletonScope=function(te,J){return __awaiter$3(void 0,void 0,void 0,function(){var X,re;return __generator$3(this,function(ne){switch(ne.label){case 0:return ne.trys.push([0,2,,3]),[4,J];case 1:return X=ne.sent(),te.cache=X,[3,3];case 2:throw re=ne.sent(),te.cache=null,te.activated=!1,re;case 3:return[2]}})})},FactoryType;(function(te){te.DynamicValue="toDynamicValue",te.Factory="toFactory",te.Provider="toProvider"})(FactoryType||(FactoryType={}));var ensureFullyBound=function(te){var J=null;switch(te.type){case BindingTypeEnum.ConstantValue:case BindingTypeEnum.Function:J=te.cache;break;case BindingTypeEnum.Constructor:case BindingTypeEnum.Instance:J=te.implementationType;break;case BindingTypeEnum.DynamicValue:J=te.dynamicValue;break;case BindingTypeEnum.Provider:J=te.provider;break;case BindingTypeEnum.Factory:J=te.factory;break}if(J===null){var X=getServiceIdentifierAsString(te.serviceIdentifier);throw new Error(INVALID_BINDING_TYPE+" "+X)}},getFactoryDetails=function(te){switch(te.type){case BindingTypeEnum.Factory:return{factory:te.factory,factoryType:FactoryType.Factory};case BindingTypeEnum.Provider:return{factory:te.provider,factoryType:FactoryType.Provider};case BindingTypeEnum.DynamicValue:return{factory:te.dynamicValue,factoryType:FactoryType.DynamicValue};default:throw new Error("Unexpected factory type "+te.type)}},__assign$1=function(){return __assign$1=Object.assign||function(te){for(var J,X=1,re=arguments.length;X<re;X++){J=arguments[X];for(var ne in J)Object.prototype.hasOwnProperty.call(J,ne)&&(te[ne]=J[ne])}return te},__assign$1.apply(this,arguments)},__awaiter$2=function(te,J,X,re){function ne(oe){return oe instanceof X?oe:new X(function(de){de(oe)})}return new(X||(X=Promise))(function(oe,de){function ce(pe){try{ue(re.next(pe))}catch(fe){de(fe)}}function he(pe){try{ue(re.throw(pe))}catch(fe){de(fe)}}function ue(pe){pe.done?oe(pe.value):ne(pe.value).then(ce,he)}ue((re=re.apply(te,J||[])).next())})},__generator$2=function(te,J){var X={label:0,sent:function(){if(oe[0]&1)throw oe[1];return oe[1]},trys:[],ops:[]},re,ne,oe,de;return de={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function ce(ue){return function(pe){return he([ue,pe])}}function he(ue){if(re)throw new TypeError("Generator is already executing.");for(;X;)try{if(re=1,ne&&(oe=ue[0]&2?ne.return:ue[0]?ne.throw||((oe=ne.return)&&oe.call(ne),0):ne.next)&&!(oe=oe.call(ne,ue[1])).done)return oe;switch(ne=0,oe&&(ue=[ue[0]&2,oe.value]),ue[0]){case 0:case 1:oe=ue;break;case 4:return X.label++,{value:ue[1],done:!1};case 5:X.label++,ne=ue[1],ue=[0];continue;case 7:ue=X.ops.pop(),X.trys.pop();continue;default:if(oe=X.trys,!(oe=oe.length>0&&oe[oe.length-1])&&(ue[0]===6||ue[0]===2)){X=0;continue}if(ue[0]===3&&(!oe||ue[1]>oe[0]&&ue[1]<oe[3])){X.label=ue[1];break}if(ue[0]===6&&X.label<oe[1]){X.label=oe[1],oe=ue;break}if(oe&&X.label<oe[2]){X.label=oe[2],X.ops.push(ue);break}oe[2]&&X.ops.pop(),X.trys.pop();continue}ue=J.call(te,X)}catch(pe){ue=[6,pe],ne=0}finally{re=oe=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},__spreadArray$1=function(te,J,X){if(X||arguments.length===2)for(var re=0,ne=J.length,oe;re<ne;re++)(oe||!(re in J))&&(oe||(oe=Array.prototype.slice.call(J,0,re)),oe[re]=J[re]);return te.concat(oe||Array.prototype.slice.call(J))};function _resolveRequests(te,J){return te.reduce(function(X,re){var ne=J(re),oe=re.target.type;return oe===TargetTypeEnum.ConstructorArgument?X.constructorInjections.push(ne):(X.propertyRequests.push(re),X.propertyInjections.push(ne)),X.isAsync||(X.isAsync=isPromiseOrContainsPromise(ne)),X},{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}function _createInstance(te,J,X){var re;if(J.length>0){var ne=_resolveRequests(J,X),oe=__assign$1(__assign$1({},ne),{constr:te});ne.isAsync?re=createInstanceWithInjectionsAsync(oe):re=createInstanceWithInjections(oe)}else re=new te;return re}function createInstanceWithInjections(te){var J,X=new((J=te.constr).bind.apply(J,__spreadArray$1([void 0],te.constructorInjections,!1)));return te.propertyRequests.forEach(function(re,ne){var oe=re.target.identifier,de=te.propertyInjections[ne];(!re.target.isOptional()||de!==void 0)&&(X[oe]=de)}),X}function createInstanceWithInjectionsAsync(te){return __awaiter$2(this,void 0,void 0,function(){var J,X;return __generator$2(this,function(re){switch(re.label){case 0:return[4,possiblyWaitInjections(te.constructorInjections)];case 1:return J=re.sent(),[4,possiblyWaitInjections(te.propertyInjections)];case 2:return X=re.sent(),[2,createInstanceWithInjections(__assign$1(__assign$1({},te),{constructorInjections:J,propertyInjections:X}))]}})})}function possiblyWaitInjections(te){return __awaiter$2(this,void 0,void 0,function(){var J,X,re,ne;return __generator$2(this,function(oe){for(J=[],X=0,re=te;X<re.length;X++)ne=re[X],Array.isArray(ne)?J.push(Promise.all(ne)):J.push(ne);return[2,Promise.all(J)]})})}function _getInstanceAfterPostConstruct(te,J){var X=_postConstruct(te,J);return isPromise(X)?X.then(function(){return J}):J}function _postConstruct(te,J){var X,re;if(Reflect.hasMetadata(POST_CONSTRUCT,te)){var ne=Reflect.getMetadata(POST_CONSTRUCT,te);try{return(re=(X=J)[ne.value])===null||re===void 0?void 0:re.call(X)}catch(oe){if(oe instanceof Error)throw new Error(POST_CONSTRUCT_ERROR(te.name,oe.message))}}}function _validateInstanceResolution(te,J){te.scope!==BindingScopeEnum.Singleton&&_throwIfHandlingDeactivation(te,J)}function _throwIfHandlingDeactivation(te,J){var X="Class cannot be instantiated in "+(te.scope===BindingScopeEnum.Request?"request":"transient")+" scope.";if(typeof te.onDeactivation=="function")throw new Error(ON_DEACTIVATION_ERROR(J.name,X));if(Reflect.hasMetadata(PRE_DESTROY,J))throw new Error(PRE_DESTROY_ERROR(J.name,X))}function resolveInstance(te,J,X,re){_validateInstanceResolution(te,J);var ne=_createInstance(J,X,re);return isPromise(ne)?ne.then(function(oe){return _getInstanceAfterPostConstruct(J,oe)}):_getInstanceAfterPostConstruct(J,ne)}var __awaiter$1=function(te,J,X,re){function ne(oe){return oe instanceof X?oe:new X(function(de){de(oe)})}return new(X||(X=Promise))(function(oe,de){function ce(pe){try{ue(re.next(pe))}catch(fe){de(fe)}}function he(pe){try{ue(re.throw(pe))}catch(fe){de(fe)}}function ue(pe){pe.done?oe(pe.value):ne(pe.value).then(ce,he)}ue((re=re.apply(te,J||[])).next())})},__generator$1=function(te,J){var X={label:0,sent:function(){if(oe[0]&1)throw oe[1];return oe[1]},trys:[],ops:[]},re,ne,oe,de;return de={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function ce(ue){return function(pe){return he([ue,pe])}}function he(ue){if(re)throw new TypeError("Generator is already executing.");for(;X;)try{if(re=1,ne&&(oe=ue[0]&2?ne.return:ue[0]?ne.throw||((oe=ne.return)&&oe.call(ne),0):ne.next)&&!(oe=oe.call(ne,ue[1])).done)return oe;switch(ne=0,oe&&(ue=[ue[0]&2,oe.value]),ue[0]){case 0:case 1:oe=ue;break;case 4:return X.label++,{value:ue[1],done:!1};case 5:X.label++,ne=ue[1],ue=[0];continue;case 7:ue=X.ops.pop(),X.trys.pop();continue;default:if(oe=X.trys,!(oe=oe.length>0&&oe[oe.length-1])&&(ue[0]===6||ue[0]===2)){X=0;continue}if(ue[0]===3&&(!oe||ue[1]>oe[0]&&ue[1]<oe[3])){X.label=ue[1];break}if(ue[0]===6&&X.label<oe[1]){X.label=oe[1],oe=ue;break}if(oe&&X.label<oe[2]){X.label=oe[2],X.ops.push(ue);break}oe[2]&&X.ops.pop(),X.trys.pop();continue}ue=J.call(te,X)}catch(pe){ue=[6,pe],ne=0}finally{re=oe=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},_resolveRequest=function(te){return function(J){J.parentContext.setCurrentRequest(J);var X=J.bindings,re=J.childRequests,ne=J.target&&J.target.isArray(),oe=!J.parentRequest||!J.parentRequest.target||!J.target||!J.parentRequest.target.matchesArray(J.target.serviceIdentifier);if(ne&&oe)return re.map(function(ce){var he=_resolveRequest(te);return he(ce)});if(J.target.isOptional()&&X.length===0)return;var de=X[0];return _resolveBinding(te,J,de)}},_resolveFactoryFromBinding=function(te,J){var X=getFactoryDetails(te);return tryAndThrowErrorIfStackOverflow(function(){return X.factory.bind(te)(J)},function(){return new Error(CIRCULAR_DEPENDENCY_IN_FACTORY(X.factoryType,J.currentRequest.serviceIdentifier.toString()))})},_getResolvedFromBinding=function(te,J,X){var re,ne=J.childRequests;switch(ensureFullyBound(X),X.type){case BindingTypeEnum.ConstantValue:case BindingTypeEnum.Function:re=X.cache;break;case BindingTypeEnum.Constructor:re=X.implementationType;break;case BindingTypeEnum.Instance:re=resolveInstance(X,X.implementationType,ne,_resolveRequest(te));break;default:re=_resolveFactoryFromBinding(X,J.parentContext)}return re},_resolveInScope=function(te,J,X){var re=tryGetFromScope(te,J);return re!==null||(re=X(),saveToScope(te,J,re)),re},_resolveBinding=function(te,J,X){return _resolveInScope(te,X,function(){var re=_getResolvedFromBinding(te,J,X);return isPromise(re)?re=re.then(function(ne){return _onActivation(J,X,ne)}):re=_onActivation(J,X,re),re})};function _onActivation(te,J,X){var re=_bindingActivation(te.parentContext,J,X),ne=_getContainersIterator(te.parentContext.container),oe,de=ne.next();do{oe=de.value;var ce=te.parentContext,he=te.serviceIdentifier,ue=_getContainerActivationsForService(oe,he);isPromise(re)?re=_activateContainerAsync(ue,ce,re):re=_activateContainer(ue,ce,re),de=ne.next()}while(de.done!==!0&&!getBindingDictionary(oe).hasKey(te.serviceIdentifier));return re}var _bindingActivation=function(te,J,X){var re;return typeof J.onActivation=="function"?re=J.onActivation(te,X):re=X,re},_activateContainer=function(te,J,X){for(var re=te.next();!re.done;){if(X=re.value(J,X),isPromise(X))return _activateContainerAsync(te,J,X);re=te.next()}return X},_activateContainerAsync=function(te,J,X){return __awaiter$1(void 0,void 0,void 0,function(){var re,ne;return __generator$1(this,function(oe){switch(oe.label){case 0:return[4,X];case 1:re=oe.sent(),ne=te.next(),oe.label=2;case 2:return ne.done?[3,4]:[4,ne.value(J,re)];case 3:return re=oe.sent(),ne=te.next(),[3,2];case 4:return[2,re]}})})},_getContainerActivationsForService=function(te,J){var X=te._activations;return X.hasKey(J)?X.get(J).values():[].values()},_getContainersIterator=function(te){for(var J=[te],X=te.parent;X!==null;)J.push(X),X=X.parent;var re=function(){var oe=J.pop();return oe!==void 0?{done:!1,value:oe}:{done:!0,value:void 0}},ne={next:re};return ne};function resolve(te){var J=_resolveRequest(te.plan.rootRequest.requestScope);return J(te.plan.rootRequest)}var traverseAncerstors=function(te,J){var X=te.parentRequest;return X!==null?J(X)?!0:traverseAncerstors(X,J):!1},taggedConstraint=function(te){return function(J){var X=function(re){return re!==null&&re.target!==null&&re.target.matchesTag(te)(J)};return X.metaData=new Metadata(te,J),X}},namedConstraint=taggedConstraint(NAMED_TAG),typeConstraint=function(te){return function(J){var X=null;if(J!==null)if(X=J.bindings[0],typeof te=="string"){var re=X.serviceIdentifier;return re===te}else{var ne=J.bindings[0].implementationType;return te===ne}return!1}},BindingWhenSyntax=function(){function te(J){this._binding=J}return te.prototype.when=function(J){return this._binding.constraint=J,new BindingOnSyntax(this._binding)},te.prototype.whenTargetNamed=function(J){return this._binding.constraint=namedConstraint(J),new BindingOnSyntax(this._binding)},te.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(J){if(J===null)return!1;var X=J.target!==null&&!J.target.isNamed()&&!J.target.isTagged();return X},new BindingOnSyntax(this._binding)},te.prototype.whenTargetTagged=function(J,X){return this._binding.constraint=taggedConstraint(J)(X),new BindingOnSyntax(this._binding)},te.prototype.whenInjectedInto=function(J){return this._binding.constraint=function(X){return X!==null&&typeConstraint(J)(X.parentRequest)},new BindingOnSyntax(this._binding)},te.prototype.whenParentNamed=function(J){return this._binding.constraint=function(X){return X!==null&&namedConstraint(J)(X.parentRequest)},new BindingOnSyntax(this._binding)},te.prototype.whenParentTagged=function(J,X){return this._binding.constraint=function(re){return re!==null&&taggedConstraint(J)(X)(re.parentRequest)},new BindingOnSyntax(this._binding)},te.prototype.whenAnyAncestorIs=function(J){return this._binding.constraint=function(X){return X!==null&&traverseAncerstors(X,typeConstraint(J))},new BindingOnSyntax(this._binding)},te.prototype.whenNoAncestorIs=function(J){return this._binding.constraint=function(X){return X!==null&&!traverseAncerstors(X,typeConstraint(J))},new BindingOnSyntax(this._binding)},te.prototype.whenAnyAncestorNamed=function(J){return this._binding.constraint=function(X){return X!==null&&traverseAncerstors(X,namedConstraint(J))},new BindingOnSyntax(this._binding)},te.prototype.whenNoAncestorNamed=function(J){return this._binding.constraint=function(X){return X!==null&&!traverseAncerstors(X,namedConstraint(J))},new BindingOnSyntax(this._binding)},te.prototype.whenAnyAncestorTagged=function(J,X){return this._binding.constraint=function(re){return re!==null&&traverseAncerstors(re,taggedConstraint(J)(X))},new BindingOnSyntax(this._binding)},te.prototype.whenNoAncestorTagged=function(J,X){return this._binding.constraint=function(re){return re!==null&&!traverseAncerstors(re,taggedConstraint(J)(X))},new BindingOnSyntax(this._binding)},te.prototype.whenAnyAncestorMatches=function(J){return this._binding.constraint=function(X){return X!==null&&traverseAncerstors(X,J)},new BindingOnSyntax(this._binding)},te.prototype.whenNoAncestorMatches=function(J){return this._binding.constraint=function(X){return X!==null&&!traverseAncerstors(X,J)},new BindingOnSyntax(this._binding)},te}(),BindingOnSyntax=function(){function te(J){this._binding=J}return te.prototype.onActivation=function(J){return this._binding.onActivation=J,new BindingWhenSyntax(this._binding)},te.prototype.onDeactivation=function(J){return this._binding.onDeactivation=J,new BindingWhenSyntax(this._binding)},te}(),BindingWhenOnSyntax=function(){function te(J){this._binding=J,this._bindingWhenSyntax=new BindingWhenSyntax(this._binding),this._bindingOnSyntax=new BindingOnSyntax(this._binding)}return te.prototype.when=function(J){return this._bindingWhenSyntax.when(J)},te.prototype.whenTargetNamed=function(J){return this._bindingWhenSyntax.whenTargetNamed(J)},te.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},te.prototype.whenTargetTagged=function(J,X){return this._bindingWhenSyntax.whenTargetTagged(J,X)},te.prototype.whenInjectedInto=function(J){return this._bindingWhenSyntax.whenInjectedInto(J)},te.prototype.whenParentNamed=function(J){return this._bindingWhenSyntax.whenParentNamed(J)},te.prototype.whenParentTagged=function(J,X){return this._bindingWhenSyntax.whenParentTagged(J,X)},te.prototype.whenAnyAncestorIs=function(J){return this._bindingWhenSyntax.whenAnyAncestorIs(J)},te.prototype.whenNoAncestorIs=function(J){return this._bindingWhenSyntax.whenNoAncestorIs(J)},te.prototype.whenAnyAncestorNamed=function(J){return this._bindingWhenSyntax.whenAnyAncestorNamed(J)},te.prototype.whenAnyAncestorTagged=function(J,X){return this._bindingWhenSyntax.whenAnyAncestorTagged(J,X)},te.prototype.whenNoAncestorNamed=function(J){return this._bindingWhenSyntax.whenNoAncestorNamed(J)},te.prototype.whenNoAncestorTagged=function(J,X){return this._bindingWhenSyntax.whenNoAncestorTagged(J,X)},te.prototype.whenAnyAncestorMatches=function(J){return this._bindingWhenSyntax.whenAnyAncestorMatches(J)},te.prototype.whenNoAncestorMatches=function(J){return this._bindingWhenSyntax.whenNoAncestorMatches(J)},te.prototype.onActivation=function(J){return this._bindingOnSyntax.onActivation(J)},te.prototype.onDeactivation=function(J){return this._bindingOnSyntax.onDeactivation(J)},te}(),BindingInSyntax=function(){function te(J){this._binding=J}return te.prototype.inRequestScope=function(){return this._binding.scope=BindingScopeEnum.Request,new BindingWhenOnSyntax(this._binding)},te.prototype.inSingletonScope=function(){return this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},te.prototype.inTransientScope=function(){return this._binding.scope=BindingScopeEnum.Transient,new BindingWhenOnSyntax(this._binding)},te}(),BindingInWhenOnSyntax=function(){function te(J){this._binding=J,this._bindingWhenSyntax=new BindingWhenSyntax(this._binding),this._bindingOnSyntax=new BindingOnSyntax(this._binding),this._bindingInSyntax=new BindingInSyntax(J)}return te.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},te.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},te.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},te.prototype.when=function(J){return this._bindingWhenSyntax.when(J)},te.prototype.whenTargetNamed=function(J){return this._bindingWhenSyntax.whenTargetNamed(J)},te.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},te.prototype.whenTargetTagged=function(J,X){return this._bindingWhenSyntax.whenTargetTagged(J,X)},te.prototype.whenInjectedInto=function(J){return this._bindingWhenSyntax.whenInjectedInto(J)},te.prototype.whenParentNamed=function(J){return this._bindingWhenSyntax.whenParentNamed(J)},te.prototype.whenParentTagged=function(J,X){return this._bindingWhenSyntax.whenParentTagged(J,X)},te.prototype.whenAnyAncestorIs=function(J){return this._bindingWhenSyntax.whenAnyAncestorIs(J)},te.prototype.whenNoAncestorIs=function(J){return this._bindingWhenSyntax.whenNoAncestorIs(J)},te.prototype.whenAnyAncestorNamed=function(J){return this._bindingWhenSyntax.whenAnyAncestorNamed(J)},te.prototype.whenAnyAncestorTagged=function(J,X){return this._bindingWhenSyntax.whenAnyAncestorTagged(J,X)},te.prototype.whenNoAncestorNamed=function(J){return this._bindingWhenSyntax.whenNoAncestorNamed(J)},te.prototype.whenNoAncestorTagged=function(J,X){return this._bindingWhenSyntax.whenNoAncestorTagged(J,X)},te.prototype.whenAnyAncestorMatches=function(J){return this._bindingWhenSyntax.whenAnyAncestorMatches(J)},te.prototype.whenNoAncestorMatches=function(J){return this._bindingWhenSyntax.whenNoAncestorMatches(J)},te.prototype.onActivation=function(J){return this._bindingOnSyntax.onActivation(J)},te.prototype.onDeactivation=function(J){return this._bindingOnSyntax.onDeactivation(J)},te}(),BindingToSyntax=function(){function te(J){this._binding=J}return te.prototype.to=function(J){return this._binding.type=BindingTypeEnum.Instance,this._binding.implementationType=J,new BindingInWhenOnSyntax(this._binding)},te.prototype.toSelf=function(){if(typeof this._binding.serviceIdentifier!="function")throw new Error(""+INVALID_TO_SELF_VALUE);var J=this._binding.serviceIdentifier;return this.to(J)},te.prototype.toConstantValue=function(J){return this._binding.type=BindingTypeEnum.ConstantValue,this._binding.cache=J,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},te.prototype.toDynamicValue=function(J){return this._binding.type=BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=J,this._binding.implementationType=null,new BindingInWhenOnSyntax(this._binding)},te.prototype.toConstructor=function(J){return this._binding.type=BindingTypeEnum.Constructor,this._binding.implementationType=J,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},te.prototype.toFactory=function(J){return this._binding.type=BindingTypeEnum.Factory,this._binding.factory=J,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},te.prototype.toFunction=function(J){if(typeof J!="function")throw new Error(INVALID_FUNCTION_BINDING);var X=this.toConstantValue(J);return this._binding.type=BindingTypeEnum.Function,this._binding.scope=BindingScopeEnum.Singleton,X},te.prototype.toAutoFactory=function(J){return this._binding.type=BindingTypeEnum.Factory,this._binding.factory=function(X){var re=function(){return X.container.get(J)};return re},this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},te.prototype.toAutoNamedFactory=function(J){return this._binding.type=BindingTypeEnum.Factory,this._binding.factory=function(X){return function(re){return X.container.getNamed(J,re)}},new BindingWhenOnSyntax(this._binding)},te.prototype.toProvider=function(J){return this._binding.type=BindingTypeEnum.Provider,this._binding.provider=J,this._binding.scope=BindingScopeEnum.Singleton,new BindingWhenOnSyntax(this._binding)},te.prototype.toService=function(J){this.toDynamicValue(function(X){return X.container.get(J)})},te}(),ContainerSnapshot=function(){function te(){}return te.of=function(J,X,re,ne,oe){var de=new te;return de.bindings=J,de.middleware=X,de.deactivations=ne,de.activations=re,de.moduleActivationStore=oe,de},te}();function isClonable(te){return typeof te=="object"&&te!==null&&"clone"in te&&typeof te.clone=="function"}var Lookup=function(){function te(){this._map=new Map}return te.prototype.getMap=function(){return this._map},te.prototype.add=function(J,X){if(J==null)throw new Error(NULL_ARGUMENT);if(X==null)throw new Error(NULL_ARGUMENT);var re=this._map.get(J);re!==void 0?re.push(X):this._map.set(J,[X])},te.prototype.get=function(J){if(J==null)throw new Error(NULL_ARGUMENT);var X=this._map.get(J);if(X!==void 0)return X;throw new Error(KEY_NOT_FOUND)},te.prototype.remove=function(J){if(J==null)throw new Error(NULL_ARGUMENT);if(!this._map.delete(J))throw new Error(KEY_NOT_FOUND)},te.prototype.removeIntersection=function(J){var X=this;this.traverse(function(re,ne){var oe=J.hasKey(re)?J.get(re):void 0;if(oe!==void 0){var de=ne.filter(function(ce){return!oe.some(function(he){return ce===he})});X._setValue(re,de)}})},te.prototype.removeByCondition=function(J){var X=this,re=[];return this._map.forEach(function(ne,oe){for(var de=[],ce=0,he=ne;ce<he.length;ce++){var ue=he[ce],pe=J(ue);pe?re.push(ue):de.push(ue)}X._setValue(oe,de)}),re},te.prototype.hasKey=function(J){if(J==null)throw new Error(NULL_ARGUMENT);return this._map.has(J)},te.prototype.clone=function(){var J=new te;return this._map.forEach(function(X,re){X.forEach(function(ne){return J.add(re,isClonable(ne)?ne.clone():ne)})}),J},te.prototype.traverse=function(J){this._map.forEach(function(X,re){J(re,X)})},te.prototype._setValue=function(J,X){X.length>0?this._map.set(J,X):this._map.delete(J)},te}(),ModuleActivationStore=function(){function te(){this._map=new Map}return te.prototype.remove=function(J){if(this._map.has(J)){var X=this._map.get(J);return this._map.delete(J),X}return this._getEmptyHandlersStore()},te.prototype.addDeactivation=function(J,X,re){this._getModuleActivationHandlers(J).onDeactivations.add(X,re)},te.prototype.addActivation=function(J,X,re){this._getModuleActivationHandlers(J).onActivations.add(X,re)},te.prototype.clone=function(){var J=new te;return this._map.forEach(function(X,re){J._map.set(re,{onActivations:X.onActivations.clone(),onDeactivations:X.onDeactivations.clone()})}),J},te.prototype._getModuleActivationHandlers=function(J){var X=this._map.get(J);return X===void 0&&(X=this._getEmptyHandlersStore(),this._map.set(J,X)),X},te.prototype._getEmptyHandlersStore=function(){var J={onActivations:new Lookup,onDeactivations:new Lookup};return J},te}(),__assign=function(){return __assign=Object.assign||function(te){for(var J,X=1,re=arguments.length;X<re;X++){J=arguments[X];for(var ne in J)Object.prototype.hasOwnProperty.call(J,ne)&&(te[ne]=J[ne])}return te},__assign.apply(this,arguments)},__awaiter=function(te,J,X,re){function ne(oe){return oe instanceof X?oe:new X(function(de){de(oe)})}return new(X||(X=Promise))(function(oe,de){function ce(pe){try{ue(re.next(pe))}catch(fe){de(fe)}}function he(pe){try{ue(re.throw(pe))}catch(fe){de(fe)}}function ue(pe){pe.done?oe(pe.value):ne(pe.value).then(ce,he)}ue((re=re.apply(te,J||[])).next())})},__generator=function(te,J){var X={label:0,sent:function(){if(oe[0]&1)throw oe[1];return oe[1]},trys:[],ops:[]},re,ne,oe,de;return de={next:ce(0),throw:ce(1),return:ce(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function ce(ue){return function(pe){return he([ue,pe])}}function he(ue){if(re)throw new TypeError("Generator is already executing.");for(;X;)try{if(re=1,ne&&(oe=ue[0]&2?ne.return:ue[0]?ne.throw||((oe=ne.return)&&oe.call(ne),0):ne.next)&&!(oe=oe.call(ne,ue[1])).done)return oe;switch(ne=0,oe&&(ue=[ue[0]&2,oe.value]),ue[0]){case 0:case 1:oe=ue;break;case 4:return X.label++,{value:ue[1],done:!1};case 5:X.label++,ne=ue[1],ue=[0];continue;case 7:ue=X.ops.pop(),X.trys.pop();continue;default:if(oe=X.trys,!(oe=oe.length>0&&oe[oe.length-1])&&(ue[0]===6||ue[0]===2)){X=0;continue}if(ue[0]===3&&(!oe||ue[1]>oe[0]&&ue[1]<oe[3])){X.label=ue[1];break}if(ue[0]===6&&X.label<oe[1]){X.label=oe[1],oe=ue;break}if(oe&&X.label<oe[2]){X.label=oe[2],X.ops.push(ue);break}oe[2]&&X.ops.pop(),X.trys.pop();continue}ue=J.call(te,X)}catch(pe){ue=[6,pe],ne=0}finally{re=oe=0}if(ue[0]&5)throw ue[1];return{value:ue[0]?ue[1]:void 0,done:!0}}},__spreadArray=function(te,J,X){if(X||arguments.length===2)for(var re=0,ne=J.length,oe;re<ne;re++)(oe||!(re in J))&&(oe||(oe=Array.prototype.slice.call(J,0,re)),oe[re]=J[re]);return te.concat(oe||Array.prototype.slice.call(J))},Container=function(){function te(J){var X=J||{};if(typeof X!="object")throw new Error(""+CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);if(X.defaultScope===void 0)X.defaultScope=BindingScopeEnum.Transient;else if(X.defaultScope!==BindingScopeEnum.Singleton&&X.defaultScope!==BindingScopeEnum.Transient&&X.defaultScope!==BindingScopeEnum.Request)throw new Error(""+CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);if(X.autoBindInjectable===void 0)X.autoBindInjectable=!1;else if(typeof X.autoBindInjectable!="boolean")throw new Error(""+CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);if(X.skipBaseClassChecks===void 0)X.skipBaseClassChecks=!1;else if(typeof X.skipBaseClassChecks!="boolean")throw new Error(""+CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);this.options={autoBindInjectable:X.autoBindInjectable,defaultScope:X.defaultScope,skipBaseClassChecks:X.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 te.merge=function(J,X){for(var re=[],ne=2;ne<arguments.length;ne++)re[ne-2]=arguments[ne];var oe=new te,de=__spreadArray([J,X],re,!0).map(function(ue){return getBindingDictionary(ue)}),ce=getBindingDictionary(oe);function he(ue,pe){ue.traverse(function(fe,ge){ge.forEach(function(me){pe.add(me.serviceIdentifier,me.clone())})})}return de.forEach(function(ue){he(ue,ce)}),oe},te.prototype.load=function(){for(var J=[],X=0;X<arguments.length;X++)J[X]=arguments[X];for(var re=this._getContainerModuleHelpersFactory(),ne=0,oe=J;ne<oe.length;ne++){var de=oe[ne],ce=re(de.id);de.registry(ce.bindFunction,ce.unbindFunction,ce.isboundFunction,ce.rebindFunction,ce.unbindAsyncFunction,ce.onActivationFunction,ce.onDeactivationFunction)}},te.prototype.loadAsync=function(){for(var J=[],X=0;X<arguments.length;X++)J[X]=arguments[X];return __awaiter(this,void 0,void 0,function(){var re,ne,oe,de,ce;return __generator(this,function(he){switch(he.label){case 0:re=this._getContainerModuleHelpersFactory(),ne=0,oe=J,he.label=1;case 1:return ne<oe.length?(de=oe[ne],ce=re(de.id),[4,de.registry(ce.bindFunction,ce.unbindFunction,ce.isboundFunction,ce.rebindFunction,ce.unbindAsyncFunction,ce.onActivationFunction,ce.onDeactivationFunction)]):[3,4];case 2:he.sent(),he.label=3;case 3:return ne++,[3,1];case 4:return[2]}})})},te.prototype.unload=function(){for(var J=this,X=[],re=0;re<arguments.length;re++)X[re]=arguments[re];X.forEach(function(ne){var oe=J._removeModuleBindings(ne.id);J._deactivateSingletons(oe),J._removeModuleHandlers(ne.id)})},te.prototype.unloadAsync=function(){for(var J=[],X=0;X<arguments.length;X++)J[X]=arguments[X];return __awaiter(this,void 0,void 0,function(){var re,ne,oe,de;return __generator(this,function(ce){switch(ce.label){case 0:re=0,ne=J,ce.label=1;case 1:return re<ne.length?(oe=ne[re],de=this._removeModuleBindings(oe.id),[4,this._deactivateSingletonsAsync(de)]):[3,4];case 2:ce.sent(),this._removeModuleHandlers(oe.id),ce.label=3;case 3:return re++,[3,1];case 4:return[2]}})})},te.prototype.bind=function(J){var X=this.options.defaultScope||BindingScopeEnum.Transient,re=new Binding(J,X);return this._bindingDictionary.add(J,re),new BindingToSyntax(re)},te.prototype.rebind=function(J){return this.unbind(J),this.bind(J)},te.prototype.rebindAsync=function(J){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(X){switch(X.label){case 0:return[4,this.unbindAsync(J)];case 1:return X.sent(),[2,this.bind(J)]}})})},te.prototype.unbind=function(J){if(this._bindingDictionary.hasKey(J)){var X=this._bindingDictionary.get(J);this._deactivateSingletons(X)}this._removeServiceFromDictionary(J)},te.prototype.unbindAsync=function(J){return __awaiter(this,void 0,void 0,function(){var X;return __generator(this,function(re){switch(re.label){case 0:return this._bindingDictionary.hasKey(J)?(X=this._bindingDictionary.get(J),[4,this._deactivateSingletonsAsync(X)]):[3,2];case 1:re.sent(),re.label=2;case 2:return this._removeServiceFromDictionary(J),[2]}})})},te.prototype.unbindAll=function(){var J=this;this._bindingDictionary.traverse(function(X,re){J._deactivateSingletons(re)}),this._bindingDictionary=new Lookup},te.prototype.unbindAllAsync=function(){return __awaiter(this,void 0,void 0,function(){var J,X=this;return __generator(this,function(re){switch(re.label){case 0:return J=[],this._bindingDictionary.traverse(function(ne,oe){J.push(X._deactivateSingletonsAsync(oe))}),[4,Promise.all(J)];case 1:return re.sent(),this._bindingDictionary=new Lookup,[2]}})})},te.prototype.onActivation=function(J,X){this._activations.add(J,X)},te.prototype.onDeactivation=function(J,X){this._deactivations.add(J,X)},te.prototype.isBound=function(J){var X=this._bindingDictionary.hasKey(J);return!X&&this.parent&&(X=this.parent.isBound(J)),X},te.prototype.isCurrentBound=function(J){return this._bindingDictionary.hasKey(J)},te.prototype.isBoundNamed=function(J,X){return this.isBoundTagged(J,NAMED_TAG,X)},te.prototype.isBoundTagged=function(J,X,re){var ne=!1;if(this._bindingDictionary.hasKey(J)){var oe=this._bindingDictionary.get(J),de=createMockRequest(this,J,X,re);ne=oe.some(function(ce){return ce.constraint(de)})}return!ne&&this.parent&&(ne=this.parent.isBoundTagged(J,X,re)),ne},te.prototype.snapshot=function(){this._snapshots.push(ContainerSnapshot.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))},te.prototype.restore=function(){var J=this._snapshots.pop();if(J===void 0)throw new Error(NO_MORE_SNAPSHOTS_AVAILABLE);this._bindingDictionary=J.bindings,this._activations=J.activations,this._deactivations=J.deactivations,this._middleware=J.middleware,this._moduleActivationStore=J.moduleActivationStore},te.prototype.createChild=function(J){var X=new te(J||this.options);return X.parent=this,X},te.prototype.applyMiddleware=function(){for(var J=[],X=0;X<arguments.length;X++)J[X]=arguments[X];var re=this._middleware?this._middleware:this._planAndResolve();this._middleware=J.reduce(function(ne,oe){return oe(ne)},re)},te.prototype.applyCustomMetadataReader=function(J){this._metadataReader=J},te.prototype.get=function(J){var X=this._getNotAllArgs(J,!1);return this._getButThrowIfAsync(X)},te.prototype.getAsync=function(J){return __awaiter(this,void 0,void 0,function(){var X;return __generator(this,function(re){return X=this._getNotAllArgs(J,!1),[2,this._get(X)]})})},te.prototype.getTagged=function(J,X,re){var ne=this._getNotAllArgs(J,!1,X,re);return this._getButThrowIfAsync(ne)},te.prototype.getTaggedAsync=function(J,X,re){return __awaiter(this,void 0,void 0,function(){var ne;return __generator(this,function(oe){return ne=this._getNotAllArgs(J,!1,X,re),[2,this._get(ne)]})})},te.prototype.getNamed=function(J,X){return this.getTagged(J,NAMED_TAG,X)},te.prototype.getNamedAsync=function(J,X){return this.getTaggedAsync(J,NAMED_TAG,X)},te.prototype.getAll=function(J){var X=this._getAllArgs(J);return this._getButThrowIfAsync(X)},te.prototype.getAllAsync=function(J){var X=this._getAllArgs(J);return this._getAll(X)},te.prototype.getAllTagged=function(J,X,re){var ne=this._getNotAllArgs(J,!0,X,re);return this._getButThrowIfAsync(ne)},te.prototype.getAllTaggedAsync=function(J,X,re){var ne=this._getNotAllArgs(J,!0,X,re);return this._getAll(ne)},te.prototype.getAllNamed=function(J,X){return this.getAllTagged(J,NAMED_TAG,X)},te.prototype.getAllNamedAsync=function(J,X){return this.getAllTaggedAsync(J,NAMED_TAG,X)},te.prototype.resolve=function(J){var X=this.isBound(J);X||this.bind(J).toSelf();var re=this.get(J);return X||this.unbind(J),re},te.prototype._preDestroy=function(J,X){var re,ne;if(Reflect.hasMetadata(PRE_DESTROY,J)){var oe=Reflect.getMetadata(PRE_DESTROY,J);return(ne=(re=X)[oe.value])===null||ne===void 0?void 0:ne.call(re)}},te.prototype._removeModuleHandlers=function(J){var X=this._moduleActivationStore.remove(J);this._activations.removeIntersection(X.onActivations),this._deactivations.removeIntersection(X.onDeactivations)},te.prototype._removeModuleBindings=function(J){return this._bindingDictionary.removeByCondition(function(X){return X.moduleId===J})},te.prototype._deactivate=function(J,X){var re=this,ne=Object.getPrototypeOf(X).constructor;try{if(this._deactivations.hasKey(J.serviceIdentifier)){var oe=this._deactivateContainer(X,this._deactivations.get(J.serviceIdentifier).values());if(isPromise(oe))return this._handleDeactivationError(oe.then(function(){return re._propagateContainerDeactivationThenBindingAndPreDestroyAsync(J,X,ne)}),ne)}var de=this._propagateContainerDeactivationThenBindingAndPreDestroy(J,X,ne);if(isPromise(de))return this._handleDeactivationError(de,ne)}catch(ce){if(ce instanceof Error)throw new Error(ON_DEACTIVATION_ERROR(ne.name,ce.message))}},te.prototype._handleDeactivationError=function(J,X){return __awaiter(this,void 0,void 0,function(){var re;return __generator(this,function(ne){switch(ne.label){case 0:return ne.trys.push([0,2,,3]),[4,J];case 1:return ne.sent(),[3,3];case 2:if(re=ne.sent(),re instanceof Error)throw new Error(ON_DEACTIVATION_ERROR(X.name,re.message));return[3,3];case 3:return[2]}})})},te.prototype._deactivateContainer=function(J,X){for(var re=this,ne=X.next();ne.value;){var oe=ne.value(J);if(isPromise(oe))return oe.then(function(){return re._deactivateContainerAsync(J,X)});ne=X.next()}},te.prototype._deactivateContainerAsync=function(J,X){return __awaiter(this,void 0,void 0,function(){var re;return __generator(this,function(ne){switch(ne.label){case 0:re=X.next(),ne.label=1;case 1:return re.value?[4,re.value(J)]:[3,3];case 2:return ne.sent(),re=X.next(),[3,1];case 3:return[2]}})})},te.prototype._getContainerModuleHelpersFactory=function(){var J=this,X=function(pe,fe){pe._binding.moduleId=fe},re=function(pe){return function(fe){var ge=J.bind(fe);return X(ge,pe),ge}},ne=function(){return function(pe){return J.unbind(pe)}},oe=function(){return function(pe){return J.unbindAsync(pe)}},de=function(){return function(pe){return J.isBound(pe)}},ce=function(pe){return function(fe){var ge=J.rebind(fe);return X(ge,pe),ge}},he=function(pe){return function(fe,ge){J._moduleActivationStore.addActivation(pe,fe,ge),J.onActivation(fe,ge)}},ue=function(pe){return function(fe,ge){J._moduleActivationStore.addDeactivation(pe,fe,ge),J.onDeactivation(fe,ge)}};return function(pe){return{bindFunction:re(pe),isboundFunction:de(),onActivationFunction:he(pe),onDeactivationFunction:ue(pe),rebindFunction:ce(pe),unbindFunction:ne(),unbindAsyncFunction:oe()}}},te.prototype._getAll=function(J){return Promise.all(this._get(J))},te.prototype._get=function(J){var X=__assign(__assign({},J),{contextInterceptor:function(ne){return ne},targetType:TargetTypeEnum.Variable});if(this._middleware){var re=this._middleware(X);if(re==null)throw new Error(INVALID_MIDDLEWARE_RETURN);return re}return this._planAndResolve()(X)},te.prototype._getButThrowIfAsync=function(J){var X=this._get(J);if(isPromiseOrContainsPromise(X))throw new Error(LAZY_IN_SYNC(J.serviceIdentifier));return X},te.prototype._getAllArgs=function(J){var X={avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:J};return X},te.prototype._getNotAllArgs=function(J,X,re,ne){var oe={avoidConstraints:!1,isMultiInject:X,serviceIdentifier:J,key:re,value:ne};return oe},te.prototype._planAndResolve=function(){var J=this;return function(X){var re=plan(J._metadataReader,J,X.isMultiInject,X.targetType,X.serviceIdentifier,X.key,X.value,X.avoidConstraints);re=X.contextInterceptor(re);var ne=resolve(re);return ne}},te.prototype._deactivateIfSingleton=function(J){var X=this;if(J.activated)return isPromise(J.cache)?J.cache.then(function(re){return X._deactivate(J,re)}):this._deactivate(J,J.cache)},te.prototype._deactivateSingletons=function(J){for(var X=0,re=J;X<re.length;X++){var ne=re[X],oe=this._deactivateIfSingleton(ne);if(isPromise(oe))throw new Error(ASYNC_UNBIND_REQUIRED)}},te.prototype._deactivateSingletonsAsync=function(J){return __awaiter(this,void 0,void 0,function(){var X=this;return __generator(this,function(re){switch(re.label){case 0:return[4,Promise.all(J.map(function(ne){return X._deactivateIfSingleton(ne)}))];case 1:return re.sent(),[2]}})})},te.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(J,X,re){return this.parent?this._deactivate.bind(this.parent)(J,X):this._bindingDeactivationAndPreDestroy(J,X,re)},te.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(J,X,re){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(ne){switch(ne.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(J,X)]:[3,2];case 1:return ne.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(J,X,re)];case 3:ne.sent(),ne.label=4;case 4:return[2]}})})},te.prototype._removeServiceFromDictionary=function(J){try{this._bindingDictionary.remove(J)}catch{throw new Error(CANNOT_UNBIND+" "+getServiceIdentifierAsString(J))}},te.prototype._bindingDeactivationAndPreDestroy=function(J,X,re){var ne=this;if(typeof J.onDeactivation=="function"){var oe=J.onDeactivation(X);if(isPromise(oe))return oe.then(function(){return ne._preDestroy(re,X)})}return this._preDestroy(re,X)},te.prototype._bindingDeactivationAndPreDestroyAsync=function(J,X,re){return __awaiter(this,void 0,void 0,function(){return __generator(this,function(ne){switch(ne.label){case 0:return typeof J.onDeactivation!="function"?[3,2]:[4,J.onDeactivation(X)];case 1:ne.sent(),ne.label=2;case 2:return[4,this._preDestroy(re,X)];case 3:return ne.sent(),[2]}})})},te}();function getFirstArrayDuplicate(te){for(var J=new Set,X=0,re=te;X<re.length;X++){var ne=re[X];if(J.has(ne))return ne;J.add(ne)}}function targetIsConstructorFunction(te){return te.prototype!==void 0}function _throwIfMethodParameter(te){if(te!==void 0)throw new Error(INVALID_DECORATOR_OPERATION)}function tagParameter(te,J,X,re){_throwIfMethodParameter(J),_tagParameterOrProperty(TAGGED,te,X.toString(),re)}function tagProperty(te,J,X){if(targetIsConstructorFunction(te))throw new Error(INVALID_DECORATOR_OPERATION);_tagParameterOrProperty(TAGGED_PROP,te.constructor,J,X)}function _ensureNoMetadataKeyDuplicates(te){var J=[];if(Array.isArray(te)){J=te;var X=getFirstArrayDuplicate(J.map(function(re){return re.key}));if(X!==void 0)throw new Error(DUPLICATED_METADATA+" "+X.toString())}else J=[te];return J}function _tagParameterOrProperty(te,J,X,re){var ne=_ensureNoMetadataKeyDuplicates(re),oe={};Reflect.hasOwnMetadata(te,J)&&(oe=Reflect.getMetadata(te,J));var de=oe[X];if(de===void 0)de=[];else for(var ce=function(fe){if(ne.some(function(ge){return ge.key===fe.key}))throw new Error(DUPLICATED_METADATA+" "+fe.key.toString())},he=0,ue=de;he<ue.length;he++){var pe=ue[he];ce(pe)}de.push.apply(de,ne),oe[X]=de,Reflect.defineMetadata(te,oe,J)}function createTaggedDecorator(te){return function(J,X,re){typeof re=="number"?tagParameter(J,X,re,te):tagProperty(J,X,te)}}function injectable(){return function(te){if(Reflect.hasOwnMetadata(PARAM_TYPES,te))throw new Error(DUPLICATED_INJECTABLE_DECORATOR);var J=Reflect.getMetadata(DESIGN_PARAM_TYPES,te)||[];return Reflect.defineMetadata(PARAM_TYPES,J,te),te}}function injectBase(te){return function(J){return function(X,re,ne){if(J===void 0){var oe=typeof X=="function"?X.name:X.constructor.name;throw new Error(UNDEFINED_INJECT_ANNOTATION(oe))}return createTaggedDecorator(new Metadata(te,J))(X,re,ne)}}}var inject=injectBase(INJECT_TAG);const registerRequest$1=(te,J)=>(X,re)=>{J.bind(re).to(re).inTransientScope(),injectable()(re);const ne=te.broker.registerRequest(X,oe=>J.get(re).handle(oe));return{dispose:()=>{J.isBound(re)&&J.unbind(re),ne.dispose()}}},brokerExtensions=(te,J)=>({registerRequest:registerRequest$1(te,J)});function rand(te){const J=Math.random()*16|0;return(te==="x"?J:J&3|8).toString(16)}function generateId(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,rand)}const mapArrayToLabelValue=(te,J,X)=>te.map(re=>({label:re[J],value:re[X]}));function createConnectToStoreDecorator(te){return function(X){return(re,ne)=>{Object.defineProperty(re,ne,{get(){return this[`__${ne}`]},set(ce){this[`__${ne}`]!==ce&&(this[`__${ne}`]=Array.isArray(ce)?[...ce]:typeof ce=="object"&&ce!==null?{...ce}:ce,this.requestUpdate(ne))},configurable:!0,enumerable:!0});const oe=re.connectedCallback,de=re.disconnectedCallback;re.connectedCallback=function(){oe&&oe.call(this),this[ne]=X(te.getState()),this[`__unsubscribe__${ne}`]=te.subscribe(()=>{const ce=X(te.getState());this[ne]=Array.isArray(ce)?[...ce]:typeof ce=="object"&&ce!==null?{...ce}:ce})},re.disconnectedCallback=function(){de&&de.call(this),this[`__unsubscribe__${ne}`]&&this[`__unsubscribe__${ne}`]()}}}}function createConnectedProperty(te){return(J,X={})=>{const re=createConnectToStoreDecorator(te);return(ne,oe)=>{n$x(X)(ne,oe),re(J)(ne,oe)}}}const pdfViewerId="pdf-viewer";let shellLocaleManager;const useLocalization=async te=>{L$3("ca"),shellLocaleManager=await te.createLocaleManager(locales$1)},translate$1=te=>shellLocaleManager?shellLocaleManager.translate(te):te,locales$1={ca:{[primariaShellId]:{title:"Estació de Treball Clínica",actions:{create:"Crear",toggleMenuClose:"Tancar menú",toggleMenuOpen:"Expandir menú",askExit:"Atenció, vols sortir igualment?",finalizeVisit:"Finalitzar visita"},clinicalMonitoring:{title:"Seguiment clínic"},errors:{session:"Hi ha hagut un error amb la sessió. Siusplau, tanca i torna a obrir l'aplicació.",invalidPatient:"El pacient actual no és vàlid. Siusplau, tanca i torna a obrir l'aplicació."},header:{workCenter:"Centre treball",role:"Rol",speciality:"Àmbit treball"},busyManager:{title:"Tasques pendents a desar:"},pdfManager:{uploaded:"Document disponible al visor de resultats",alreadyUploaded:"Ja s'ha carregat un document amb aquest nom",navButtonLabel:"Visor PDF",missingData:"Es necesita un document o URL per enviar al visor de resultats",duplicatedSource:"Només pots envar un document o URL a la vegada"},pdfVisor:{noPdfSelected:"No hi ha cap PDF seleccionat"}}}},styles$l=".item{display:flex;cursor:pointer;border-radius:8px;padding:8px;justify-content:center;transition:background-color .3s ease}.item[expanded]{justify-content:space-between}.item:hover{background-color:var(--color-primary-900);color:#fff}.item .icon-label{display:flex;gap:8px;transition:background-color .3s}.item.active{outline:2px solid white;outline-offset:-2px}";/**
211
211
  * @license
212
212
  * Copyright 2017 Google LLC
213
213
  * SPDX-License-Identifier: BSD-3-Clause
@@ -325,7 +325,7 @@ Registered bindings:`,ne.forEach(function(oe){var de="Object";oe.implementationT
325
325
  ${template$i(this)}
326
326
  `}static get styles(){return i$A`
327
327
  ${r$H(styles$h)}
328
- `}handleTest(){console.log(this.selectedPeriodDate)}};__decorateClass$p([n$x()],ExportPdfModal.prototype,"selectedRadioOption",2),__decorateClass$p([n$x()],ExportPdfModal.prototype,"text",2),__decorateClass$p([n$x()],ExportPdfModal.prototype,"selectedVisibilityLevelElement",2),__decorateClass$p([n$x()],ExportPdfModal.prototype,"selectedPeriodDate",2),__decorateClass$p([n$x({type:Array})],ExportPdfModal.prototype,"arrayElements",2),ExportPdfModal=__decorateClass$p([t$j("export-pdf-modal")],ExportPdfModal);class ExportToPdfHandler extends ApiBaseHandler{async handle(){try{this.api.interactionService.confirm(void 0,ExportPdfModal,{title:translate("modal.selectExportOption"),confirmButtonText:"Exportar",cancelButtonText:"Cancelar"})}catch(J){this._notifyError(J.message)}}_notifyError(J){this.api.notificationService.error(J||"actions.delete.error")}}class ExportPdf{}let request$e;const bootstrapExportPdf=te=>{request$e=te.registerRequest(ExportPdf,ExportToPdfHandler)},teardownExportPdf=()=>{request$e==null||request$e.dispose()},{addActivityHistoryItems}=activityHistoryCollectionsSlice.actions;class AddHistoryItemsHandler extends StoreBaseHandler{async handle(J){try{const X=validateAndFilterBasicItems(J.items);this.store.dispatch(addActivityHistoryItems({id:J.entityId,items:X,componentFactory:J.componentFactory,searchPredicate:J.searchPredicate})),handleAddDiagnosticsFilter(X,this.store)}catch(X){console.log(X.message)}}}let request$d;const bootstrapAddHistoryItems=te=>{request$d=te.registerRequest(addHistoryItemsCommand,AddHistoryItemsHandler)},teardownAddHistoryItems=()=>{request$d==null||request$d.dispose()},{updateActivityHistoryItem}=activityHistoryCollectionsSlice.actions;class UpdateHistoryItemHandler extends StoreBaseHandler{async handle(J){try{ensureAreValidBasicActivityHistoryItems([J.item]),this.store.dispatch(updateActivityHistoryItem({id:J.entityId,item:J.item}))}catch(X){console.log(X.message)}}}const updateHistoryItemCommand="update_history_item_request";let request$c;const bootstrapUpdateHistoryItem=te=>{request$c=te.registerRequest(updateHistoryItemCommand,UpdateHistoryItemHandler)},teardownUpdateHistoryItem=()=>{request$c==null||request$c.dispose()};function connectedProperty(te,J={}){return createConnectedProperty(store)(te,J)}const activityHistorySearchStringSelector=te=>te.activityHistoryFilters.searchString;function getUniqueObjects(te,J,X,re){const ne=`Sense ${re.toLocaleLowerCase()}`,oe=new Map;let de=!1;for(const he of te){const ue=J.reduce((me,ve)=>me==null?void 0:me[ve],he),pe=X.reduce((me,ve)=>me==null?void 0:me[ve],he),fe=typeof ue=="string"&&ue.trim()!=="",ge=typeof pe=="string"&&pe.trim()!=="";fe&&ge?oe.has(ue)||oe.set(ue,{id:ue,title:pe}):de=!0}const ce=Array.from(oe.values()).sort((he,ue)=>he.title.localeCompare(ue.title,"ca",{sensitivity:"base"}));return de&&ce.push({id:"",title:ne}),ce}class TrueSpec extends Spec{isSatisfiedBy(){return!0}}class CommonFilterSpec extends Spec{constructor(J){super(),this.commonFilters=J}isSatisfiedBy(J){return this.commonFilters.filter(ne=>ne.enabled).reduce((ne,oe)=>ne.and(new oe.spec),new TrueSpec).isSatisfiedBy(J)}}class FalseSpec extends Spec{isSatisfiedBy(){return!1}}class PropPathSpec extends Spec{constructor(J,X){super(),this.propPath=J,this.value=X}isSatisfiedBy(J){return this.propPath.reduce((re,ne)=>re==null?void 0:re[ne],J)===this.value}}class CustomFilterSpec extends Spec{constructor(J){super(),this.filters=J}isSatisfiedBy(J){const X=this.filters.filter(re=>re.enabled);return X.length===0?!0:X.every(re=>{if(!this.belongsToGroup(J,re))return!0;const ne=re.filters.filter(oe=>oe.enabled||oe.singleOption);return ne.length===0?!0:ne.every(oe=>oe.singleOption?oe.enabled?!0:new PropPathSpec(oe.propPathValue,!1).isSatisfiedBy(J):!oe.enabledValues||oe.enabledValues.length===0?!0:oe.enabledValues.reduce((ce,he)=>ce.or(new PropPathSpec(oe.propPathValue,he)),new FalseSpec).isSatisfiedBy(J))})}belongsToGroup(J,X){return J.type===X.id}}const normalizeStringToNFD=te=>te==null?"":String(te).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase(),propContainsString=(te,J)=>{const X=normalizeStringToNFD(te),re=normalizeStringToNFD(J);return X.toString().toLowerCase().indexOf(re)!==-1||X.toString().indexOf(re)!==-1},commonFieldsSearchPredicate=(te,J)=>{var he,ue,pe,fe,ge,me,ve,be,_e,we,Se;const X=((he=te.professional)==null?void 0:he.name)&&propContainsString((ue=te.professional)==null?void 0:ue.name,J),re=((pe=te.center)==null?void 0:pe.description)&&propContainsString(te.center.description,J),ne=((ge=(fe=te.professional)==null?void 0:fe.speciality)==null?void 0:ge.description)&&propContainsString((me=te.professional)==null?void 0:me.speciality.description,J),oe=((be=(ve=te.professional)==null?void 0:ve.role)==null?void 0:be.description)&&propContainsString((_e=te.professional)==null?void 0:_e.role.description,J),de=((we=te.service)==null?void 0:we.description)&&propContainsString(te.service.description,J),ce=(Se=te.diagnostics)==null?void 0:Se.some(Ce=>propContainsString(Ce.id,J)||propContainsString(Ce.description,J));return X||re||ne||oe||de||ce};class SearchStringSpec extends Spec{constructor(J,X){super(),this.searchString=J,this.searchPredicate=X}isSatisfiedBy(J){var ne;if(!((ne=this.searchString)!=null&&ne.trim()))return!0;const X=commonFieldsSearchPredicate(J,this.searchString),re=this.searchPredicate?this.searchPredicate(this.searchString.toLowerCase(),J):!1;return!!(X||re)}}class TypeSpec extends Spec{constructor(J){super(),this.itemType=J}isSatisfiedBy(J){return(J==null?void 0:J.type)===this.itemType}}class ComposedTypeSpec extends Spec{constructor(J){super(),this.filters=J}isSatisfiedBy(J){return this.filters.filter(ne=>ne.enabled).map(ne=>ne.id).reduce((ne,oe)=>ne.or(new TypeSpec(oe)),new FalseSpec).isSatisfiedBy(J)}}const activityHistoryFiltersSelector=te=>te.activityHistoryFilters.filters,activityHistoryCommonFiltersSelector=createSelector(activityHistoryFiltersSelector,te=>{var J;return((J=te.find(isCommonFilterGroup))==null?void 0:J.filters)||[]}),activityHistoryEnabledCommonFiltersSelector=createSelector(activityHistoryCommonFiltersSelector,te=>te.filter(J=>J.enabled)),areCommonFiltersActive=createSelector(activityHistoryEnabledCommonFiltersSelector,te=>!!te.length),activityHistoryCustomFilterGroupsSelector=createSelector(activityHistoryFiltersSelector,te=>te.filter(isCustomFilter).sort(sortBySortProperty)),sortBySortProperty=(te,J)=>Number(te.sort)-Number(J.sort),areCustomFiltersActive=createSelector(activityHistoryCustomFilterGroupsSelector,te=>te.some(J=>J.filters.some(X=>{var re;return(re=X.enabledValues)==null?void 0:re.length}))),activeGroupsWithEnabledFilters=createSelector(activityHistoryCustomFilterGroupsSelector,te=>te.filter(J=>J.enabled).map(({id:J,title:X,enabled:re,sort:ne,filters:oe})=>({id:J,title:X,enabled:re,sort:ne,filters:oe.filter(de=>{var ce;return(ce=de.enabledValues)==null?void 0:ce.length})})).filter(J=>J.filters.length>0)),areSameDiagnostics=(te,J)=>{if(te.length!==J.length)return!1;const X=te.map(ne=>ne.codi).sort(),re=J.map(ne=>ne.codi).sort();return X.every((ne,oe)=>ne===re[oe])},hasValidDiagnostic=te=>te!=null&&typeof te.codi=="string"&&typeof te.cataleg=="string"&&typeof te.descripcio=="string",hasValidDiagnostics=te=>te==null?!0:Array.isArray(te)&&te.every(hasValidDiagnostic),isSameVisit=(te,J)=>{var oe,de,ce,he,ue,pe,fe,ge,me,ve,be,_e,we,Se,Ce,ye,Ae,Le;const X=((oe=te.professional)==null?void 0:oe.id)===((de=J.professional)==null?void 0:de.id)&&((he=(ce=te.professional)==null?void 0:ce.role)==null?void 0:he.id)===((pe=(ue=J.professional)==null?void 0:ue.role)==null?void 0:pe.id)&&((ge=(fe=te.professional)==null?void 0:fe.speciality)==null?void 0:ge.id)===((ve=(me=J.professional)==null?void 0:me.speciality)==null?void 0:ve.id),re=((be=te.ep)==null?void 0:be.id)===((_e=J.ep)==null?void 0:_e.id)&&((we=te.up)==null?void 0:we.id)===((Se=J.up)==null?void 0:Se.id)&&((Ce=te.center)==null?void 0:Ce.id)===((ye=J.center)==null?void 0:ye.id)&&((Ae=te.service)==null?void 0:Ae.id)===((Le=J.service)==null?void 0:Le.id),ne=new Date(te.date).toDateString()===new Date(J.date).toDateString();return X&&re&&ne},withinEightHours=(te,J)=>Math.abs(new Date(te).getTime()-new Date(J).getTime())<=8*60*60*1e3;function groupByValidDiagnostics(te){te.forEach(J=>{const X=[],re=[];J.items.forEach(ne=>{const oe=ne.diagnostics;if((oe==null?void 0:oe.length)>0&&hasValidDiagnostics(oe)){let ce=!1;for(const he of X){const ue=he.items[0];if(areSameDiagnostics(ue.diagnostics,oe)){he.items.push(ne),ce=!0;break}}ce||X.push({idSubGroup:crypto.randomUUID(),items:[ne]})}else re.push(ne)}),J.items=re,J.subGroups=X})}const groupActivityHistoryItems=te=>{const J=[];return te==null||te.forEach(X=>{let re=!1;for(const ne of J){const oe=ne.items[0],de=ne.items[ne.items.length-1];if(isSameVisit(oe,X)&&withinEightHours(oe.date,X.date)&&withinEightHours(de.date,X.date)){ne.items.push(X),ne.sameVisit=!0,re=!0;break}}if(!re)for(const ne of J){if(ne.sameVisit)continue;const oe=ne.items[0],de=ne.items[ne.items.length-1];if(withinEightHours(oe.date,X.date)&&withinEightHours(de.date,X.date)){ne.items.push(X),re=!0;break}}re||J.push({idGroup:crypto.randomUUID(),items:[X],sameVisit:!1})}),groupByValidDiagnostics(J),J},sortGroupsByMostRecentDate=te=>{const J=oe=>oe.reduce((de,ce)=>{const he=new Date(ce.date);return he>de?he:de},new Date(0)),X=oe=>oe.sort((de,ce)=>new Date(ce.date).getTime()-new Date(de.date).getTime()),re=oe=>J(oe.items),ne=oe=>{const de=oe.items.length>0?[J(oe.items)]:[],ce=oe.subGroups.map(re),he=[...de,...ce];return he.length>0?new Date(Math.max(...he.map(ue=>ue.getTime()))):new Date(0)};return te.forEach(oe=>{oe.items=X(oe.items),oe.subGroups.forEach(de=>{de.items=X(de.items)}),oe.subGroups.sort((de,ce)=>re(ce).getTime()-re(de).getTime())}),te.sort((oe,de)=>ne(de).getTime()-ne(oe).getTime())},diagnosticFilterSelector=createSelector(activityHistoryFiltersSelector,te=>te.find(isDiagnosticFilter)),diagnosticFilterEnabledValuesSelector=createSelector(diagnosticFilterSelector,te=>(te==null?void 0:te.enabledValues)||[]),areDiagnosticFiltersActive=createSelector(diagnosticFilterEnabledValuesSelector,te=>!!te.length);class DiagnosticCodeSpec extends Spec{constructor(J){super(),this.diagnosticCodes=J}isSatisfiedBy(J){var re;return(re=this.diagnosticCodes)!=null&&re.length?(J.diagnostics??[]).some(ne=>this.diagnosticCodes.includes(ne.codi)):!0}}const activityHistoryCollectionsSelector=te=>te.activityHistoryCollections.collections,mapItemsWithMetadata=(te,J,X,re)=>te.map(ne=>({...ne,searchPredicate:re,componentFactory:J,type:X})),activityHistoryMappedItems=createSelector(activityHistoryCollectionsSelector,te=>Object.values(te).flatMap(J=>mapItemsWithMetadata(J.items,J.componentFactory,J.id,J.searchPredicate))),customFilterGroupsWithOptionsSelector=createSelector(activityHistoryCustomFilterGroupsSelector,activityHistoryCollectionsSelector,(te,J)=>te.map(re=>{const ne=J[re.id];return{...re,filters:re.filters.map(oe=>({...oe,options:(oe.singleOption?[]:getUniqueObjects(ne.items,oe.propPathValue,oe.propsPathDescription,oe.title))||[]}))}})),activityHistoryGroupedItems=createSelector(activityHistoryMappedItems,activityHistorySearchStringSelector,activityHistoryCommonFiltersSelector,activityHistoryCustomFilterGroupsSelector,diagnosticFilterEnabledValuesSelector,(te,J,X,re,ne)=>{const oe=te.filter(he=>new SearchStringSpec(J,he.searchPredicate).and(new CommonFilterSpec(X)).and(new ComposedTypeSpec(re)).and(new CustomFilterSpec(re)).and(new DiagnosticCodeSpec(ne)).isSatisfiedBy(he)),de=groupActivityHistoryItems(oe);return sortGroupsByMostRecentDate(de)}),styles$g=":host{min-height:1px;height:100%}.virtualizer{height:100%;padding-inline:16px}.container{min-height:1px;height:100%}.visit:first-child{margin-top:var(--dss-spacing-md)}.visit{width:calc(100% - var(--dss-spacing-md) - var(--dss-spacing-md));display:flex;flex-direction:column;gap:var(--dss-spacing-sm);background-color:#fff;border-radius:var(--dss-radius-sm);padding:var(--dss-spacing-sm);margin-bottom:var(--dss-spacing-md)}.visit .visit__header{display:flex;flex-direction:row;align-items:center;gap:16px}.visit .visit__header .title{flex:1;font-size:14px;line-height:24px;display:flex;flex-direction:row;gap:12px;color:var(--color-neutral-800)}.visit .visit__header .title-date{font-weight:700}.visit .visit__header .title-description{font-weight:600;display:flex;flex-direction:row;gap:4px}.visit .visit__header .highlight{background-color:#ff0;font-weight:700}.visit .visit__items{display:flex;flex-direction:column;gap:16px}.visit .visit__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .visit__items .item[has-divider]:last-of-type{border:none}.visit .diagnostics{display:flex;flex-direction:column;gap:var(--dss-spacing-sm);border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .diagnostics:last-of-type{border:none}.visit .diagnostics .diagnostics__header{display:flex;flex-direction:row;align-items:center;gap:16px}.visit .diagnostics .diagnostics__items{display:flex;flex-direction:column}.visit .diagnostics .diagnostics__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .diagnostics .diagnostics__items .item[has-divider]:last-of-type{border:none}.feedback{width:100%;height:100%;display:flex;align-items:center;justify-content:center}";function toDate(te){const J=Object.prototype.toString.call(te);return te instanceof Date||typeof te=="object"&&J==="[object Date]"?new te.constructor(+te):typeof te=="number"||J==="[object Number]"||typeof te=="string"||J==="[object String]"?new Date(te):new Date(NaN)}function constructFrom(te,J){return te instanceof Date?new te.constructor(J):new Date(J)}function addDays(te,J){const X=toDate(te);return isNaN(J)?constructFrom(te,NaN):(J&&X.setDate(X.getDate()+J),X)}const millisecondsInWeek=6048e5,millisecondsInDay=864e5,millisecondsInMinute=6e4,millisecondsInHour=36e5,millisecondsInSecond=1e3;let defaultOptions={};function getDefaultOptions$1(){return defaultOptions}function startOfWeek(te,J){var ce,he,ue,pe;const X=getDefaultOptions$1(),re=(J==null?void 0:J.weekStartsOn)??((he=(ce=J==null?void 0:J.locale)==null?void 0:ce.options)==null?void 0:he.weekStartsOn)??X.weekStartsOn??((pe=(ue=X.locale)==null?void 0:ue.options)==null?void 0:pe.weekStartsOn)??0,ne=toDate(te),oe=ne.getDay(),de=(oe<re?7:0)+oe-re;return ne.setDate(ne.getDate()-de),ne.setHours(0,0,0,0),ne}function startOfISOWeek(te){return startOfWeek(te,{weekStartsOn:1})}function getISOWeekYear(te){const J=toDate(te),X=J.getFullYear(),re=constructFrom(te,0);re.setFullYear(X+1,0,4),re.setHours(0,0,0,0);const ne=startOfISOWeek(re),oe=constructFrom(te,0);oe.setFullYear(X,0,4),oe.setHours(0,0,0,0);const de=startOfISOWeek(oe);return J.getTime()>=ne.getTime()?X+1:J.getTime()>=de.getTime()?X:X-1}function startOfDay(te){const J=toDate(te);return J.setHours(0,0,0,0),J}function getTimezoneOffsetInMilliseconds(te){const J=toDate(te),X=new Date(Date.UTC(J.getFullYear(),J.getMonth(),J.getDate(),J.getHours(),J.getMinutes(),J.getSeconds(),J.getMilliseconds()));return X.setUTCFullYear(J.getFullYear()),+te-+X}function differenceInCalendarDays(te,J){const X=startOfDay(te),re=startOfDay(J),ne=+X-getTimezoneOffsetInMilliseconds(X),oe=+re-getTimezoneOffsetInMilliseconds(re);return Math.round((ne-oe)/millisecondsInDay)}function startOfISOWeekYear(te){const J=getISOWeekYear(te),X=constructFrom(te,0);return X.setFullYear(J,0,4),X.setHours(0,0,0,0),startOfISOWeek(X)}function isDate(te){return te instanceof Date||typeof te=="object"&&Object.prototype.toString.call(te)==="[object Date]"}function isValid(te){if(!isDate(te)&&typeof te!="number")return!1;const J=toDate(te);return!isNaN(Number(J))}function endOfMonth(te){const J=toDate(te),X=J.getMonth();return J.setFullYear(J.getFullYear(),X+1,0),J.setHours(23,59,59,999),J}function eachDayOfInterval(te,J){const X=toDate(te.start),re=toDate(te.end);let ne=+X>+re;const oe=ne?+X:+re,de=ne?re:X;de.setHours(0,0,0,0);let ce=1;const he=[];for(;+de<=oe;)he.push(toDate(de)),de.setDate(de.getDate()+ce),de.setHours(0,0,0,0);return ne?he.reverse():he}function startOfMonth(te){const J=toDate(te);return J.setDate(1),J.setHours(0,0,0,0),J}function startOfYear(te){const J=toDate(te),X=constructFrom(te,0);return X.setFullYear(J.getFullYear(),0,1),X.setHours(0,0,0,0),X}const formatDistanceLocale={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},formatDistance=(te,J,X)=>{let re;const ne=formatDistanceLocale[te];return typeof ne=="string"?re=ne:J===1?re=ne.one:re=ne.other.replace("{{count}}",J.toString()),X!=null&&X.addSuffix?X.comparison&&X.comparison>0?"in "+re:re+" ago":re};function buildFormatLongFn(te){return(J={})=>{const X=J.width?String(J.width):te.defaultWidth;return te.formats[X]||te.formats[te.defaultWidth]}}const dateFormats={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},timeFormats={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong={date:buildFormatLongFn({formats:dateFormats,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats,defaultWidth:"full"})},formatRelativeLocale={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},formatRelative=(te,J,X,re)=>formatRelativeLocale[te];function buildLocalizeFn(te){return(J,X)=>{const re=X!=null&&X.context?String(X.context):"standalone";let ne;if(re==="formatting"&&te.formattingValues){const de=te.defaultFormattingWidth||te.defaultWidth,ce=X!=null&&X.width?String(X.width):de;ne=te.formattingValues[ce]||te.formattingValues[de]}else{const de=te.defaultWidth,ce=X!=null&&X.width?String(X.width):te.defaultWidth;ne=te.values[ce]||te.values[de]}const oe=te.argumentCallback?te.argumentCallback(J):J;return ne[oe]}}const eraValues={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dayValues={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},formattingDayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ordinalNumber=(te,J)=>{const X=Number(te),re=X%100;if(re>20||re<10)switch(re%10){case 1:return X+"st";case 2:return X+"nd";case 3:return X+"rd"}return X+"th"},localize={ordinalNumber,era:buildLocalizeFn({values:eraValues,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues,defaultWidth:"wide",argumentCallback:te=>te-1}),month:buildLocalizeFn({values:monthValues,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues,defaultWidth:"wide",formattingValues:formattingDayPeriodValues,defaultFormattingWidth:"wide"})};function buildMatchFn(te){return(J,X={})=>{const re=X.width,ne=re&&te.matchPatterns[re]||te.matchPatterns[te.defaultMatchWidth],oe=J.match(ne);if(!oe)return null;const de=oe[0],ce=re&&te.parsePatterns[re]||te.parsePatterns[te.defaultParseWidth],he=Array.isArray(ce)?findIndex(ce,fe=>fe.test(de)):findKey(ce,fe=>fe.test(de));let ue;ue=te.valueCallback?te.valueCallback(he):he,ue=X.valueCallback?X.valueCallback(ue):ue;const pe=J.slice(de.length);return{value:ue,rest:pe}}}function findKey(te,J){for(const X in te)if(Object.prototype.hasOwnProperty.call(te,X)&&J(te[X]))return X}function findIndex(te,J){for(let X=0;X<te.length;X++)if(J(te[X]))return X}function buildMatchPatternFn(te){return(J,X={})=>{const re=J.match(te.matchPattern);if(!re)return null;const ne=re[0],oe=J.match(te.parsePattern);if(!oe)return null;let de=te.valueCallback?te.valueCallback(oe[0]):oe[0];de=X.valueCallback?X.valueCallback(de):de;const ce=J.slice(ne.length);return{value:de,rest:ce}}}const matchOrdinalNumberPattern=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern=/\d+/i,matchEraPatterns={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},parseEraPatterns={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},parseMonthPatterns={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},parseDayPatterns={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},matchDayPeriodPatterns={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},parseDayPeriodPatterns={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},match={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern,parsePattern:parseOrdinalNumberPattern,valueCallback:te=>parseInt(te,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns,defaultParseWidth:"any",valueCallback:te=>te+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns,defaultParseWidth:"any"})},enUS={code:"en-US",formatDistance,formatLong,formatRelative,localize,match,options:{weekStartsOn:0,firstWeekContainsDate:1}};function getDayOfYear(te){const J=toDate(te);return differenceInCalendarDays(J,startOfYear(J))+1}function getISOWeek(te){const J=toDate(te),X=+startOfISOWeek(J)-+startOfISOWeekYear(J);return Math.round(X/millisecondsInWeek)+1}function getWeekYear(te,J){var pe,fe,ge,me;const X=toDate(te),re=X.getFullYear(),ne=getDefaultOptions$1(),oe=(J==null?void 0:J.firstWeekContainsDate)??((fe=(pe=J==null?void 0:J.locale)==null?void 0:pe.options)==null?void 0:fe.firstWeekContainsDate)??ne.firstWeekContainsDate??((me=(ge=ne.locale)==null?void 0:ge.options)==null?void 0:me.firstWeekContainsDate)??1,de=constructFrom(te,0);de.setFullYear(re+1,0,oe),de.setHours(0,0,0,0);const ce=startOfWeek(de,J),he=constructFrom(te,0);he.setFullYear(re,0,oe),he.setHours(0,0,0,0);const ue=startOfWeek(he,J);return X.getTime()>=ce.getTime()?re+1:X.getTime()>=ue.getTime()?re:re-1}function startOfWeekYear(te,J){var ce,he,ue,pe;const X=getDefaultOptions$1(),re=(J==null?void 0:J.firstWeekContainsDate)??((he=(ce=J==null?void 0:J.locale)==null?void 0:ce.options)==null?void 0:he.firstWeekContainsDate)??X.firstWeekContainsDate??((pe=(ue=X.locale)==null?void 0:ue.options)==null?void 0:pe.firstWeekContainsDate)??1,ne=getWeekYear(te,J),oe=constructFrom(te,0);return oe.setFullYear(ne,0,re),oe.setHours(0,0,0,0),startOfWeek(oe,J)}function getWeek(te,J){const X=toDate(te),re=+startOfWeek(X,J)-+startOfWeekYear(X,J);return Math.round(re/millisecondsInWeek)+1}function addLeadingZeros(te,J){const X=te<0?"-":"",re=Math.abs(te).toString().padStart(J,"0");return X+re}const lightFormatters={y(te,J){const X=te.getFullYear(),re=X>0?X:1-X;return addLeadingZeros(J==="yy"?re%100:re,J.length)},M(te,J){const X=te.getMonth();return J==="M"?String(X+1):addLeadingZeros(X+1,2)},d(te,J){return addLeadingZeros(te.getDate(),J.length)},a(te,J){const X=te.getHours()/12>=1?"pm":"am";switch(J){case"a":case"aa":return X.toUpperCase();case"aaa":return X;case"aaaaa":return X[0];case"aaaa":default:return X==="am"?"a.m.":"p.m."}},h(te,J){return addLeadingZeros(te.getHours()%12||12,J.length)},H(te,J){return addLeadingZeros(te.getHours(),J.length)},m(te,J){return addLeadingZeros(te.getMinutes(),J.length)},s(te,J){return addLeadingZeros(te.getSeconds(),J.length)},S(te,J){const X=J.length,re=te.getMilliseconds(),ne=Math.trunc(re*Math.pow(10,X-3));return addLeadingZeros(ne,J.length)}},dayPeriodEnum={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},formatters={G:function(te,J,X){const re=te.getFullYear()>0?1:0;switch(J){case"G":case"GG":case"GGG":return X.era(re,{width:"abbreviated"});case"GGGGG":return X.era(re,{width:"narrow"});case"GGGG":default:return X.era(re,{width:"wide"})}},y:function(te,J,X){if(J==="yo"){const re=te.getFullYear(),ne=re>0?re:1-re;return X.ordinalNumber(ne,{unit:"year"})}return lightFormatters.y(te,J)},Y:function(te,J,X,re){const ne=getWeekYear(te,re),oe=ne>0?ne:1-ne;if(J==="YY"){const de=oe%100;return addLeadingZeros(de,2)}return J==="Yo"?X.ordinalNumber(oe,{unit:"year"}):addLeadingZeros(oe,J.length)},R:function(te,J){const X=getISOWeekYear(te);return addLeadingZeros(X,J.length)},u:function(te,J){const X=te.getFullYear();return addLeadingZeros(X,J.length)},Q:function(te,J,X){const re=Math.ceil((te.getMonth()+1)/3);switch(J){case"Q":return String(re);case"QQ":return addLeadingZeros(re,2);case"Qo":return X.ordinalNumber(re,{unit:"quarter"});case"QQQ":return X.quarter(re,{width:"abbreviated",context:"formatting"});case"QQQQQ":return X.quarter(re,{width:"narrow",context:"formatting"});case"QQQQ":default:return X.quarter(re,{width:"wide",context:"formatting"})}},q:function(te,J,X){const re=Math.ceil((te.getMonth()+1)/3);switch(J){case"q":return String(re);case"qq":return addLeadingZeros(re,2);case"qo":return X.ordinalNumber(re,{unit:"quarter"});case"qqq":return X.quarter(re,{width:"abbreviated",context:"standalone"});case"qqqqq":return X.quarter(re,{width:"narrow",context:"standalone"});case"qqqq":default:return X.quarter(re,{width:"wide",context:"standalone"})}},M:function(te,J,X){const re=te.getMonth();switch(J){case"M":case"MM":return lightFormatters.M(te,J);case"Mo":return X.ordinalNumber(re+1,{unit:"month"});case"MMM":return X.month(re,{width:"abbreviated",context:"formatting"});case"MMMMM":return X.month(re,{width:"narrow",context:"formatting"});case"MMMM":default:return X.month(re,{width:"wide",context:"formatting"})}},L:function(te,J,X){const re=te.getMonth();switch(J){case"L":return String(re+1);case"LL":return addLeadingZeros(re+1,2);case"Lo":return X.ordinalNumber(re+1,{unit:"month"});case"LLL":return X.month(re,{width:"abbreviated",context:"standalone"});case"LLLLL":return X.month(re,{width:"narrow",context:"standalone"});case"LLLL":default:return X.month(re,{width:"wide",context:"standalone"})}},w:function(te,J,X,re){const ne=getWeek(te,re);return J==="wo"?X.ordinalNumber(ne,{unit:"week"}):addLeadingZeros(ne,J.length)},I:function(te,J,X){const re=getISOWeek(te);return J==="Io"?X.ordinalNumber(re,{unit:"week"}):addLeadingZeros(re,J.length)},d:function(te,J,X){return J==="do"?X.ordinalNumber(te.getDate(),{unit:"date"}):lightFormatters.d(te,J)},D:function(te,J,X){const re=getDayOfYear(te);return J==="Do"?X.ordinalNumber(re,{unit:"dayOfYear"}):addLeadingZeros(re,J.length)},E:function(te,J,X){const re=te.getDay();switch(J){case"E":case"EE":case"EEE":return X.day(re,{width:"abbreviated",context:"formatting"});case"EEEEE":return X.day(re,{width:"narrow",context:"formatting"});case"EEEEEE":return X.day(re,{width:"short",context:"formatting"});case"EEEE":default:return X.day(re,{width:"wide",context:"formatting"})}},e:function(te,J,X,re){const ne=te.getDay(),oe=(ne-re.weekStartsOn+8)%7||7;switch(J){case"e":return String(oe);case"ee":return addLeadingZeros(oe,2);case"eo":return X.ordinalNumber(oe,{unit:"day"});case"eee":return X.day(ne,{width:"abbreviated",context:"formatting"});case"eeeee":return X.day(ne,{width:"narrow",context:"formatting"});case"eeeeee":return X.day(ne,{width:"short",context:"formatting"});case"eeee":default:return X.day(ne,{width:"wide",context:"formatting"})}},c:function(te,J,X,re){const ne=te.getDay(),oe=(ne-re.weekStartsOn+8)%7||7;switch(J){case"c":return String(oe);case"cc":return addLeadingZeros(oe,J.length);case"co":return X.ordinalNumber(oe,{unit:"day"});case"ccc":return X.day(ne,{width:"abbreviated",context:"standalone"});case"ccccc":return X.day(ne,{width:"narrow",context:"standalone"});case"cccccc":return X.day(ne,{width:"short",context:"standalone"});case"cccc":default:return X.day(ne,{width:"wide",context:"standalone"})}},i:function(te,J,X){const re=te.getDay(),ne=re===0?7:re;switch(J){case"i":return String(ne);case"ii":return addLeadingZeros(ne,J.length);case"io":return X.ordinalNumber(ne,{unit:"day"});case"iii":return X.day(re,{width:"abbreviated",context:"formatting"});case"iiiii":return X.day(re,{width:"narrow",context:"formatting"});case"iiiiii":return X.day(re,{width:"short",context:"formatting"});case"iiii":default:return X.day(re,{width:"wide",context:"formatting"})}},a:function(te,J,X){const ne=te.getHours()/12>=1?"pm":"am";switch(J){case"a":case"aa":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"});case"aaa":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return X.dayPeriod(ne,{width:"narrow",context:"formatting"});case"aaaa":default:return X.dayPeriod(ne,{width:"wide",context:"formatting"})}},b:function(te,J,X){const re=te.getHours();let ne;switch(re===12?ne=dayPeriodEnum.noon:re===0?ne=dayPeriodEnum.midnight:ne=re/12>=1?"pm":"am",J){case"b":case"bb":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"});case"bbb":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return X.dayPeriod(ne,{width:"narrow",context:"formatting"});case"bbbb":default:return X.dayPeriod(ne,{width:"wide",context:"formatting"})}},B:function(te,J,X){const re=te.getHours();let ne;switch(re>=17?ne=dayPeriodEnum.evening:re>=12?ne=dayPeriodEnum.afternoon:re>=4?ne=dayPeriodEnum.morning:ne=dayPeriodEnum.night,J){case"B":case"BB":case"BBB":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"});case"BBBBB":return X.dayPeriod(ne,{width:"narrow",context:"formatting"});case"BBBB":default:return X.dayPeriod(ne,{width:"wide",context:"formatting"})}},h:function(te,J,X){if(J==="ho"){let re=te.getHours()%12;return re===0&&(re=12),X.ordinalNumber(re,{unit:"hour"})}return lightFormatters.h(te,J)},H:function(te,J,X){return J==="Ho"?X.ordinalNumber(te.getHours(),{unit:"hour"}):lightFormatters.H(te,J)},K:function(te,J,X){const re=te.getHours()%12;return J==="Ko"?X.ordinalNumber(re,{unit:"hour"}):addLeadingZeros(re,J.length)},k:function(te,J,X){let re=te.getHours();return re===0&&(re=24),J==="ko"?X.ordinalNumber(re,{unit:"hour"}):addLeadingZeros(re,J.length)},m:function(te,J,X){return J==="mo"?X.ordinalNumber(te.getMinutes(),{unit:"minute"}):lightFormatters.m(te,J)},s:function(te,J,X){return J==="so"?X.ordinalNumber(te.getSeconds(),{unit:"second"}):lightFormatters.s(te,J)},S:function(te,J){return lightFormatters.S(te,J)},X:function(te,J,X){const re=te.getTimezoneOffset();if(re===0)return"Z";switch(J){case"X":return formatTimezoneWithOptionalMinutes(re);case"XXXX":case"XX":return formatTimezone(re);case"XXXXX":case"XXX":default:return formatTimezone(re,":")}},x:function(te,J,X){const re=te.getTimezoneOffset();switch(J){case"x":return formatTimezoneWithOptionalMinutes(re);case"xxxx":case"xx":return formatTimezone(re);case"xxxxx":case"xxx":default:return formatTimezone(re,":")}},O:function(te,J,X){const re=te.getTimezoneOffset();switch(J){case"O":case"OO":case"OOO":return"GMT"+formatTimezoneShort(re,":");case"OOOO":default:return"GMT"+formatTimezone(re,":")}},z:function(te,J,X){const re=te.getTimezoneOffset();switch(J){case"z":case"zz":case"zzz":return"GMT"+formatTimezoneShort(re,":");case"zzzz":default:return"GMT"+formatTimezone(re,":")}},t:function(te,J,X){const re=Math.trunc(te.getTime()/1e3);return addLeadingZeros(re,J.length)},T:function(te,J,X){const re=te.getTime();return addLeadingZeros(re,J.length)}};function formatTimezoneShort(te,J=""){const X=te>0?"-":"+",re=Math.abs(te),ne=Math.trunc(re/60),oe=re%60;return oe===0?X+String(ne):X+String(ne)+J+addLeadingZeros(oe,2)}function formatTimezoneWithOptionalMinutes(te,J){return te%60===0?(te>0?"-":"+")+addLeadingZeros(Math.abs(te)/60,2):formatTimezone(te,J)}function formatTimezone(te,J=""){const X=te>0?"-":"+",re=Math.abs(te),ne=addLeadingZeros(Math.trunc(re/60),2),oe=addLeadingZeros(re%60,2);return X+ne+J+oe}const dateLongFormatter=(te,J)=>{switch(te){case"P":return J.date({width:"short"});case"PP":return J.date({width:"medium"});case"PPP":return J.date({width:"long"});case"PPPP":default:return J.date({width:"full"})}},timeLongFormatter=(te,J)=>{switch(te){case"p":return J.time({width:"short"});case"pp":return J.time({width:"medium"});case"ppp":return J.time({width:"long"});case"pppp":default:return J.time({width:"full"})}},dateTimeLongFormatter=(te,J)=>{const X=te.match(/(P+)(p+)?/)||[],re=X[1],ne=X[2];if(!ne)return dateLongFormatter(te,J);let oe;switch(re){case"P":oe=J.dateTime({width:"short"});break;case"PP":oe=J.dateTime({width:"medium"});break;case"PPP":oe=J.dateTime({width:"long"});break;case"PPPP":default:oe=J.dateTime({width:"full"});break}return oe.replace("{{date}}",dateLongFormatter(re,J)).replace("{{time}}",timeLongFormatter(ne,J))},longFormatters={p:timeLongFormatter,P:dateTimeLongFormatter},dayOfYearTokenRE=/^D+$/,weekYearTokenRE=/^Y+$/,throwTokens=["D","DD","YY","YYYY"];function isProtectedDayOfYearToken(te){return dayOfYearTokenRE.test(te)}function isProtectedWeekYearToken(te){return weekYearTokenRE.test(te)}function warnOrThrowProtectedError(te,J,X){const re=message(te,J,X);if(console.warn(re),throwTokens.includes(te))throw new RangeError(re)}function message(te,J,X){const re=te[0]==="Y"?"years":"days of the month";return`Use \`${te.toLowerCase()}\` instead of \`${te}\` (in \`${J}\`) for formatting ${re} to the input \`${X}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const formattingTokensRegExp$1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp$1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp$1=/^'([^]*?)'?$/,doubleQuoteRegExp$1=/''/g,unescapedLatinCharacterRegExp$1=/[a-zA-Z]/;function format(te,J,X){var pe,fe,ge,me;const re=getDefaultOptions$1(),ne=re.locale??enUS,oe=re.firstWeekContainsDate??((fe=(pe=re.locale)==null?void 0:pe.options)==null?void 0:fe.firstWeekContainsDate)??1,de=re.weekStartsOn??((me=(ge=re.locale)==null?void 0:ge.options)==null?void 0:me.weekStartsOn)??0,ce=toDate(te);if(!isValid(ce))throw new RangeError("Invalid time value");let he=J.match(longFormattingTokensRegExp$1).map(ve=>{const be=ve[0];if(be==="p"||be==="P"){const _e=longFormatters[be];return _e(ve,ne.formatLong)}return ve}).join("").match(formattingTokensRegExp$1).map(ve=>{if(ve==="''")return{isToken:!1,value:"'"};const be=ve[0];if(be==="'")return{isToken:!1,value:cleanEscapedString$1(ve)};if(formatters[be])return{isToken:!0,value:ve};if(be.match(unescapedLatinCharacterRegExp$1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+be+"`");return{isToken:!1,value:ve}});ne.localize.preprocessor&&(he=ne.localize.preprocessor(ce,he));const ue={firstWeekContainsDate:oe,weekStartsOn:de,locale:ne};return he.map(ve=>{if(!ve.isToken)return ve.value;const be=ve.value;(isProtectedWeekYearToken(be)||isProtectedDayOfYearToken(be))&&warnOrThrowProtectedError(be,J,String(te));const _e=formatters[be[0]];return _e(ce,be,ne.localize,ue)}).join("")}function cleanEscapedString$1(te){const J=te.match(escapedStringRegExp$1);return J?J[1].replace(doubleQuoteRegExp$1,"'"):te}function getDay(te){return toDate(te).getDay()}function getDefaultOptions(){return Object.assign({},getDefaultOptions$1())}function getISODay(te){let X=toDate(te).getDay();return X===0&&(X=7),X}function transpose(te,J){const X=J instanceof Date?constructFrom(J,0):new J(0);return X.setFullYear(te.getFullYear(),te.getMonth(),te.getDate()),X.setHours(te.getHours(),te.getMinutes(),te.getSeconds(),te.getMilliseconds()),X}const TIMEZONE_UNIT_PRIORITY=10;class Setter{constructor(){Nt(this,"subPriority",0)}validate(J,X){return!0}}class ValueSetter extends Setter{constructor(J,X,re,ne,oe){super(),this.value=J,this.validateValue=X,this.setValue=re,this.priority=ne,oe&&(this.subPriority=oe)}validate(J,X){return this.validateValue(J,this.value,X)}set(J,X,re){return this.setValue(J,X,this.value,re)}}class DateToSystemTimezoneSetter extends Setter{constructor(){super(...arguments);Nt(this,"priority",TIMEZONE_UNIT_PRIORITY);Nt(this,"subPriority",-1)}set(X,re){return re.timestampIsSet?X:constructFrom(X,transpose(X,Date))}}class Parser{run(J,X,re,ne){const oe=this.parse(J,X,re,ne);return oe?{setter:new ValueSetter(oe.value,this.validate,this.set,this.priority,this.subPriority),rest:oe.rest}:null}validate(J,X,re){return!0}}class EraParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",140);Nt(this,"incompatibleTokens",["R","u","t","T"])}parse(X,re,ne){switch(re){case"G":case"GG":case"GGG":return ne.era(X,{width:"abbreviated"})||ne.era(X,{width:"narrow"});case"GGGGG":return ne.era(X,{width:"narrow"});case"GGGG":default:return ne.era(X,{width:"wide"})||ne.era(X,{width:"abbreviated"})||ne.era(X,{width:"narrow"})}}set(X,re,ne){return re.era=ne,X.setFullYear(ne,0,1),X.setHours(0,0,0,0),X}}const numericPatterns={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},timezonePatterns={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function mapValue(te,J){return te&&{value:J(te.value),rest:te.rest}}function parseNumericPattern(te,J){const X=J.match(te);return X?{value:parseInt(X[0],10),rest:J.slice(X[0].length)}:null}function parseTimezonePattern(te,J){const X=J.match(te);if(!X)return null;if(X[0]==="Z")return{value:0,rest:J.slice(1)};const re=X[1]==="+"?1:-1,ne=X[2]?parseInt(X[2],10):0,oe=X[3]?parseInt(X[3],10):0,de=X[5]?parseInt(X[5],10):0;return{value:re*(ne*millisecondsInHour+oe*millisecondsInMinute+de*millisecondsInSecond),rest:J.slice(X[0].length)}}function parseAnyDigitsSigned(te){return parseNumericPattern(numericPatterns.anyDigitsSigned,te)}function parseNDigits(te,J){switch(te){case 1:return parseNumericPattern(numericPatterns.singleDigit,J);case 2:return parseNumericPattern(numericPatterns.twoDigits,J);case 3:return parseNumericPattern(numericPatterns.threeDigits,J);case 4:return parseNumericPattern(numericPatterns.fourDigits,J);default:return parseNumericPattern(new RegExp("^\\d{1,"+te+"}"),J)}}function parseNDigitsSigned(te,J){switch(te){case 1:return parseNumericPattern(numericPatterns.singleDigitSigned,J);case 2:return parseNumericPattern(numericPatterns.twoDigitsSigned,J);case 3:return parseNumericPattern(numericPatterns.threeDigitsSigned,J);case 4:return parseNumericPattern(numericPatterns.fourDigitsSigned,J);default:return parseNumericPattern(new RegExp("^-?\\d{1,"+te+"}"),J)}}function dayPeriodEnumToHours(te){switch(te){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function normalizeTwoDigitYear(te,J){const X=J>0,re=X?J:1-J;let ne;if(re<=50)ne=te||100;else{const oe=re+50,de=Math.trunc(oe/100)*100,ce=te>=oe%100;ne=te+de-(ce?100:0)}return X?ne:1-ne}function isLeapYearIndex(te){return te%400===0||te%4===0&&te%100!==0}class YearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(X,re,ne){const oe=de=>({year:de,isTwoDigitYear:re==="yy"});switch(re){case"y":return mapValue(parseNDigits(4,X),oe);case"yo":return mapValue(ne.ordinalNumber(X,{unit:"year"}),oe);default:return mapValue(parseNDigits(re.length,X),oe)}}validate(X,re){return re.isTwoDigitYear||re.year>0}set(X,re,ne){const oe=X.getFullYear();if(ne.isTwoDigitYear){const ce=normalizeTwoDigitYear(ne.year,oe);return X.setFullYear(ce,0,1),X.setHours(0,0,0,0),X}const de=!("era"in re)||re.era===1?ne.year:1-ne.year;return X.setFullYear(de,0,1),X.setHours(0,0,0,0),X}}class LocalWeekYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(X,re,ne){const oe=de=>({year:de,isTwoDigitYear:re==="YY"});switch(re){case"Y":return mapValue(parseNDigits(4,X),oe);case"Yo":return mapValue(ne.ordinalNumber(X,{unit:"year"}),oe);default:return mapValue(parseNDigits(re.length,X),oe)}}validate(X,re){return re.isTwoDigitYear||re.year>0}set(X,re,ne,oe){const de=getWeekYear(X,oe);if(ne.isTwoDigitYear){const he=normalizeTwoDigitYear(ne.year,de);return X.setFullYear(he,0,oe.firstWeekContainsDate),X.setHours(0,0,0,0),startOfWeek(X,oe)}const ce=!("era"in re)||re.era===1?ne.year:1-ne.year;return X.setFullYear(ce,0,oe.firstWeekContainsDate),X.setHours(0,0,0,0),startOfWeek(X,oe)}}class ISOWeekYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(X,re){return parseNDigitsSigned(re==="R"?4:re.length,X)}set(X,re,ne){const oe=constructFrom(X,0);return oe.setFullYear(ne,0,4),oe.setHours(0,0,0,0),startOfISOWeek(oe)}}class ExtendedYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(X,re){return parseNDigitsSigned(re==="u"?4:re.length,X)}set(X,re,ne){return X.setFullYear(ne,0,1),X.setHours(0,0,0,0),X}}class QuarterParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",120);Nt(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"Q":case"QQ":return parseNDigits(re.length,X);case"Qo":return ne.ordinalNumber(X,{unit:"quarter"});case"QQQ":return ne.quarter(X,{width:"abbreviated",context:"formatting"})||ne.quarter(X,{width:"narrow",context:"formatting"});case"QQQQQ":return ne.quarter(X,{width:"narrow",context:"formatting"});case"QQQQ":default:return ne.quarter(X,{width:"wide",context:"formatting"})||ne.quarter(X,{width:"abbreviated",context:"formatting"})||ne.quarter(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=1&&re<=4}set(X,re,ne){return X.setMonth((ne-1)*3,1),X.setHours(0,0,0,0),X}}class StandAloneQuarterParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",120);Nt(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"q":case"qq":return parseNDigits(re.length,X);case"qo":return ne.ordinalNumber(X,{unit:"quarter"});case"qqq":return ne.quarter(X,{width:"abbreviated",context:"standalone"})||ne.quarter(X,{width:"narrow",context:"standalone"});case"qqqqq":return ne.quarter(X,{width:"narrow",context:"standalone"});case"qqqq":default:return ne.quarter(X,{width:"wide",context:"standalone"})||ne.quarter(X,{width:"abbreviated",context:"standalone"})||ne.quarter(X,{width:"narrow",context:"standalone"})}}validate(X,re){return re>=1&&re<=4}set(X,re,ne){return X.setMonth((ne-1)*3,1),X.setHours(0,0,0,0),X}}class MonthParser extends Parser{constructor(){super(...arguments);Nt(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);Nt(this,"priority",110)}parse(X,re,ne){const oe=de=>de-1;switch(re){case"M":return mapValue(parseNumericPattern(numericPatterns.month,X),oe);case"MM":return mapValue(parseNDigits(2,X),oe);case"Mo":return mapValue(ne.ordinalNumber(X,{unit:"month"}),oe);case"MMM":return ne.month(X,{width:"abbreviated",context:"formatting"})||ne.month(X,{width:"narrow",context:"formatting"});case"MMMMM":return ne.month(X,{width:"narrow",context:"formatting"});case"MMMM":default:return ne.month(X,{width:"wide",context:"formatting"})||ne.month(X,{width:"abbreviated",context:"formatting"})||ne.month(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=0&&re<=11}set(X,re,ne){return X.setMonth(ne,1),X.setHours(0,0,0,0),X}}class StandAloneMonthParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",110);Nt(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(X,re,ne){const oe=de=>de-1;switch(re){case"L":return mapValue(parseNumericPattern(numericPatterns.month,X),oe);case"LL":return mapValue(parseNDigits(2,X),oe);case"Lo":return mapValue(ne.ordinalNumber(X,{unit:"month"}),oe);case"LLL":return ne.month(X,{width:"abbreviated",context:"standalone"})||ne.month(X,{width:"narrow",context:"standalone"});case"LLLLL":return ne.month(X,{width:"narrow",context:"standalone"});case"LLLL":default:return ne.month(X,{width:"wide",context:"standalone"})||ne.month(X,{width:"abbreviated",context:"standalone"})||ne.month(X,{width:"narrow",context:"standalone"})}}validate(X,re){return re>=0&&re<=11}set(X,re,ne){return X.setMonth(ne,1),X.setHours(0,0,0,0),X}}function setWeek(te,J,X){const re=toDate(te),ne=getWeek(re,X)-J;return re.setDate(re.getDate()-ne*7),re}class LocalWeekParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",100);Nt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(X,re,ne){switch(re){case"w":return parseNumericPattern(numericPatterns.week,X);case"wo":return ne.ordinalNumber(X,{unit:"week"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=53}set(X,re,ne,oe){return startOfWeek(setWeek(X,ne,oe),oe)}}function setISOWeek(te,J){const X=toDate(te),re=getISOWeek(X)-J;return X.setDate(X.getDate()-re*7),X}class ISOWeekParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",100);Nt(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(X,re,ne){switch(re){case"I":return parseNumericPattern(numericPatterns.week,X);case"Io":return ne.ordinalNumber(X,{unit:"week"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=53}set(X,re,ne){return startOfISOWeek(setISOWeek(X,ne))}}const DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31],DAYS_IN_MONTH_LEAP_YEAR=[31,29,31,30,31,30,31,31,30,31,30,31];class DateParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"subPriority",1);Nt(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"d":return parseNumericPattern(numericPatterns.date,X);case"do":return ne.ordinalNumber(X,{unit:"date"});default:return parseNDigits(re.length,X)}}validate(X,re){const ne=X.getFullYear(),oe=isLeapYearIndex(ne),de=X.getMonth();return oe?re>=1&&re<=DAYS_IN_MONTH_LEAP_YEAR[de]:re>=1&&re<=DAYS_IN_MONTH[de]}set(X,re,ne){return X.setDate(ne),X.setHours(0,0,0,0),X}}class DayOfYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"subpriority",1);Nt(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"D":case"DD":return parseNumericPattern(numericPatterns.dayOfYear,X);case"Do":return ne.ordinalNumber(X,{unit:"date"});default:return parseNDigits(re.length,X)}}validate(X,re){const ne=X.getFullYear();return isLeapYearIndex(ne)?re>=1&&re<=366:re>=1&&re<=365}set(X,re,ne){return X.setMonth(0,ne),X.setHours(0,0,0,0),X}}function setDay(te,J,X){var fe,ge,me,ve;const re=getDefaultOptions$1(),ne=(X==null?void 0:X.weekStartsOn)??((ge=(fe=X==null?void 0:X.locale)==null?void 0:fe.options)==null?void 0:ge.weekStartsOn)??re.weekStartsOn??((ve=(me=re.locale)==null?void 0:me.options)==null?void 0:ve.weekStartsOn)??0,oe=toDate(te),de=oe.getDay(),he=(J%7+7)%7,ue=7-ne,pe=J<0||J>6?J-(de+ue)%7:(he+ue)%7-(de+ue)%7;return addDays(oe,pe)}class DayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"E":case"EE":case"EEE":return ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"EEEEE":return ne.day(X,{width:"narrow",context:"formatting"});case"EEEEEE":return ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"EEEE":default:return ne.day(X,{width:"wide",context:"formatting"})||ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=0&&re<=6}set(X,re,ne,oe){return X=setDay(X,ne,oe),X.setHours(0,0,0,0),X}}class LocalDayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(X,re,ne,oe){const de=ce=>{const he=Math.floor((ce-1)/7)*7;return(ce+oe.weekStartsOn+6)%7+he};switch(re){case"e":case"ee":return mapValue(parseNDigits(re.length,X),de);case"eo":return mapValue(ne.ordinalNumber(X,{unit:"day"}),de);case"eee":return ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"eeeee":return ne.day(X,{width:"narrow",context:"formatting"});case"eeeeee":return ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"eeee":default:return ne.day(X,{width:"wide",context:"formatting"})||ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=0&&re<=6}set(X,re,ne,oe){return X=setDay(X,ne,oe),X.setHours(0,0,0,0),X}}class StandAloneLocalDayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(X,re,ne,oe){const de=ce=>{const he=Math.floor((ce-1)/7)*7;return(ce+oe.weekStartsOn+6)%7+he};switch(re){case"c":case"cc":return mapValue(parseNDigits(re.length,X),de);case"co":return mapValue(ne.ordinalNumber(X,{unit:"day"}),de);case"ccc":return ne.day(X,{width:"abbreviated",context:"standalone"})||ne.day(X,{width:"short",context:"standalone"})||ne.day(X,{width:"narrow",context:"standalone"});case"ccccc":return ne.day(X,{width:"narrow",context:"standalone"});case"cccccc":return ne.day(X,{width:"short",context:"standalone"})||ne.day(X,{width:"narrow",context:"standalone"});case"cccc":default:return ne.day(X,{width:"wide",context:"standalone"})||ne.day(X,{width:"abbreviated",context:"standalone"})||ne.day(X,{width:"short",context:"standalone"})||ne.day(X,{width:"narrow",context:"standalone"})}}validate(X,re){return re>=0&&re<=6}set(X,re,ne,oe){return X=setDay(X,ne,oe),X.setHours(0,0,0,0),X}}function setISODay(te,J){const X=toDate(te),re=getISODay(X),ne=J-re;return addDays(X,ne)}class ISODayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(X,re,ne){const oe=de=>de===0?7:de;switch(re){case"i":case"ii":return parseNDigits(re.length,X);case"io":return ne.ordinalNumber(X,{unit:"day"});case"iii":return mapValue(ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"}),oe);case"iiiii":return mapValue(ne.day(X,{width:"narrow",context:"formatting"}),oe);case"iiiiii":return mapValue(ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"}),oe);case"iiii":default:return mapValue(ne.day(X,{width:"wide",context:"formatting"})||ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"}),oe)}}validate(X,re){return re>=1&&re<=7}set(X,re,ne){return X=setISODay(X,ne),X.setHours(0,0,0,0),X}}class AMPMParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",80);Nt(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(X,re,ne){switch(re){case"a":case"aa":case"aaa":return ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"aaaaa":return ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"aaaa":default:return ne.dayPeriod(X,{width:"wide",context:"formatting"})||ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"})}}set(X,re,ne){return X.setHours(dayPeriodEnumToHours(ne),0,0,0),X}}class AMPMMidnightParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",80);Nt(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(X,re,ne){switch(re){case"b":case"bb":case"bbb":return ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"bbbbb":return ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"bbbb":default:return ne.dayPeriod(X,{width:"wide",context:"formatting"})||ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"})}}set(X,re,ne){return X.setHours(dayPeriodEnumToHours(ne),0,0,0),X}}class DayPeriodParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",80);Nt(this,"incompatibleTokens",["a","b","t","T"])}parse(X,re,ne){switch(re){case"B":case"BB":case"BBB":return ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"BBBBB":return ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"BBBB":default:return ne.dayPeriod(X,{width:"wide",context:"formatting"})||ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"})}}set(X,re,ne){return X.setHours(dayPeriodEnumToHours(ne),0,0,0),X}}class Hour1to12Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["H","K","k","t","T"])}parse(X,re,ne){switch(re){case"h":return parseNumericPattern(numericPatterns.hour12h,X);case"ho":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=12}set(X,re,ne){const oe=X.getHours()>=12;return oe&&ne<12?X.setHours(ne+12,0,0,0):!oe&&ne===12?X.setHours(0,0,0,0):X.setHours(ne,0,0,0),X}}class Hour0to23Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(X,re,ne){switch(re){case"H":return parseNumericPattern(numericPatterns.hour23h,X);case"Ho":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=23}set(X,re,ne){return X.setHours(ne,0,0,0),X}}class Hour0To11Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["h","H","k","t","T"])}parse(X,re,ne){switch(re){case"K":return parseNumericPattern(numericPatterns.hour11h,X);case"Ko":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=11}set(X,re,ne){return X.getHours()>=12&&ne<12?X.setHours(ne+12,0,0,0):X.setHours(ne,0,0,0),X}}class Hour1To24Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(X,re,ne){switch(re){case"k":return parseNumericPattern(numericPatterns.hour24h,X);case"ko":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=24}set(X,re,ne){const oe=ne<=24?ne%24:ne;return X.setHours(oe,0,0,0),X}}class MinuteParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",60);Nt(this,"incompatibleTokens",["t","T"])}parse(X,re,ne){switch(re){case"m":return parseNumericPattern(numericPatterns.minute,X);case"mo":return ne.ordinalNumber(X,{unit:"minute"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=59}set(X,re,ne){return X.setMinutes(ne,0,0),X}}class SecondParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",50);Nt(this,"incompatibleTokens",["t","T"])}parse(X,re,ne){switch(re){case"s":return parseNumericPattern(numericPatterns.second,X);case"so":return ne.ordinalNumber(X,{unit:"second"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=59}set(X,re,ne){return X.setSeconds(ne,0),X}}class FractionOfSecondParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",30);Nt(this,"incompatibleTokens",["t","T"])}parse(X,re){const ne=oe=>Math.trunc(oe*Math.pow(10,-re.length+3));return mapValue(parseNDigits(re.length,X),ne)}set(X,re,ne){return X.setMilliseconds(ne),X}}class ISOTimezoneWithZParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",10);Nt(this,"incompatibleTokens",["t","T","x"])}parse(X,re){switch(re){case"X":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,X);case"XX":return parseTimezonePattern(timezonePatterns.basic,X);case"XXXX":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,X);case"XXXXX":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,X);case"XXX":default:return parseTimezonePattern(timezonePatterns.extended,X)}}set(X,re,ne){return re.timestampIsSet?X:constructFrom(X,X.getTime()-getTimezoneOffsetInMilliseconds(X)-ne)}}class ISOTimezoneParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",10);Nt(this,"incompatibleTokens",["t","T","X"])}parse(X,re){switch(re){case"x":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,X);case"xx":return parseTimezonePattern(timezonePatterns.basic,X);case"xxxx":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,X);case"xxxxx":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,X);case"xxx":default:return parseTimezonePattern(timezonePatterns.extended,X)}}set(X,re,ne){return re.timestampIsSet?X:constructFrom(X,X.getTime()-getTimezoneOffsetInMilliseconds(X)-ne)}}class TimestampSecondsParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",40);Nt(this,"incompatibleTokens","*")}parse(X){return parseAnyDigitsSigned(X)}set(X,re,ne){return[constructFrom(X,ne*1e3),{timestampIsSet:!0}]}}class TimestampMillisecondsParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",20);Nt(this,"incompatibleTokens","*")}parse(X){return parseAnyDigitsSigned(X)}set(X,re,ne){return[constructFrom(X,ne),{timestampIsSet:!0}]}}const parsers={G:new EraParser,y:new YearParser,Y:new LocalWeekYearParser,R:new ISOWeekYearParser,u:new ExtendedYearParser,Q:new QuarterParser,q:new StandAloneQuarterParser,M:new MonthParser,L:new StandAloneMonthParser,w:new LocalWeekParser,I:new ISOWeekParser,d:new DateParser,D:new DayOfYearParser,E:new DayParser,e:new LocalDayParser,c:new StandAloneLocalDayParser,i:new ISODayParser,a:new AMPMParser,b:new AMPMMidnightParser,B:new DayPeriodParser,h:new Hour1to12Parser,H:new Hour0to23Parser,K:new Hour0To11Parser,k:new Hour1To24Parser,m:new MinuteParser,s:new SecondParser,S:new FractionOfSecondParser,X:new ISOTimezoneWithZParser,x:new ISOTimezoneParser,t:new TimestampSecondsParser,T:new TimestampMillisecondsParser},formattingTokensRegExp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp=/^'([^]*?)'?$/,doubleQuoteRegExp=/''/g,notWhitespaceRegExp=/\S/,unescapedLatinCharacterRegExp=/[a-zA-Z]/;function parse(te,J,X,re){var be,_e,we,Se;const ne=getDefaultOptions(),oe=ne.locale??enUS,de=ne.firstWeekContainsDate??((_e=(be=ne.locale)==null?void 0:be.options)==null?void 0:_e.firstWeekContainsDate)??1,ce=ne.weekStartsOn??((Se=(we=ne.locale)==null?void 0:we.options)==null?void 0:Se.weekStartsOn)??0,he={firstWeekContainsDate:de,weekStartsOn:ce,locale:oe},ue=[new DateToSystemTimezoneSetter],pe=J.match(longFormattingTokensRegExp).map(Ce=>{const ye=Ce[0];if(ye in longFormatters){const Ae=longFormatters[ye];return Ae(Ce,oe.formatLong)}return Ce}).join("").match(formattingTokensRegExp),fe=[];for(let Ce of pe){isProtectedWeekYearToken(Ce)&&warnOrThrowProtectedError(Ce,J,te),isProtectedDayOfYearToken(Ce)&&warnOrThrowProtectedError(Ce,J,te);const ye=Ce[0],Ae=parsers[ye];if(Ae){const{incompatibleTokens:Le}=Ae;if(Array.isArray(Le)){const Me=fe.find(He=>Le.includes(He.token)||He.token===ye);if(Me)throw new RangeError(`The format string mustn't contain \`${Me.fullToken}\` and \`${Ce}\` at the same time`)}else if(Ae.incompatibleTokens==="*"&&fe.length>0)throw new RangeError(`The format string mustn't contain \`${Ce}\` and any other token at the same time`);fe.push({token:ye,fullToken:Ce});const De=Ae.run(te,Ce,oe.match,he);if(!De)return constructFrom(X,NaN);ue.push(De.setter),te=De.rest}else{if(ye.match(unescapedLatinCharacterRegExp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+ye+"`");if(Ce==="''"?Ce="'":ye==="'"&&(Ce=cleanEscapedString(Ce)),te.indexOf(Ce)===0)te=te.slice(Ce.length);else return constructFrom(X,NaN)}}if(te.length>0&&notWhitespaceRegExp.test(te))return constructFrom(X,NaN);const ge=ue.map(Ce=>Ce.priority).sort((Ce,ye)=>ye-Ce).filter((Ce,ye,Ae)=>Ae.indexOf(Ce)===ye).map(Ce=>ue.filter(ye=>ye.priority===Ce).sort((ye,Ae)=>Ae.subPriority-ye.subPriority)).map(Ce=>Ce[0]);let me=toDate(X);if(isNaN(me.getTime()))return constructFrom(X,NaN);const ve={};for(const Ce of ge){if(!Ce.validate(me,he))return constructFrom(X,NaN);const ye=Ce.set(me,ve,he);Array.isArray(ye)?(me=ye[0],Object.assign(ve,ye[1])):me=ye}return constructFrom(X,me)}function cleanEscapedString(te){return te.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp,"'")}const notFound="data:image/svg+xml,%3csvg%20width='215'%20height='150'%20viewBox='0%200%20215%20150'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20opacity='0.9'%20d='M135.132%2057.43C96.9221%2047.658%2083.3815%20-29.7048%2026.9734%2012.5083C-13.0511%2042.4595%2011.4691%20115.499%2061.6878%20107.019C92.0822%20101.867%2087.3917%20101.341%20113.129%20115.244C139.231%20129.308%20167.972%20136.397%20195.855%20111.436C210.28%2098.5179%20215.939%2067.0352%20201.939%2050.7417C184.388%2030.3592%20158.485%2063.4098%20135.132%2057.43Z'%20fill='%23EFF7FF'/%3e%3cellipse%20cx='120.5'%20cy='143.5'%20rx='52.5'%20ry='3.5'%20fill='%23F5F5F5'/%3e%3cpath%20d='M121.387%2080.2184C121.995%2079.5948%20122.563%2078.953%20123.09%2078.2959L134.396%2089.3383C135.09%2090.0177%20134.851%2091.389%20133.861%2092.4024C132.872%2093.4159%20131.505%2093.6888%20130.811%2093.0094L119.505%2081.967C120.148%2081.424%20120.777%2080.8407%20121.385%2080.2171L121.387%2080.2184Z'%20fill='%231D1D1D'/%3e%3cpath%20opacity='0.6'%20d='M121.127%2079.9896C132.157%2068.6986%20131.888%2050.5485%20120.527%2039.4502C109.166%2028.3519%2091.0149%2028.5081%2079.9849%2039.799C68.955%2051.09%2069.2233%2069.2401%2080.5843%2080.3385C91.9453%2091.4368%20110.097%2091.2806%20121.127%2079.9896Z'%20fill='%238FC2F5'/%3e%3cpath%20d='M78.0382%2083.0622C90.8729%2095.6382%20111.378%2095.4578%20123.835%2082.6609C136.293%2069.8625%20135.986%2049.2932%20123.15%2036.7173C110.316%2024.1413%2089.8107%2024.3217%2077.3538%2037.1186C64.8956%2049.9169%2065.2022%2070.4862%2078.0382%2083.0622ZM80.642%2080.387C69.289%2069.264%2069.0172%2051.0692%2080.037%2039.749C91.0569%2028.4288%20109.194%2028.2694%20120.547%2039.3938C131.9%2050.5182%20132.171%2068.713%20121.152%2080.0332C110.132%2091.3534%2091.9949%2091.5128%2080.642%2080.3884V80.387Z'%20fill='%237BACFC'/%3e%3cpath%20d='M169.953%20128.522L171.714%20126.696C173.474%20124.871%20173.421%20121.964%20171.595%20120.205L135.013%2084.9265C133.187%2083.1661%20130.281%2083.2205%20128.522%2085.0451L126.761%2086.8711C125.001%2088.6957%20125.055%2091.6028%20126.88%2093.3619L163.462%20128.64C165.287%20130.401%20168.194%20130.346%20169.953%20128.522Z'%20fill='%23656565'/%3e%3cpath%20opacity='0.35'%20d='M88.8399%2071.2315C96.506%2079.2245%20101.258%2078.1642%20100.757%2082.4547C100.256%2086.7452%2091.398%2085.7448%2082.7698%2076.0396C74.1415%2066.3344%2075.0893%2054.9166%2079.8491%2055.2485C84.6089%2055.5803%2080.129%2062.1492%2088.8399%2071.2315Z'%20fill='white'/%3e%3c/svg%3e";/**
328
+ `}handleTest(){console.log(this.selectedPeriodDate)}};__decorateClass$p([n$x()],ExportPdfModal.prototype,"selectedRadioOption",2),__decorateClass$p([n$x()],ExportPdfModal.prototype,"text",2),__decorateClass$p([n$x()],ExportPdfModal.prototype,"selectedVisibilityLevelElement",2),__decorateClass$p([n$x()],ExportPdfModal.prototype,"selectedPeriodDate",2),__decorateClass$p([n$x({type:Array})],ExportPdfModal.prototype,"arrayElements",2),ExportPdfModal=__decorateClass$p([t$j("export-pdf-modal")],ExportPdfModal);class ExportToPdfHandler extends ApiBaseHandler{async handle(){try{this.api.interactionService.confirm(void 0,ExportPdfModal,{title:translate("modal.selectExportOption"),confirmButtonText:"Exportar",cancelButtonText:"Cancelar"})}catch(J){this._notifyError(J.message)}}_notifyError(J){this.api.notificationService.error(J||"actions.delete.error")}}class ExportPdf{}let request$e;const bootstrapExportPdf=te=>{request$e=te.registerRequest(ExportPdf,ExportToPdfHandler)},teardownExportPdf=()=>{request$e==null||request$e.dispose()},{addActivityHistoryItems}=activityHistoryCollectionsSlice.actions;class AddHistoryItemsHandler extends StoreBaseHandler{async handle(J){try{const X=validateAndFilterBasicItems(J.items);this.store.dispatch(addActivityHistoryItems({id:J.entityId,items:X,componentFactory:J.componentFactory,searchPredicate:J.searchPredicate})),handleAddDiagnosticsFilter(X,this.store)}catch(X){console.log(X.message)}}}let request$d;const bootstrapAddHistoryItems=te=>{request$d=te.registerRequest(addHistoryItemsCommand,AddHistoryItemsHandler)},teardownAddHistoryItems=()=>{request$d==null||request$d.dispose()},{updateActivityHistoryItem}=activityHistoryCollectionsSlice.actions;class UpdateHistoryItemHandler extends StoreBaseHandler{async handle(J){try{ensureAreValidBasicActivityHistoryItems([J.item]),this.store.dispatch(updateActivityHistoryItem({id:J.entityId,item:J.item}))}catch(X){console.log(X.message)}}}const updateHistoryItemCommand="update_history_item_request";let request$c;const bootstrapUpdateHistoryItem=te=>{request$c=te.registerRequest(updateHistoryItemCommand,UpdateHistoryItemHandler)},teardownUpdateHistoryItem=()=>{request$c==null||request$c.dispose()};function connectedProperty(te,J={}){return createConnectedProperty(store)(te,J)}const activityHistorySearchStringSelector=te=>te.activityHistoryFilters.searchString;function getUniqueObjects(te,J,X,re){const ne=`Sense ${re.toLocaleLowerCase()}`,oe=new Map;let de=!1;for(const he of te){const ue=J.reduce((me,ve)=>me==null?void 0:me[ve],he),pe=X.reduce((me,ve)=>me==null?void 0:me[ve],he),fe=typeof ue=="string"&&ue.trim()!=="",ge=typeof pe=="string"&&pe.trim()!=="";fe&&ge?oe.has(ue)||oe.set(ue,{id:ue,title:pe}):de=!0}const ce=Array.from(oe.values()).sort((he,ue)=>he.title.localeCompare(ue.title,"ca",{sensitivity:"base"}));return de&&ce.push({id:"",title:ne}),ce}class TrueSpec extends Spec{isSatisfiedBy(){return!0}}class CommonFilterSpec extends Spec{constructor(J){super(),this.commonFilters=J}isSatisfiedBy(J){return this.commonFilters.filter(ne=>ne.enabled).reduce((ne,oe)=>ne.and(new oe.spec),new TrueSpec).isSatisfiedBy(J)}}class FalseSpec extends Spec{isSatisfiedBy(){return!1}}class PropPathSpec extends Spec{constructor(J,X){super(),this.propPath=J,this.value=X}isSatisfiedBy(J){return this.propPath.reduce((re,ne)=>re==null?void 0:re[ne],J)===this.value}}class CustomFilterSpec extends Spec{constructor(J){super(),this.filters=J}isSatisfiedBy(J){const X=this.filters.filter(re=>re.enabled);return X.length===0?!0:X.every(re=>{if(!this.belongsToGroup(J,re))return!0;const ne=re.filters.filter(oe=>oe.enabled||oe.singleOption);return ne.length===0?!0:ne.every(oe=>oe.singleOption?oe.enabled?!0:new PropPathSpec(oe.propPathValue,!1).isSatisfiedBy(J):!oe.enabledValues||oe.enabledValues.length===0?!0:oe.enabledValues.reduce((ce,he)=>ce.or(new PropPathSpec(oe.propPathValue,he)),new FalseSpec).isSatisfiedBy(J))})}belongsToGroup(J,X){return J.type===X.id}}const normalizeStringToNFD=te=>te==null?"":String(te).normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLocaleLowerCase(),propContainsString=(te,J)=>{const X=normalizeStringToNFD(te),re=normalizeStringToNFD(J);return X.toString().toLowerCase().indexOf(re)!==-1||X.toString().indexOf(re)!==-1},commonFieldsSearchPredicate=(te,J)=>{var he,ue,pe,fe,ge,me,ve,be,_e,we,Se;const X=((he=te.professional)==null?void 0:he.name)&&propContainsString((ue=te.professional)==null?void 0:ue.name,J),re=((pe=te.center)==null?void 0:pe.description)&&propContainsString(te.center.description,J),ne=((ge=(fe=te.professional)==null?void 0:fe.speciality)==null?void 0:ge.description)&&propContainsString((me=te.professional)==null?void 0:me.speciality.description,J),oe=((be=(ve=te.professional)==null?void 0:ve.role)==null?void 0:be.description)&&propContainsString((_e=te.professional)==null?void 0:_e.role.description,J),de=((we=te.service)==null?void 0:we.description)&&propContainsString(te.service.description,J),ce=(Se=te.diagnostics)==null?void 0:Se.some(Ce=>propContainsString(Ce.id,J)||propContainsString(Ce.description,J));return X||re||ne||oe||de||ce};class SearchStringSpec extends Spec{constructor(J,X){super(),this.searchString=J,this.searchPredicate=X}isSatisfiedBy(J){var ne;if(!((ne=this.searchString)!=null&&ne.trim()))return!0;const X=commonFieldsSearchPredicate(J,this.searchString),re=this.searchPredicate?this.searchPredicate(this.searchString.toLowerCase(),J):!1;return!!(X||re)}}class TypeSpec extends Spec{constructor(J){super(),this.itemType=J}isSatisfiedBy(J){return(J==null?void 0:J.type)===this.itemType}}class ComposedTypeSpec extends Spec{constructor(J){super(),this.filters=J}isSatisfiedBy(J){return this.filters.filter(ne=>ne.enabled).map(ne=>ne.id).reduce((ne,oe)=>ne.or(new TypeSpec(oe)),new FalseSpec).isSatisfiedBy(J)}}const activityHistoryFiltersSelector=te=>te.activityHistoryFilters.filters,activityHistoryCommonFiltersSelector=createSelector(activityHistoryFiltersSelector,te=>{var J;return((J=te.find(isCommonFilterGroup))==null?void 0:J.filters)||[]}),activityHistoryEnabledCommonFiltersSelector=createSelector(activityHistoryCommonFiltersSelector,te=>te.filter(J=>J.enabled)),areCommonFiltersActive=createSelector(activityHistoryEnabledCommonFiltersSelector,te=>!!te.length),activityHistoryCustomFilterGroupsSelector=createSelector(activityHistoryFiltersSelector,te=>te.filter(isCustomFilter).sort(sortBySortProperty)),sortBySortProperty=(te,J)=>Number(te.sort)-Number(J.sort),areCustomFiltersActive=createSelector(activityHistoryCustomFilterGroupsSelector,te=>te.some(J=>J.filters.some(X=>{var re;return(re=X.enabledValues)==null?void 0:re.length}))),activeGroupsWithEnabledFilters=createSelector(activityHistoryCustomFilterGroupsSelector,te=>te.filter(J=>J.enabled).map(({id:J,title:X,enabled:re,sort:ne,filters:oe})=>({id:J,title:X,enabled:re,sort:ne,filters:oe.filter(de=>{var ce;return(ce=de.enabledValues)==null?void 0:ce.length})})).filter(J=>J.filters.length>0)),areSameDiagnostics=(te,J)=>{if(te.length!==J.length)return!1;const X=te.map(ne=>ne.codi).sort(),re=J.map(ne=>ne.codi).sort();return X.every((ne,oe)=>ne===re[oe])},hasValidDiagnostic=te=>te!=null&&typeof te.codi=="string"&&typeof te.cataleg=="string"&&typeof te.descripcio=="string",hasValidDiagnostics=te=>te==null?!0:Array.isArray(te)&&te.every(hasValidDiagnostic),isSameVisit=(te,J)=>{var oe,de,ce,he,ue,pe,fe,ge,me,ve,be,_e,we,Se,Ce,ye,Ae,Le;const X=((oe=te.professional)==null?void 0:oe.id)===((de=J.professional)==null?void 0:de.id)&&((he=(ce=te.professional)==null?void 0:ce.role)==null?void 0:he.id)===((pe=(ue=J.professional)==null?void 0:ue.role)==null?void 0:pe.id)&&((ge=(fe=te.professional)==null?void 0:fe.speciality)==null?void 0:ge.id)===((ve=(me=J.professional)==null?void 0:me.speciality)==null?void 0:ve.id),re=((be=te.ep)==null?void 0:be.id)===((_e=J.ep)==null?void 0:_e.id)&&((we=te.up)==null?void 0:we.id)===((Se=J.up)==null?void 0:Se.id)&&((Ce=te.center)==null?void 0:Ce.id)===((ye=J.center)==null?void 0:ye.id)&&((Ae=te.service)==null?void 0:Ae.id)===((Le=J.service)==null?void 0:Le.id),ne=new Date(te.date).toDateString()===new Date(J.date).toDateString();return X&&re&&ne},withinEightHours=(te,J)=>Math.abs(new Date(te).getTime()-new Date(J).getTime())<=8*60*60*1e3;function groupByValidDiagnostics(te){te.forEach(J=>{const X=[],re=[];J.items.forEach(ne=>{const oe=ne.diagnostics;if((oe==null?void 0:oe.length)>0&&hasValidDiagnostics(oe)){let ce=!1;for(const he of X){const ue=he.items[0];if(areSameDiagnostics(ue.diagnostics,oe)){he.items.push(ne),ce=!0;break}}ce||X.push({idSubGroup:crypto.randomUUID(),items:[ne]})}else re.push(ne)}),J.items=re,J.subGroups=X})}const groupActivityHistoryItems=te=>{const J=[];return te==null||te.forEach(X=>{let re=!1;for(const ne of J){const oe=ne.items[0],de=ne.items[ne.items.length-1];if(isSameVisit(oe,X)&&withinEightHours(oe.date,X.date)&&withinEightHours(de.date,X.date)){ne.items.push(X),re=!0;break}}re||J.push({idGroup:Math.random().toString(36).substr(2,9),items:[X]})}),groupByValidDiagnostics(J),J},sortGroupsByMostRecentDate=te=>{const J=oe=>oe.reduce((de,ce)=>{const he=new Date(ce.date);return he>de?he:de},new Date(0)),X=oe=>oe.sort((de,ce)=>new Date(ce.date).getTime()-new Date(de.date).getTime()),re=oe=>J(oe.items),ne=oe=>{const de=oe.items.length>0?[J(oe.items)]:[],ce=oe.subGroups.map(re),he=[...de,...ce];return he.length>0?new Date(Math.max(...he.map(ue=>ue.getTime()))):new Date(0)};return te.forEach(oe=>{oe.items=X(oe.items),oe.subGroups.forEach(de=>{de.items=X(de.items)}),oe.subGroups.sort((de,ce)=>re(ce).getTime()-re(de).getTime())}),te.sort((oe,de)=>ne(de).getTime()-ne(oe).getTime())},diagnosticFilterSelector=createSelector(activityHistoryFiltersSelector,te=>te.find(isDiagnosticFilter)),diagnosticFilterEnabledValuesSelector=createSelector(diagnosticFilterSelector,te=>(te==null?void 0:te.enabledValues)||[]),areDiagnosticFiltersActive=createSelector(diagnosticFilterEnabledValuesSelector,te=>!!te.length);class DiagnosticCodeSpec extends Spec{constructor(J){super(),this.diagnosticCodes=J}isSatisfiedBy(J){var re;return(re=this.diagnosticCodes)!=null&&re.length?(J.diagnostics??[]).some(ne=>this.diagnosticCodes.includes(ne.codi)):!0}}const activityHistoryCollectionsSelector=te=>te.activityHistoryCollections.collections,mapItemsWithMetadata=(te,J,X,re)=>te.map(ne=>({...ne,searchPredicate:re,componentFactory:J,type:X})),activityHistoryMappedItems=createSelector(activityHistoryCollectionsSelector,te=>Object.values(te).flatMap(J=>mapItemsWithMetadata(J.items,J.componentFactory,J.id,J.searchPredicate))),customFilterGroupsWithOptionsSelector=createSelector(activityHistoryCustomFilterGroupsSelector,activityHistoryCollectionsSelector,(te,J)=>te.map(re=>{const ne=J[re.id];return{...re,filters:re.filters.map(oe=>({...oe,options:(oe.singleOption?[]:getUniqueObjects(ne.items,oe.propPathValue,oe.propsPathDescription,oe.title))||[]}))}})),activityHistoryGroupedItems=createSelector(activityHistoryMappedItems,activityHistorySearchStringSelector,activityHistoryCommonFiltersSelector,activityHistoryCustomFilterGroupsSelector,diagnosticFilterEnabledValuesSelector,(te,J,X,re,ne)=>{const oe=te.filter(he=>new SearchStringSpec(J,he.searchPredicate).and(new CommonFilterSpec(X)).and(new ComposedTypeSpec(re)).and(new CustomFilterSpec(re)).and(new DiagnosticCodeSpec(ne)).isSatisfiedBy(he)),de=groupActivityHistoryItems(oe);return sortGroupsByMostRecentDate(de)}),styles$g=":host{min-height:1px;height:100%}.virtualizer{height:100%;padding-inline:16px}.container{min-height:1px;height:100%}.visit:first-child{margin-top:var(--dss-spacing-md)}.visit{width:calc(100% - var(--dss-spacing-md) - var(--dss-spacing-md));display:flex;flex-direction:column;gap:var(--dss-spacing-sm);background-color:#fff;border-radius:var(--dss-radius-sm);padding:var(--dss-spacing-sm);margin-bottom:var(--dss-spacing-md)}.visit .visit__header{display:flex;flex-direction:row;align-items:center;gap:16px}.visit .visit__header .title{flex:1;font-size:14px;line-height:24px;display:flex;flex-direction:row;gap:12px;color:var(--color-neutral-800)}.visit .visit__header .title-date{font-weight:700}.visit .visit__header .title-description{font-weight:600;display:flex;flex-direction:row;gap:4px}.visit .visit__header .highlight{background-color:#ff0;font-weight:700}.visit .visit__items{display:flex;flex-direction:column;gap:16px}.visit .visit__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .visit__items .item[has-divider]:last-of-type{border:none}.visit .diagnostics{display:flex;flex-direction:column;gap:var(--dss-spacing-sm);border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .diagnostics:last-of-type{border:none}.visit .diagnostics .diagnostics__header{display:flex;flex-direction:row;align-items:center;gap:16px}.visit .diagnostics .diagnostics__items{display:flex;flex-direction:column}.visit .diagnostics .diagnostics__items .item[has-divider]{border-bottom:var(--dss-border-width-sm) solid var(--color-neutral-200)}.visit .diagnostics .diagnostics__items .item[has-divider]:last-of-type{border:none}.feedback{width:100%;height:100%;display:flex;align-items:center;justify-content:center}";function toDate(te){const J=Object.prototype.toString.call(te);return te instanceof Date||typeof te=="object"&&J==="[object Date]"?new te.constructor(+te):typeof te=="number"||J==="[object Number]"||typeof te=="string"||J==="[object String]"?new Date(te):new Date(NaN)}function constructFrom(te,J){return te instanceof Date?new te.constructor(J):new Date(J)}function addDays(te,J){const X=toDate(te);return isNaN(J)?constructFrom(te,NaN):(J&&X.setDate(X.getDate()+J),X)}const millisecondsInWeek=6048e5,millisecondsInDay=864e5,millisecondsInMinute=6e4,millisecondsInHour=36e5,millisecondsInSecond=1e3;let defaultOptions={};function getDefaultOptions$1(){return defaultOptions}function startOfWeek(te,J){var ce,he,ue,pe;const X=getDefaultOptions$1(),re=(J==null?void 0:J.weekStartsOn)??((he=(ce=J==null?void 0:J.locale)==null?void 0:ce.options)==null?void 0:he.weekStartsOn)??X.weekStartsOn??((pe=(ue=X.locale)==null?void 0:ue.options)==null?void 0:pe.weekStartsOn)??0,ne=toDate(te),oe=ne.getDay(),de=(oe<re?7:0)+oe-re;return ne.setDate(ne.getDate()-de),ne.setHours(0,0,0,0),ne}function startOfISOWeek(te){return startOfWeek(te,{weekStartsOn:1})}function getISOWeekYear(te){const J=toDate(te),X=J.getFullYear(),re=constructFrom(te,0);re.setFullYear(X+1,0,4),re.setHours(0,0,0,0);const ne=startOfISOWeek(re),oe=constructFrom(te,0);oe.setFullYear(X,0,4),oe.setHours(0,0,0,0);const de=startOfISOWeek(oe);return J.getTime()>=ne.getTime()?X+1:J.getTime()>=de.getTime()?X:X-1}function startOfDay(te){const J=toDate(te);return J.setHours(0,0,0,0),J}function getTimezoneOffsetInMilliseconds(te){const J=toDate(te),X=new Date(Date.UTC(J.getFullYear(),J.getMonth(),J.getDate(),J.getHours(),J.getMinutes(),J.getSeconds(),J.getMilliseconds()));return X.setUTCFullYear(J.getFullYear()),+te-+X}function differenceInCalendarDays(te,J){const X=startOfDay(te),re=startOfDay(J),ne=+X-getTimezoneOffsetInMilliseconds(X),oe=+re-getTimezoneOffsetInMilliseconds(re);return Math.round((ne-oe)/millisecondsInDay)}function startOfISOWeekYear(te){const J=getISOWeekYear(te),X=constructFrom(te,0);return X.setFullYear(J,0,4),X.setHours(0,0,0,0),startOfISOWeek(X)}function isDate(te){return te instanceof Date||typeof te=="object"&&Object.prototype.toString.call(te)==="[object Date]"}function isValid(te){if(!isDate(te)&&typeof te!="number")return!1;const J=toDate(te);return!isNaN(Number(J))}function endOfMonth(te){const J=toDate(te),X=J.getMonth();return J.setFullYear(J.getFullYear(),X+1,0),J.setHours(23,59,59,999),J}function eachDayOfInterval(te,J){const X=toDate(te.start),re=toDate(te.end);let ne=+X>+re;const oe=ne?+X:+re,de=ne?re:X;de.setHours(0,0,0,0);let ce=1;const he=[];for(;+de<=oe;)he.push(toDate(de)),de.setDate(de.getDate()+ce),de.setHours(0,0,0,0);return ne?he.reverse():he}function startOfMonth(te){const J=toDate(te);return J.setDate(1),J.setHours(0,0,0,0),J}function startOfYear(te){const J=toDate(te),X=constructFrom(te,0);return X.setFullYear(J.getFullYear(),0,1),X.setHours(0,0,0,0),X}const formatDistanceLocale={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},formatDistance=(te,J,X)=>{let re;const ne=formatDistanceLocale[te];return typeof ne=="string"?re=ne:J===1?re=ne.one:re=ne.other.replace("{{count}}",J.toString()),X!=null&&X.addSuffix?X.comparison&&X.comparison>0?"in "+re:re+" ago":re};function buildFormatLongFn(te){return(J={})=>{const X=J.width?String(J.width):te.defaultWidth;return te.formats[X]||te.formats[te.defaultWidth]}}const dateFormats={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},timeFormats={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},dateTimeFormats={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},formatLong={date:buildFormatLongFn({formats:dateFormats,defaultWidth:"full"}),time:buildFormatLongFn({formats:timeFormats,defaultWidth:"full"}),dateTime:buildFormatLongFn({formats:dateTimeFormats,defaultWidth:"full"})},formatRelativeLocale={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},formatRelative=(te,J,X,re)=>formatRelativeLocale[te];function buildLocalizeFn(te){return(J,X)=>{const re=X!=null&&X.context?String(X.context):"standalone";let ne;if(re==="formatting"&&te.formattingValues){const de=te.defaultFormattingWidth||te.defaultWidth,ce=X!=null&&X.width?String(X.width):de;ne=te.formattingValues[ce]||te.formattingValues[de]}else{const de=te.defaultWidth,ce=X!=null&&X.width?String(X.width):te.defaultWidth;ne=te.values[ce]||te.values[de]}const oe=te.argumentCallback?te.argumentCallback(J):J;return ne[oe]}}const eraValues={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},quarterValues={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},monthValues={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},dayValues={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},dayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},formattingDayPeriodValues={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ordinalNumber=(te,J)=>{const X=Number(te),re=X%100;if(re>20||re<10)switch(re%10){case 1:return X+"st";case 2:return X+"nd";case 3:return X+"rd"}return X+"th"},localize={ordinalNumber,era:buildLocalizeFn({values:eraValues,defaultWidth:"wide"}),quarter:buildLocalizeFn({values:quarterValues,defaultWidth:"wide",argumentCallback:te=>te-1}),month:buildLocalizeFn({values:monthValues,defaultWidth:"wide"}),day:buildLocalizeFn({values:dayValues,defaultWidth:"wide"}),dayPeriod:buildLocalizeFn({values:dayPeriodValues,defaultWidth:"wide",formattingValues:formattingDayPeriodValues,defaultFormattingWidth:"wide"})};function buildMatchFn(te){return(J,X={})=>{const re=X.width,ne=re&&te.matchPatterns[re]||te.matchPatterns[te.defaultMatchWidth],oe=J.match(ne);if(!oe)return null;const de=oe[0],ce=re&&te.parsePatterns[re]||te.parsePatterns[te.defaultParseWidth],he=Array.isArray(ce)?findIndex(ce,fe=>fe.test(de)):findKey(ce,fe=>fe.test(de));let ue;ue=te.valueCallback?te.valueCallback(he):he,ue=X.valueCallback?X.valueCallback(ue):ue;const pe=J.slice(de.length);return{value:ue,rest:pe}}}function findKey(te,J){for(const X in te)if(Object.prototype.hasOwnProperty.call(te,X)&&J(te[X]))return X}function findIndex(te,J){for(let X=0;X<te.length;X++)if(J(te[X]))return X}function buildMatchPatternFn(te){return(J,X={})=>{const re=J.match(te.matchPattern);if(!re)return null;const ne=re[0],oe=J.match(te.parsePattern);if(!oe)return null;let de=te.valueCallback?te.valueCallback(oe[0]):oe[0];de=X.valueCallback?X.valueCallback(de):de;const ce=J.slice(ne.length);return{value:de,rest:ce}}}const matchOrdinalNumberPattern=/^(\d+)(th|st|nd|rd)?/i,parseOrdinalNumberPattern=/\d+/i,matchEraPatterns={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},parseEraPatterns={any:[/^b/i,/^(a|c)/i]},matchQuarterPatterns={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},parseQuarterPatterns={any:[/1/i,/2/i,/3/i,/4/i]},matchMonthPatterns={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},parseMonthPatterns={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},matchDayPatterns={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},parseDayPatterns={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},matchDayPeriodPatterns={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},parseDayPeriodPatterns={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},match={ordinalNumber:buildMatchPatternFn({matchPattern:matchOrdinalNumberPattern,parsePattern:parseOrdinalNumberPattern,valueCallback:te=>parseInt(te,10)}),era:buildMatchFn({matchPatterns:matchEraPatterns,defaultMatchWidth:"wide",parsePatterns:parseEraPatterns,defaultParseWidth:"any"}),quarter:buildMatchFn({matchPatterns:matchQuarterPatterns,defaultMatchWidth:"wide",parsePatterns:parseQuarterPatterns,defaultParseWidth:"any",valueCallback:te=>te+1}),month:buildMatchFn({matchPatterns:matchMonthPatterns,defaultMatchWidth:"wide",parsePatterns:parseMonthPatterns,defaultParseWidth:"any"}),day:buildMatchFn({matchPatterns:matchDayPatterns,defaultMatchWidth:"wide",parsePatterns:parseDayPatterns,defaultParseWidth:"any"}),dayPeriod:buildMatchFn({matchPatterns:matchDayPeriodPatterns,defaultMatchWidth:"any",parsePatterns:parseDayPeriodPatterns,defaultParseWidth:"any"})},enUS={code:"en-US",formatDistance,formatLong,formatRelative,localize,match,options:{weekStartsOn:0,firstWeekContainsDate:1}};function getDayOfYear(te){const J=toDate(te);return differenceInCalendarDays(J,startOfYear(J))+1}function getISOWeek(te){const J=toDate(te),X=+startOfISOWeek(J)-+startOfISOWeekYear(J);return Math.round(X/millisecondsInWeek)+1}function getWeekYear(te,J){var pe,fe,ge,me;const X=toDate(te),re=X.getFullYear(),ne=getDefaultOptions$1(),oe=(J==null?void 0:J.firstWeekContainsDate)??((fe=(pe=J==null?void 0:J.locale)==null?void 0:pe.options)==null?void 0:fe.firstWeekContainsDate)??ne.firstWeekContainsDate??((me=(ge=ne.locale)==null?void 0:ge.options)==null?void 0:me.firstWeekContainsDate)??1,de=constructFrom(te,0);de.setFullYear(re+1,0,oe),de.setHours(0,0,0,0);const ce=startOfWeek(de,J),he=constructFrom(te,0);he.setFullYear(re,0,oe),he.setHours(0,0,0,0);const ue=startOfWeek(he,J);return X.getTime()>=ce.getTime()?re+1:X.getTime()>=ue.getTime()?re:re-1}function startOfWeekYear(te,J){var ce,he,ue,pe;const X=getDefaultOptions$1(),re=(J==null?void 0:J.firstWeekContainsDate)??((he=(ce=J==null?void 0:J.locale)==null?void 0:ce.options)==null?void 0:he.firstWeekContainsDate)??X.firstWeekContainsDate??((pe=(ue=X.locale)==null?void 0:ue.options)==null?void 0:pe.firstWeekContainsDate)??1,ne=getWeekYear(te,J),oe=constructFrom(te,0);return oe.setFullYear(ne,0,re),oe.setHours(0,0,0,0),startOfWeek(oe,J)}function getWeek(te,J){const X=toDate(te),re=+startOfWeek(X,J)-+startOfWeekYear(X,J);return Math.round(re/millisecondsInWeek)+1}function addLeadingZeros(te,J){const X=te<0?"-":"",re=Math.abs(te).toString().padStart(J,"0");return X+re}const lightFormatters={y(te,J){const X=te.getFullYear(),re=X>0?X:1-X;return addLeadingZeros(J==="yy"?re%100:re,J.length)},M(te,J){const X=te.getMonth();return J==="M"?String(X+1):addLeadingZeros(X+1,2)},d(te,J){return addLeadingZeros(te.getDate(),J.length)},a(te,J){const X=te.getHours()/12>=1?"pm":"am";switch(J){case"a":case"aa":return X.toUpperCase();case"aaa":return X;case"aaaaa":return X[0];case"aaaa":default:return X==="am"?"a.m.":"p.m."}},h(te,J){return addLeadingZeros(te.getHours()%12||12,J.length)},H(te,J){return addLeadingZeros(te.getHours(),J.length)},m(te,J){return addLeadingZeros(te.getMinutes(),J.length)},s(te,J){return addLeadingZeros(te.getSeconds(),J.length)},S(te,J){const X=J.length,re=te.getMilliseconds(),ne=Math.trunc(re*Math.pow(10,X-3));return addLeadingZeros(ne,J.length)}},dayPeriodEnum={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},formatters={G:function(te,J,X){const re=te.getFullYear()>0?1:0;switch(J){case"G":case"GG":case"GGG":return X.era(re,{width:"abbreviated"});case"GGGGG":return X.era(re,{width:"narrow"});case"GGGG":default:return X.era(re,{width:"wide"})}},y:function(te,J,X){if(J==="yo"){const re=te.getFullYear(),ne=re>0?re:1-re;return X.ordinalNumber(ne,{unit:"year"})}return lightFormatters.y(te,J)},Y:function(te,J,X,re){const ne=getWeekYear(te,re),oe=ne>0?ne:1-ne;if(J==="YY"){const de=oe%100;return addLeadingZeros(de,2)}return J==="Yo"?X.ordinalNumber(oe,{unit:"year"}):addLeadingZeros(oe,J.length)},R:function(te,J){const X=getISOWeekYear(te);return addLeadingZeros(X,J.length)},u:function(te,J){const X=te.getFullYear();return addLeadingZeros(X,J.length)},Q:function(te,J,X){const re=Math.ceil((te.getMonth()+1)/3);switch(J){case"Q":return String(re);case"QQ":return addLeadingZeros(re,2);case"Qo":return X.ordinalNumber(re,{unit:"quarter"});case"QQQ":return X.quarter(re,{width:"abbreviated",context:"formatting"});case"QQQQQ":return X.quarter(re,{width:"narrow",context:"formatting"});case"QQQQ":default:return X.quarter(re,{width:"wide",context:"formatting"})}},q:function(te,J,X){const re=Math.ceil((te.getMonth()+1)/3);switch(J){case"q":return String(re);case"qq":return addLeadingZeros(re,2);case"qo":return X.ordinalNumber(re,{unit:"quarter"});case"qqq":return X.quarter(re,{width:"abbreviated",context:"standalone"});case"qqqqq":return X.quarter(re,{width:"narrow",context:"standalone"});case"qqqq":default:return X.quarter(re,{width:"wide",context:"standalone"})}},M:function(te,J,X){const re=te.getMonth();switch(J){case"M":case"MM":return lightFormatters.M(te,J);case"Mo":return X.ordinalNumber(re+1,{unit:"month"});case"MMM":return X.month(re,{width:"abbreviated",context:"formatting"});case"MMMMM":return X.month(re,{width:"narrow",context:"formatting"});case"MMMM":default:return X.month(re,{width:"wide",context:"formatting"})}},L:function(te,J,X){const re=te.getMonth();switch(J){case"L":return String(re+1);case"LL":return addLeadingZeros(re+1,2);case"Lo":return X.ordinalNumber(re+1,{unit:"month"});case"LLL":return X.month(re,{width:"abbreviated",context:"standalone"});case"LLLLL":return X.month(re,{width:"narrow",context:"standalone"});case"LLLL":default:return X.month(re,{width:"wide",context:"standalone"})}},w:function(te,J,X,re){const ne=getWeek(te,re);return J==="wo"?X.ordinalNumber(ne,{unit:"week"}):addLeadingZeros(ne,J.length)},I:function(te,J,X){const re=getISOWeek(te);return J==="Io"?X.ordinalNumber(re,{unit:"week"}):addLeadingZeros(re,J.length)},d:function(te,J,X){return J==="do"?X.ordinalNumber(te.getDate(),{unit:"date"}):lightFormatters.d(te,J)},D:function(te,J,X){const re=getDayOfYear(te);return J==="Do"?X.ordinalNumber(re,{unit:"dayOfYear"}):addLeadingZeros(re,J.length)},E:function(te,J,X){const re=te.getDay();switch(J){case"E":case"EE":case"EEE":return X.day(re,{width:"abbreviated",context:"formatting"});case"EEEEE":return X.day(re,{width:"narrow",context:"formatting"});case"EEEEEE":return X.day(re,{width:"short",context:"formatting"});case"EEEE":default:return X.day(re,{width:"wide",context:"formatting"})}},e:function(te,J,X,re){const ne=te.getDay(),oe=(ne-re.weekStartsOn+8)%7||7;switch(J){case"e":return String(oe);case"ee":return addLeadingZeros(oe,2);case"eo":return X.ordinalNumber(oe,{unit:"day"});case"eee":return X.day(ne,{width:"abbreviated",context:"formatting"});case"eeeee":return X.day(ne,{width:"narrow",context:"formatting"});case"eeeeee":return X.day(ne,{width:"short",context:"formatting"});case"eeee":default:return X.day(ne,{width:"wide",context:"formatting"})}},c:function(te,J,X,re){const ne=te.getDay(),oe=(ne-re.weekStartsOn+8)%7||7;switch(J){case"c":return String(oe);case"cc":return addLeadingZeros(oe,J.length);case"co":return X.ordinalNumber(oe,{unit:"day"});case"ccc":return X.day(ne,{width:"abbreviated",context:"standalone"});case"ccccc":return X.day(ne,{width:"narrow",context:"standalone"});case"cccccc":return X.day(ne,{width:"short",context:"standalone"});case"cccc":default:return X.day(ne,{width:"wide",context:"standalone"})}},i:function(te,J,X){const re=te.getDay(),ne=re===0?7:re;switch(J){case"i":return String(ne);case"ii":return addLeadingZeros(ne,J.length);case"io":return X.ordinalNumber(ne,{unit:"day"});case"iii":return X.day(re,{width:"abbreviated",context:"formatting"});case"iiiii":return X.day(re,{width:"narrow",context:"formatting"});case"iiiiii":return X.day(re,{width:"short",context:"formatting"});case"iiii":default:return X.day(re,{width:"wide",context:"formatting"})}},a:function(te,J,X){const ne=te.getHours()/12>=1?"pm":"am";switch(J){case"a":case"aa":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"});case"aaa":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return X.dayPeriod(ne,{width:"narrow",context:"formatting"});case"aaaa":default:return X.dayPeriod(ne,{width:"wide",context:"formatting"})}},b:function(te,J,X){const re=te.getHours();let ne;switch(re===12?ne=dayPeriodEnum.noon:re===0?ne=dayPeriodEnum.midnight:ne=re/12>=1?"pm":"am",J){case"b":case"bb":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"});case"bbb":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return X.dayPeriod(ne,{width:"narrow",context:"formatting"});case"bbbb":default:return X.dayPeriod(ne,{width:"wide",context:"formatting"})}},B:function(te,J,X){const re=te.getHours();let ne;switch(re>=17?ne=dayPeriodEnum.evening:re>=12?ne=dayPeriodEnum.afternoon:re>=4?ne=dayPeriodEnum.morning:ne=dayPeriodEnum.night,J){case"B":case"BB":case"BBB":return X.dayPeriod(ne,{width:"abbreviated",context:"formatting"});case"BBBBB":return X.dayPeriod(ne,{width:"narrow",context:"formatting"});case"BBBB":default:return X.dayPeriod(ne,{width:"wide",context:"formatting"})}},h:function(te,J,X){if(J==="ho"){let re=te.getHours()%12;return re===0&&(re=12),X.ordinalNumber(re,{unit:"hour"})}return lightFormatters.h(te,J)},H:function(te,J,X){return J==="Ho"?X.ordinalNumber(te.getHours(),{unit:"hour"}):lightFormatters.H(te,J)},K:function(te,J,X){const re=te.getHours()%12;return J==="Ko"?X.ordinalNumber(re,{unit:"hour"}):addLeadingZeros(re,J.length)},k:function(te,J,X){let re=te.getHours();return re===0&&(re=24),J==="ko"?X.ordinalNumber(re,{unit:"hour"}):addLeadingZeros(re,J.length)},m:function(te,J,X){return J==="mo"?X.ordinalNumber(te.getMinutes(),{unit:"minute"}):lightFormatters.m(te,J)},s:function(te,J,X){return J==="so"?X.ordinalNumber(te.getSeconds(),{unit:"second"}):lightFormatters.s(te,J)},S:function(te,J){return lightFormatters.S(te,J)},X:function(te,J,X){const re=te.getTimezoneOffset();if(re===0)return"Z";switch(J){case"X":return formatTimezoneWithOptionalMinutes(re);case"XXXX":case"XX":return formatTimezone(re);case"XXXXX":case"XXX":default:return formatTimezone(re,":")}},x:function(te,J,X){const re=te.getTimezoneOffset();switch(J){case"x":return formatTimezoneWithOptionalMinutes(re);case"xxxx":case"xx":return formatTimezone(re);case"xxxxx":case"xxx":default:return formatTimezone(re,":")}},O:function(te,J,X){const re=te.getTimezoneOffset();switch(J){case"O":case"OO":case"OOO":return"GMT"+formatTimezoneShort(re,":");case"OOOO":default:return"GMT"+formatTimezone(re,":")}},z:function(te,J,X){const re=te.getTimezoneOffset();switch(J){case"z":case"zz":case"zzz":return"GMT"+formatTimezoneShort(re,":");case"zzzz":default:return"GMT"+formatTimezone(re,":")}},t:function(te,J,X){const re=Math.trunc(te.getTime()/1e3);return addLeadingZeros(re,J.length)},T:function(te,J,X){const re=te.getTime();return addLeadingZeros(re,J.length)}};function formatTimezoneShort(te,J=""){const X=te>0?"-":"+",re=Math.abs(te),ne=Math.trunc(re/60),oe=re%60;return oe===0?X+String(ne):X+String(ne)+J+addLeadingZeros(oe,2)}function formatTimezoneWithOptionalMinutes(te,J){return te%60===0?(te>0?"-":"+")+addLeadingZeros(Math.abs(te)/60,2):formatTimezone(te,J)}function formatTimezone(te,J=""){const X=te>0?"-":"+",re=Math.abs(te),ne=addLeadingZeros(Math.trunc(re/60),2),oe=addLeadingZeros(re%60,2);return X+ne+J+oe}const dateLongFormatter=(te,J)=>{switch(te){case"P":return J.date({width:"short"});case"PP":return J.date({width:"medium"});case"PPP":return J.date({width:"long"});case"PPPP":default:return J.date({width:"full"})}},timeLongFormatter=(te,J)=>{switch(te){case"p":return J.time({width:"short"});case"pp":return J.time({width:"medium"});case"ppp":return J.time({width:"long"});case"pppp":default:return J.time({width:"full"})}},dateTimeLongFormatter=(te,J)=>{const X=te.match(/(P+)(p+)?/)||[],re=X[1],ne=X[2];if(!ne)return dateLongFormatter(te,J);let oe;switch(re){case"P":oe=J.dateTime({width:"short"});break;case"PP":oe=J.dateTime({width:"medium"});break;case"PPP":oe=J.dateTime({width:"long"});break;case"PPPP":default:oe=J.dateTime({width:"full"});break}return oe.replace("{{date}}",dateLongFormatter(re,J)).replace("{{time}}",timeLongFormatter(ne,J))},longFormatters={p:timeLongFormatter,P:dateTimeLongFormatter},dayOfYearTokenRE=/^D+$/,weekYearTokenRE=/^Y+$/,throwTokens=["D","DD","YY","YYYY"];function isProtectedDayOfYearToken(te){return dayOfYearTokenRE.test(te)}function isProtectedWeekYearToken(te){return weekYearTokenRE.test(te)}function warnOrThrowProtectedError(te,J,X){const re=message(te,J,X);if(console.warn(re),throwTokens.includes(te))throw new RangeError(re)}function message(te,J,X){const re=te[0]==="Y"?"years":"days of the month";return`Use \`${te.toLowerCase()}\` instead of \`${te}\` (in \`${J}\`) for formatting ${re} to the input \`${X}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const formattingTokensRegExp$1=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp$1=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp$1=/^'([^]*?)'?$/,doubleQuoteRegExp$1=/''/g,unescapedLatinCharacterRegExp$1=/[a-zA-Z]/;function format(te,J,X){var pe,fe,ge,me;const re=getDefaultOptions$1(),ne=re.locale??enUS,oe=re.firstWeekContainsDate??((fe=(pe=re.locale)==null?void 0:pe.options)==null?void 0:fe.firstWeekContainsDate)??1,de=re.weekStartsOn??((me=(ge=re.locale)==null?void 0:ge.options)==null?void 0:me.weekStartsOn)??0,ce=toDate(te);if(!isValid(ce))throw new RangeError("Invalid time value");let he=J.match(longFormattingTokensRegExp$1).map(ve=>{const be=ve[0];if(be==="p"||be==="P"){const _e=longFormatters[be];return _e(ve,ne.formatLong)}return ve}).join("").match(formattingTokensRegExp$1).map(ve=>{if(ve==="''")return{isToken:!1,value:"'"};const be=ve[0];if(be==="'")return{isToken:!1,value:cleanEscapedString$1(ve)};if(formatters[be])return{isToken:!0,value:ve};if(be.match(unescapedLatinCharacterRegExp$1))throw new RangeError("Format string contains an unescaped latin alphabet character `"+be+"`");return{isToken:!1,value:ve}});ne.localize.preprocessor&&(he=ne.localize.preprocessor(ce,he));const ue={firstWeekContainsDate:oe,weekStartsOn:de,locale:ne};return he.map(ve=>{if(!ve.isToken)return ve.value;const be=ve.value;(isProtectedWeekYearToken(be)||isProtectedDayOfYearToken(be))&&warnOrThrowProtectedError(be,J,String(te));const _e=formatters[be[0]];return _e(ce,be,ne.localize,ue)}).join("")}function cleanEscapedString$1(te){const J=te.match(escapedStringRegExp$1);return J?J[1].replace(doubleQuoteRegExp$1,"'"):te}function getDay(te){return toDate(te).getDay()}function getDefaultOptions(){return Object.assign({},getDefaultOptions$1())}function getISODay(te){let X=toDate(te).getDay();return X===0&&(X=7),X}function transpose(te,J){const X=J instanceof Date?constructFrom(J,0):new J(0);return X.setFullYear(te.getFullYear(),te.getMonth(),te.getDate()),X.setHours(te.getHours(),te.getMinutes(),te.getSeconds(),te.getMilliseconds()),X}const TIMEZONE_UNIT_PRIORITY=10;class Setter{constructor(){Nt(this,"subPriority",0)}validate(J,X){return!0}}class ValueSetter extends Setter{constructor(J,X,re,ne,oe){super(),this.value=J,this.validateValue=X,this.setValue=re,this.priority=ne,oe&&(this.subPriority=oe)}validate(J,X){return this.validateValue(J,this.value,X)}set(J,X,re){return this.setValue(J,X,this.value,re)}}class DateToSystemTimezoneSetter extends Setter{constructor(){super(...arguments);Nt(this,"priority",TIMEZONE_UNIT_PRIORITY);Nt(this,"subPriority",-1)}set(X,re){return re.timestampIsSet?X:constructFrom(X,transpose(X,Date))}}class Parser{run(J,X,re,ne){const oe=this.parse(J,X,re,ne);return oe?{setter:new ValueSetter(oe.value,this.validate,this.set,this.priority,this.subPriority),rest:oe.rest}:null}validate(J,X,re){return!0}}class EraParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",140);Nt(this,"incompatibleTokens",["R","u","t","T"])}parse(X,re,ne){switch(re){case"G":case"GG":case"GGG":return ne.era(X,{width:"abbreviated"})||ne.era(X,{width:"narrow"});case"GGGGG":return ne.era(X,{width:"narrow"});case"GGGG":default:return ne.era(X,{width:"wide"})||ne.era(X,{width:"abbreviated"})||ne.era(X,{width:"narrow"})}}set(X,re,ne){return re.era=ne,X.setFullYear(ne,0,1),X.setHours(0,0,0,0),X}}const numericPatterns={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},timezonePatterns={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function mapValue(te,J){return te&&{value:J(te.value),rest:te.rest}}function parseNumericPattern(te,J){const X=J.match(te);return X?{value:parseInt(X[0],10),rest:J.slice(X[0].length)}:null}function parseTimezonePattern(te,J){const X=J.match(te);if(!X)return null;if(X[0]==="Z")return{value:0,rest:J.slice(1)};const re=X[1]==="+"?1:-1,ne=X[2]?parseInt(X[2],10):0,oe=X[3]?parseInt(X[3],10):0,de=X[5]?parseInt(X[5],10):0;return{value:re*(ne*millisecondsInHour+oe*millisecondsInMinute+de*millisecondsInSecond),rest:J.slice(X[0].length)}}function parseAnyDigitsSigned(te){return parseNumericPattern(numericPatterns.anyDigitsSigned,te)}function parseNDigits(te,J){switch(te){case 1:return parseNumericPattern(numericPatterns.singleDigit,J);case 2:return parseNumericPattern(numericPatterns.twoDigits,J);case 3:return parseNumericPattern(numericPatterns.threeDigits,J);case 4:return parseNumericPattern(numericPatterns.fourDigits,J);default:return parseNumericPattern(new RegExp("^\\d{1,"+te+"}"),J)}}function parseNDigitsSigned(te,J){switch(te){case 1:return parseNumericPattern(numericPatterns.singleDigitSigned,J);case 2:return parseNumericPattern(numericPatterns.twoDigitsSigned,J);case 3:return parseNumericPattern(numericPatterns.threeDigitsSigned,J);case 4:return parseNumericPattern(numericPatterns.fourDigitsSigned,J);default:return parseNumericPattern(new RegExp("^-?\\d{1,"+te+"}"),J)}}function dayPeriodEnumToHours(te){switch(te){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function normalizeTwoDigitYear(te,J){const X=J>0,re=X?J:1-J;let ne;if(re<=50)ne=te||100;else{const oe=re+50,de=Math.trunc(oe/100)*100,ce=te>=oe%100;ne=te+de-(ce?100:0)}return X?ne:1-ne}function isLeapYearIndex(te){return te%400===0||te%4===0&&te%100!==0}class YearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(X,re,ne){const oe=de=>({year:de,isTwoDigitYear:re==="yy"});switch(re){case"y":return mapValue(parseNDigits(4,X),oe);case"yo":return mapValue(ne.ordinalNumber(X,{unit:"year"}),oe);default:return mapValue(parseNDigits(re.length,X),oe)}}validate(X,re){return re.isTwoDigitYear||re.year>0}set(X,re,ne){const oe=X.getFullYear();if(ne.isTwoDigitYear){const ce=normalizeTwoDigitYear(ne.year,oe);return X.setFullYear(ce,0,1),X.setHours(0,0,0,0),X}const de=!("era"in re)||re.era===1?ne.year:1-ne.year;return X.setFullYear(de,0,1),X.setHours(0,0,0,0),X}}class LocalWeekYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(X,re,ne){const oe=de=>({year:de,isTwoDigitYear:re==="YY"});switch(re){case"Y":return mapValue(parseNDigits(4,X),oe);case"Yo":return mapValue(ne.ordinalNumber(X,{unit:"year"}),oe);default:return mapValue(parseNDigits(re.length,X),oe)}}validate(X,re){return re.isTwoDigitYear||re.year>0}set(X,re,ne,oe){const de=getWeekYear(X,oe);if(ne.isTwoDigitYear){const he=normalizeTwoDigitYear(ne.year,de);return X.setFullYear(he,0,oe.firstWeekContainsDate),X.setHours(0,0,0,0),startOfWeek(X,oe)}const ce=!("era"in re)||re.era===1?ne.year:1-ne.year;return X.setFullYear(ce,0,oe.firstWeekContainsDate),X.setHours(0,0,0,0),startOfWeek(X,oe)}}class ISOWeekYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(X,re){return parseNDigitsSigned(re==="R"?4:re.length,X)}set(X,re,ne){const oe=constructFrom(X,0);return oe.setFullYear(ne,0,4),oe.setHours(0,0,0,0),startOfISOWeek(oe)}}class ExtendedYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",130);Nt(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(X,re){return parseNDigitsSigned(re==="u"?4:re.length,X)}set(X,re,ne){return X.setFullYear(ne,0,1),X.setHours(0,0,0,0),X}}class QuarterParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",120);Nt(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"Q":case"QQ":return parseNDigits(re.length,X);case"Qo":return ne.ordinalNumber(X,{unit:"quarter"});case"QQQ":return ne.quarter(X,{width:"abbreviated",context:"formatting"})||ne.quarter(X,{width:"narrow",context:"formatting"});case"QQQQQ":return ne.quarter(X,{width:"narrow",context:"formatting"});case"QQQQ":default:return ne.quarter(X,{width:"wide",context:"formatting"})||ne.quarter(X,{width:"abbreviated",context:"formatting"})||ne.quarter(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=1&&re<=4}set(X,re,ne){return X.setMonth((ne-1)*3,1),X.setHours(0,0,0,0),X}}class StandAloneQuarterParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",120);Nt(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"q":case"qq":return parseNDigits(re.length,X);case"qo":return ne.ordinalNumber(X,{unit:"quarter"});case"qqq":return ne.quarter(X,{width:"abbreviated",context:"standalone"})||ne.quarter(X,{width:"narrow",context:"standalone"});case"qqqqq":return ne.quarter(X,{width:"narrow",context:"standalone"});case"qqqq":default:return ne.quarter(X,{width:"wide",context:"standalone"})||ne.quarter(X,{width:"abbreviated",context:"standalone"})||ne.quarter(X,{width:"narrow",context:"standalone"})}}validate(X,re){return re>=1&&re<=4}set(X,re,ne){return X.setMonth((ne-1)*3,1),X.setHours(0,0,0,0),X}}class MonthParser extends Parser{constructor(){super(...arguments);Nt(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);Nt(this,"priority",110)}parse(X,re,ne){const oe=de=>de-1;switch(re){case"M":return mapValue(parseNumericPattern(numericPatterns.month,X),oe);case"MM":return mapValue(parseNDigits(2,X),oe);case"Mo":return mapValue(ne.ordinalNumber(X,{unit:"month"}),oe);case"MMM":return ne.month(X,{width:"abbreviated",context:"formatting"})||ne.month(X,{width:"narrow",context:"formatting"});case"MMMMM":return ne.month(X,{width:"narrow",context:"formatting"});case"MMMM":default:return ne.month(X,{width:"wide",context:"formatting"})||ne.month(X,{width:"abbreviated",context:"formatting"})||ne.month(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=0&&re<=11}set(X,re,ne){return X.setMonth(ne,1),X.setHours(0,0,0,0),X}}class StandAloneMonthParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",110);Nt(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(X,re,ne){const oe=de=>de-1;switch(re){case"L":return mapValue(parseNumericPattern(numericPatterns.month,X),oe);case"LL":return mapValue(parseNDigits(2,X),oe);case"Lo":return mapValue(ne.ordinalNumber(X,{unit:"month"}),oe);case"LLL":return ne.month(X,{width:"abbreviated",context:"standalone"})||ne.month(X,{width:"narrow",context:"standalone"});case"LLLLL":return ne.month(X,{width:"narrow",context:"standalone"});case"LLLL":default:return ne.month(X,{width:"wide",context:"standalone"})||ne.month(X,{width:"abbreviated",context:"standalone"})||ne.month(X,{width:"narrow",context:"standalone"})}}validate(X,re){return re>=0&&re<=11}set(X,re,ne){return X.setMonth(ne,1),X.setHours(0,0,0,0),X}}function setWeek(te,J,X){const re=toDate(te),ne=getWeek(re,X)-J;return re.setDate(re.getDate()-ne*7),re}class LocalWeekParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",100);Nt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(X,re,ne){switch(re){case"w":return parseNumericPattern(numericPatterns.week,X);case"wo":return ne.ordinalNumber(X,{unit:"week"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=53}set(X,re,ne,oe){return startOfWeek(setWeek(X,ne,oe),oe)}}function setISOWeek(te,J){const X=toDate(te),re=getISOWeek(X)-J;return X.setDate(X.getDate()-re*7),X}class ISOWeekParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",100);Nt(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(X,re,ne){switch(re){case"I":return parseNumericPattern(numericPatterns.week,X);case"Io":return ne.ordinalNumber(X,{unit:"week"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=53}set(X,re,ne){return startOfISOWeek(setISOWeek(X,ne))}}const DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31],DAYS_IN_MONTH_LEAP_YEAR=[31,29,31,30,31,30,31,31,30,31,30,31];class DateParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"subPriority",1);Nt(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"d":return parseNumericPattern(numericPatterns.date,X);case"do":return ne.ordinalNumber(X,{unit:"date"});default:return parseNDigits(re.length,X)}}validate(X,re){const ne=X.getFullYear(),oe=isLeapYearIndex(ne),de=X.getMonth();return oe?re>=1&&re<=DAYS_IN_MONTH_LEAP_YEAR[de]:re>=1&&re<=DAYS_IN_MONTH[de]}set(X,re,ne){return X.setDate(ne),X.setHours(0,0,0,0),X}}class DayOfYearParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"subpriority",1);Nt(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"D":case"DD":return parseNumericPattern(numericPatterns.dayOfYear,X);case"Do":return ne.ordinalNumber(X,{unit:"date"});default:return parseNDigits(re.length,X)}}validate(X,re){const ne=X.getFullYear();return isLeapYearIndex(ne)?re>=1&&re<=366:re>=1&&re<=365}set(X,re,ne){return X.setMonth(0,ne),X.setHours(0,0,0,0),X}}function setDay(te,J,X){var fe,ge,me,ve;const re=getDefaultOptions$1(),ne=(X==null?void 0:X.weekStartsOn)??((ge=(fe=X==null?void 0:X.locale)==null?void 0:fe.options)==null?void 0:ge.weekStartsOn)??re.weekStartsOn??((ve=(me=re.locale)==null?void 0:me.options)==null?void 0:ve.weekStartsOn)??0,oe=toDate(te),de=oe.getDay(),he=(J%7+7)%7,ue=7-ne,pe=J<0||J>6?J-(de+ue)%7:(he+ue)%7-(de+ue)%7;return addDays(oe,pe)}class DayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(X,re,ne){switch(re){case"E":case"EE":case"EEE":return ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"EEEEE":return ne.day(X,{width:"narrow",context:"formatting"});case"EEEEEE":return ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"EEEE":default:return ne.day(X,{width:"wide",context:"formatting"})||ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=0&&re<=6}set(X,re,ne,oe){return X=setDay(X,ne,oe),X.setHours(0,0,0,0),X}}class LocalDayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(X,re,ne,oe){const de=ce=>{const he=Math.floor((ce-1)/7)*7;return(ce+oe.weekStartsOn+6)%7+he};switch(re){case"e":case"ee":return mapValue(parseNDigits(re.length,X),de);case"eo":return mapValue(ne.ordinalNumber(X,{unit:"day"}),de);case"eee":return ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"eeeee":return ne.day(X,{width:"narrow",context:"formatting"});case"eeeeee":return ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"});case"eeee":default:return ne.day(X,{width:"wide",context:"formatting"})||ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"})}}validate(X,re){return re>=0&&re<=6}set(X,re,ne,oe){return X=setDay(X,ne,oe),X.setHours(0,0,0,0),X}}class StandAloneLocalDayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(X,re,ne,oe){const de=ce=>{const he=Math.floor((ce-1)/7)*7;return(ce+oe.weekStartsOn+6)%7+he};switch(re){case"c":case"cc":return mapValue(parseNDigits(re.length,X),de);case"co":return mapValue(ne.ordinalNumber(X,{unit:"day"}),de);case"ccc":return ne.day(X,{width:"abbreviated",context:"standalone"})||ne.day(X,{width:"short",context:"standalone"})||ne.day(X,{width:"narrow",context:"standalone"});case"ccccc":return ne.day(X,{width:"narrow",context:"standalone"});case"cccccc":return ne.day(X,{width:"short",context:"standalone"})||ne.day(X,{width:"narrow",context:"standalone"});case"cccc":default:return ne.day(X,{width:"wide",context:"standalone"})||ne.day(X,{width:"abbreviated",context:"standalone"})||ne.day(X,{width:"short",context:"standalone"})||ne.day(X,{width:"narrow",context:"standalone"})}}validate(X,re){return re>=0&&re<=6}set(X,re,ne,oe){return X=setDay(X,ne,oe),X.setHours(0,0,0,0),X}}function setISODay(te,J){const X=toDate(te),re=getISODay(X),ne=J-re;return addDays(X,ne)}class ISODayParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",90);Nt(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(X,re,ne){const oe=de=>de===0?7:de;switch(re){case"i":case"ii":return parseNDigits(re.length,X);case"io":return ne.ordinalNumber(X,{unit:"day"});case"iii":return mapValue(ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"}),oe);case"iiiii":return mapValue(ne.day(X,{width:"narrow",context:"formatting"}),oe);case"iiiiii":return mapValue(ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"}),oe);case"iiii":default:return mapValue(ne.day(X,{width:"wide",context:"formatting"})||ne.day(X,{width:"abbreviated",context:"formatting"})||ne.day(X,{width:"short",context:"formatting"})||ne.day(X,{width:"narrow",context:"formatting"}),oe)}}validate(X,re){return re>=1&&re<=7}set(X,re,ne){return X=setISODay(X,ne),X.setHours(0,0,0,0),X}}class AMPMParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",80);Nt(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(X,re,ne){switch(re){case"a":case"aa":case"aaa":return ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"aaaaa":return ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"aaaa":default:return ne.dayPeriod(X,{width:"wide",context:"formatting"})||ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"})}}set(X,re,ne){return X.setHours(dayPeriodEnumToHours(ne),0,0,0),X}}class AMPMMidnightParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",80);Nt(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(X,re,ne){switch(re){case"b":case"bb":case"bbb":return ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"bbbbb":return ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"bbbb":default:return ne.dayPeriod(X,{width:"wide",context:"formatting"})||ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"})}}set(X,re,ne){return X.setHours(dayPeriodEnumToHours(ne),0,0,0),X}}class DayPeriodParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",80);Nt(this,"incompatibleTokens",["a","b","t","T"])}parse(X,re,ne){switch(re){case"B":case"BB":case"BBB":return ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"BBBBB":return ne.dayPeriod(X,{width:"narrow",context:"formatting"});case"BBBB":default:return ne.dayPeriod(X,{width:"wide",context:"formatting"})||ne.dayPeriod(X,{width:"abbreviated",context:"formatting"})||ne.dayPeriod(X,{width:"narrow",context:"formatting"})}}set(X,re,ne){return X.setHours(dayPeriodEnumToHours(ne),0,0,0),X}}class Hour1to12Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["H","K","k","t","T"])}parse(X,re,ne){switch(re){case"h":return parseNumericPattern(numericPatterns.hour12h,X);case"ho":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=12}set(X,re,ne){const oe=X.getHours()>=12;return oe&&ne<12?X.setHours(ne+12,0,0,0):!oe&&ne===12?X.setHours(0,0,0,0):X.setHours(ne,0,0,0),X}}class Hour0to23Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(X,re,ne){switch(re){case"H":return parseNumericPattern(numericPatterns.hour23h,X);case"Ho":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=23}set(X,re,ne){return X.setHours(ne,0,0,0),X}}class Hour0To11Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["h","H","k","t","T"])}parse(X,re,ne){switch(re){case"K":return parseNumericPattern(numericPatterns.hour11h,X);case"Ko":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=11}set(X,re,ne){return X.getHours()>=12&&ne<12?X.setHours(ne+12,0,0,0):X.setHours(ne,0,0,0),X}}class Hour1To24Parser extends Parser{constructor(){super(...arguments);Nt(this,"priority",70);Nt(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(X,re,ne){switch(re){case"k":return parseNumericPattern(numericPatterns.hour24h,X);case"ko":return ne.ordinalNumber(X,{unit:"hour"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=1&&re<=24}set(X,re,ne){const oe=ne<=24?ne%24:ne;return X.setHours(oe,0,0,0),X}}class MinuteParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",60);Nt(this,"incompatibleTokens",["t","T"])}parse(X,re,ne){switch(re){case"m":return parseNumericPattern(numericPatterns.minute,X);case"mo":return ne.ordinalNumber(X,{unit:"minute"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=59}set(X,re,ne){return X.setMinutes(ne,0,0),X}}class SecondParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",50);Nt(this,"incompatibleTokens",["t","T"])}parse(X,re,ne){switch(re){case"s":return parseNumericPattern(numericPatterns.second,X);case"so":return ne.ordinalNumber(X,{unit:"second"});default:return parseNDigits(re.length,X)}}validate(X,re){return re>=0&&re<=59}set(X,re,ne){return X.setSeconds(ne,0),X}}class FractionOfSecondParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",30);Nt(this,"incompatibleTokens",["t","T"])}parse(X,re){const ne=oe=>Math.trunc(oe*Math.pow(10,-re.length+3));return mapValue(parseNDigits(re.length,X),ne)}set(X,re,ne){return X.setMilliseconds(ne),X}}class ISOTimezoneWithZParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",10);Nt(this,"incompatibleTokens",["t","T","x"])}parse(X,re){switch(re){case"X":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,X);case"XX":return parseTimezonePattern(timezonePatterns.basic,X);case"XXXX":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,X);case"XXXXX":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,X);case"XXX":default:return parseTimezonePattern(timezonePatterns.extended,X)}}set(X,re,ne){return re.timestampIsSet?X:constructFrom(X,X.getTime()-getTimezoneOffsetInMilliseconds(X)-ne)}}class ISOTimezoneParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",10);Nt(this,"incompatibleTokens",["t","T","X"])}parse(X,re){switch(re){case"x":return parseTimezonePattern(timezonePatterns.basicOptionalMinutes,X);case"xx":return parseTimezonePattern(timezonePatterns.basic,X);case"xxxx":return parseTimezonePattern(timezonePatterns.basicOptionalSeconds,X);case"xxxxx":return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds,X);case"xxx":default:return parseTimezonePattern(timezonePatterns.extended,X)}}set(X,re,ne){return re.timestampIsSet?X:constructFrom(X,X.getTime()-getTimezoneOffsetInMilliseconds(X)-ne)}}class TimestampSecondsParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",40);Nt(this,"incompatibleTokens","*")}parse(X){return parseAnyDigitsSigned(X)}set(X,re,ne){return[constructFrom(X,ne*1e3),{timestampIsSet:!0}]}}class TimestampMillisecondsParser extends Parser{constructor(){super(...arguments);Nt(this,"priority",20);Nt(this,"incompatibleTokens","*")}parse(X){return parseAnyDigitsSigned(X)}set(X,re,ne){return[constructFrom(X,ne),{timestampIsSet:!0}]}}const parsers={G:new EraParser,y:new YearParser,Y:new LocalWeekYearParser,R:new ISOWeekYearParser,u:new ExtendedYearParser,Q:new QuarterParser,q:new StandAloneQuarterParser,M:new MonthParser,L:new StandAloneMonthParser,w:new LocalWeekParser,I:new ISOWeekParser,d:new DateParser,D:new DayOfYearParser,E:new DayParser,e:new LocalDayParser,c:new StandAloneLocalDayParser,i:new ISODayParser,a:new AMPMParser,b:new AMPMMidnightParser,B:new DayPeriodParser,h:new Hour1to12Parser,H:new Hour0to23Parser,K:new Hour0To11Parser,k:new Hour1To24Parser,m:new MinuteParser,s:new SecondParser,S:new FractionOfSecondParser,X:new ISOTimezoneWithZParser,x:new ISOTimezoneParser,t:new TimestampSecondsParser,T:new TimestampMillisecondsParser},formattingTokensRegExp=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,longFormattingTokensRegExp=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,escapedStringRegExp=/^'([^]*?)'?$/,doubleQuoteRegExp=/''/g,notWhitespaceRegExp=/\S/,unescapedLatinCharacterRegExp=/[a-zA-Z]/;function parse(te,J,X,re){var be,_e,we,Se;const ne=getDefaultOptions(),oe=ne.locale??enUS,de=ne.firstWeekContainsDate??((_e=(be=ne.locale)==null?void 0:be.options)==null?void 0:_e.firstWeekContainsDate)??1,ce=ne.weekStartsOn??((Se=(we=ne.locale)==null?void 0:we.options)==null?void 0:Se.weekStartsOn)??0,he={firstWeekContainsDate:de,weekStartsOn:ce,locale:oe},ue=[new DateToSystemTimezoneSetter],pe=J.match(longFormattingTokensRegExp).map(Ce=>{const ye=Ce[0];if(ye in longFormatters){const Ae=longFormatters[ye];return Ae(Ce,oe.formatLong)}return Ce}).join("").match(formattingTokensRegExp),fe=[];for(let Ce of pe){isProtectedWeekYearToken(Ce)&&warnOrThrowProtectedError(Ce,J,te),isProtectedDayOfYearToken(Ce)&&warnOrThrowProtectedError(Ce,J,te);const ye=Ce[0],Ae=parsers[ye];if(Ae){const{incompatibleTokens:Le}=Ae;if(Array.isArray(Le)){const Me=fe.find(He=>Le.includes(He.token)||He.token===ye);if(Me)throw new RangeError(`The format string mustn't contain \`${Me.fullToken}\` and \`${Ce}\` at the same time`)}else if(Ae.incompatibleTokens==="*"&&fe.length>0)throw new RangeError(`The format string mustn't contain \`${Ce}\` and any other token at the same time`);fe.push({token:ye,fullToken:Ce});const De=Ae.run(te,Ce,oe.match,he);if(!De)return constructFrom(X,NaN);ue.push(De.setter),te=De.rest}else{if(ye.match(unescapedLatinCharacterRegExp))throw new RangeError("Format string contains an unescaped latin alphabet character `"+ye+"`");if(Ce==="''"?Ce="'":ye==="'"&&(Ce=cleanEscapedString(Ce)),te.indexOf(Ce)===0)te=te.slice(Ce.length);else return constructFrom(X,NaN)}}if(te.length>0&&notWhitespaceRegExp.test(te))return constructFrom(X,NaN);const ge=ue.map(Ce=>Ce.priority).sort((Ce,ye)=>ye-Ce).filter((Ce,ye,Ae)=>Ae.indexOf(Ce)===ye).map(Ce=>ue.filter(ye=>ye.priority===Ce).sort((ye,Ae)=>Ae.subPriority-ye.subPriority)).map(Ce=>Ce[0]);let me=toDate(X);if(isNaN(me.getTime()))return constructFrom(X,NaN);const ve={};for(const Ce of ge){if(!Ce.validate(me,he))return constructFrom(X,NaN);const ye=Ce.set(me,ve,he);Array.isArray(ye)?(me=ye[0],Object.assign(ve,ye[1])):me=ye}return constructFrom(X,me)}function cleanEscapedString(te){return te.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp,"'")}const notFound="data:image/svg+xml,%3csvg%20width='215'%20height='150'%20viewBox='0%200%20215%20150'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20opacity='0.9'%20d='M135.132%2057.43C96.9221%2047.658%2083.3815%20-29.7048%2026.9734%2012.5083C-13.0511%2042.4595%2011.4691%20115.499%2061.6878%20107.019C92.0822%20101.867%2087.3917%20101.341%20113.129%20115.244C139.231%20129.308%20167.972%20136.397%20195.855%20111.436C210.28%2098.5179%20215.939%2067.0352%20201.939%2050.7417C184.388%2030.3592%20158.485%2063.4098%20135.132%2057.43Z'%20fill='%23EFF7FF'/%3e%3cellipse%20cx='120.5'%20cy='143.5'%20rx='52.5'%20ry='3.5'%20fill='%23F5F5F5'/%3e%3cpath%20d='M121.387%2080.2184C121.995%2079.5948%20122.563%2078.953%20123.09%2078.2959L134.396%2089.3383C135.09%2090.0177%20134.851%2091.389%20133.861%2092.4024C132.872%2093.4159%20131.505%2093.6888%20130.811%2093.0094L119.505%2081.967C120.148%2081.424%20120.777%2080.8407%20121.385%2080.2171L121.387%2080.2184Z'%20fill='%231D1D1D'/%3e%3cpath%20opacity='0.6'%20d='M121.127%2079.9896C132.157%2068.6986%20131.888%2050.5485%20120.527%2039.4502C109.166%2028.3519%2091.0149%2028.5081%2079.9849%2039.799C68.955%2051.09%2069.2233%2069.2401%2080.5843%2080.3385C91.9453%2091.4368%20110.097%2091.2806%20121.127%2079.9896Z'%20fill='%238FC2F5'/%3e%3cpath%20d='M78.0382%2083.0622C90.8729%2095.6382%20111.378%2095.4578%20123.835%2082.6609C136.293%2069.8625%20135.986%2049.2932%20123.15%2036.7173C110.316%2024.1413%2089.8107%2024.3217%2077.3538%2037.1186C64.8956%2049.9169%2065.2022%2070.4862%2078.0382%2083.0622ZM80.642%2080.387C69.289%2069.264%2069.0172%2051.0692%2080.037%2039.749C91.0569%2028.4288%20109.194%2028.2694%20120.547%2039.3938C131.9%2050.5182%20132.171%2068.713%20121.152%2080.0332C110.132%2091.3534%2091.9949%2091.5128%2080.642%2080.3884V80.387Z'%20fill='%237BACFC'/%3e%3cpath%20d='M169.953%20128.522L171.714%20126.696C173.474%20124.871%20173.421%20121.964%20171.595%20120.205L135.013%2084.9265C133.187%2083.1661%20130.281%2083.2205%20128.522%2085.0451L126.761%2086.8711C125.001%2088.6957%20125.055%2091.6028%20126.88%2093.3619L163.462%20128.64C165.287%20130.401%20168.194%20130.346%20169.953%20128.522Z'%20fill='%23656565'/%3e%3cpath%20opacity='0.35'%20d='M88.8399%2071.2315C96.506%2079.2245%20101.258%2078.1642%20100.757%2082.4547C100.256%2086.7452%2091.398%2085.7448%2082.7698%2076.0396C74.1415%2066.3344%2075.0893%2054.9166%2079.8491%2055.2485C84.6089%2055.5803%2080.129%2062.1492%2088.8399%2071.2315Z'%20fill='white'/%3e%3c/svg%3e";/**
329
329
  * @license
330
330
  * Copyright 2018 Google LLC
331
331
  * SPDX-License-Identifier: BSD-3-Clause
@@ -625,7 +625,7 @@ Registered bindings:`,ne.forEach(function(oe){var de="Object";oe.implementationT
625
625
  </div>
626
626
  `;var __defProp$b=Object.defineProperty,__decorateClass$b=(te,J,X,re)=>{for(var ne=void 0,oe=te.length-1,de;oe>=0;oe--)(de=te[oe])&&(ne=de(J,X,ne)||ne);return ne&&__defProp$b(J,X,ne),ne};const Vi=class Vi extends PrimariaRegionHost(h$q){render(){return ke$1`${template$7()}`}firstUpdated(){this._observeMaximizedState()}_observeMaximizedState(){const J=this.renderRoot.querySelector("#content-widgets-region");if(!J)return;new MutationObserver(()=>{const re=J.querySelector("activity-history-main");if(!re)return;const ne=re.hasAttribute("maximized")||re.maximized;this._toggleWidgetsVisibility(!ne)}).observe(J,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["maximized"]})}_toggleWidgetsVisibility(J){const X=this.renderRoot.querySelector("#widgets-sidebar-region"),re=this.renderRoot.querySelector("#header-widgets-region");X&&(X.style.display=J?"":"none"),re&&(re.style.display=J?"":"none")}};Vi.styles=i$A`
627
627
  ${r$H(styles$6)}
628
- `;let ClinicalMonitoring=Vi;__decorateClass$b([s$x({targetId:"widgets-sidebar-region",name:clinicalMonitoringRegions.sidebar})],ClinicalMonitoring.prototype,"sidebarRegion"),__decorateClass$b([s$x({targetId:"header-widgets-region",name:clinicalMonitoringRegions.header})],ClinicalMonitoring.prototype,"headerRegion"),__decorateClass$b([s$x({targetId:"content-widgets-region",name:clinicalMonitoringRegions.content})],ClinicalMonitoring.prototype,"contentRegion");const useClinicalMonitoring=te=>{t$j("clinical-monitoring")(ClinicalMonitoring),te.regionManager.registerMainView({id:clinicalMonitoringId,factory:()=>{const J=new ClinicalMonitoring;return Promise.resolve(J)},isDefault:!0}),te.regionManager.registerView(shellRegions.navigationMenu,{id:clinicalMonitoringId,factory:()=>{const J=new PrimariaNavItem({icon:"account_box",label:"Seguiment clínic",callbackFn:()=>{te.regionManager.activateMainView(clinicalMonitoringId),te.broker.publish(shellEvents.openClinicalMonitoringRequested)}});return Promise.resolve(J)},sortHint:"0020"})},disposeClinicalMonitoring=te=>{te.regionManager.removeView(shellRegions.main,clinicalMonitoringId)};var __defProp$a=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__decorateClass$a=(te,J,X,re)=>{for(var ne=re>1?void 0:re?__getOwnPropDesc$2(J,X):J,oe=te.length-1,de;oe>=0;oe--)(de=te[oe])&&(ne=(re?de(J,X,ne):de(ne))||ne);return re&&ne&&__defProp$a(J,X,ne),ne},__decorateParam$1=(te,J)=>(X,re)=>J(X,re,te);let GetVisitIdHandler=class{constructor(te){this.api=te}async handle(te){try{const J=await this.getVisitId();return console.log("Visit ID obtenido: ",J),J}catch(J){this.api.notificationService.error(J.message);return}}getVisitId(){const te=new URLSearchParams(window.location.search);console.log("Paràmetres de la URL: ",window.location.search);const J=te.get("visit_id");return Promise.resolve(J||void 0)}};GetVisitIdHandler=__decorateClass$a([__decorateParam$1(0,inject(TYPES$1.primaryApi))],GetVisitIdHandler);class GetVisitId{}let request$1;const useGetVisitId=te=>{disposeGetVisitId(),request$1=registerRequest(te,container$1)(GetVisitId,GetVisitIdHandler)},disposeGetVisitId=()=>{request$1==null||request$1.dispose()};var __defProp$9=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$9=(te,J,X,re)=>{for(var ne=re>1?void 0:re?__getOwnPropDesc$1(J,X):J,oe=te.length-1,de;oe>=0;oe--)(de=te[oe])&&(ne=(re?de(J,X,ne):de(ne))||ne);return re&&ne&&__defProp$9(J,X,ne),ne},__decorateParam=(te,J)=>(X,re)=>J(X,re,te);let FinalizeVisitHandler=class{constructor(te){this.api=te}async handle(te){try{const J=te.visitId;this.api.ecapEventManager.publish("RESOL_VISITA","",{VisiID:J})}catch(J){this.api.notificationService.error(J.message)}}};FinalizeVisitHandler=__decorateClass$9([__decorateParam(0,inject(TYPES$1.primaryApi))],FinalizeVisitHandler);class FinalizeVisit{constructor(J){this.visitId=J}}let request;const useFinalizeVisit=te=>{disposeFinalizeVisit(),request=registerRequest(te,container$1)(FinalizeVisit,FinalizeVisitHandler)},disposeFinalizeVisit=()=>{request==null||request.dispose()},useFeatures=te=>{container$1.bind(TYPES$1.primaryApi).toConstantValue(te),useGetUserInfo(te),useExitShell(te),useGetVisitId(te),useFinalizeVisit(te),useClinicalMonitoring(te),te.broker.send(new GetUserInfo)},disposeFeatures=te=>{disposeGetUserInfo(),disposeExitShell(),disposeGetVisitId(),disposeFinalizeVisit(),disposeClinicalMonitoring(te),container$1.unbindAll(),te.regionManager._destroy(),mediatorSettings.resolver.clear()},disposeShell=()=>{disposeFeatures(shellApi)},raiseCloseEvent=()=>{shellApi.ecapEventManager.publish("CLOSE_FORM","",{})},raiseCustomCloseEvent=te=>{shellApi.ecapEventManager.publish(te,"",{})};var shellViews=(te=>(te.shell="primaria-shell",te.error="primaria-error-view",te))(shellViews||{});const styles$5=":host{width:100%;overflow:hidden}#main-switcher{display:inherit}.container{width:100%;height:100%;display:flex;flex-direction:column;background:#fff}.main-container{min-height:1px;height:100%;display:flex}.main-container .sidebar{padding-inline:16px;display:flex;flex-direction:column;justify-content:space-between;align-items:center;background:var(--color-primary-700);width:40px;height:100%;color:#fff}.main-container .sidebar .quick-actions-content{padding-top:24px;padding-bottom:22px;border-radius:8px}.main-container .sidebar .quick-actions-content .create-button-icon-badge{position:relative}.main-container .sidebar .quick-actions-content .create-button-icon-badge dss-notification-badge{position:absolute;top:-7px;right:-6px;z-index:1}.main-container .sidebar .quick-actions-content .create-button-icon-badge dss-icon{position:relative}.main-container .sidebar .icon{margin-left:8px}.main-container .sidebar #menu-region-container{padding-top:24px;min-height:1px;height:100%;width:100%;display:flex;flex-direction:column;gap:4px}.main-container .sidebar .bottom-content{display:flex;flex-direction:column;gap:24px;width:100%}.main-container .sidebar .bottom-content .bottom-content-first{display:flex;flex-direction:column;gap:4px}.main-container .sidebar #quick-actions-region-container{width:100%}.main-container .sidebar[expanded]{width:252px;align-items:flex-start}.main-container .sidebar .create-button-closed{cursor:pointer;background-color:#f0f0f0;color:var(--color-primary-700);border-radius:8px;width:40px;height:40px;display:flex;flex-direction:row;align-items:center;justify-content:center;transition:background-color .3s ease}.main-container .sidebar .create-button-closed:hover{background-color:var(--color-primary-900);color:#fff}.main-container .sidebar .create-button-opened{cursor:pointer;background-color:#f0f0f0;color:var(--color-primary-700);border-radius:8px;gap:8px;font-weight:600;width:220px;height:40px;display:flex;flex-direction:row;align-items:center;transition:background-color .3s ease}.main-container .sidebar .create-button-opened:hover{background-color:var(--color-primary-900);color:#fff}.main-container .content{display:flex;height:100%;width:100%}.main-container #main-region-container{min-height:1px;height:100%;flex:1}.main-container #floating-region-container{position:fixed;z-index:300}.footer{display:flex;height:48px;padding:12px 24px}.footer .footer-logo{align-self:center;display:flex;gap:16px}.divider-opened{width:220px}.divider-closed{width:40px}.toggle-button{margin-bottom:24px}";let t$f="";function f$l(){return t$f}function s$q(te,J){const X=f$l(),re=`${te}${X}`;customElements.define(re,J)}const e$J="*,*:before,*:after{box-sizing:border-box}*{margin:0;padding:0;font-family:var(--font-family)}ul,ol{list-style:none}",o$J={type:Boolean,converter:{fromAttribute:te=>te!==null&&te!=="false",toAttribute:te=>te?"true":null}},n$u={type:Array,converter:{fromAttribute:te=>{if(!te)return[];const J=JSON.parse(te);return Array.isArray(J)?J.map(X=>X.toString()):[J.toString()]},toAttribute:te=>JSON.stringify(te)}},i$w=':host{display:flex;align-items:center}.dss-icon,.material-symbols-rounded{font-family:var(--font-icons);font-size:var(--icon-size-md);font-weight:400;font-style:normal;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-feature-settings:"liga";-webkit-font-smoothing:antialiased;font-variation-settings:"FILL" 0,"wght" 400,"GRAD" 0,"opsz" 24}.dss-icon--fill,.material-symbols-rounded--fill{font-variation-settings:"FILL" 1}.dss-icon--sm{font-size:var(--icon-size-sm)}.dss-icon--md{font-size:var(--icon-size-md)}.dss-icon--lg{font-size:var(--icon-size-lg)}.dss-icon--xl{font-size:var(--icon-size-xl)}.dss-icon-ghost{display:inline-block;height:var(--icon-size-md);width:var(--icon-size-md);overflow:hidden;background-color:transparent}.dss-icon-ghost--sm{height:var(--icon-size-sm);width:var(--icon-size-sm);border-radius:var(--dss-radius-xs)}.dss-icon-ghost--lg{height:var(--icon-size-lg);width:var(--icon-size-lg)}.dss-icon-ghost--xl{height:var(--icon-size-xl);width:var(--icon-size-xl)}',d$p=te=>ke$1`
628
+ `;let ClinicalMonitoring=Vi;__decorateClass$b([s$x({targetId:"widgets-sidebar-region",name:clinicalMonitoringRegions.sidebar})],ClinicalMonitoring.prototype,"sidebarRegion"),__decorateClass$b([s$x({targetId:"header-widgets-region",name:clinicalMonitoringRegions.header})],ClinicalMonitoring.prototype,"headerRegion"),__decorateClass$b([s$x({targetId:"content-widgets-region",name:clinicalMonitoringRegions.content})],ClinicalMonitoring.prototype,"contentRegion");const useClinicalMonitoring=te=>{t$j("clinical-monitoring")(ClinicalMonitoring),te.regionManager.registerMainView({id:clinicalMonitoringId,factory:()=>{const J=new ClinicalMonitoring;return Promise.resolve(J)},isDefault:!0}),te.regionManager.registerView(shellRegions.navigationMenu,{id:clinicalMonitoringId,factory:()=>{const J=new PrimariaNavItem({icon:"account_box",label:"Seguiment clínic",callbackFn:()=>{te.regionManager.activateMainView(clinicalMonitoringId),te.broker.publish(shellEvents.openClinicalMonitoringRequested)}});return Promise.resolve(J)},sortHint:"0020"})},disposeClinicalMonitoring=te=>{te.regionManager.removeView(shellRegions.main,clinicalMonitoringId)};var __defProp$a=Object.defineProperty,__getOwnPropDesc$2=Object.getOwnPropertyDescriptor,__decorateClass$a=(te,J,X,re)=>{for(var ne=re>1?void 0:re?__getOwnPropDesc$2(J,X):J,oe=te.length-1,de;oe>=0;oe--)(de=te[oe])&&(ne=(re?de(J,X,ne):de(ne))||ne);return re&&ne&&__defProp$a(J,X,ne),ne},__decorateParam$1=(te,J)=>(X,re)=>J(X,re,te);let GetVisitIdHandler=class{constructor(te){this.api=te}async handle(te){try{const J=await this.getVisitId();return console.log("Visit ID obtenido: ",J),J}catch(J){this.api.notificationService.error(J.message);return}}getVisitId(){const te=new URLSearchParams(window.location.search);console.log("Paràmetres de la URL: ",window.location.search);const J=te.get("visit_id");return Promise.resolve(J||void 0)}};GetVisitIdHandler=__decorateClass$a([__decorateParam$1(0,inject(TYPES$1.primaryApi))],GetVisitIdHandler);class GetVisitId{}let request$1;const useGetVisitId=te=>{disposeGetVisitId(),request$1=registerRequest(te,container$1)(GetVisitId,GetVisitIdHandler)},disposeGetVisitId=()=>{request$1==null||request$1.dispose()};var __defProp$9=Object.defineProperty,__getOwnPropDesc$1=Object.getOwnPropertyDescriptor,__decorateClass$9=(te,J,X,re)=>{for(var ne=re>1?void 0:re?__getOwnPropDesc$1(J,X):J,oe=te.length-1,de;oe>=0;oe--)(de=te[oe])&&(ne=(re?de(J,X,ne):de(ne))||ne);return re&&ne&&__defProp$9(J,X,ne),ne},__decorateParam=(te,J)=>(X,re)=>J(X,re,te);let FinalizeVisitHandler=class{constructor(te){this.api=te}async handle(te){try{const J=te.visitId;this.api.ecapEventManager.publish("RESOL_VISITA","",{VisiID:J})}catch(J){this.api.notificationService.error(J.message)}}};FinalizeVisitHandler=__decorateClass$9([__decorateParam(0,inject(TYPES$1.primaryApi))],FinalizeVisitHandler);class FinalizeVisit{constructor(J){this.visitId=J}}let request;const useFinalizeVisit=te=>{disposeFinalizeVisit(),request=registerRequest(te,container$1)(FinalizeVisit,FinalizeVisitHandler)},disposeFinalizeVisit=()=>{request==null||request.dispose()},useFeatures=te=>{container$1.bind(TYPES$1.primaryApi).toConstantValue(te),useGetUserInfo(te),useExitShell(te),useGetVisitId(te),useFinalizeVisit(te),useClinicalMonitoring(te),te.broker.send(new GetUserInfo)},disposeFeatures=te=>{disposeGetUserInfo(),disposeExitShell(),disposeGetVisitId(),disposeFinalizeVisit(),disposeClinicalMonitoring(te),container$1.unbindAll(),te.regionManager._destroy(),mediatorSettings.resolver.clear()},disposeShell=()=>{disposeFeatures(shellApi)},raiseCloseEvent=()=>{shellApi.ecapEventManager.publish("CLOSE_FORM","",{})},raiseCustomCloseEvent=te=>{shellApi.ecapEventManager.publish(te,"",{})};var shellViews=(te=>(te.shell="primaria-shell",te.error="primaria-error-view",te))(shellViews||{});const styles$5=":host{width:100%;overflow:hidden}#main-switcher{display:inherit}.container{width:100%;height:100%;display:flex;flex-direction:column;background:#fff}.main-container{min-height:1px;height:100%;display:flex}.main-container .sidebar{padding-inline:16px;display:flex;flex-direction:column;justify-content:space-between;align-items:center;background:var(--color-primary-700);width:40px;height:100%;color:#fff}.main-container .sidebar .quick-actions-content{padding-top:24px;padding-bottom:22px;border-radius:8px}.main-container .sidebar .quick-actions-content .create-button-icon-badge{position:relative}.main-container .sidebar .quick-actions-content .create-button-icon-badge dss-notification-badge{position:absolute;top:-7px;right:-6px;z-index:1}.main-container .sidebar .quick-actions-content .create-button-icon-badge dss-icon{position:relative}.main-container .sidebar .icon{margin-left:8px}.main-container .sidebar #menu-region-container{padding-top:24px;min-height:1px;height:100%;width:100%;display:flex;flex-direction:column;gap:4px}.main-container .sidebar #menu-region-container{overflow-y:auto;margin-right:-10px;padding-right:10px;scrollbar-color:var(--color-primary-900) var(--color-primary-700);scrollbar-width:thin}.main-container .sidebar .bottom-content{display:flex;flex-direction:column;gap:24px;width:100%}.main-container .sidebar .bottom-content .bottom-content-first{display:flex;flex-direction:column;gap:4px}.main-container .sidebar #quick-actions-region-container{width:100%}.main-container .sidebar[expanded]{width:252px;align-items:flex-start}.main-container .sidebar .create-button-closed{cursor:pointer;background-color:#f0f0f0;color:var(--color-primary-700);border-radius:8px;width:40px;height:40px;display:flex;flex-direction:row;align-items:center;justify-content:center;transition:background-color .3s ease}.main-container .sidebar .create-button-closed:hover{background-color:var(--color-primary-900);color:#fff}.main-container .sidebar .create-button-opened{cursor:pointer;background-color:#f0f0f0;color:var(--color-primary-700);border-radius:8px;gap:8px;font-weight:600;width:220px;height:40px;display:flex;flex-direction:row;align-items:center;transition:background-color .3s ease}.main-container .sidebar .create-button-opened:hover{background-color:var(--color-primary-900);color:#fff}.main-container .content{display:flex;height:100%;width:100%}.main-container #main-region-container{min-height:1px;height:100%;flex:1}.main-container #floating-region-container{position:fixed;z-index:300}.footer{display:flex;height:48px;padding:12px 24px}.footer .footer-logo{align-self:center;display:flex;gap:16px}.divider-opened{width:220px}.divider-closed{width:40px}.toggle-button{margin-bottom:24px}";let t$f="";function f$l(){return t$f}function s$q(te,J){const X=f$l(),re=`${te}${X}`;customElements.define(re,J)}const e$J="*,*:before,*:after{box-sizing:border-box}*{margin:0;padding:0;font-family:var(--font-family)}ul,ol{list-style:none}",o$J={type:Boolean,converter:{fromAttribute:te=>te!==null&&te!=="false",toAttribute:te=>te?"true":null}},n$u={type:Array,converter:{fromAttribute:te=>{if(!te)return[];const J=JSON.parse(te);return Array.isArray(J)?J.map(X=>X.toString()):[J.toString()]},toAttribute:te=>JSON.stringify(te)}},i$w=':host{display:flex;align-items:center}.dss-icon,.material-symbols-rounded{font-family:var(--font-icons);font-size:var(--icon-size-md);font-weight:400;font-style:normal;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-feature-settings:"liga";-webkit-font-smoothing:antialiased;font-variation-settings:"FILL" 0,"wght" 400,"GRAD" 0,"opsz" 24}.dss-icon--fill,.material-symbols-rounded--fill{font-variation-settings:"FILL" 1}.dss-icon--sm{font-size:var(--icon-size-sm)}.dss-icon--md{font-size:var(--icon-size-md)}.dss-icon--lg{font-size:var(--icon-size-lg)}.dss-icon--xl{font-size:var(--icon-size-xl)}.dss-icon-ghost{display:inline-block;height:var(--icon-size-md);width:var(--icon-size-md);overflow:hidden;background-color:transparent}.dss-icon-ghost--sm{height:var(--icon-size-sm);width:var(--icon-size-sm);border-radius:var(--dss-radius-xs)}.dss-icon-ghost--lg{height:var(--icon-size-lg);width:var(--icon-size-lg)}.dss-icon-ghost--xl{height:var(--icon-size-xl);width:var(--icon-size-xl)}',d$p=te=>ke$1`
629
629
 
630
630
  ${te.fontLoaded?ke$1`
631
631
  <i
@@ -6696,7 +6696,7 @@ Registered bindings:`,ne.forEach(function(oe){var de="Object";oe.implementationT
6696
6696
  ></dss-alert>
6697
6697
  `:D$1}};Xi.styles=i$A`
6698
6698
  ${r$H(styles)}
6699
- `;let PrimariaCharacterLimitBadge=Xi;__decorateClass([n$x({type:Number})],PrimariaCharacterLimitBadge.prototype,"characterCount"),__decorateClass([n$x({type:Number})],PrimariaCharacterLimitBadge.prototype,"characterLimit"),__decorateClass([n$x({type:String})],PrimariaCharacterLimitBadge.prototype,"label");const useSharedUI=()=>{t$j("primaria-content-switcher")(PrimariaContentSwitcher),t$j("primaria-nav-item")(PrimariaNavItem),t$j("primaria-rich-text-editor")(PrimariaRichTextEditor),t$j("primaria-nav-tree-menu")(PrimariaNavTreeMenu),t$j("primaria-character-limit-badge")(PrimariaCharacterLimitBadge)},registerLowerNavMenuViews=()=>{shellApi.regionManager.registerView(shellRegions.navigationLowerLeftMenu,{id:"configuration-center",factory:()=>{const te=new PrimariaNavItem({icon:"settings",label:"Centre de configuració",callbackFn:()=>{}});return Promise.resolve(te)}})},getPatientCip=async te=>await te.broker.send("get_patient_cip"),navigateToEcapWithoutClosingWithCip=async te=>{const J=await getPatientCip(shellApi);shellApi.ecapEventManager.publish(te,"NO_TANCAR",{CIP:J})},upperNavMenuItems=[{id:"landing",icon:"home",label:"Pàgina inici",type:"item",sortHint:"0010",callbackFn:()=>shellApi.broker.send(new ExitShell("OBRIR_PI"))},{id:"dinamic-monitoring",icon:"poll",label:"Monitoratge dinàmic",type:"item",sortHint:"0030",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SIA_DEV")},{id:"processes",icon:"account_tree",label:"Vies clíniques",type:"tree",sortHint:"0040",actionMenuItems:[{icon:"open_in_new",label:"ARES",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PROCES_ATENCIO")},{icon:"open_in_new",label:"Nen sa",callbackFn:()=>navigateToEcapWithoutClosingWithCip("NEN_SA")},{icon:"open_in_new",label:"ASSIR",callbackFn:()=>navigateToEcapWithoutClosingWithCip("NAVEGACIO_ASSIR")},{icon:"open_in_new",label:"Odontologia",callbackFn:()=>navigateToEcapWithoutClosingWithCip("ODONTOLOGO")},{icon:"open_in_new",label:"Situació d'especial cura",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SIT_ESPEC_CURA_DEV")},{icon:"open_in_new",label:"Valoració social",callbackFn:()=>{}}]},{id:"unique-petition",icon:"playlist_add",label:"Petitori",type:"tree",sortHint:"0050",actionMenuItems:[{icon:"open_in_new",label:"Analítiques",callbackFn:()=>navigateToEcapWithoutClosingWithCip("LABORATORI")},{icon:"open_in_new",label:"Ordres Clíniques",callbackFn:()=>navigateToEcapWithoutClosingWithCip("RESULT_OC")},{icon:"open_in_new",label:"OC Exprés",callbackFn:()=>navigateToEcapWithoutClosingWithCip("OC_EXPRES")},{icon:"open_in_new",label:"Sol·licitud de trasllat",callbackFn:()=>navigateToEcapWithoutClosingWithCip("TRANSPORT")}]},{id:"analytics-monitoring",icon:"science",label:"Seguiment analític",type:"item",sortHint:"0060",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SEGUIMENT_ANALITIC")},{id:"results-reports",icon:"folder_shared",label:"Documents",type:"tree",sortHint:"0070",actionMenuItems:[{icon:"open_in_new",label:"Resultats i informes",callbackFn:()=>navigateToEcapWithoutClosingWithCip("RESULTAT_INFORMES")},{icon:"open_in_new",label:"Documents usuari",callbackFn:()=>setTimeout(()=>{navigateToEcapWithoutClosingWithCip("CRIDA_DOCS_USU")},0)},{icon:"open_in_new",label:"Informes clínics",callbackFn:()=>navigateToEcapWithoutClosingWithCip("INFORME_CLINIC_NET")}]},{id:"test-cabinets",icon:"list_alt",label:"Gabinets de proves",type:"item",sortHint:"0080",callbackFn:()=>{}},{id:"prescriptions",icon:"pill",label:"Prescripció",type:"tree",sortHint:"0090",actionMenuItems:[{icon:"open_in_new",label:"Prescripció",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PRESCIPCIO_ACTIVA")},{icon:"open_in_new",label:"Ordres de tractament",callbackFn:()=>navigateToEcapWithoutClosingWithCip("ORDRE_TRACTAMENT")},{icon:"open_in_new",label:"Dispensació material sanitari",callbackFn:()=>navigateToEcapWithoutClosingWithCip("DISPENSACIO_MATERIAL_PACIENT")},{icon:"open_in_new",label:"Prescripció social",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PRESCIPCIO_SOCIAL")}]},{id:"vaccines",icon:"vaccines",label:"Immunitzacions",type:"item",sortHint:"0100",callbackFn:()=>navigateToEcapWithoutClosingWithCip("IMMUNITZACIONS")},{id:"it",icon:"history_toggle_off",label:"Incapacitat temporal",type:"item",sortHint:"0100",callbackFn:()=>navigateToEcapWithoutClosingWithCip("REV_IT")},{id:"communication",icon:"3p",label:"Comunicació",type:"tree",sortHint:"0120",actionMenuItems:[{icon:"open_in_new",label:"SMS",callbackFn:async()=>{const te=await getPatientCip(shellApi);shellApi.ecapEventManager.publish("MISSATGES_DEV","NO_TANCAR",{CIP:te||"",TipusMissatge:"SMS"})}},{icon:"open_in_new",label:"eConsulta",callbackFn:()=>{}},{icon:"open_in_new",label:"Mail",callbackFn:()=>{}},{icon:"open_in_new",label:"Veu IP",callbackFn:()=>navigateToEcapWithoutClosingWithCip("VOIP")},{icon:"open_in_new",label:"Videoconsulta",callbackFn:()=>{}}]},{id:"visits",icon:"event",label:"Visites",type:"item",sortHint:"0130",callbackFn:()=>navigateToEcapWithoutClosingWithCip("CONSULTA_VISITES")},{id:"visor",icon:"window",label:"Visor",type:"item",sortHint:"0140",callbackFn:()=>{}}],registerUpperNavMenuViews=()=>{for(const te of upperNavMenuItems)shellApi.regionManager.registerView(shellRegions.navigationMenu,{id:te.id,sortHint:te.sortHint,factory:()=>{const J=te.type==="item"?new PrimariaNavItem({icon:te.icon,label:te.label,callbackFn:te.callbackFn}):new PrimariaNavTreeMenu({icon:te.icon,label:te.label,actionMenuItems:te.actionMenuItems});return Promise.resolve(J)}})},registerMainViews=()=>{registerPDFVisorMainView()},useInternalViews=()=>{registerMainViews(),registerUpperNavMenuViews(),registerLowerNavMenuViews()},useUI=()=>{p$h.registerAdapterFactory("primaria-content-switcher",d$v),useSharedUI(),useComponents(),useInternalViews()},initializeShell=te=>{useLocalization(shellApi),useUI(),useFeatures(shellApi);const J=new PrimariaShell;te.appendChild(J)};class n extends HTMLElement{constructor(J,X,re={}){super(),this.jsx=J,this.styles=X,this.root=this.attachShadow({mode:"open"}),this.reactRoot=null,re&&(this.props=re)}connectedCallback(){const J=document.createElement("div");J.style.minHeight="100%",J.style.width="100%";const X=document.createElement("style");X.innerText=this.styles,this.root.appendChild(J),this.root.appendChild(X),this.reactRoot=r$N.createRoot(J),this.renderReact()}disconnectedCallback(){this.reactRoot&&this.reactRoot.unmount()}renderReact(){this.reactRoot&&this.reactRoot.render(c$v.createElement(this.jsx,{...this.props}))}}customElements.define("ux-react-web-component",n);const h=(te,J)=>(X={})=>Promise.resolve(new n(te,J,X));/**
6699
+ `;let PrimariaCharacterLimitBadge=Xi;__decorateClass([n$x({type:Number})],PrimariaCharacterLimitBadge.prototype,"characterCount"),__decorateClass([n$x({type:Number})],PrimariaCharacterLimitBadge.prototype,"characterLimit"),__decorateClass([n$x({type:String})],PrimariaCharacterLimitBadge.prototype,"label");const useSharedUI=()=>{t$j("primaria-content-switcher")(PrimariaContentSwitcher),t$j("primaria-nav-item")(PrimariaNavItem),t$j("primaria-rich-text-editor")(PrimariaRichTextEditor),t$j("primaria-nav-tree-menu")(PrimariaNavTreeMenu),t$j("primaria-character-limit-badge")(PrimariaCharacterLimitBadge)},registerLowerNavMenuViews=()=>{shellApi.regionManager.registerView(shellRegions.navigationLowerLeftMenu,{id:"configuration-center",factory:()=>{const te=new PrimariaNavItem({icon:"settings",label:"Centre de configuració",callbackFn:()=>{}});return Promise.resolve(te)}})},getPatientCip=async te=>await te.broker.send("get_patient_cip"),navigateToEcapWithoutClosingWithCip=async te=>{const J=await getPatientCip(shellApi);shellApi.ecapEventManager.publish(te,"NO_TANCAR",{CIP:J})},upperNavMenuItems=[{id:"landing",icon:"home",label:"Pàgina inici",type:"item",sortHint:"0010",callbackFn:()=>shellApi.broker.send(new ExitShell("OBRIR_PI"))},{id:"dinamic-monitoring",icon:"poll",label:"Monitoratge dinàmic",type:"item",sortHint:"0030",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SIA_DEV")},{id:"processes",icon:"account_tree",label:"Vies clíniques",type:"tree",sortHint:"0040",actionMenuItems:[{icon:"open_in_new",label:"ARES",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PROCES_ATENCIO")},{icon:"open_in_new",label:"Nen sa",callbackFn:()=>navigateToEcapWithoutClosingWithCip("NEN_SA")},{icon:"open_in_new",label:"ASSIR",callbackFn:()=>navigateToEcapWithoutClosingWithCip("NAVEGACIO_ASSIR")},{icon:"open_in_new",label:"Odontologia",callbackFn:()=>navigateToEcapWithoutClosingWithCip("ODONTOLOGO")},{icon:"open_in_new",label:"Situació d'especial cura",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SIT_ESPEC_CURA_DEV")},{icon:"open_in_new",label:"Valoració social",callbackFn:()=>{}}]},{id:"unique-petition",icon:"playlist_add",label:"Petitori",type:"tree",sortHint:"0050",actionMenuItems:[{icon:"open_in_new",label:"Analítiques",callbackFn:()=>navigateToEcapWithoutClosingWithCip("LABORATORI")},{icon:"open_in_new",label:"Ordres Clíniques",callbackFn:()=>navigateToEcapWithoutClosingWithCip("RESULT_OC")},{icon:"open_in_new",label:"OC Exprés",callbackFn:()=>navigateToEcapWithoutClosingWithCip("OC_EXPRES")},{icon:"open_in_new",label:"Sol·licitud de trasllat",callbackFn:()=>navigateToEcapWithoutClosingWithCip("TRANSPORT")}]},{id:"analytics-monitoring",icon:"science",label:"Seguiment analític",type:"item",sortHint:"0060",callbackFn:()=>navigateToEcapWithoutClosingWithCip("SEGUIMENT_ANALITIC")},{id:"results-reports",icon:"folder_shared",label:"Documents",type:"tree",sortHint:"0070",actionMenuItems:[{icon:"open_in_new",label:"Resultats i informes",callbackFn:()=>navigateToEcapWithoutClosingWithCip("RESULTAT_INFORMES")},{icon:"open_in_new",label:"Documents usuari",callbackFn:()=>setTimeout(()=>{navigateToEcapWithoutClosingWithCip("CRIDA_DOCS_USU")},0)},{icon:"open_in_new",label:"Informes clínics",callbackFn:()=>navigateToEcapWithoutClosingWithCip("INFORME_CLINIC_NET")}]},{id:"test-cabinets",icon:"list_alt",label:"Gabinets de proves",type:"item",sortHint:"0080",callbackFn:()=>navigateToEcapWithoutClosingWithCip("GABINETS_PROVES")},{id:"prescriptions",icon:"pill",label:"Prescripció",type:"tree",sortHint:"0090",actionMenuItems:[{icon:"open_in_new",label:"Prescripció",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PRESCIPCIO_ACTIVA")},{icon:"open_in_new",label:"Ordres de tractament",callbackFn:()=>navigateToEcapWithoutClosingWithCip("ORDRE_TRACTAMENT")},{icon:"open_in_new",label:"Dispensació material sanitari",callbackFn:()=>navigateToEcapWithoutClosingWithCip("DISPENSACIO_MATERIAL_PACIENT")},{icon:"open_in_new",label:"Prescripció social",callbackFn:()=>navigateToEcapWithoutClosingWithCip("PRESCIPCIO_SOCIAL")}]},{id:"vaccines",icon:"vaccines",label:"Immunitzacions",type:"item",sortHint:"0100",callbackFn:()=>navigateToEcapWithoutClosingWithCip("IMMUNITZACIONS")},{id:"it",icon:"history_toggle_off",label:"Incapacitat temporal",type:"item",sortHint:"0100",callbackFn:()=>navigateToEcapWithoutClosingWithCip("REV_IT")},{id:"communication",icon:"3p",label:"Comunicació",type:"tree",sortHint:"0120",actionMenuItems:[{icon:"open_in_new",label:"SMS",callbackFn:async()=>{const te=await getPatientCip(shellApi);shellApi.ecapEventManager.publish("MISSATGES_DEV","NO_TANCAR",{CIP:te||"",TipusMissatge:"SMS"})}},{icon:"open_in_new",label:"eConsulta",callbackFn:()=>{}},{icon:"open_in_new",label:"Mail",callbackFn:()=>{}},{icon:"open_in_new",label:"Veu IP",callbackFn:()=>navigateToEcapWithoutClosingWithCip("VOIP")},{icon:"open_in_new",label:"Videoconsulta",callbackFn:()=>{}}]},{id:"visits",icon:"event",label:"Visites",type:"item",sortHint:"0130",callbackFn:()=>navigateToEcapWithoutClosingWithCip("CONSULTA_VISITES")},{id:"visor",icon:"window",label:"Visor",type:"item",sortHint:"0140",callbackFn:()=>{}}],registerUpperNavMenuViews=()=>{for(const te of upperNavMenuItems)shellApi.regionManager.registerView(shellRegions.navigationMenu,{id:te.id,sortHint:te.sortHint,factory:()=>{const J=te.type==="item"?new PrimariaNavItem({icon:te.icon,label:te.label,callbackFn:te.callbackFn}):new PrimariaNavTreeMenu({icon:te.icon,label:te.label,actionMenuItems:te.actionMenuItems});return Promise.resolve(J)}})},registerMainViews=()=>{registerPDFVisorMainView()},useInternalViews=()=>{registerMainViews(),registerUpperNavMenuViews(),registerLowerNavMenuViews()},useUI=()=>{p$h.registerAdapterFactory("primaria-content-switcher",d$v),useSharedUI(),useComponents(),useInternalViews()},initializeShell=te=>{useLocalization(shellApi),useUI(),useFeatures(shellApi);const J=new PrimariaShell;te.appendChild(J)};class n extends HTMLElement{constructor(J,X,re={}){super(),this.jsx=J,this.styles=X,this.root=this.attachShadow({mode:"open"}),this.reactRoot=null,re&&(this.props=re)}connectedCallback(){const J=document.createElement("div");J.style.minHeight="100%",J.style.width="100%";const X=document.createElement("style");X.innerText=this.styles,this.root.appendChild(J),this.root.appendChild(X),this.reactRoot=r$N.createRoot(J),this.renderReact()}disconnectedCallback(){this.reactRoot&&this.reactRoot.unmount()}renderReact(){this.reactRoot&&this.reactRoot.render(c$v.createElement(this.jsx,{...this.props}))}}customElements.define("ux-react-web-component",n);const h=(te,J)=>(X={})=>Promise.resolve(new n(te,J,X));/**
6700
6700
  * @license
6701
6701
  * Copyright 2021 Google LLC
6702
6702
  * SPDX-License-Identifier: BSD-3-Clause