@nmshd/consumption 3.10.0 → 5.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/buildInformation.js +4 -4
- package/dist/consumption/ConsumptionController.d.ts.map +1 -1
- package/dist/consumption/ConsumptionController.js +1 -1
- package/dist/consumption/ConsumptionController.js.map +1 -1
- package/dist/consumption/CoreErrors.d.ts +5 -0
- package/dist/consumption/CoreErrors.d.ts.map +1 -1
- package/dist/consumption/CoreErrors.js +15 -0
- package/dist/consumption/CoreErrors.js.map +1 -1
- package/dist/modules/attributes/AttributesController.d.ts +9 -3
- package/dist/modules/attributes/AttributesController.d.ts.map +1 -1
- package/dist/modules/attributes/AttributesController.js +162 -90
- package/dist/modules/attributes/AttributesController.js.map +1 -1
- package/dist/modules/attributes/events/ThirdPartyOwnedRelationshipAttributeSucceededEvent.d.ts +8 -0
- package/dist/modules/attributes/events/ThirdPartyOwnedRelationshipAttributeSucceededEvent.d.ts.map +1 -0
- package/dist/modules/attributes/events/ThirdPartyOwnedRelationshipAttributeSucceededEvent.js +12 -0
- package/dist/modules/attributes/events/ThirdPartyOwnedRelationshipAttributeSucceededEvent.js.map +1 -0
- package/dist/modules/attributes/events/index.d.ts +1 -0
- package/dist/modules/attributes/events/index.d.ts.map +1 -1
- package/dist/modules/attributes/events/index.js +1 -0
- package/dist/modules/attributes/events/index.js.map +1 -1
- package/dist/modules/attributes/local/LocalAttribute.d.ts.map +1 -1
- package/dist/modules/attributes/local/LocalAttribute.js +6 -9
- package/dist/modules/attributes/local/LocalAttribute.js.map +1 -1
- package/dist/modules/attributes/local/LocalAttributeShareInfo.d.ts.map +1 -1
- package/dist/modules/attributes/local/LocalAttributeShareInfo.js +3 -4
- package/dist/modules/attributes/local/LocalAttributeShareInfo.js.map +1 -1
- package/dist/modules/notifications/itemProcessors/attributeDeleted/OwnSharedAttributeDeletedByOwnerNotificationItemProcessor.d.ts.map +1 -1
- package/dist/modules/notifications/itemProcessors/attributeDeleted/OwnSharedAttributeDeletedByOwnerNotificationItemProcessor.js +4 -5
- package/dist/modules/notifications/itemProcessors/attributeDeleted/OwnSharedAttributeDeletedByOwnerNotificationItemProcessor.js.map +1 -1
- package/dist/modules/notifications/itemProcessors/attributeDeleted/PeerSharedAttributeDeletedByPeerNotificationItemProcessor.d.ts.map +1 -1
- package/dist/modules/notifications/itemProcessors/attributeDeleted/PeerSharedAttributeDeletedByPeerNotificationItemProcessor.js +3 -4
- package/dist/modules/notifications/itemProcessors/attributeDeleted/PeerSharedAttributeDeletedByPeerNotificationItemProcessor.js.map +1 -1
- package/dist/modules/notifications/itemProcessors/attributeDeleted/ThirdPartyOwnedRelationshipAttributeDeletedByPeerNotificationItemProcessor.d.ts.map +1 -1
- package/dist/modules/notifications/itemProcessors/attributeDeleted/ThirdPartyOwnedRelationshipAttributeDeletedByPeerNotificationItemProcessor.js +3 -4
- package/dist/modules/notifications/itemProcessors/attributeDeleted/ThirdPartyOwnedRelationshipAttributeDeletedByPeerNotificationItemProcessor.js.map +1 -1
- package/dist/modules/notifications/itemProcessors/attributeSucceeded/PeerSharedAttributeSucceededNotificationItemProcessor.js +2 -2
- package/dist/modules/notifications/itemProcessors/attributeSucceeded/PeerSharedAttributeSucceededNotificationItemProcessor.js.map +1 -1
- package/dist/modules/notifications/local/LocalNotification.js +2 -2
- package/dist/modules/notifications/local/LocalNotification.js.map +1 -1
- package/dist/modules/requests/incoming/IncomingRequestsController.d.ts +4 -1
- package/dist/modules/requests/incoming/IncomingRequestsController.d.ts.map +1 -1
- package/dist/modules/requests/incoming/IncomingRequestsController.js +9 -3
- package/dist/modules/requests/incoming/IncomingRequestsController.js.map +1 -1
- package/dist/modules/requests/incoming/complete/CompleteIncomingRequestParameters.d.ts +3 -3
- package/dist/modules/requests/incoming/complete/CompleteIncomingRequestParameters.d.ts.map +1 -1
- package/dist/modules/requests/incoming/complete/CompleteIncomingRequestParameters.js +1 -1
- package/dist/modules/requests/incoming/complete/CompleteIncomingRequestParameters.js.map +1 -1
- package/dist/modules/requests/incoming/decide/DecideRequestItemGroupParameters.js +1 -1
- package/dist/modules/requests/incoming/decide/DecideRequestItemGroupParameters.js.map +1 -1
- package/dist/modules/requests/incoming/decide/DecideRequestItemParameters.js +1 -1
- package/dist/modules/requests/incoming/decide/DecideRequestItemParameters.js.map +1 -1
- package/dist/modules/requests/itemProcessors/AbstractRequestItemProcessor.d.ts +2 -1
- package/dist/modules/requests/itemProcessors/AbstractRequestItemProcessor.d.ts.map +1 -1
- package/dist/modules/requests/itemProcessors/AbstractRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/GenericRequestItemProcessor.d.ts +2 -1
- package/dist/modules/requests/itemProcessors/GenericRequestItemProcessor.d.ts.map +1 -1
- package/dist/modules/requests/itemProcessors/GenericRequestItemProcessor.js +0 -1
- package/dist/modules/requests/itemProcessors/GenericRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/IRequestItemProcessor.d.ts +2 -1
- package/dist/modules/requests/itemProcessors/IRequestItemProcessor.d.ts.map +1 -1
- package/dist/modules/requests/itemProcessors/createAttribute/CreateAttributeRequestItemProcessor.d.ts.map +1 -1
- package/dist/modules/requests/itemProcessors/createAttribute/CreateAttributeRequestItemProcessor.js +12 -6
- package/dist/modules/requests/itemProcessors/createAttribute/CreateAttributeRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/deleteAttribute/DeleteAttributeRequestItemProcessor.d.ts.map +1 -1
- package/dist/modules/requests/itemProcessors/deleteAttribute/DeleteAttributeRequestItemProcessor.js +4 -7
- package/dist/modules/requests/itemProcessors/deleteAttribute/DeleteAttributeRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/proposeAttribute/AcceptProposeAttributeRequestItemParameters.js +2 -2
- package/dist/modules/requests/itemProcessors/proposeAttribute/AcceptProposeAttributeRequestItemParameters.js.map +1 -1
- package/dist/modules/requests/itemProcessors/proposeAttribute/ProposeAttributeRequestItemProcessor.d.ts +7 -6
- package/dist/modules/requests/itemProcessors/proposeAttribute/ProposeAttributeRequestItemProcessor.d.ts.map +1 -1
- package/dist/modules/requests/itemProcessors/proposeAttribute/ProposeAttributeRequestItemProcessor.js +127 -29
- package/dist/modules/requests/itemProcessors/proposeAttribute/ProposeAttributeRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/readAttribute/AcceptReadAttributeRequestItemParameters.d.ts +1 -1
- package/dist/modules/requests/itemProcessors/readAttribute/AcceptReadAttributeRequestItemParameters.d.ts.map +1 -1
- package/dist/modules/requests/itemProcessors/readAttribute/AcceptReadAttributeRequestItemParameters.js +2 -2
- package/dist/modules/requests/itemProcessors/readAttribute/AcceptReadAttributeRequestItemParameters.js.map +1 -1
- package/dist/modules/requests/itemProcessors/readAttribute/ReadAttributeRequestItemProcessor.d.ts +9 -5
- package/dist/modules/requests/itemProcessors/readAttribute/ReadAttributeRequestItemProcessor.d.ts.map +1 -1
- package/dist/modules/requests/itemProcessors/readAttribute/ReadAttributeRequestItemProcessor.js +192 -23
- package/dist/modules/requests/itemProcessors/readAttribute/ReadAttributeRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/shareAttribute/ShareAttributeRequestItemProcessor.d.ts +1 -1
- package/dist/modules/requests/itemProcessors/shareAttribute/ShareAttributeRequestItemProcessor.d.ts.map +1 -1
- package/dist/modules/requests/itemProcessors/shareAttribute/ShareAttributeRequestItemProcessor.js +45 -12
- package/dist/modules/requests/itemProcessors/shareAttribute/ShareAttributeRequestItemProcessor.js.map +1 -1
- package/dist/modules/requests/itemProcessors/utility/validateAttributeMatchesWithQuery.d.ts +5 -0
- package/dist/modules/requests/itemProcessors/utility/validateAttributeMatchesWithQuery.d.ts.map +1 -0
- package/dist/modules/requests/itemProcessors/utility/validateAttributeMatchesWithQuery.js +124 -0
- package/dist/modules/requests/itemProcessors/utility/validateAttributeMatchesWithQuery.js.map +1 -0
- package/dist/modules/requests/itemProcessors/utility/validateQuery.d.ts.map +1 -1
- package/dist/modules/requests/itemProcessors/utility/validateQuery.js +0 -3
- package/dist/modules/requests/itemProcessors/utility/validateQuery.js.map +1 -1
- package/dist/modules/requests/local/LocalResponse.d.ts +2 -2
- package/dist/modules/requests/local/LocalResponse.d.ts.map +1 -1
- package/dist/modules/requests/local/LocalResponse.js.map +1 -1
- package/dist/modules/requests/outgoing/OutgoingRequestsController.d.ts +2 -2
- package/dist/modules/requests/outgoing/OutgoingRequestsController.d.ts.map +1 -1
- package/dist/modules/requests/outgoing/OutgoingRequestsController.js +17 -9
- package/dist/modules/requests/outgoing/OutgoingRequestsController.js.map +1 -1
- package/dist/modules/requests/outgoing/createAndCompleteFromRelationshipTemplateResponse/CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponseParameters.d.ts +4 -3
- package/dist/modules/requests/outgoing/createAndCompleteFromRelationshipTemplateResponse/CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponseParameters.d.ts.map +1 -1
- package/dist/modules/requests/outgoing/createAndCompleteFromRelationshipTemplateResponse/CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponseParameters.js +7 -2
- package/dist/modules/requests/outgoing/createAndCompleteFromRelationshipTemplateResponse/CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponseParameters.js.map +1 -1
- package/package.json +6 -15
- package/lib-web/nmshd.consumption.js +0 -36384
- package/lib-web/nmshd.consumption.js.map +0 -1
- package/lib-web/nmshd.consumption.min.js +0 -3
- package/lib-web/nmshd.consumption.min.js.map +0 -1
- package/ui5.yaml +0 -9
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
/*! For license information please see nmshd.consumption.min.js.LICENSE.txt */
|
|
2
|
-
var NMSHDConsumption;(()=>{var e={9683:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QueryTranslator=void 0;class QueryTranslator{static defaultKeyRegex=/^[a-zA-Z_@][a-zA-Z@0-9-_]*(\.[a-zA-Z_@][a-zA-Z@0-9-_]*)*$/;static defaultValRegex=void 0;static defaultArrRegex=/^[a-zA-Z@æøå0-9-_.]+(\[])?$/i;ops;alias;blacklist;whitelist;custom;string;keyRegex;valRegex;arrRegex;constructor(e={}){this.ops=e.ops??["!","^","$","~",">","<","$containsAny","$containsNone"],this.alias=e.alias??{},this.blacklist=e.blacklist??{},this.whitelist=e.whitelist??{},this.custom=e.custom??{},e.string=e.string??{},this.string=e.string,this.string.toBoolean="boolean"!=typeof e.string.toBoolean||e.string.toBoolean,this.string.toNumber="boolean"!=typeof e.string.toNumber||e.string.toNumber,this.keyRegex=e.keyRegex??QueryTranslator.defaultKeyRegex,this.valRegex=e.valRegex??QueryTranslator.defaultValRegex,this.arrRegex=e.arrRegex??QueryTranslator.defaultArrRegex}static setDefaultKeyRegex(e){QueryTranslator.defaultKeyRegex=e}static setDefaultValRegex(e){QueryTranslator.defaultValRegex=e}static setDefaultArrRegex(e){QueryTranslator.defaultArrRegex=e}parseString(e,t){let r=e[0]||"";const n="="===e[1];let i=e.substr(n?2:1)||"";const s=this.parseStringVal(i),o={op:r,org:i,value:s};switch(r){case"!":t?o.field="$containsNone":""===i?(o.field="$exists",o.value=!1):o.field="$ne";break;case">":o.field=n?"$gte":"$gt";break;case"<":o.field=n?"$lte":"$lt";break;case"^":case"$":case"~":switch(o.field="$regex",o.options="i",o.value=this.valRegex?i.replace(this.valRegex,""):o.value.toString(),r){case"^":o.value=`^${s}`;break;case"$":o.value=`${s}$`}break;default:o.org=i=r+i,o.op=r="",o.value=this.parseStringVal(i),t?o.field="$containsAny":""===i?(o.field="$exists",o.value=!0):o.field="$eq"}return o.parsed={},o.parsed[o.field]=o.value,o.options&&(o.parsed.$options=o.options),o}parseStringVal(e){return!(!this.string.toBoolean||"true"!==e.toLowerCase())||(!this.string.toBoolean||"false"!==e.toLowerCase())&&(this.string.toNumber&&!isNaN(parseInt(e,10))&&+e-+e+1>=0?parseFloat(e):e)}parse(e){if(!e)return{};const t={};for(let r of Object.keys(e)){if("__proto__"===r)continue;const n=e[r];if(Array.isArray(n)&&(r=r.replace(/\[]$/,"")),(!Object.keys(this.whitelist).length||this.whitelist[r])&&!this.blacklist[r]&&(this.alias[r]&&(r=this.alias[r]),("string"!=typeof n||this.keyRegex.test(r))&&(!Array.isArray(n)||this.arrRegex.test(r))))if("function"!=typeof this.custom[r])if(Array.isArray(n)){if(this.ops.includes("$containsAny")&&n.length>0){t[r]={};for(const e of n)if(this.ops.includes(e[0])){const n=this.parseString(e,!0);switch(n.field){case"$containsAny":case"$containsNone":t[r][n.field]=t[r][n.field]||[],t[r][n.field].push(n.value);break;case"$regex":t[r].$regex=n.value,t[r].$options=n.options;break;default:t[r][n.field]=n.value}}else t[r].$containsAny=t[r].$containsAny||[],t[r].$containsAny.push(this.parseStringVal(e))}}else"string"==typeof n&&(n?this.ops.includes(n[0])?t[r]=this.parseString(n).parsed:t[r]=this.parseStringVal(n):t[r]={$exists:!0});else this.custom[r].apply(null,[t,n])}return t}}t.QueryTranslator=QueryTranslator},7197:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.QueryTranslator=void 0;var n=r(9683);Object.defineProperty(t,"QueryTranslator",{enumerable:!0,get:function(){return n.QueryTranslator}})},8072:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7040:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEventNamespaceFromObject=t.EventBus=void 0;t.EventBus=class EventBus{},t.getEventNamespaceFromObject=function getEventNamespaceFromObject(e){return e.namespace}},4226:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SubscriptionTargetInfo=void 0;class SubscriptionTargetInfo{namespace;constructor(e){this.namespace=e}static from(e){return e instanceof Function?new ConstructorSubscriptionTargetInfo(e):new NamespaceSubscriptionTargetInfo(e)}}t.SubscriptionTargetInfo=SubscriptionTargetInfo;class ConstructorSubscriptionTargetInfo extends SubscriptionTargetInfo{constructorFunction;constructor(e){super(function getEventNamespaceFromClass(e){return e.namespace}(e)),this.constructorFunction=e}isCompatibleWith(e){return e instanceof this.constructorFunction}}class NamespaceSubscriptionTargetInfo extends SubscriptionTargetInfo{constructor(e){super(e)}isCompatibleWith(e){return!0}}},6465:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EventEmitter2EventBus=void 0;const n=r(9902);r(864);const i=r(7040),s=r(4226);t.EventEmitter2EventBus=class EventEmitter2EventBus{errorCallback;emitter;listeners=new Map;nextId=0;invocationPromises=[];constructor(e,t){this.errorCallback=e,this.emitter=new n.EventEmitter2({maxListeners:50,verboseMemoryLeak:!0,...t,wildcard:!0})}subscribe(e,t){return this.registerHandler(e,t)}subscribeOnce(e,t){return this.registerHandler(e,t,!0)}unsubscribe(e){return this.unregisterHandler(e)}registerHandler(e,t,r=!1){const n=s.SubscriptionTargetInfo.from(e),i=this.nextId++,handlerWrapper=async e=>{if(!n.isCompatibleWith(e))return;const s=(async()=>await t(e))();this.invocationPromises.push(s),await s.catch((e=>this.errorCallback(e,n.namespace))),this.invocationPromises=this.invocationPromises.filter((e=>e!==s)),r&&this.listeners.delete(i)};if(r){const e=this.emitter.once(n.namespace,handlerWrapper,{objectify:!0});return this.listeners.set(i,e),i}const o=this.emitter.on(n.namespace,handlerWrapper,{objectify:!0});return this.listeners.set(i,o),i}unregisterHandler(e){const t=this.listeners.get(e);return!!t&&(t.off(),this.listeners.delete(e),!0)}publish(e){const t=(0,i.getEventNamespaceFromObject)(e);if(!t)throw Error("The event needs a namespace. Use the EventNamespace-decorator in order to define a namespace for a event.");this.emitter.emit(t,e)}async close(e){this.emitter.removeAllListeners();const t=Promise.all(this.invocationPromises).catch((()=>{}));if(!e)return void await t;let r;const n=new Promise(((t,n)=>{r=setTimeout((()=>{n(new Error("timeout exceeded while waiting for events to process"))}),e)}));await Promise.race([t,n]),clearTimeout(r)}}},8756:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7040),t),i(r(6465),t)},1347:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DataEvent=void 0;const n=r(7179);class DataEvent extends n.Event{data;constructor(e,t){super(e),this.data=t}}t.DataEvent=DataEvent},7179:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Event=void 0;t.Event=class Event{namespace;constructor(e){this.namespace=e}}},4647:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(1347),t),i(r(7179),t)},1917:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8756),t),i(r(4647),t),i(r(4186),t),i(r(967),t),i(r(9787),t),i(r(8072),t),i(r(3395),t),i(r(7106),t)},4186:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.log=void 0;const i=n(r(4191));t.log=function log(e){return function(t,r,n){const s=n.value;return n.value=function(...t){const n=this;try{e?.logParams?n.log.trace(`Calling ${r}(${t.map((e=>(0,i.default)(e))).join(", ")})`):n.log.trace(`Calling ${r}`);const o=s.apply(this,t);return e?.logReturnValue?n.log.trace(`Returning from ${r} with: ${(0,i.default)(o)}`):n.log.trace(`Returning from ${r}`),o}catch(e){throw e instanceof Error&&e.stack&&(e.stack=e.stack.split("\n").filter((e=>!e.includes(".propertyDescriptorDoNotChangeMyNamePlease.value"))).join("\n")),n.log.error(`Error in ${r}:`,e),e}},n}}},967:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.measureExcecutionTime=void 0,t.measureExcecutionTime=function measureExcecutionTime(e,t,r){const n=r.value;return r.value=async function(...e){const t=Date.now(),r=await n.apply(this,e),i=Date.now();return console.info(`Execution time: ${i-t}ms`),r},r}},9787:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomString=void 0,t.randomString=function randomString(e,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"){let r="";const n=t.length;for(let i=0;i<e;i++)r+=t.charAt(Math.floor(Math.random()*n));return r}},4439:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ApplicationError=void 0;class ApplicationError extends Error{code;data;constructor(e,t,r){super(t),this.code=e,this.data=r}equals(e){return this.code===e.code}toString(){return JSON.stringify({code:this.code,message:this.message,data:this.data},void 0,2)}}t.ApplicationError=ApplicationError},34:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Result=void 0;class Result{_isSuccess;_error;_value;constructor(e,t,r){if(e&&r)throw new Error("InvalidOperation: A result cannot be successful and contain an error");if(!e&&!r)throw new Error("InvalidOperation: A failing result needs to contain an error");if(void 0!==t&&!e)throw new Error("InvalidOperation: A value is only useful in case of a success.");this._value=t,this._isSuccess=e,this._error=r}get isSuccess(){return this._isSuccess}get isError(){return!this._isSuccess}get error(){return this._error}get value(){if(!this.isSuccess)throw new Error(`Can't get the value of an error result. Use 'error' instead. Root error: \r\n${this.error}`);return this._value}static ok(e){return new Result(!0,e)}static fail(e){return new Result(!1,void 0,e)}}t.Result=Result},3395:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4439),t),i(r(34),t)},7106:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sleep=void 0,t.sleep=function sleep(e){return new Promise((t=>{setTimeout(t,e)}))}},864:()=>{var e;!function(e){!function(t){var r="object"==typeof global?global:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),n=makeExporter(e);function makeExporter(e,t){return function(r,n){"function"!=typeof e[r]&&Object.defineProperty(e,r,{configurable:!0,writable:!0,value:n}),t&&t(r,n)}}void 0===r.Reflect?r.Reflect=e:n=makeExporter(r.Reflect,n),function(e){var t=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,n=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,o={__proto__:[]}instanceof Array,a=!s&&!o,u={create:s?function(){return MakeDictionary(Object.create(null))}:o?function(){return MakeDictionary({__proto__:null})}:function(){return MakeDictionary({})},has:a?function(e,r){return t.call(e,r)}:function(e,t){return t in e},get:a?function(e,r){return t.call(e,r)?e[r]:void 0}:function(e,t){return e[t]}},c=Object.getPrototypeOf(Function),l="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,d=l||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?CreateMapPolyfill():Map,f=l||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?CreateSetPolyfill():Set,h=new(l||"function"!=typeof WeakMap?CreateWeakMapPolyfill():WeakMap);function decorate(e,t,r,n){if(IsUndefined(r)){if(!IsArray(e))throw new TypeError;if(!IsConstructor(t))throw new TypeError;return DecorateConstructor(e,t)}if(!IsArray(e))throw new TypeError;if(!IsObject(t))throw new TypeError;if(!IsObject(n)&&!IsUndefined(n)&&!IsNull(n))throw new TypeError;return IsNull(n)&&(n=void 0),DecorateProperty(e,t,r=ToPropertyKey(r),n)}function metadata(e,t){function decorator(r,n){if(!IsObject(r))throw new TypeError;if(!IsUndefined(n)&&!IsPropertyKey(n))throw new TypeError;OrdinaryDefineOwnMetadata(e,t,r,n)}return decorator}function defineMetadata(e,t,r,n){if(!IsObject(r))throw new TypeError;return IsUndefined(n)||(n=ToPropertyKey(n)),OrdinaryDefineOwnMetadata(e,t,r,n)}function hasMetadata(e,t,r){if(!IsObject(t))throw new TypeError;return IsUndefined(r)||(r=ToPropertyKey(r)),OrdinaryHasMetadata(e,t,r)}function hasOwnMetadata(e,t,r){if(!IsObject(t))throw new TypeError;return IsUndefined(r)||(r=ToPropertyKey(r)),OrdinaryHasOwnMetadata(e,t,r)}function getMetadata(e,t,r){if(!IsObject(t))throw new TypeError;return IsUndefined(r)||(r=ToPropertyKey(r)),OrdinaryGetMetadata(e,t,r)}function getOwnMetadata(e,t,r){if(!IsObject(t))throw new TypeError;return IsUndefined(r)||(r=ToPropertyKey(r)),OrdinaryGetOwnMetadata(e,t,r)}function getMetadataKeys(e,t){if(!IsObject(e))throw new TypeError;return IsUndefined(t)||(t=ToPropertyKey(t)),OrdinaryMetadataKeys(e,t)}function getOwnMetadataKeys(e,t){if(!IsObject(e))throw new TypeError;return IsUndefined(t)||(t=ToPropertyKey(t)),OrdinaryOwnMetadataKeys(e,t)}function deleteMetadata(e,t,r){if(!IsObject(t))throw new TypeError;IsUndefined(r)||(r=ToPropertyKey(r));var n=GetOrCreateMetadataMap(t,r,!1);if(IsUndefined(n))return!1;if(!n.delete(e))return!1;if(n.size>0)return!0;var i=h.get(t);return i.delete(r),i.size>0||h.delete(t),!0}function DecorateConstructor(e,t){for(var r=e.length-1;r>=0;--r){var n=(0,e[r])(t);if(!IsUndefined(n)&&!IsNull(n)){if(!IsConstructor(n))throw new TypeError;t=n}}return t}function DecorateProperty(e,t,r,n){for(var i=e.length-1;i>=0;--i){var s=(0,e[i])(t,r,n);if(!IsUndefined(s)&&!IsNull(s)){if(!IsObject(s))throw new TypeError;n=s}}return n}function GetOrCreateMetadataMap(e,t,r){var n=h.get(e);if(IsUndefined(n)){if(!r)return;n=new d,h.set(e,n)}var i=n.get(t);if(IsUndefined(i)){if(!r)return;i=new d,n.set(t,i)}return i}function OrdinaryHasMetadata(e,t,r){if(OrdinaryHasOwnMetadata(e,t,r))return!0;var n=OrdinaryGetPrototypeOf(t);return!IsNull(n)&&OrdinaryHasMetadata(e,n,r)}function OrdinaryHasOwnMetadata(e,t,r){var n=GetOrCreateMetadataMap(t,r,!1);return!IsUndefined(n)&&ToBoolean(n.has(e))}function OrdinaryGetMetadata(e,t,r){if(OrdinaryHasOwnMetadata(e,t,r))return OrdinaryGetOwnMetadata(e,t,r);var n=OrdinaryGetPrototypeOf(t);return IsNull(n)?void 0:OrdinaryGetMetadata(e,n,r)}function OrdinaryGetOwnMetadata(e,t,r){var n=GetOrCreateMetadataMap(t,r,!1);if(!IsUndefined(n))return n.get(e)}function OrdinaryDefineOwnMetadata(e,t,r,n){GetOrCreateMetadataMap(r,n,!0).set(e,t)}function OrdinaryMetadataKeys(e,t){var r=OrdinaryOwnMetadataKeys(e,t),n=OrdinaryGetPrototypeOf(e);if(null===n)return r;var i=OrdinaryMetadataKeys(n,t);if(i.length<=0)return r;if(r.length<=0)return i;for(var s=new f,o=[],a=0,u=r;a<u.length;a++){var c=u[a];s.has(c)||(s.add(c),o.push(c))}for(var l=0,d=i;l<d.length;l++){c=d[l];s.has(c)||(s.add(c),o.push(c))}return o}function OrdinaryOwnMetadataKeys(e,t){var r=[],n=GetOrCreateMetadataMap(e,t,!1);if(IsUndefined(n))return r;for(var i=GetIterator(n.keys()),s=0;;){var o=IteratorStep(i);if(!o)return r.length=s,r;var a=IteratorValue(o);try{r[s]=a}catch(e){try{IteratorClose(i)}finally{throw e}}s++}}function Type(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function IsUndefined(e){return void 0===e}function IsNull(e){return null===e}function IsSymbol(e){return"symbol"==typeof e}function IsObject(e){return"object"==typeof e?null!==e:"function"==typeof e}function ToPrimitive(e,t){switch(Type(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var r=3===t?"string":5===t?"number":"default",i=GetMethod(e,n);if(void 0!==i){var s=i.call(e,r);if(IsObject(s))throw new TypeError;return s}return OrdinaryToPrimitive(e,"default"===r?"number":r)}function OrdinaryToPrimitive(e,t){if("string"===t){var r=e.toString;if(IsCallable(r))if(!IsObject(i=r.call(e)))return i;if(IsCallable(n=e.valueOf))if(!IsObject(i=n.call(e)))return i}else{var n;if(IsCallable(n=e.valueOf))if(!IsObject(i=n.call(e)))return i;var i,s=e.toString;if(IsCallable(s))if(!IsObject(i=s.call(e)))return i}throw new TypeError}function ToBoolean(e){return!!e}function ToString(e){return""+e}function ToPropertyKey(e){var t=ToPrimitive(e,3);return IsSymbol(t)?t:ToString(t)}function IsArray(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function IsCallable(e){return"function"==typeof e}function IsConstructor(e){return"function"==typeof e}function IsPropertyKey(e){switch(Type(e)){case 3:case 4:return!0;default:return!1}}function GetMethod(e,t){var r=e[t];if(null!=r){if(!IsCallable(r))throw new TypeError;return r}}function GetIterator(e){var t=GetMethod(e,i);if(!IsCallable(t))throw new TypeError;var r=t.call(e);if(!IsObject(r))throw new TypeError;return r}function IteratorValue(e){return e.value}function IteratorStep(e){var t=e.next();return!t.done&&t}function IteratorClose(e){var t=e.return;t&&t.call(e)}function OrdinaryGetPrototypeOf(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===c)return t;if(t!==c)return t;var r=e.prototype,n=r&&Object.getPrototypeOf(r);if(null==n||n===Object.prototype)return t;var i=n.constructor;return"function"!=typeof i||i===e?t:i}function CreateMapPolyfill(){var e={},t=[],r=function(){function MapIterator(e,t,r){this._index=0,this._keys=e,this._values=t,this._selector=r}return MapIterator.prototype["@@iterator"]=function(){return this},MapIterator.prototype[i]=function(){return this},MapIterator.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var r=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},MapIterator.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},MapIterator.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},MapIterator}();return function(){function Map(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(Map.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Map.prototype.has=function(e){return this._find(e,!1)>=0},Map.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},Map.prototype.set=function(e,t){var r=this._find(e,!0);return this._values[r]=t,this},Map.prototype.delete=function(t){var r=this._find(t,!1);if(r>=0){for(var n=this._keys.length,i=r+1;i<n;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},Map.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},Map.prototype.keys=function(){return new r(this._keys,this._values,getKey)},Map.prototype.values=function(){return new r(this._keys,this._values,getValue)},Map.prototype.entries=function(){return new r(this._keys,this._values,getEntry)},Map.prototype["@@iterator"]=function(){return this.entries()},Map.prototype[i]=function(){return this.entries()},Map.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},Map}();function getKey(e,t){return e}function getValue(e,t){return t}function getEntry(e,t){return[e,t]}}function CreateSetPolyfill(){return function(){function Set(){this._map=new d}return Object.defineProperty(Set.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),Set.prototype.has=function(e){return this._map.has(e)},Set.prototype.add=function(e){return this._map.set(e,e),this},Set.prototype.delete=function(e){return this._map.delete(e)},Set.prototype.clear=function(){this._map.clear()},Set.prototype.keys=function(){return this._map.keys()},Set.prototype.values=function(){return this._map.values()},Set.prototype.entries=function(){return this._map.entries()},Set.prototype["@@iterator"]=function(){return this.keys()},Set.prototype[i]=function(){return this.keys()},Set}()}function CreateWeakMapPolyfill(){var e=16,r=u.create(),n=CreateUniqueKey();return function(){function WeakMap(){this._key=CreateUniqueKey()}return WeakMap.prototype.has=function(e){var t=GetOrCreateWeakMapTable(e,!1);return void 0!==t&&u.has(t,this._key)},WeakMap.prototype.get=function(e){var t=GetOrCreateWeakMapTable(e,!1);return void 0!==t?u.get(t,this._key):void 0},WeakMap.prototype.set=function(e,t){return GetOrCreateWeakMapTable(e,!0)[this._key]=t,this},WeakMap.prototype.delete=function(e){var t=GetOrCreateWeakMapTable(e,!1);return void 0!==t&&delete t[this._key]},WeakMap.prototype.clear=function(){this._key=CreateUniqueKey()},WeakMap}();function CreateUniqueKey(){var e;do{e="@@WeakMap@@"+CreateUUID()}while(u.has(r,e));return r[e]=!0,e}function GetOrCreateWeakMapTable(e,r){if(!t.call(e,n)){if(!r)return;Object.defineProperty(e,n,{value:u.create()})}return e[n]}function FillRandomBytes(e,t){for(var r=0;r<t;++r)e[r]=255*Math.random()|0;return e}function GenRandomBytes(e){return"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(e)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(e)):FillRandomBytes(new Uint8Array(e),e):FillRandomBytes(new Array(e),e)}function CreateUUID(){var t=GenRandomBytes(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var r="",n=0;n<e;++n){var i=t[n];4!==n&&6!==n&&8!==n||(r+="-"),i<16&&(r+="0"),r+=i.toString(16).toLowerCase()}return r}}function MakeDictionary(e){return e.__=void 0,delete e.__,e}e("decorate",decorate),e("metadata",metadata),e("defineMetadata",defineMetadata),e("hasMetadata",hasMetadata),e("hasOwnMetadata",hasOwnMetadata),e("getMetadata",getMetadata),e("getOwnMetadata",getOwnMetadata),e("getMetadataKeys",getMetadataKeys),e("getOwnMetadataKeys",getOwnMetadataKeys),e("deleteMetadata",deleteMetadata)}(n)}()}(e||(e={}))},9902:(e,t,r)=>{var n;!function(i){var s=Object.hasOwnProperty,o=Array.isArray?Array.isArray:function _isArray(e){return"[object Array]"===Object.prototype.toString.call(e)},a="object"==typeof process&&"function"==typeof process.nextTick,u="function"==typeof Symbol,c="object"==typeof Reflect,l="function"==typeof setImmediate?setImmediate:setTimeout,d=u?c&&"function"==typeof Reflect.ownKeys?Reflect.ownKeys:function(e){var t=Object.getOwnPropertyNames(e);return t.push.apply(t,Object.getOwnPropertySymbols(e)),t}:Object.keys;function init(){this._events={},this._conf&&configure.call(this,this._conf)}function configure(e){e&&(this._conf=e,e.delimiter&&(this.delimiter=e.delimiter),e.maxListeners!==i&&(this._maxListeners=e.maxListeners),e.wildcard&&(this.wildcard=e.wildcard),e.newListener&&(this._newListener=e.newListener),e.removeListener&&(this._removeListener=e.removeListener),e.verboseMemoryLeak&&(this.verboseMemoryLeak=e.verboseMemoryLeak),e.ignoreErrors&&(this.ignoreErrors=e.ignoreErrors),this.wildcard&&(this.listenerTree={}))}function logPossibleMemoryLeak(e,t){var r="(node) warning: possible EventEmitter memory leak detected. "+e+" listeners added. Use emitter.setMaxListeners() to increase limit.";if(this.verboseMemoryLeak&&(r+=" Event name: "+t+"."),"undefined"!=typeof process&&process.emitWarning){var n=new Error(r);n.name="MaxListenersExceededWarning",n.emitter=this,n.count=e,process.emitWarning(n)}else console.error(r),console.trace&&console.trace()}var toArray=function(e,t,r){var n=arguments.length;switch(n){case 0:return[];case 1:return[e];case 2:return[e,t];case 3:return[e,t,r];default:for(var i=new Array(n);n--;)i[n]=arguments[n];return i}};function toObject(e,t){for(var r={},n=e.length,s=t?t.length:0,o=0;o<n;o++)r[e[o]]=o<s?t[o]:i;return r}function TargetObserver(e,t,r){var n,i;if(this._emitter=e,this._target=t,this._listeners={},this._listenersCount=0,(r.on||r.off)&&(n=r.on,i=r.off),t.addEventListener?(n=t.addEventListener,i=t.removeEventListener):t.addListener?(n=t.addListener,i=t.removeListener):t.on&&(n=t.on,i=t.off),!n&&!i)throw Error("target does not implement any known event API");if("function"!=typeof n)throw TypeError("on method must be a function");if("function"!=typeof i)throw TypeError("off method must be a function");this._on=n,this._off=i;var s=e._observers;s?s.push(this):e._observers=[this]}function resolveOptions(e,t,r,n){var o=Object.assign({},t);if(!e)return o;if("object"!=typeof e)throw TypeError("options must be an object");var a,u,c,l=Object.keys(e),d=l.length;function reject(e){throw Error('Invalid "'+a+'" option value'+(e?". Reason: "+e:""))}for(var f=0;f<d;f++){if(a=l[f],!n&&!s.call(t,a))throw Error('Unknown "'+a+'" option');(u=e[a])!==i&&(c=r[a],o[a]=c?c(u,reject):u)}return o}function constructorReducer(e,t){return"function"==typeof e&&e.hasOwnProperty("prototype")||t("value must be a constructor"),e}function makeTypeReducer(e){var t="value must be type of "+e.join("|"),r=e.length,n=e[0],i=e[1];return 1===r?function(e,r){if(typeof e===n)return e;r(t)}:2===r?function(e,r){var s=typeof e;if(s===n||s===i)return e;r(t)}:function(n,i){for(var s=typeof n,o=r;o-- >0;)if(s===e[o])return n;i(t)}}Object.assign(TargetObserver.prototype,{subscribe:function(e,t,r){var n=this,i=this._target,s=this._emitter,o=this._listeners,handler=function(){var n=toArray.apply(null,arguments),o={data:n,name:t,original:e};r?!1!==r.call(i,o)&&s.emit.apply(s,[o.name].concat(n)):s.emit.apply(s,[t].concat(n))};if(o[e])throw Error("Event '"+e+"' is already listening");this._listenersCount++,s._newListener&&s._removeListener&&!n._onNewListener?(this._onNewListener=function(r){r===t&&null===o[e]&&(o[e]=handler,n._on.call(i,e,handler))},s.on("newListener",this._onNewListener),this._onRemoveListener=function(r){r===t&&!s.hasListeners(r)&&o[e]&&(o[e]=null,n._off.call(i,e,handler))},o[e]=null,s.on("removeListener",this._onRemoveListener)):(o[e]=handler,n._on.call(i,e,handler))},unsubscribe:function(e){var t,r,n,i=this,s=this._listeners,o=this._emitter,a=this._off,u=this._target;if(e&&"string"!=typeof e)throw TypeError("event must be a string");function clearRefs(){i._onNewListener&&(o.off("newListener",i._onNewListener),o.off("removeListener",i._onRemoveListener),i._onNewListener=null,i._onRemoveListener=null);var e=findTargetIndex.call(o,i);o._observers.splice(e,1)}if(e){if(!(t=s[e]))return;a.call(u,e,t),delete s[e],--this._listenersCount||clearRefs()}else{for(n=(r=d(s)).length;n-- >0;)e=r[n],a.call(u,e,s[e]);this._listeners={},this._listenersCount=0,clearRefs()}}});var f=makeTypeReducer(["function"]),h=makeTypeReducer(["object","function"]);function makeCancelablePromise(e,t,r){var n,i,s,o=0,a=new e((function(u,c,l){function cleanup(){i&&(i=null),o&&(clearTimeout(o),o=0)}r=resolveOptions(r,{timeout:0,overload:!1},{timeout:function(e,t){return("number"!=typeof(e*=1)||e<0||!Number.isFinite(e))&&t("timeout must be a positive number"),e}}),n=!r.overload&&"function"==typeof e.prototype.cancel&&"function"==typeof l;var _resolve=function(e){cleanup(),u(e)},_reject=function(e){cleanup(),c(e)};n?t(_resolve,_reject,l):(i=[function(e){_reject(e||Error("canceled"))}],t(_resolve,_reject,(function(e){if(s)throw Error("Unable to subscribe on cancel event asynchronously");if("function"!=typeof e)throw TypeError("onCancel callback must be a function");i.push(e)})),s=!0),r.timeout>0&&(o=setTimeout((function(){var e=Error("timeout");e.code="ETIMEDOUT",o=0,a.cancel(e),c(e)}),r.timeout))}));return n||(a.cancel=function(e){if(i){for(var t=i.length,r=1;r<t;r++)i[r](e);i[0](e),i=null}}),a}function findTargetIndex(e){var t=this._observers;if(!t)return-1;for(var r=t.length,n=0;n<r;n++)if(t[n]._target===e)return n;return-1}function searchListenerTree(e,t,r,n,i){if(!r)return null;if(0===n){var s=typeof t;if("string"===s){var o,a,u=0,c=0,l=this.delimiter,f=l.length;if(-1!==(a=t.indexOf(l))){o=new Array(5);do{o[u++]=t.slice(c,a),c=a+f}while(-1!==(a=t.indexOf(l,c)));o[u++]=t.slice(c),t=o,i=u}else t=[t],i=1}else"object"===s?i=t.length:(t=[t],i=1)}var h,p,m,y,b,g,v,w=null,I=t[n],A=t[n+1];if(n===i)r._listeners&&("function"==typeof r._listeners?(e&&e.push(r._listeners),w=[r]):(e&&e.push.apply(e,r._listeners),w=[r]));else{if("*"===I){for(a=(g=d(r)).length;a-- >0;)"_listeners"!==(h=g[a])&&(v=searchListenerTree(e,t,r[h],n+1,i))&&(w?w.push.apply(w,v):w=v);return w}if("**"===I){for((b=n+1===i||n+2===i&&"*"===A)&&r._listeners&&(w=searchListenerTree(e,t,r,i,i)),a=(g=d(r)).length;a-- >0;)"_listeners"!==(h=g[a])&&("*"===h||"**"===h?(r[h]._listeners&&!b&&(v=searchListenerTree(e,t,r[h],i,i))&&(w?w.push.apply(w,v):w=v),v=searchListenerTree(e,t,r[h],n,i)):v=searchListenerTree(e,t,r[h],h===A?n+2:n,i),v&&(w?w.push.apply(w,v):w=v));return w}r[I]&&(w=searchListenerTree(e,t,r[I],n+1,i))}if((p=r["*"])&&searchListenerTree(e,t,p,n+1,i),m=r["**"])if(n<i)for(m._listeners&&searchListenerTree(e,t,m,i,i),a=(g=d(m)).length;a-- >0;)"_listeners"!==(h=g[a])&&(h===A?searchListenerTree(e,t,m[h],n+2,i):h===I?searchListenerTree(e,t,m[h],n+1,i):((y={})[h]=m[h],searchListenerTree(e,t,{"**":y},n+1,i)));else m._listeners?searchListenerTree(e,t,m,i,i):m["*"]&&m["*"]._listeners&&searchListenerTree(e,t,m["*"],i,i);return w}function growListenerTree(e,t,r){var n,i,s=0,o=0,a=this.delimiter,u=a.length;if("string"==typeof e)if(-1!==(n=e.indexOf(a))){i=new Array(5);do{i[s++]=e.slice(o,n),o=n+u}while(-1!==(n=e.indexOf(a,o)));i[s++]=e.slice(o)}else i=[e],s=1;else i=e,s=e.length;if(s>1)for(n=0;n+1<s;n++)if("**"===i[n]&&"**"===i[n+1])return;var c,l=this.listenerTree;for(n=0;n<s;n++)if(l=l[c=i[n]]||(l[c]={}),n===s-1)return l._listeners?("function"==typeof l._listeners&&(l._listeners=[l._listeners]),r?l._listeners.unshift(t):l._listeners.push(t),!l._listeners.warned&&this._maxListeners>0&&l._listeners.length>this._maxListeners&&(l._listeners.warned=!0,logPossibleMemoryLeak.call(this,l._listeners.length,c))):l._listeners=t,!0;return!0}function collectTreeEvents(e,t,r,n){for(var i,s,o,a,u=d(e),c=u.length,l=e._listeners;c-- >0;)i=e[s=u[c]],o="_listeners"===s?r:r?r.concat(s):[s],a=n||"symbol"==typeof s,l&&t.push(a?o:o.join(this.delimiter)),"object"==typeof i&&collectTreeEvents.call(this,i,t,o,a);return t}function recursivelyGarbageCollect(e){for(var t,r,n,i=d(e),s=i.length;s-- >0;)(t=e[r=i[s]])&&(n=!0,"_listeners"===r||recursivelyGarbageCollect(t)||delete e[r]);return n}function Listener(e,t,r){this.emitter=e,this.event=t,this.listener=r}function setupListener(e,t,r){if(!0===r)s=!0;else if(!1===r)n=!0;else{if(!r||"object"!=typeof r)throw TypeError("options should be an object or true");var n=r.async,s=r.promisify,o=r.nextTick,u=r.objectify}if(n||o||s){var c=t,d=t._origin||t;if(o&&!a)throw Error("process.nextTick is not supported");s===i&&(s="AsyncFunction"===t.constructor.name),t=function(){var e=arguments,t=this,r=this.event;return s?o?Promise.resolve():new Promise((function(e){l(e)})).then((function(){return t.event=r,c.apply(t,e)})):(o?process.nextTick:l)((function(){t.event=r,c.apply(t,e)}))},t._async=!0,t._origin=d}return[t,u?new Listener(this,e,t):this]}function EventEmitter(e){this._events={},this._newListener=!1,this._removeListener=!1,this.verboseMemoryLeak=!1,configure.call(this,e)}Listener.prototype.off=function(){return this.emitter.off(this.event,this.listener),this},EventEmitter.EventEmitter2=EventEmitter,EventEmitter.prototype.listenTo=function(e,t,r){if("object"!=typeof e)throw TypeError("target musts be an object");var n=this;function listen(t){if("object"!=typeof t)throw TypeError("events must be an object");var i,s=r.reducers,o=findTargetIndex.call(n,e);i=-1===o?new TargetObserver(n,e,r):n._observers[o];for(var a,u=d(t),c=u.length,l="function"==typeof s,f=0;f<c;f++)a=u[f],i.subscribe(a,t[a]||a,l?s:s&&s[a])}return r=resolveOptions(r,{on:i,off:i,reducers:i},{on:f,off:f,reducers:h}),o(t)?listen(toObject(t)):listen("string"==typeof t?toObject(t.split(/\s+/)):t),this},EventEmitter.prototype.stopListeningTo=function(e,t){var r=this._observers;if(!r)return!1;var n,i=r.length,s=!1;if(e&&"object"!=typeof e)throw TypeError("target should be an object");for(;i-- >0;)n=r[i],e&&n._target!==e||(n.unsubscribe(t),s=!0);return s},EventEmitter.prototype.delimiter=".",EventEmitter.prototype.setMaxListeners=function(e){e!==i&&(this._maxListeners=e,this._conf||(this._conf={}),this._conf.maxListeners=e)},EventEmitter.prototype.getMaxListeners=function(){return this._maxListeners},EventEmitter.prototype.event="",EventEmitter.prototype.once=function(e,t,r){return this._once(e,t,!1,r)},EventEmitter.prototype.prependOnceListener=function(e,t,r){return this._once(e,t,!0,r)},EventEmitter.prototype._once=function(e,t,r,n){return this._many(e,1,t,r,n)},EventEmitter.prototype.many=function(e,t,r,n){return this._many(e,t,r,!1,n)},EventEmitter.prototype.prependMany=function(e,t,r,n){return this._many(e,t,r,!0,n)},EventEmitter.prototype._many=function(e,t,r,n,i){var s=this;if("function"!=typeof r)throw new Error("many only accepts instances of Function");function listener(){return 0==--t&&s.off(e,listener),r.apply(this,arguments)}return listener._origin=r,this._on(e,listener,n,i)},EventEmitter.prototype.emit=function(){if(!this._events&&!this._all)return!1;this._events||init.call(this);var e,t,r,n,i,s,o=arguments[0],a=this.wildcard;if("newListener"===o&&!this._newListener&&!this._events.newListener)return!1;if(a&&(e=o,"newListener"!==o&&"removeListener"!==o&&"object"==typeof o)){if(r=o.length,u)for(n=0;n<r;n++)if("symbol"==typeof o[n]){s=!0;break}s||(o=o.join(this.delimiter))}var c,l=arguments.length;if(this._all&&this._all.length)for(n=0,r=(c=this._all.slice()).length;n<r;n++)switch(this.event=o,l){case 1:c[n].call(this,o);break;case 2:c[n].call(this,o,arguments[1]);break;case 3:c[n].call(this,o,arguments[1],arguments[2]);break;default:c[n].apply(this,arguments)}if(a)c=[],searchListenerTree.call(this,c,e,this.listenerTree,0,r);else{if("function"==typeof(c=this._events[o])){switch(this.event=o,l){case 1:c.call(this);break;case 2:c.call(this,arguments[1]);break;case 3:c.call(this,arguments[1],arguments[2]);break;default:for(t=new Array(l-1),i=1;i<l;i++)t[i-1]=arguments[i];c.apply(this,t)}return!0}c&&(c=c.slice())}if(c&&c.length){if(l>3)for(t=new Array(l-1),i=1;i<l;i++)t[i-1]=arguments[i];for(n=0,r=c.length;n<r;n++)switch(this.event=o,l){case 1:c[n].call(this);break;case 2:c[n].call(this,arguments[1]);break;case 3:c[n].call(this,arguments[1],arguments[2]);break;default:c[n].apply(this,t)}return!0}if(!this.ignoreErrors&&!this._all&&"error"===o)throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");return!!this._all},EventEmitter.prototype.emitAsync=function(){if(!this._events&&!this._all)return!1;this._events||init.call(this);var e,t,r,n,i,s,o=arguments[0],a=this.wildcard;if("newListener"===o&&!this._newListener&&!this._events.newListener)return Promise.resolve([!1]);if(a&&(e=o,"newListener"!==o&&"removeListener"!==o&&"object"==typeof o)){if(n=o.length,u)for(i=0;i<n;i++)if("symbol"==typeof o[i]){t=!0;break}t||(o=o.join(this.delimiter))}var c,l=[],d=arguments.length;if(this._all)for(i=0,n=this._all.length;i<n;i++)switch(this.event=o,d){case 1:l.push(this._all[i].call(this,o));break;case 2:l.push(this._all[i].call(this,o,arguments[1]));break;case 3:l.push(this._all[i].call(this,o,arguments[1],arguments[2]));break;default:l.push(this._all[i].apply(this,arguments))}if(a?(c=[],searchListenerTree.call(this,c,e,this.listenerTree,0)):c=this._events[o],"function"==typeof c)switch(this.event=o,d){case 1:l.push(c.call(this));break;case 2:l.push(c.call(this,arguments[1]));break;case 3:l.push(c.call(this,arguments[1],arguments[2]));break;default:for(r=new Array(d-1),s=1;s<d;s++)r[s-1]=arguments[s];l.push(c.apply(this,r))}else if(c&&c.length){if(c=c.slice(),d>3)for(r=new Array(d-1),s=1;s<d;s++)r[s-1]=arguments[s];for(i=0,n=c.length;i<n;i++)switch(this.event=o,d){case 1:l.push(c[i].call(this));break;case 2:l.push(c[i].call(this,arguments[1]));break;case 3:l.push(c[i].call(this,arguments[1],arguments[2]));break;default:l.push(c[i].apply(this,r))}}else if(!this.ignoreErrors&&!this._all&&"error"===o)return arguments[1]instanceof Error?Promise.reject(arguments[1]):Promise.reject("Uncaught, unspecified 'error' event.");return Promise.all(l)},EventEmitter.prototype.on=function(e,t,r){return this._on(e,t,!1,r)},EventEmitter.prototype.prependListener=function(e,t,r){return this._on(e,t,!0,r)},EventEmitter.prototype.onAny=function(e){return this._onAny(e,!1)},EventEmitter.prototype.prependAny=function(e){return this._onAny(e,!0)},EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prototype._onAny=function(e,t){if("function"!=typeof e)throw new Error("onAny only accepts instances of Function");return this._all||(this._all=[]),t?this._all.unshift(e):this._all.push(e),this},EventEmitter.prototype._on=function(e,t,r,n){if("function"==typeof e)return this._onAny(e,t),this;if("function"!=typeof t)throw new Error("on only accepts instances of Function");this._events||init.call(this);var s,o=this;return n!==i&&(t=(s=setupListener.call(this,e,t,n))[0],o=s[1]),this._newListener&&this.emit("newListener",e,t),this.wildcard?(growListenerTree.call(this,e,t,r),o):(this._events[e]?("function"==typeof this._events[e]&&(this._events[e]=[this._events[e]]),r?this._events[e].unshift(t):this._events[e].push(t),!this._events[e].warned&&this._maxListeners>0&&this._events[e].length>this._maxListeners&&(this._events[e].warned=!0,logPossibleMemoryLeak.call(this,this._events[e].length,e))):this._events[e]=t,o)},EventEmitter.prototype.off=function(e,t){if("function"!=typeof t)throw new Error("removeListener only takes instances of Function");var r,n=[];if(this.wildcard){var i="string"==typeof e?e.split(this.delimiter):e.slice();if(!(n=searchListenerTree.call(this,null,i,this.listenerTree,0)))return this}else{if(!this._events[e])return this;r=this._events[e],n.push({_listeners:r})}for(var s=0;s<n.length;s++){var a=n[s];if(r=a._listeners,o(r)){for(var u=-1,c=0,l=r.length;c<l;c++)if(r[c]===t||r[c].listener&&r[c].listener===t||r[c]._origin&&r[c]._origin===t){u=c;break}if(u<0)continue;return this.wildcard?a._listeners.splice(u,1):this._events[e].splice(u,1),0===r.length&&(this.wildcard?delete a._listeners:delete this._events[e]),this._removeListener&&this.emit("removeListener",e,t),this}(r===t||r.listener&&r.listener===t||r._origin&&r._origin===t)&&(this.wildcard?delete a._listeners:delete this._events[e],this._removeListener&&this.emit("removeListener",e,t))}return this.listenerTree&&recursivelyGarbageCollect(this.listenerTree),this},EventEmitter.prototype.offAny=function(e){var t,r=0,n=0;if(e&&this._all&&this._all.length>0){for(r=0,n=(t=this._all).length;r<n;r++)if(e===t[r])return t.splice(r,1),this._removeListener&&this.emit("removeListenerAny",e),this}else{if(t=this._all,this._removeListener)for(r=0,n=t.length;r<n;r++)this.emit("removeListenerAny",t[r]);this._all=[]}return this},EventEmitter.prototype.removeListener=EventEmitter.prototype.off,EventEmitter.prototype.removeAllListeners=function(e){if(e===i)return!this._events||init.call(this),this;if(this.wildcard){var t,r=searchListenerTree.call(this,null,e,this.listenerTree,0);if(!r)return this;for(t=0;t<r.length;t++)r[t]._listeners=null;this.listenerTree&&recursivelyGarbageCollect(this.listenerTree)}else this._events&&(this._events[e]=null);return this},EventEmitter.prototype.listeners=function(e){var t,r,n,s,o,a=this._events;if(e===i){if(this.wildcard)throw Error("event name required for wildcard emitter");if(!a)return[];for(s=(t=d(a)).length,n=[];s-- >0;)"function"==typeof(r=a[t[s]])?n.push(r):n.push.apply(n,r);return n}if(this.wildcard){if(!(o=this.listenerTree))return[];var u=[],c="string"==typeof e?e.split(this.delimiter):e.slice();return searchListenerTree.call(this,u,c,o,0),u}return a&&(r=a[e])?"function"==typeof r?[r]:r:[]},EventEmitter.prototype.eventNames=function(e){var t=this._events;return this.wildcard?collectTreeEvents.call(this,this.listenerTree,[],null,e):t?d(t):[]},EventEmitter.prototype.listenerCount=function(e){return this.listeners(e).length},EventEmitter.prototype.hasListeners=function(e){if(this.wildcard){var t=[],r="string"==typeof e?e.split(this.delimiter):e.slice();return searchListenerTree.call(this,t,r,this.listenerTree,0),t.length>0}var n=this._events,s=this._all;return!!(s&&s.length||n&&(e===i?d(n).length:n[e]))},EventEmitter.prototype.listenersAny=function(){return this._all?this._all:[]},EventEmitter.prototype.waitFor=function(e,t){var r=this,n=typeof t;return"number"===n?t={timeout:t}:"function"===n&&(t={filter:t}),makeCancelablePromise((t=resolveOptions(t,{timeout:0,filter:i,handleError:!1,Promise,overload:!1},{filter:f,Promise:constructorReducer})).Promise,(function(n,i,s){function listener(){var s=t.filter;if(!s||s.apply(r,arguments))if(r.off(e,listener),t.handleError){var o=arguments[0];o?i(o):n(toArray.apply(null,arguments).slice(1))}else n(toArray.apply(null,arguments))}s((function(){r.off(e,listener)})),r._on(e,listener,!1)}),{timeout:t.timeout,overload:t.overload})};var p=EventEmitter.prototype;Object.defineProperties(EventEmitter,{defaultMaxListeners:{get:function(){return p._maxListeners},set:function(e){if("number"!=typeof e||e<0||Number.isNaN(e))throw TypeError("n must be a non-negative number");p._maxListeners=e},enumerable:!0},once:{value:function once(e,t,r){return makeCancelablePromise((r=resolveOptions(r,{Promise,timeout:0,overload:!1},{Promise:constructorReducer})).Promise,(function(r,n,i){var s;if("function"==typeof e.addEventListener)return s=function(){r(toArray.apply(null,arguments))},i((function(){e.removeEventListener(t,s)})),void e.addEventListener(t,s,{once:!0});var o,eventListener=function(){o&&e.removeListener("error",o),r(toArray.apply(null,arguments))};"error"!==t&&(o=function(r){e.removeListener(t,eventListener),n(r)},e.once("error",o)),i((function(){o&&e.removeListener("error",o),e.removeListener(t,eventListener)})),e.once(t,eventListener)}),{timeout:r.timeout,overload:r.overload})},writable:!0,configurable:!0}}),Object.defineProperties(p,{_maxListeners:{value:10,writable:!0,configurable:!0},_observers:{value:null,writable:!0,configurable:!0}}),(n=function(){return EventEmitter}.call(t,r,t,e))===i||(e.exports=n)}()},4191:(e,t)=>{function serializer(e,t){var r=[],n=[];return null==t&&(t=function(e,t){return r[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(t)).join(".")+"]"}),function(i,s){if(r.length>0){var o=r.indexOf(this);~o?r.splice(o+1):r.push(this),~o?n.splice(o,1/0,i):n.push(i),~r.indexOf(s)&&(s=t.call(this,i,s))}else r.push(s);return null==e?s:e.call(this,i,s)}}(e.exports=function stringify(e,t,r,n){return JSON.stringify(e,serializer(t,n),r)}).getSerialize=serializer},5250:function(e,t,r){var n;e=r.nmd(e),function(){var i,s="Expected a function",o="__lodash_hash_undefined__",a="__lodash_placeholder__",u=16,c=32,l=64,d=128,f=256,h=1/0,p=9007199254740991,m=NaN,y=4294967295,b=[["ary",d],["bind",1],["bindKey",2],["curry",8],["curryRight",u],["flip",512],["partial",c],["partialRight",l],["rearg",f]],g="[object Arguments]",v="[object Array]",w="[object Boolean]",I="[object Date]",A="[object Error]",O="[object Function]",S="[object GeneratorFunction]",_="[object Map]",R="[object Number]",P="[object Object]",E="[object Promise]",T="[object RegExp]",L="[object Set]",D="[object String]",x="[object Symbol]",k="[object WeakMap]",j="[object ArrayBuffer]",q="[object DataView]",M="[object Float32Array]",N="[object Float64Array]",F="[object Int8Array]",$="[object Int16Array]",V="[object Int32Array]",z="[object Uint8Array]",B="[object Uint8ClampedArray]",W="[object Uint16Array]",U="[object Uint32Array]",Z=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,K=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,J=RegExp(K.source),Q=RegExp(Y.source),X=/<%-([\s\S]+?)%>/g,ee=/<%([\s\S]+?)%>/g,te=/<%=([\s\S]+?)%>/g,re=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,ie=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,se=/[\\^$.*+?()[\]{}|]/g,oe=RegExp(se.source),ae=/^\s+/,ue=/\s/,ce=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,le=/\{\n\/\* \[wrapped with (.+)\] \*/,de=/,? & /,fe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,he=/[()=,{}\[\]\/\s]/,pe=/\\(\\)?/g,me=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ye=/\w*$/,be=/^[-+]0x[0-9a-f]+$/i,ge=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,we=/^0o[0-7]+$/i,Ie=/^(?:0|[1-9]\d*)$/,Ae=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Oe=/($^)/,Se=/['\n\r\u2028\u2029\\]/g,_e="\\ud800-\\udfff",Re="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\u2700-\\u27bf",Pe="a-z\\xdf-\\xf6\\xf8-\\xff",Ee="A-Z\\xc0-\\xd6\\xd8-\\xde",Te="\\ufe0e\\ufe0f",Le="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",De="['’]",xe="["+_e+"]",ke="["+Le+"]",je="["+Re+"]",qe="\\d+",Me="["+Ce+"]",Ne="["+Pe+"]",Fe="[^"+_e+Le+qe+Ce+Pe+Ee+"]",$e="\\ud83c[\\udffb-\\udfff]",Ve="[^"+_e+"]",ze="(?:\\ud83c[\\udde6-\\uddff]){2}",Be="[\\ud800-\\udbff][\\udc00-\\udfff]",We="["+Ee+"]",Ue="\\u200d",Ze="(?:"+Ne+"|"+Fe+")",Ge="(?:"+We+"|"+Fe+")",He="(?:['’](?:d|ll|m|re|s|t|ve))?",Ke="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+je+"|"+$e+")"+"?",Je="["+Te+"]?",Qe=Je+Ye+("(?:"+Ue+"(?:"+[Ve,ze,Be].join("|")+")"+Je+Ye+")*"),Xe="(?:"+[Me,ze,Be].join("|")+")"+Qe,et="(?:"+[Ve+je+"?",je,ze,Be,xe].join("|")+")",tt=RegExp(De,"g"),rt=RegExp(je,"g"),nt=RegExp($e+"(?="+$e+")|"+et+Qe,"g"),it=RegExp([We+"?"+Ne+"+"+He+"(?="+[ke,We,"$"].join("|")+")",Ge+"+"+Ke+"(?="+[ke,We+Ze,"$"].join("|")+")",We+"?"+Ze+"+"+He,We+"+"+Ke,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",qe,Xe].join("|"),"g"),st=RegExp("["+Ue+_e+Re+Te+"]"),ot=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,at=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ut=-1,ct={};ct[M]=ct[N]=ct[F]=ct[$]=ct[V]=ct[z]=ct[B]=ct[W]=ct[U]=!0,ct[g]=ct[v]=ct[j]=ct[w]=ct[q]=ct[I]=ct[A]=ct[O]=ct[_]=ct[R]=ct[P]=ct[T]=ct[L]=ct[D]=ct[k]=!1;var lt={};lt[g]=lt[v]=lt[j]=lt[q]=lt[w]=lt[I]=lt[M]=lt[N]=lt[F]=lt[$]=lt[V]=lt[_]=lt[R]=lt[P]=lt[T]=lt[L]=lt[D]=lt[x]=lt[z]=lt[B]=lt[W]=lt[U]=!0,lt[A]=lt[O]=lt[k]=!1;var dt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ft=parseFloat,ht=parseInt,pt="object"==typeof global&&global&&global.Object===Object&&global,mt="object"==typeof self&&self&&self.Object===Object&&self,yt=pt||mt||Function("return this")(),bt=t&&!t.nodeType&&t,gt=bt&&e&&!e.nodeType&&e,vt=gt&>.exports===bt,wt=vt&&pt.process,It=function(){try{var e=gt&>.require&>.require("util").types;return e||wt&&wt.binding&&wt.binding("util")}catch(e){}}(),At=It&&It.isArrayBuffer,Ot=It&&It.isDate,St=It&&It.isMap,_t=It&&It.isRegExp,Rt=It&&It.isSet,Ct=It&&It.isTypedArray;function apply(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function arrayAggregator(e,t,r,n){for(var i=-1,s=null==e?0:e.length;++i<s;){var o=e[i];t(n,o,r(o),e)}return n}function arrayEach(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function arrayEachRight(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function arrayEvery(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function arrayFilter(e,t){for(var r=-1,n=null==e?0:e.length,i=0,s=[];++r<n;){var o=e[r];t(o,r,e)&&(s[i++]=o)}return s}function arrayIncludes(e,t){return!!(null==e?0:e.length)&&baseIndexOf(e,t,0)>-1}function arrayIncludesWith(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function arrayMap(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function arrayPush(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function arrayReduce(e,t,r,n){var i=-1,s=null==e?0:e.length;for(n&&s&&(r=e[++i]);++i<s;)r=t(r,e[i],i,e);return r}function arrayReduceRight(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function arraySome(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Pt=baseProperty("length");function baseFindKey(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function baseFindIndex(e,t,r,n){for(var i=e.length,s=r+(n?1:-1);n?s--:++s<i;)if(t(e[s],s,e))return s;return-1}function baseIndexOf(e,t,r){return t==t?function strictIndexOf(e,t,r){var n=r-1,i=e.length;for(;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):baseFindIndex(e,baseIsNaN,r)}function baseIndexOfWith(e,t,r,n){for(var i=r-1,s=e.length;++i<s;)if(n(e[i],t))return i;return-1}function baseIsNaN(e){return e!=e}function baseMean(e,t){var r=null==e?0:e.length;return r?baseSum(e,t)/r:m}function baseProperty(e){return function(t){return null==t?i:t[e]}}function basePropertyOf(e){return function(t){return null==e?i:e[t]}}function baseReduce(e,t,r,n,i){return i(e,(function(e,i,s){r=n?(n=!1,e):t(r,e,i,s)})),r}function baseSum(e,t){for(var r,n=-1,s=e.length;++n<s;){var o=t(e[n]);o!==i&&(r=r===i?o:r+o)}return r}function baseTimes(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function baseTrim(e){return e?e.slice(0,trimmedEndIndex(e)+1).replace(ae,""):e}function baseUnary(e){return function(t){return e(t)}}function baseValues(e,t){return arrayMap(t,(function(t){return e[t]}))}function cacheHas(e,t){return e.has(t)}function charsStartIndex(e,t){for(var r=-1,n=e.length;++r<n&&baseIndexOf(t,e[r],0)>-1;);return r}function charsEndIndex(e,t){for(var r=e.length;r--&&baseIndexOf(t,e[r],0)>-1;);return r}var Et=basePropertyOf({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Tt=basePropertyOf({"&":"&","<":"<",">":">",'"':""","'":"'"});function escapeStringChar(e){return"\\"+dt[e]}function hasUnicode(e){return st.test(e)}function mapToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function overArg(e,t){return function(r){return e(t(r))}}function replaceHolders(e,t){for(var r=-1,n=e.length,i=0,s=[];++r<n;){var o=e[r];o!==t&&o!==a||(e[r]=a,s[i++]=r)}return s}function setToArray(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function setToPairs(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function stringSize(e){return hasUnicode(e)?function unicodeSize(e){var t=nt.lastIndex=0;for(;nt.test(e);)++t;return t}(e):Pt(e)}function stringToArray(e){return hasUnicode(e)?function unicodeToArray(e){return e.match(nt)||[]}(e):function asciiToArray(e){return e.split("")}(e)}function trimmedEndIndex(e){for(var t=e.length;t--&&ue.test(e.charAt(t)););return t}var Lt=basePropertyOf({"&":"&","<":"<",">":">",""":'"',"'":"'"});var Dt=function runInContext(e){var t,r=(e=null==e?yt:Dt.defaults(yt.Object(),e,Dt.pick(yt,at))).Array,n=e.Date,ue=e.Error,_e=e.Function,Re=e.Math,Ce=e.Object,Pe=e.RegExp,Ee=e.String,Te=e.TypeError,Le=r.prototype,De=_e.prototype,xe=Ce.prototype,ke=e["__core-js_shared__"],je=De.toString,qe=xe.hasOwnProperty,Me=0,Ne=(t=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||""))?"Symbol(src)_1."+t:"",Fe=xe.toString,$e=je.call(Ce),Ve=yt._,ze=Pe("^"+je.call(qe).replace(se,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Be=vt?e.Buffer:i,We=e.Symbol,Ue=e.Uint8Array,Ze=Be?Be.allocUnsafe:i,Ge=overArg(Ce.getPrototypeOf,Ce),He=Ce.create,Ke=xe.propertyIsEnumerable,Ye=Le.splice,Je=We?We.isConcatSpreadable:i,Qe=We?We.iterator:i,Xe=We?We.toStringTag:i,et=function(){try{var e=getNative(Ce,"defineProperty");return e({},"",{}),e}catch(e){}}(),nt=e.clearTimeout!==yt.clearTimeout&&e.clearTimeout,st=n&&n.now!==yt.Date.now&&n.now,dt=e.setTimeout!==yt.setTimeout&&e.setTimeout,pt=Re.ceil,mt=Re.floor,bt=Ce.getOwnPropertySymbols,gt=Be?Be.isBuffer:i,wt=e.isFinite,It=Le.join,Pt=overArg(Ce.keys,Ce),xt=Re.max,kt=Re.min,jt=n.now,qt=e.parseInt,Mt=Re.random,Nt=Le.reverse,Ft=getNative(e,"DataView"),$t=getNative(e,"Map"),Vt=getNative(e,"Promise"),zt=getNative(e,"Set"),Bt=getNative(e,"WeakMap"),Wt=getNative(Ce,"create"),Ut=Bt&&new Bt,Zt={},Gt=toSource(Ft),Ht=toSource($t),Kt=toSource(Vt),Yt=toSource(zt),Jt=toSource(Bt),Qt=We?We.prototype:i,Xt=Qt?Qt.valueOf:i,er=Qt?Qt.toString:i;function lodash(e){if(isObjectLike(e)&&!sn(e)&&!(e instanceof LazyWrapper)){if(e instanceof LodashWrapper)return e;if(qe.call(e,"__wrapped__"))return wrapperClone(e)}return new LodashWrapper(e)}var tr=function(){function object(){}return function(e){if(!isObject(e))return{};if(He)return He(e);object.prototype=e;var t=new object;return object.prototype=i,t}}();function baseLodash(){}function LodashWrapper(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function LazyWrapper(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=y,this.__views__=[]}function Hash(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ListCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function MapCache(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function SetCache(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new MapCache;++t<r;)this.add(e[t])}function Stack(e){var t=this.__data__=new ListCache(e);this.size=t.size}function arrayLikeKeys(e,t){var r=sn(e),n=!r&&nn(e),i=!r&&!n&&an(e),s=!r&&!n&&!i&&fn(e),o=r||n||i||s,a=o?baseTimes(e.length,Ee):[],u=a.length;for(var c in e)!t&&!qe.call(e,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||isIndex(c,u))||a.push(c);return a}function arraySample(e){var t=e.length;return t?e[baseRandom(0,t-1)]:i}function arraySampleSize(e,t){return shuffleSelf(copyArray(e),baseClamp(t,0,e.length))}function arrayShuffle(e){return shuffleSelf(copyArray(e))}function assignMergeValue(e,t,r){(r!==i&&!eq(e[t],r)||r===i&&!(t in e))&&baseAssignValue(e,t,r)}function assignValue(e,t,r){var n=e[t];qe.call(e,t)&&eq(n,r)&&(r!==i||t in e)||baseAssignValue(e,t,r)}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}function baseAggregator(e,t,r,n){return rr(e,(function(e,i,s){t(n,e,r(e),s)})),n}function baseAssign(e,t){return e&©Object(t,keys(t),e)}function baseAssignValue(e,t,r){"__proto__"==t&&et?et(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function baseAt(e,t){for(var n=-1,s=t.length,o=r(s),a=null==e;++n<s;)o[n]=a?i:get(e,t[n]);return o}function baseClamp(e,t,r){return e==e&&(r!==i&&(e=e<=r?e:r),t!==i&&(e=e>=t?e:t)),e}function baseClone(e,t,r,n,s,o){var a,u=1&t,c=2&t,l=4&t;if(r&&(a=s?r(e,n,s,o):r(e)),a!==i)return a;if(!isObject(e))return e;var d=sn(e);if(d){if(a=function initCloneArray(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&qe.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!u)return copyArray(e,a)}else{var f=pr(e),h=f==O||f==S;if(an(e))return cloneBuffer(e,u);if(f==P||f==g||h&&!s){if(a=c||h?{}:initCloneObject(e),!u)return c?function copySymbolsIn(e,t){return copyObject(e,hr(e),t)}(e,function baseAssignIn(e,t){return e&©Object(t,keysIn(t),e)}(a,e)):function copySymbols(e,t){return copyObject(e,fr(e),t)}(e,baseAssign(a,e))}else{if(!lt[f])return s?e:{};a=function initCloneByTag(e,t,r){var n=e.constructor;switch(t){case j:return cloneArrayBuffer(e);case w:case I:return new n(+e);case q:return function cloneDataView(e,t){var r=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case M:case N:case F:case $:case V:case z:case B:case W:case U:return cloneTypedArray(e,r);case _:return new n;case R:case D:return new n(e);case T:return function cloneRegExp(e){var t=new e.constructor(e.source,ye.exec(e));return t.lastIndex=e.lastIndex,t}(e);case L:return new n;case x:return function cloneSymbol(e){return Xt?Ce(Xt.call(e)):{}}(e)}}(e,f,u)}}o||(o=new Stack);var p=o.get(e);if(p)return p;o.set(e,a),dn(e)?e.forEach((function(n){a.add(baseClone(n,t,r,n,e,o))})):cn(e)&&e.forEach((function(n,i){a.set(i,baseClone(n,t,r,i,e,o))}));var m=d?i:(l?c?getAllKeysIn:getAllKeys:c?keysIn:keys)(e);return arrayEach(m||e,(function(n,i){m&&(n=e[i=n]),assignValue(a,i,baseClone(n,t,r,i,e,o))})),a}function baseConformsTo(e,t,r){var n=r.length;if(null==e)return!n;for(e=Ce(e);n--;){var s=r[n],o=t[s],a=e[s];if(a===i&&!(s in e)||!o(a))return!1}return!0}function baseDelay(e,t,r){if("function"!=typeof e)throw new Te(s);return br((function(){e.apply(i,r)}),t)}function baseDifference(e,t,r,n){var i=-1,s=arrayIncludes,o=!0,a=e.length,u=[],c=t.length;if(!a)return u;r&&(t=arrayMap(t,baseUnary(r))),n?(s=arrayIncludesWith,o=!1):t.length>=200&&(s=cacheHas,o=!1,t=new SetCache(t));e:for(;++i<a;){var l=e[i],d=null==r?l:r(l);if(l=n||0!==l?l:0,o&&d==d){for(var f=c;f--;)if(t[f]===d)continue e;u.push(l)}else s(t,d,n)||u.push(l)}return u}lodash.templateSettings={escape:X,evaluate:ee,interpolate:te,variable:"",imports:{_:lodash}},lodash.prototype=baseLodash.prototype,lodash.prototype.constructor=lodash,LodashWrapper.prototype=tr(baseLodash.prototype),LodashWrapper.prototype.constructor=LodashWrapper,LazyWrapper.prototype=tr(baseLodash.prototype),LazyWrapper.prototype.constructor=LazyWrapper,Hash.prototype.clear=function hashClear(){this.__data__=Wt?Wt(null):{},this.size=0},Hash.prototype.delete=function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Hash.prototype.get=function hashGet(e){var t=this.__data__;if(Wt){var r=t[e];return r===o?i:r}return qe.call(t,e)?t[e]:i},Hash.prototype.has=function hashHas(e){var t=this.__data__;return Wt?t[e]!==i:qe.call(t,e)},Hash.prototype.set=function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Wt&&t===i?o:t,this},ListCache.prototype.clear=function listCacheClear(){this.__data__=[],this.size=0},ListCache.prototype.delete=function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ye.call(t,r,1),--this.size,!0)},ListCache.prototype.get=function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?i:t[r][1]},ListCache.prototype.has=function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1},ListCache.prototype.set=function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},MapCache.prototype.clear=function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new($t||ListCache),string:new Hash}},MapCache.prototype.delete=function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t},MapCache.prototype.get=function mapCacheGet(e){return getMapData(this,e).get(e)},MapCache.prototype.has=function mapCacheHas(e){return getMapData(this,e).has(e)},MapCache.prototype.set=function mapCacheSet(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},SetCache.prototype.add=SetCache.prototype.push=function setCacheAdd(e){return this.__data__.set(e,o),this},SetCache.prototype.has=function setCacheHas(e){return this.__data__.has(e)},Stack.prototype.clear=function stackClear(){this.__data__=new ListCache,this.size=0},Stack.prototype.delete=function stackDelete(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Stack.prototype.get=function stackGet(e){return this.__data__.get(e)},Stack.prototype.has=function stackHas(e){return this.__data__.has(e)},Stack.prototype.set=function stackSet(e,t){var r=this.__data__;if(r instanceof ListCache){var n=r.__data__;if(!$t||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new MapCache(n)}return r.set(e,t),this.size=r.size,this};var rr=createBaseEach(baseForOwn),nr=createBaseEach(baseForOwnRight,!0);function baseEvery(e,t){var r=!0;return rr(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function baseExtremum(e,t,r){for(var n=-1,s=e.length;++n<s;){var o=e[n],a=t(o);if(null!=a&&(u===i?a==a&&!isSymbol(a):r(a,u)))var u=a,c=o}return c}function baseFilter(e,t){var r=[];return rr(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function baseFlatten(e,t,r,n,i){var s=-1,o=e.length;for(r||(r=isFlattenable),i||(i=[]);++s<o;){var a=e[s];t>0&&r(a)?t>1?baseFlatten(a,t-1,r,n,i):arrayPush(i,a):n||(i[i.length]=a)}return i}var ir=createBaseFor(),sr=createBaseFor(!0);function baseForOwn(e,t){return e&&ir(e,t,keys)}function baseForOwnRight(e,t){return e&&sr(e,t,keys)}function baseFunctions(e,t){return arrayFilter(t,(function(t){return isFunction(e[t])}))}function baseGet(e,t){for(var r=0,n=(t=castPath(t,e)).length;null!=e&&r<n;)e=e[toKey(t[r++])];return r&&r==n?e:i}function baseGetAllKeys(e,t,r){var n=t(e);return sn(e)?n:arrayPush(n,r(e))}function baseGetTag(e){return null==e?e===i?"[object Undefined]":"[object Null]":Xe&&Xe in Ce(e)?function getRawTag(e){var t=qe.call(e,Xe),r=e[Xe];try{e[Xe]=i;var n=!0}catch(e){}var s=Fe.call(e);n&&(t?e[Xe]=r:delete e[Xe]);return s}(e):function objectToString(e){return Fe.call(e)}(e)}function baseGt(e,t){return e>t}function baseHas(e,t){return null!=e&&qe.call(e,t)}function baseHasIn(e,t){return null!=e&&t in Ce(e)}function baseIntersection(e,t,n){for(var s=n?arrayIncludesWith:arrayIncludes,o=e[0].length,a=e.length,u=a,c=r(a),l=1/0,d=[];u--;){var f=e[u];u&&t&&(f=arrayMap(f,baseUnary(t))),l=kt(f.length,l),c[u]=!n&&(t||o>=120&&f.length>=120)?new SetCache(u&&f):i}f=e[0];var h=-1,p=c[0];e:for(;++h<o&&d.length<l;){var m=f[h],y=t?t(m):m;if(m=n||0!==m?m:0,!(p?cacheHas(p,y):s(d,y,n))){for(u=a;--u;){var b=c[u];if(!(b?cacheHas(b,y):s(e[u],y,n)))continue e}p&&p.push(y),d.push(m)}}return d}function baseInvoke(e,t,r){var n=null==(e=parent(e,t=castPath(t,e)))?e:e[toKey(last(t))];return null==n?i:apply(n,e,r)}function baseIsArguments(e){return isObjectLike(e)&&baseGetTag(e)==g}function baseIsEqual(e,t,r,n,s){return e===t||(null==e||null==t||!isObjectLike(e)&&!isObjectLike(t)?e!=e&&t!=t:function baseIsEqualDeep(e,t,r,n,s,o){var a=sn(e),u=sn(t),c=a?v:pr(e),l=u?v:pr(t),d=(c=c==g?P:c)==P,f=(l=l==g?P:l)==P,h=c==l;if(h&&an(e)){if(!an(t))return!1;a=!0,d=!1}if(h&&!d)return o||(o=new Stack),a||fn(e)?equalArrays(e,t,r,n,s,o):function equalByTag(e,t,r,n,i,s,o){switch(r){case q:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case j:return!(e.byteLength!=t.byteLength||!s(new Ue(e),new Ue(t)));case w:case I:case R:return eq(+e,+t);case A:return e.name==t.name&&e.message==t.message;case T:case D:return e==t+"";case _:var a=mapToArray;case L:var u=1&n;if(a||(a=setToArray),e.size!=t.size&&!u)return!1;var c=o.get(e);if(c)return c==t;n|=2,o.set(e,t);var l=equalArrays(a(e),a(t),n,i,s,o);return o.delete(e),l;case x:if(Xt)return Xt.call(e)==Xt.call(t)}return!1}(e,t,c,r,n,s,o);if(!(1&r)){var p=d&&qe.call(e,"__wrapped__"),m=f&&qe.call(t,"__wrapped__");if(p||m){var y=p?e.value():e,b=m?t.value():t;return o||(o=new Stack),s(y,b,r,n,o)}}if(!h)return!1;return o||(o=new Stack),function equalObjects(e,t,r,n,s,o){var a=1&r,u=getAllKeys(e),c=u.length,l=getAllKeys(t),d=l.length;if(c!=d&&!a)return!1;var f=c;for(;f--;){var h=u[f];if(!(a?h in t:qe.call(t,h)))return!1}var p=o.get(e),m=o.get(t);if(p&&m)return p==t&&m==e;var y=!0;o.set(e,t),o.set(t,e);var b=a;for(;++f<c;){var g=e[h=u[f]],v=t[h];if(n)var w=a?n(v,g,h,t,e,o):n(g,v,h,e,t,o);if(!(w===i?g===v||s(g,v,r,n,o):w)){y=!1;break}b||(b="constructor"==h)}if(y&&!b){var I=e.constructor,A=t.constructor;I==A||!("constructor"in e)||!("constructor"in t)||"function"==typeof I&&I instanceof I&&"function"==typeof A&&A instanceof A||(y=!1)}return o.delete(e),o.delete(t),y}(e,t,r,n,s,o)}(e,t,r,n,baseIsEqual,s))}function baseIsMatch(e,t,r,n){var s=r.length,o=s,a=!n;if(null==e)return!o;for(e=Ce(e);s--;){var u=r[s];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++s<o;){var c=(u=r[s])[0],l=e[c],d=u[1];if(a&&u[2]){if(l===i&&!(c in e))return!1}else{var f=new Stack;if(n)var h=n(l,d,c,e,t,f);if(!(h===i?baseIsEqual(d,l,3,n,f):h))return!1}}return!0}function baseIsNative(e){return!(!isObject(e)||function isMasked(e){return!!Ne&&Ne in e}(e))&&(isFunction(e)?ze:ve).test(toSource(e))}function baseIteratee(e){return"function"==typeof e?e:null==e?identity:"object"==typeof e?sn(e)?baseMatchesProperty(e[0],e[1]):baseMatches(e):property(e)}function baseKeys(e){if(!isPrototype(e))return Pt(e);var t=[];for(var r in Ce(e))qe.call(e,r)&&"constructor"!=r&&t.push(r);return t}function baseKeysIn(e){if(!isObject(e))return function nativeKeysIn(e){var t=[];if(null!=e)for(var r in Ce(e))t.push(r);return t}(e);var t=isPrototype(e),r=[];for(var n in e)("constructor"!=n||!t&&qe.call(e,n))&&r.push(n);return r}function baseLt(e,t){return e<t}function baseMap(e,t){var n=-1,i=isArrayLike(e)?r(e.length):[];return rr(e,(function(e,r,s){i[++n]=t(e,r,s)})),i}function baseMatches(e){var t=getMatchData(e);return 1==t.length&&t[0][2]?matchesStrictComparable(t[0][0],t[0][1]):function(r){return r===e||baseIsMatch(r,e,t)}}function baseMatchesProperty(e,t){return isKey(e)&&isStrictComparable(t)?matchesStrictComparable(toKey(e),t):function(r){var n=get(r,e);return n===i&&n===t?hasIn(r,e):baseIsEqual(t,n,3)}}function baseMerge(e,t,r,n,s){e!==t&&ir(t,(function(o,a){if(s||(s=new Stack),isObject(o))!function baseMergeDeep(e,t,r,n,s,o,a){var u=safeGet(e,r),c=safeGet(t,r),l=a.get(c);if(l)return void assignMergeValue(e,r,l);var d=o?o(u,c,r+"",e,t,a):i,f=d===i;if(f){var h=sn(c),p=!h&&an(c),m=!h&&!p&&fn(c);d=c,h||p||m?sn(u)?d=u:isArrayLikeObject(u)?d=copyArray(u):p?(f=!1,d=cloneBuffer(c,!0)):m?(f=!1,d=cloneTypedArray(c,!0)):d=[]:isPlainObject(c)||nn(c)?(d=u,nn(u)?d=toPlainObject(u):isObject(u)&&!isFunction(u)||(d=initCloneObject(c))):f=!1}f&&(a.set(c,d),s(d,c,n,o,a),a.delete(c));assignMergeValue(e,r,d)}(e,t,a,r,baseMerge,n,s);else{var u=n?n(safeGet(e,a),o,a+"",e,t,s):i;u===i&&(u=o),assignMergeValue(e,a,u)}}),keysIn)}function baseNth(e,t){var r=e.length;if(r)return isIndex(t+=t<0?r:0,r)?e[t]:i}function baseOrderBy(e,t,r){t=t.length?arrayMap(t,(function(e){return sn(e)?function(t){return baseGet(t,1===e.length?e[0]:e)}:e})):[identity];var n=-1;t=arrayMap(t,baseUnary(getIteratee()));var i=baseMap(e,(function(e,r,i){var s=arrayMap(t,(function(t){return t(e)}));return{criteria:s,index:++n,value:e}}));return function baseSortBy(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(i,(function(e,t){return function compareMultiple(e,t,r){var n=-1,i=e.criteria,s=t.criteria,o=i.length,a=r.length;for(;++n<o;){var u=compareAscending(i[n],s[n]);if(u)return n>=a?u:u*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function basePickBy(e,t,r){for(var n=-1,i=t.length,s={};++n<i;){var o=t[n],a=baseGet(e,o);r(a,o)&&baseSet(s,castPath(o,e),a)}return s}function basePullAll(e,t,r,n){var i=n?baseIndexOfWith:baseIndexOf,s=-1,o=t.length,a=e;for(e===t&&(t=copyArray(t)),r&&(a=arrayMap(e,baseUnary(r)));++s<o;)for(var u=0,c=t[s],l=r?r(c):c;(u=i(a,l,u,n))>-1;)a!==e&&Ye.call(a,u,1),Ye.call(e,u,1);return e}function basePullAt(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==s){var s=i;isIndex(i)?Ye.call(e,i,1):baseUnset(e,i)}}return e}function baseRandom(e,t){return e+mt(Mt()*(t-e+1))}function baseRepeat(e,t){var r="";if(!e||t<1||t>p)return r;do{t%2&&(r+=e),(t=mt(t/2))&&(e+=e)}while(t);return r}function baseRest(e,t){return gr(overRest(e,t,identity),e+"")}function baseSample(e){return arraySample(values(e))}function baseSampleSize(e,t){var r=values(e);return shuffleSelf(r,baseClamp(t,0,r.length))}function baseSet(e,t,r,n){if(!isObject(e))return e;for(var s=-1,o=(t=castPath(t,e)).length,a=o-1,u=e;null!=u&&++s<o;){var c=toKey(t[s]),l=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(s!=a){var d=u[c];(l=n?n(d,c,u):i)===i&&(l=isObject(d)?d:isIndex(t[s+1])?[]:{})}assignValue(u,c,l),u=u[c]}return e}var or=Ut?function(e,t){return Ut.set(e,t),e}:identity,ar=et?function(e,t){return et(e,"toString",{configurable:!0,enumerable:!1,value:constant(t),writable:!0})}:identity;function baseShuffle(e){return shuffleSelf(values(e))}function baseSlice(e,t,n){var i=-1,s=e.length;t<0&&(t=-t>s?0:s+t),(n=n>s?s:n)<0&&(n+=s),s=t>n?0:n-t>>>0,t>>>=0;for(var o=r(s);++i<s;)o[i]=e[i+t];return o}function baseSome(e,t){var r;return rr(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function baseSortedIndex(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var s=n+i>>>1,o=e[s];null!==o&&!isSymbol(o)&&(r?o<=t:o<t)?n=s+1:i=s}return i}return baseSortedIndexBy(e,t,identity,r)}function baseSortedIndexBy(e,t,r,n){var s=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=r(t))!=t,u=null===t,c=isSymbol(t),l=t===i;s<o;){var d=mt((s+o)/2),f=r(e[d]),h=f!==i,p=null===f,m=f==f,y=isSymbol(f);if(a)var b=n||m;else b=l?m&&(n||h):u?m&&h&&(n||!p):c?m&&h&&!p&&(n||!y):!p&&!y&&(n?f<=t:f<t);b?s=d+1:o=d}return kt(o,4294967294)}function baseSortedUniq(e,t){for(var r=-1,n=e.length,i=0,s=[];++r<n;){var o=e[r],a=t?t(o):o;if(!r||!eq(a,u)){var u=a;s[i++]=0===o?0:o}}return s}function baseToNumber(e){return"number"==typeof e?e:isSymbol(e)?m:+e}function baseToString(e){if("string"==typeof e)return e;if(sn(e))return arrayMap(e,baseToString)+"";if(isSymbol(e))return er?er.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function baseUniq(e,t,r){var n=-1,i=arrayIncludes,s=e.length,o=!0,a=[],u=a;if(r)o=!1,i=arrayIncludesWith;else if(s>=200){var c=t?null:lr(e);if(c)return setToArray(c);o=!1,i=cacheHas,u=new SetCache}else u=t?[]:a;e:for(;++n<s;){var l=e[n],d=t?t(l):l;if(l=r||0!==l?l:0,o&&d==d){for(var f=u.length;f--;)if(u[f]===d)continue e;t&&u.push(d),a.push(l)}else i(u,d,r)||(u!==a&&u.push(d),a.push(l))}return a}function baseUnset(e,t){return null==(e=parent(e,t=castPath(t,e)))||delete e[toKey(last(t))]}function baseUpdate(e,t,r,n){return baseSet(e,t,r(baseGet(e,t)),n)}function baseWhile(e,t,r,n){for(var i=e.length,s=n?i:-1;(n?s--:++s<i)&&t(e[s],s,e););return r?baseSlice(e,n?0:s,n?s+1:i):baseSlice(e,n?s+1:0,n?i:s)}function baseWrapperValue(e,t){var r=e;return r instanceof LazyWrapper&&(r=r.value()),arrayReduce(t,(function(e,t){return t.func.apply(t.thisArg,arrayPush([e],t.args))}),r)}function baseXor(e,t,n){var i=e.length;if(i<2)return i?baseUniq(e[0]):[];for(var s=-1,o=r(i);++s<i;)for(var a=e[s],u=-1;++u<i;)u!=s&&(o[s]=baseDifference(o[s]||a,e[u],t,n));return baseUniq(baseFlatten(o,1),t,n)}function baseZipObject(e,t,r){for(var n=-1,s=e.length,o=t.length,a={};++n<s;){var u=n<o?t[n]:i;r(a,e[n],u)}return a}function castArrayLikeObject(e){return isArrayLikeObject(e)?e:[]}function castFunction(e){return"function"==typeof e?e:identity}function castPath(e,t){return sn(e)?e:isKey(e,t)?[e]:vr(toString(e))}var ur=baseRest;function castSlice(e,t,r){var n=e.length;return r=r===i?n:r,!t&&r>=n?e:baseSlice(e,t,r)}var cr=nt||function(e){return yt.clearTimeout(e)};function cloneBuffer(e,t){if(t)return e.slice();var r=e.length,n=Ze?Ze(r):new e.constructor(r);return e.copy(n),n}function cloneArrayBuffer(e){var t=new e.constructor(e.byteLength);return new Ue(t).set(new Ue(e)),t}function cloneTypedArray(e,t){var r=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function compareAscending(e,t){if(e!==t){var r=e!==i,n=null===e,s=e==e,o=isSymbol(e),a=t!==i,u=null===t,c=t==t,l=isSymbol(t);if(!u&&!l&&!o&&e>t||o&&a&&c&&!u&&!l||n&&a&&c||!r&&c||!s)return 1;if(!n&&!o&&!l&&e<t||l&&r&&s&&!n&&!o||u&&r&&s||!a&&s||!c)return-1}return 0}function composeArgs(e,t,n,i){for(var s=-1,o=e.length,a=n.length,u=-1,c=t.length,l=xt(o-a,0),d=r(c+l),f=!i;++u<c;)d[u]=t[u];for(;++s<a;)(f||s<o)&&(d[n[s]]=e[s]);for(;l--;)d[u++]=e[s++];return d}function composeArgsRight(e,t,n,i){for(var s=-1,o=e.length,a=-1,u=n.length,c=-1,l=t.length,d=xt(o-u,0),f=r(d+l),h=!i;++s<d;)f[s]=e[s];for(var p=s;++c<l;)f[p+c]=t[c];for(;++a<u;)(h||s<o)&&(f[p+n[a]]=e[s++]);return f}function copyArray(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function copyObject(e,t,r,n){var s=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var u=t[o],c=n?n(r[u],e[u],u,r,e):i;c===i&&(c=e[u]),s?baseAssignValue(r,u,c):assignValue(r,u,c)}return r}function createAggregator(e,t){return function(r,n){var i=sn(r)?arrayAggregator:baseAggregator,s=t?t():{};return i(r,e,getIteratee(n,2),s)}}function createAssigner(e){return baseRest((function(t,r){var n=-1,s=r.length,o=s>1?r[s-1]:i,a=s>2?r[2]:i;for(o=e.length>3&&"function"==typeof o?(s--,o):i,a&&isIterateeCall(r[0],r[1],a)&&(o=s<3?i:o,s=1),t=Ce(t);++n<s;){var u=r[n];u&&e(t,u,n,o)}return t}))}function createBaseEach(e,t){return function(r,n){if(null==r)return r;if(!isArrayLike(r))return e(r,n);for(var i=r.length,s=t?i:-1,o=Ce(r);(t?s--:++s<i)&&!1!==n(o[s],s,o););return r}}function createBaseFor(e){return function(t,r,n){for(var i=-1,s=Ce(t),o=n(t),a=o.length;a--;){var u=o[e?a:++i];if(!1===r(s[u],u,s))break}return t}}function createCaseFirst(e){return function(t){var r=hasUnicode(t=toString(t))?stringToArray(t):i,n=r?r[0]:t.charAt(0),s=r?castSlice(r,1).join(""):t.slice(1);return n[e]()+s}}function createCompounder(e){return function(t){return arrayReduce(words(deburr(t).replace(tt,"")),e,"")}}function createCtor(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=tr(e.prototype),n=e.apply(r,t);return isObject(n)?n:r}}function createFind(e){return function(t,r,n){var s=Ce(t);if(!isArrayLike(t)){var o=getIteratee(r,3);t=keys(t),r=function(e){return o(s[e],e,s)}}var a=e(t,r,n);return a>-1?s[o?t[a]:a]:i}}function createFlow(e){return flatRest((function(t){var r=t.length,n=r,o=LodashWrapper.prototype.thru;for(e&&t.reverse();n--;){var a=t[n];if("function"!=typeof a)throw new Te(s);if(o&&!u&&"wrapper"==getFuncName(a))var u=new LodashWrapper([],!0)}for(n=u?n:r;++n<r;){var c=getFuncName(a=t[n]),l="wrapper"==c?dr(a):i;u=l&&isLaziable(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?u[getFuncName(l[0])].apply(u,l[3]):1==a.length&&isLaziable(a)?u[c]():u.thru(a)}return function(){var e=arguments,n=e[0];if(u&&1==e.length&&sn(n))return u.plant(n).value();for(var i=0,s=r?t[i].apply(this,e):n;++i<r;)s=t[i].call(this,s);return s}}))}function createHybrid(e,t,n,s,o,a,u,c,l,f){var h=t&d,p=1&t,m=2&t,y=24&t,b=512&t,g=m?i:createCtor(e);return function wrapper(){for(var d=arguments.length,v=r(d),w=d;w--;)v[w]=arguments[w];if(y)var I=getHolder(wrapper),A=function countHolders(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(v,I);if(s&&(v=composeArgs(v,s,o,y)),a&&(v=composeArgsRight(v,a,u,y)),d-=A,y&&d<f){var O=replaceHolders(v,I);return createRecurry(e,t,createHybrid,wrapper.placeholder,n,v,O,c,l,f-d)}var S=p?n:this,_=m?S[e]:e;return d=v.length,c?v=function reorder(e,t){var r=e.length,n=kt(t.length,r),s=copyArray(e);for(;n--;){var o=t[n];e[n]=isIndex(o,r)?s[o]:i}return e}(v,c):b&&d>1&&v.reverse(),h&&l<d&&(v.length=l),this&&this!==yt&&this instanceof wrapper&&(_=g||createCtor(_)),_.apply(S,v)}}function createInverter(e,t){return function(r,n){return function baseInverter(e,t,r,n){return baseForOwn(e,(function(e,i,s){t(n,r(e),i,s)})),n}(r,e,t(n),{})}}function createMathOperation(e,t){return function(r,n){var s;if(r===i&&n===i)return t;if(r!==i&&(s=r),n!==i){if(s===i)return n;"string"==typeof r||"string"==typeof n?(r=baseToString(r),n=baseToString(n)):(r=baseToNumber(r),n=baseToNumber(n)),s=e(r,n)}return s}}function createOver(e){return flatRest((function(t){return t=arrayMap(t,baseUnary(getIteratee())),baseRest((function(r){var n=this;return e(t,(function(e){return apply(e,n,r)}))}))}))}function createPadding(e,t){var r=(t=t===i?" ":baseToString(t)).length;if(r<2)return r?baseRepeat(t,e):t;var n=baseRepeat(t,pt(e/stringSize(t)));return hasUnicode(t)?castSlice(stringToArray(n),0,e).join(""):n.slice(0,e)}function createRange(e){return function(t,n,s){return s&&"number"!=typeof s&&isIterateeCall(t,n,s)&&(n=s=i),t=toFinite(t),n===i?(n=t,t=0):n=toFinite(n),function baseRange(e,t,n,i){for(var s=-1,o=xt(pt((t-e)/(n||1)),0),a=r(o);o--;)a[i?o:++s]=e,e+=n;return a}(t,n,s=s===i?t<n?1:-1:toFinite(s),e)}}function createRelationalOperation(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=toNumber(t),r=toNumber(r)),e(t,r)}}function createRecurry(e,t,r,n,s,o,a,u,d,f){var h=8&t;t|=h?c:l,4&(t&=~(h?l:c))||(t&=-4);var p=[e,t,s,h?o:i,h?a:i,h?i:o,h?i:a,u,d,f],m=r.apply(i,p);return isLaziable(e)&&yr(m,p),m.placeholder=n,setWrapToString(m,e,t)}function createRound(e){var t=Re[e];return function(e,r){if(e=toNumber(e),(r=null==r?0:kt(toInteger(r),292))&&wt(e)){var n=(toString(e)+"e").split("e");return+((n=(toString(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var lr=zt&&1/setToArray(new zt([,-0]))[1]==h?function(e){return new zt(e)}:noop;function createToPairs(e){return function(t){var r=pr(t);return r==_?mapToArray(t):r==L?setToPairs(t):function baseToPairs(e,t){return arrayMap(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function createWrap(e,t,n,o,h,p,m,y){var b=2&t;if(!b&&"function"!=typeof e)throw new Te(s);var g=o?o.length:0;if(g||(t&=-97,o=h=i),m=m===i?m:xt(toInteger(m),0),y=y===i?y:toInteger(y),g-=h?h.length:0,t&l){var v=o,w=h;o=h=i}var I=b?i:dr(e),A=[e,t,n,o,h,v,w,p,m,y];if(I&&function mergeData(e,t){var r=e[1],n=t[1],i=r|n,s=i<131,o=n==d&&8==r||n==d&&r==f&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!s&&!o)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var u=t[3];if(u){var c=e[3];e[3]=c?composeArgs(c,u,t[4]):u,e[4]=c?replaceHolders(e[3],a):t[4]}(u=t[5])&&(c=e[5],e[5]=c?composeArgsRight(c,u,t[6]):u,e[6]=c?replaceHolders(e[5],a):t[6]);(u=t[7])&&(e[7]=u);n&d&&(e[8]=null==e[8]?t[8]:kt(e[8],t[8]));null==e[9]&&(e[9]=t[9]);return e[0]=t[0],e[1]=i,e}(A,I),e=A[0],t=A[1],n=A[2],o=A[3],h=A[4],!(y=A[9]=A[9]===i?b?0:e.length:xt(A[9]-g,0))&&24&t&&(t&=-25),t&&1!=t)O=8==t||t==u?function createCurry(e,t,n){var s=createCtor(e);return function wrapper(){for(var o=arguments.length,a=r(o),u=o,c=getHolder(wrapper);u--;)a[u]=arguments[u];var l=o<3&&a[0]!==c&&a[o-1]!==c?[]:replaceHolders(a,c);return(o-=l.length)<n?createRecurry(e,t,createHybrid,wrapper.placeholder,i,a,l,i,i,n-o):apply(this&&this!==yt&&this instanceof wrapper?s:e,this,a)}}(e,t,y):t!=c&&33!=t||h.length?createHybrid.apply(i,A):function createPartial(e,t,n,i){var s=1&t,o=createCtor(e);return function wrapper(){for(var t=-1,a=arguments.length,u=-1,c=i.length,l=r(c+a),d=this&&this!==yt&&this instanceof wrapper?o:e;++u<c;)l[u]=i[u];for(;a--;)l[u++]=arguments[++t];return apply(d,s?n:this,l)}}(e,t,n,o);else var O=function createBind(e,t,r){var n=1&t,i=createCtor(e);return function wrapper(){return(this&&this!==yt&&this instanceof wrapper?i:e).apply(n?r:this,arguments)}}(e,t,n);return setWrapToString((I?or:yr)(O,A),e,t)}function customDefaultsAssignIn(e,t,r,n){return e===i||eq(e,xe[r])&&!qe.call(n,r)?t:e}function customDefaultsMerge(e,t,r,n,s,o){return isObject(e)&&isObject(t)&&(o.set(t,e),baseMerge(e,t,i,customDefaultsMerge,o),o.delete(t)),e}function customOmitClone(e){return isPlainObject(e)?i:e}function equalArrays(e,t,r,n,s,o){var a=1&r,u=e.length,c=t.length;if(u!=c&&!(a&&c>u))return!1;var l=o.get(e),d=o.get(t);if(l&&d)return l==t&&d==e;var f=-1,h=!0,p=2&r?new SetCache:i;for(o.set(e,t),o.set(t,e);++f<u;){var m=e[f],y=t[f];if(n)var b=a?n(y,m,f,t,e,o):n(m,y,f,e,t,o);if(b!==i){if(b)continue;h=!1;break}if(p){if(!arraySome(t,(function(e,t){if(!cacheHas(p,t)&&(m===e||s(m,e,r,n,o)))return p.push(t)}))){h=!1;break}}else if(m!==y&&!s(m,y,r,n,o)){h=!1;break}}return o.delete(e),o.delete(t),h}function flatRest(e){return gr(overRest(e,i,flatten),e+"")}function getAllKeys(e){return baseGetAllKeys(e,keys,fr)}function getAllKeysIn(e){return baseGetAllKeys(e,keysIn,hr)}var dr=Ut?function(e){return Ut.get(e)}:noop;function getFuncName(e){for(var t=e.name+"",r=Zt[t],n=qe.call(Zt,t)?r.length:0;n--;){var i=r[n],s=i.func;if(null==s||s==e)return i.name}return t}function getHolder(e){return(qe.call(lodash,"placeholder")?lodash:e).placeholder}function getIteratee(){var e=lodash.iteratee||iteratee;return e=e===iteratee?baseIteratee:e,arguments.length?e(arguments[0],arguments[1]):e}function getMapData(e,t){var r=e.__data__;return function isKeyable(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?r["string"==typeof t?"string":"hash"]:r.map}function getMatchData(e){for(var t=keys(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,isStrictComparable(i)]}return t}function getNative(e,t){var r=function getValue(e,t){return null==e?i:e[t]}(e,t);return baseIsNative(r)?r:i}var fr=bt?function(e){return null==e?[]:(e=Ce(e),arrayFilter(bt(e),(function(t){return Ke.call(e,t)})))}:stubArray,hr=bt?function(e){for(var t=[];e;)arrayPush(t,fr(e)),e=Ge(e);return t}:stubArray,pr=baseGetTag;function hasPath(e,t,r){for(var n=-1,i=(t=castPath(t,e)).length,s=!1;++n<i;){var o=toKey(t[n]);if(!(s=null!=e&&r(e,o)))break;e=e[o]}return s||++n!=i?s:!!(i=null==e?0:e.length)&&isLength(i)&&isIndex(o,i)&&(sn(e)||nn(e))}function initCloneObject(e){return"function"!=typeof e.constructor||isPrototype(e)?{}:tr(Ge(e))}function isFlattenable(e){return sn(e)||nn(e)||!!(Je&&e&&e[Je])}function isIndex(e,t){var r=typeof e;return!!(t=null==t?p:t)&&("number"==r||"symbol"!=r&&Ie.test(e))&&e>-1&&e%1==0&&e<t}function isIterateeCall(e,t,r){if(!isObject(r))return!1;var n=typeof t;return!!("number"==n?isArrayLike(r)&&isIndex(t,r.length):"string"==n&&t in r)&&eq(r[t],e)}function isKey(e,t){if(sn(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol(e))||(ne.test(e)||!re.test(e)||null!=t&&e in Ce(t))}function isLaziable(e){var t=getFuncName(e),r=lodash[t];if("function"!=typeof r||!(t in LazyWrapper.prototype))return!1;if(e===r)return!0;var n=dr(r);return!!n&&e===n[0]}(Ft&&pr(new Ft(new ArrayBuffer(1)))!=q||$t&&pr(new $t)!=_||Vt&&pr(Vt.resolve())!=E||zt&&pr(new zt)!=L||Bt&&pr(new Bt)!=k)&&(pr=function(e){var t=baseGetTag(e),r=t==P?e.constructor:i,n=r?toSource(r):"";if(n)switch(n){case Gt:return q;case Ht:return _;case Kt:return E;case Yt:return L;case Jt:return k}return t});var mr=ke?isFunction:stubFalse;function isPrototype(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||xe)}function isStrictComparable(e){return e==e&&!isObject(e)}function matchesStrictComparable(e,t){return function(r){return null!=r&&(r[e]===t&&(t!==i||e in Ce(r)))}}function overRest(e,t,n){return t=xt(t===i?e.length-1:t,0),function(){for(var i=arguments,s=-1,o=xt(i.length-t,0),a=r(o);++s<o;)a[s]=i[t+s];s=-1;for(var u=r(t+1);++s<t;)u[s]=i[s];return u[t]=n(a),apply(e,this,u)}}function parent(e,t){return t.length<2?e:baseGet(e,baseSlice(t,0,-1))}function safeGet(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var yr=shortOut(or),br=dt||function(e,t){return yt.setTimeout(e,t)},gr=shortOut(ar);function setWrapToString(e,t,r){var n=t+"";return gr(e,function insertWrapDetails(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(ce,"{\n/* [wrapped with "+t+"] */\n")}(n,function updateWrapDetails(e,t){return arrayEach(b,(function(r){var n="_."+r[0];t&r[1]&&!arrayIncludes(e,n)&&e.push(n)})),e.sort()}(function getWrapDetails(e){var t=e.match(le);return t?t[1].split(de):[]}(n),r)))}function shortOut(e){var t=0,r=0;return function(){var n=jt(),s=16-(n-r);if(r=n,s>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function shuffleSelf(e,t){var r=-1,n=e.length,s=n-1;for(t=t===i?n:t;++r<t;){var o=baseRandom(r,s),a=e[o];e[o]=e[r],e[r]=a}return e.length=t,e}var vr=function memoizeCapped(e){var t=memoize(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ie,(function(e,r,n,i){t.push(n?i.replace(pe,"$1"):r||e)})),t}));function toKey(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function toSource(e){if(null!=e){try{return je.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function wrapperClone(e){if(e instanceof LazyWrapper)return e.clone();var t=new LodashWrapper(e.__wrapped__,e.__chain__);return t.__actions__=copyArray(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var wr=baseRest((function(e,t){return isArrayLikeObject(e)?baseDifference(e,baseFlatten(t,1,isArrayLikeObject,!0)):[]})),Ir=baseRest((function(e,t){var r=last(t);return isArrayLikeObject(r)&&(r=i),isArrayLikeObject(e)?baseDifference(e,baseFlatten(t,1,isArrayLikeObject,!0),getIteratee(r,2)):[]})),Ar=baseRest((function(e,t){var r=last(t);return isArrayLikeObject(r)&&(r=i),isArrayLikeObject(e)?baseDifference(e,baseFlatten(t,1,isArrayLikeObject,!0),i,r):[]}));function findIndex(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:toInteger(r);return i<0&&(i=xt(n+i,0)),baseFindIndex(e,getIteratee(t,3),i)}function findLastIndex(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var s=n-1;return r!==i&&(s=toInteger(r),s=r<0?xt(n+s,0):kt(s,n-1)),baseFindIndex(e,getIteratee(t,3),s,!0)}function flatten(e){return(null==e?0:e.length)?baseFlatten(e,1):[]}function head(e){return e&&e.length?e[0]:i}var Or=baseRest((function(e){var t=arrayMap(e,castArrayLikeObject);return t.length&&t[0]===e[0]?baseIntersection(t):[]})),Sr=baseRest((function(e){var t=last(e),r=arrayMap(e,castArrayLikeObject);return t===last(r)?t=i:r.pop(),r.length&&r[0]===e[0]?baseIntersection(r,getIteratee(t,2)):[]})),_r=baseRest((function(e){var t=last(e),r=arrayMap(e,castArrayLikeObject);return(t="function"==typeof t?t:i)&&r.pop(),r.length&&r[0]===e[0]?baseIntersection(r,i,t):[]}));function last(e){var t=null==e?0:e.length;return t?e[t-1]:i}var Rr=baseRest(pullAll);function pullAll(e,t){return e&&e.length&&t&&t.length?basePullAll(e,t):e}var Cr=flatRest((function(e,t){var r=null==e?0:e.length,n=baseAt(e,t);return basePullAt(e,arrayMap(t,(function(e){return isIndex(e,r)?+e:e})).sort(compareAscending)),n}));function reverse(e){return null==e?e:Nt.call(e)}var Pr=baseRest((function(e){return baseUniq(baseFlatten(e,1,isArrayLikeObject,!0))})),Er=baseRest((function(e){var t=last(e);return isArrayLikeObject(t)&&(t=i),baseUniq(baseFlatten(e,1,isArrayLikeObject,!0),getIteratee(t,2))})),Tr=baseRest((function(e){var t=last(e);return t="function"==typeof t?t:i,baseUniq(baseFlatten(e,1,isArrayLikeObject,!0),i,t)}));function unzip(e){if(!e||!e.length)return[];var t=0;return e=arrayFilter(e,(function(e){if(isArrayLikeObject(e))return t=xt(e.length,t),!0})),baseTimes(t,(function(t){return arrayMap(e,baseProperty(t))}))}function unzipWith(e,t){if(!e||!e.length)return[];var r=unzip(e);return null==t?r:arrayMap(r,(function(e){return apply(t,i,e)}))}var Lr=baseRest((function(e,t){return isArrayLikeObject(e)?baseDifference(e,t):[]})),Dr=baseRest((function(e){return baseXor(arrayFilter(e,isArrayLikeObject))})),xr=baseRest((function(e){var t=last(e);return isArrayLikeObject(t)&&(t=i),baseXor(arrayFilter(e,isArrayLikeObject),getIteratee(t,2))})),kr=baseRest((function(e){var t=last(e);return t="function"==typeof t?t:i,baseXor(arrayFilter(e,isArrayLikeObject),i,t)})),jr=baseRest(unzip);var qr=baseRest((function(e){var t=e.length,r=t>1?e[t-1]:i;return r="function"==typeof r?(e.pop(),r):i,unzipWith(e,r)}));function chain(e){var t=lodash(e);return t.__chain__=!0,t}function thru(e,t){return t(e)}var Mr=flatRest((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,interceptor=function(t){return baseAt(t,e)};return!(t>1||this.__actions__.length)&&n instanceof LazyWrapper&&isIndex(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:thru,args:[interceptor],thisArg:i}),new LodashWrapper(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(interceptor)}));var Nr=createAggregator((function(e,t,r){qe.call(e,r)?++e[r]:baseAssignValue(e,r,1)}));var Fr=createFind(findIndex),$r=createFind(findLastIndex);function forEach(e,t){return(sn(e)?arrayEach:rr)(e,getIteratee(t,3))}function forEachRight(e,t){return(sn(e)?arrayEachRight:nr)(e,getIteratee(t,3))}var Vr=createAggregator((function(e,t,r){qe.call(e,r)?e[r].push(t):baseAssignValue(e,r,[t])}));var zr=baseRest((function(e,t,n){var i=-1,s="function"==typeof t,o=isArrayLike(e)?r(e.length):[];return rr(e,(function(e){o[++i]=s?apply(t,e,n):baseInvoke(e,t,n)})),o})),Br=createAggregator((function(e,t,r){baseAssignValue(e,r,t)}));function map(e,t){return(sn(e)?arrayMap:baseMap)(e,getIteratee(t,3))}var Wr=createAggregator((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var Ur=baseRest((function(e,t){if(null==e)return[];var r=t.length;return r>1&&isIterateeCall(e,t[0],t[1])?t=[]:r>2&&isIterateeCall(t[0],t[1],t[2])&&(t=[t[0]]),baseOrderBy(e,baseFlatten(t,1),[])})),Zr=st||function(){return yt.Date.now()};function ary(e,t,r){return t=r?i:t,t=e&&null==t?e.length:t,createWrap(e,d,i,i,i,i,t)}function before(e,t){var r;if("function"!=typeof t)throw new Te(s);return e=toInteger(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=i),r}}var Gr=baseRest((function(e,t,r){var n=1;if(r.length){var i=replaceHolders(r,getHolder(Gr));n|=c}return createWrap(e,n,t,r,i)})),Hr=baseRest((function(e,t,r){var n=3;if(r.length){var i=replaceHolders(r,getHolder(Hr));n|=c}return createWrap(t,n,e,r,i)}));function debounce(e,t,r){var n,o,a,u,c,l,d=0,f=!1,h=!1,p=!0;if("function"!=typeof e)throw new Te(s);function invokeFunc(t){var r=n,s=o;return n=o=i,d=t,u=e.apply(s,r)}function shouldInvoke(e){var r=e-l;return l===i||r>=t||r<0||h&&e-d>=a}function timerExpired(){var e=Zr();if(shouldInvoke(e))return trailingEdge(e);c=br(timerExpired,function remainingWait(e){var r=t-(e-l);return h?kt(r,a-(e-d)):r}(e))}function trailingEdge(e){return c=i,p&&n?invokeFunc(e):(n=o=i,u)}function debounced(){var e=Zr(),r=shouldInvoke(e);if(n=arguments,o=this,l=e,r){if(c===i)return function leadingEdge(e){return d=e,c=br(timerExpired,t),f?invokeFunc(e):u}(l);if(h)return cr(c),c=br(timerExpired,t),invokeFunc(l)}return c===i&&(c=br(timerExpired,t)),u}return t=toNumber(t)||0,isObject(r)&&(f=!!r.leading,a=(h="maxWait"in r)?xt(toNumber(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p),debounced.cancel=function cancel(){c!==i&&cr(c),d=0,n=l=o=c=i},debounced.flush=function flush(){return c===i?u:trailingEdge(Zr())},debounced}var Kr=baseRest((function(e,t){return baseDelay(e,1,t)})),Yr=baseRest((function(e,t,r){return baseDelay(e,toNumber(t)||0,r)}));function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Te(s);var memoized=function(){var r=arguments,n=t?t.apply(this,r):r[0],i=memoized.cache;if(i.has(n))return i.get(n);var s=e.apply(this,r);return memoized.cache=i.set(n,s)||i,s};return memoized.cache=new(memoize.Cache||MapCache),memoized}function negate(e){if("function"!=typeof e)throw new Te(s);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}memoize.Cache=MapCache;var Jr=ur((function(e,t){var r=(t=1==t.length&&sn(t[0])?arrayMap(t[0],baseUnary(getIteratee())):arrayMap(baseFlatten(t,1),baseUnary(getIteratee()))).length;return baseRest((function(n){for(var i=-1,s=kt(n.length,r);++i<s;)n[i]=t[i].call(this,n[i]);return apply(e,this,n)}))})),Qr=baseRest((function(e,t){var r=replaceHolders(t,getHolder(Qr));return createWrap(e,c,i,t,r)})),Xr=baseRest((function(e,t){var r=replaceHolders(t,getHolder(Xr));return createWrap(e,l,i,t,r)})),en=flatRest((function(e,t){return createWrap(e,f,i,i,i,t)}));function eq(e,t){return e===t||e!=e&&t!=t}var tn=createRelationalOperation(baseGt),rn=createRelationalOperation((function(e,t){return e>=t})),nn=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&&qe.call(e,"callee")&&!Ke.call(e,"callee")},sn=r.isArray,on=At?baseUnary(At):function baseIsArrayBuffer(e){return isObjectLike(e)&&baseGetTag(e)==j};function isArrayLike(e){return null!=e&&isLength(e.length)&&!isFunction(e)}function isArrayLikeObject(e){return isObjectLike(e)&&isArrayLike(e)}var an=gt||stubFalse,un=Ot?baseUnary(Ot):function baseIsDate(e){return isObjectLike(e)&&baseGetTag(e)==I};function isError(e){if(!isObjectLike(e))return!1;var t=baseGetTag(e);return t==A||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!isPlainObject(e)}function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==O||t==S||"[object AsyncFunction]"==t||"[object Proxy]"==t}function isInteger(e){return"number"==typeof e&&e==toInteger(e)}function isLength(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=p}function isObject(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function isObjectLike(e){return null!=e&&"object"==typeof e}var cn=St?baseUnary(St):function baseIsMap(e){return isObjectLike(e)&&pr(e)==_};function isNumber(e){return"number"==typeof e||isObjectLike(e)&&baseGetTag(e)==R}function isPlainObject(e){if(!isObjectLike(e)||baseGetTag(e)!=P)return!1;var t=Ge(e);if(null===t)return!0;var r=qe.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&je.call(r)==$e}var ln=_t?baseUnary(_t):function baseIsRegExp(e){return isObjectLike(e)&&baseGetTag(e)==T};var dn=Rt?baseUnary(Rt):function baseIsSet(e){return isObjectLike(e)&&pr(e)==L};function isString(e){return"string"==typeof e||!sn(e)&&isObjectLike(e)&&baseGetTag(e)==D}function isSymbol(e){return"symbol"==typeof e||isObjectLike(e)&&baseGetTag(e)==x}var fn=Ct?baseUnary(Ct):function baseIsTypedArray(e){return isObjectLike(e)&&isLength(e.length)&&!!ct[baseGetTag(e)]};var hn=createRelationalOperation(baseLt),pn=createRelationalOperation((function(e,t){return e<=t}));function toArray(e){if(!e)return[];if(isArrayLike(e))return isString(e)?stringToArray(e):copyArray(e);if(Qe&&e[Qe])return function iteratorToArray(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Qe]());var t=pr(e);return(t==_?mapToArray:t==L?setToArray:values)(e)}function toFinite(e){return e?(e=toNumber(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function toInteger(e){var t=toFinite(e),r=t%1;return t==t?r?t-r:t:0}function toLength(e){return e?baseClamp(toInteger(e),0,y):0}function toNumber(e){if("number"==typeof e)return e;if(isSymbol(e))return m;if(isObject(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=isObject(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=baseTrim(e);var r=ge.test(e);return r||we.test(e)?ht(e.slice(2),r?2:8):be.test(e)?m:+e}function toPlainObject(e){return copyObject(e,keysIn(e))}function toString(e){return null==e?"":baseToString(e)}var mn=createAssigner((function(e,t){if(isPrototype(t)||isArrayLike(t))copyObject(t,keys(t),e);else for(var r in t)qe.call(t,r)&&assignValue(e,r,t[r])})),yn=createAssigner((function(e,t){copyObject(t,keysIn(t),e)})),bn=createAssigner((function(e,t,r,n){copyObject(t,keysIn(t),e,n)})),gn=createAssigner((function(e,t,r,n){copyObject(t,keys(t),e,n)})),vn=flatRest(baseAt);var wn=baseRest((function(e,t){e=Ce(e);var r=-1,n=t.length,s=n>2?t[2]:i;for(s&&isIterateeCall(t[0],t[1],s)&&(n=1);++r<n;)for(var o=t[r],a=keysIn(o),u=-1,c=a.length;++u<c;){var l=a[u],d=e[l];(d===i||eq(d,xe[l])&&!qe.call(e,l))&&(e[l]=o[l])}return e})),In=baseRest((function(e){return e.push(i,customDefaultsMerge),apply(Rn,i,e)}));function get(e,t,r){var n=null==e?i:baseGet(e,t);return n===i?r:n}function hasIn(e,t){return null!=e&&hasPath(e,t,baseHasIn)}var An=createInverter((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Fe.call(t)),e[t]=r}),constant(identity)),On=createInverter((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Fe.call(t)),qe.call(e,t)?e[t].push(r):e[t]=[r]}),getIteratee),Sn=baseRest(baseInvoke);function keys(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}function keysIn(e){return isArrayLike(e)?arrayLikeKeys(e,!0):baseKeysIn(e)}var _n=createAssigner((function(e,t,r){baseMerge(e,t,r)})),Rn=createAssigner((function(e,t,r,n){baseMerge(e,t,r,n)})),Cn=flatRest((function(e,t){var r={};if(null==e)return r;var n=!1;t=arrayMap(t,(function(t){return t=castPath(t,e),n||(n=t.length>1),t})),copyObject(e,getAllKeysIn(e),r),n&&(r=baseClone(r,7,customOmitClone));for(var i=t.length;i--;)baseUnset(r,t[i]);return r}));var Pn=flatRest((function(e,t){return null==e?{}:function basePick(e,t){return basePickBy(e,t,(function(t,r){return hasIn(e,r)}))}(e,t)}));function pickBy(e,t){if(null==e)return{};var r=arrayMap(getAllKeysIn(e),(function(e){return[e]}));return t=getIteratee(t),basePickBy(e,r,(function(e,r){return t(e,r[0])}))}var En=createToPairs(keys),Tn=createToPairs(keysIn);function values(e){return null==e?[]:baseValues(e,keys(e))}var Ln=createCompounder((function(e,t,r){return t=t.toLowerCase(),e+(r?capitalize(t):t)}));function capitalize(e){return Nn(toString(e).toLowerCase())}function deburr(e){return(e=toString(e))&&e.replace(Ae,Et).replace(rt,"")}var Dn=createCompounder((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),xn=createCompounder((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),kn=createCaseFirst("toLowerCase");var jn=createCompounder((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var qn=createCompounder((function(e,t,r){return e+(r?" ":"")+Nn(t)}));var Mn=createCompounder((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Nn=createCaseFirst("toUpperCase");function words(e,t,r){return e=toString(e),(t=r?i:t)===i?function hasUnicodeWord(e){return ot.test(e)}(e)?function unicodeWords(e){return e.match(it)||[]}(e):function asciiWords(e){return e.match(fe)||[]}(e):e.match(t)||[]}var Fn=baseRest((function(e,t){try{return apply(e,i,t)}catch(e){return isError(e)?e:new ue(e)}})),$n=flatRest((function(e,t){return arrayEach(t,(function(t){t=toKey(t),baseAssignValue(e,t,Gr(e[t],e))})),e}));function constant(e){return function(){return e}}var Vn=createFlow(),zn=createFlow(!0);function identity(e){return e}function iteratee(e){return baseIteratee("function"==typeof e?e:baseClone(e,1))}var Bn=baseRest((function(e,t){return function(r){return baseInvoke(r,e,t)}})),Wn=baseRest((function(e,t){return function(r){return baseInvoke(e,r,t)}}));function mixin(e,t,r){var n=keys(t),i=baseFunctions(t,n);null!=r||isObject(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=baseFunctions(t,keys(t)));var s=!(isObject(r)&&"chain"in r&&!r.chain),o=isFunction(e);return arrayEach(i,(function(r){var n=t[r];e[r]=n,o&&(e.prototype[r]=function(){var t=this.__chain__;if(s||t){var r=e(this.__wrapped__);return(r.__actions__=copyArray(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,arrayPush([this.value()],arguments))})})),e}function noop(){}var Un=createOver(arrayMap),Zn=createOver(arrayEvery),Gn=createOver(arraySome);function property(e){return isKey(e)?baseProperty(toKey(e)):function basePropertyDeep(e){return function(t){return baseGet(t,e)}}(e)}var Hn=createRange(),Kn=createRange(!0);function stubArray(){return[]}function stubFalse(){return!1}var Yn=createMathOperation((function(e,t){return e+t}),0),Jn=createRound("ceil"),Qn=createMathOperation((function(e,t){return e/t}),1),Xn=createRound("floor");var ei,ti=createMathOperation((function(e,t){return e*t}),1),ri=createRound("round"),ni=createMathOperation((function(e,t){return e-t}),0);return lodash.after=function after(e,t){if("function"!=typeof t)throw new Te(s);return e=toInteger(e),function(){if(--e<1)return t.apply(this,arguments)}},lodash.ary=ary,lodash.assign=mn,lodash.assignIn=yn,lodash.assignInWith=bn,lodash.assignWith=gn,lodash.at=vn,lodash.before=before,lodash.bind=Gr,lodash.bindAll=$n,lodash.bindKey=Hr,lodash.castArray=function castArray(){if(!arguments.length)return[];var e=arguments[0];return sn(e)?e:[e]},lodash.chain=chain,lodash.chunk=function chunk(e,t,n){t=(n?isIterateeCall(e,t,n):t===i)?1:xt(toInteger(t),0);var s=null==e?0:e.length;if(!s||t<1)return[];for(var o=0,a=0,u=r(pt(s/t));o<s;)u[a++]=baseSlice(e,o,o+=t);return u},lodash.compact=function compact(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var s=e[t];s&&(i[n++]=s)}return i},lodash.concat=function concat(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return arrayPush(sn(n)?copyArray(n):[n],baseFlatten(t,1))},lodash.cond=function cond(e){var t=null==e?0:e.length,r=getIteratee();return e=t?arrayMap(e,(function(e){if("function"!=typeof e[1])throw new Te(s);return[r(e[0]),e[1]]})):[],baseRest((function(r){for(var n=-1;++n<t;){var i=e[n];if(apply(i[0],this,r))return apply(i[1],this,r)}}))},lodash.conforms=function conforms(e){return function baseConforms(e){var t=keys(e);return function(r){return baseConformsTo(r,e,t)}}(baseClone(e,1))},lodash.constant=constant,lodash.countBy=Nr,lodash.create=function create(e,t){var r=tr(e);return null==t?r:baseAssign(r,t)},lodash.curry=function curry(e,t,r){var n=createWrap(e,8,i,i,i,i,i,t=r?i:t);return n.placeholder=curry.placeholder,n},lodash.curryRight=function curryRight(e,t,r){var n=createWrap(e,u,i,i,i,i,i,t=r?i:t);return n.placeholder=curryRight.placeholder,n},lodash.debounce=debounce,lodash.defaults=wn,lodash.defaultsDeep=In,lodash.defer=Kr,lodash.delay=Yr,lodash.difference=wr,lodash.differenceBy=Ir,lodash.differenceWith=Ar,lodash.drop=function drop(e,t,r){var n=null==e?0:e.length;return n?baseSlice(e,(t=r||t===i?1:toInteger(t))<0?0:t,n):[]},lodash.dropRight=function dropRight(e,t,r){var n=null==e?0:e.length;return n?baseSlice(e,0,(t=n-(t=r||t===i?1:toInteger(t)))<0?0:t):[]},lodash.dropRightWhile=function dropRightWhile(e,t){return e&&e.length?baseWhile(e,getIteratee(t,3),!0,!0):[]},lodash.dropWhile=function dropWhile(e,t){return e&&e.length?baseWhile(e,getIteratee(t,3),!0):[]},lodash.fill=function fill(e,t,r,n){var s=null==e?0:e.length;return s?(r&&"number"!=typeof r&&isIterateeCall(e,t,r)&&(r=0,n=s),function baseFill(e,t,r,n){var s=e.length;for((r=toInteger(r))<0&&(r=-r>s?0:s+r),(n=n===i||n>s?s:toInteger(n))<0&&(n+=s),n=r>n?0:toLength(n);r<n;)e[r++]=t;return e}(e,t,r,n)):[]},lodash.filter=function filter(e,t){return(sn(e)?arrayFilter:baseFilter)(e,getIteratee(t,3))},lodash.flatMap=function flatMap(e,t){return baseFlatten(map(e,t),1)},lodash.flatMapDeep=function flatMapDeep(e,t){return baseFlatten(map(e,t),h)},lodash.flatMapDepth=function flatMapDepth(e,t,r){return r=r===i?1:toInteger(r),baseFlatten(map(e,t),r)},lodash.flatten=flatten,lodash.flattenDeep=function flattenDeep(e){return(null==e?0:e.length)?baseFlatten(e,h):[]},lodash.flattenDepth=function flattenDepth(e,t){return(null==e?0:e.length)?baseFlatten(e,t=t===i?1:toInteger(t)):[]},lodash.flip=function flip(e){return createWrap(e,512)},lodash.flow=Vn,lodash.flowRight=zn,lodash.fromPairs=function fromPairs(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},lodash.functions=function functions(e){return null==e?[]:baseFunctions(e,keys(e))},lodash.functionsIn=function functionsIn(e){return null==e?[]:baseFunctions(e,keysIn(e))},lodash.groupBy=Vr,lodash.initial=function initial(e){return(null==e?0:e.length)?baseSlice(e,0,-1):[]},lodash.intersection=Or,lodash.intersectionBy=Sr,lodash.intersectionWith=_r,lodash.invert=An,lodash.invertBy=On,lodash.invokeMap=zr,lodash.iteratee=iteratee,lodash.keyBy=Br,lodash.keys=keys,lodash.keysIn=keysIn,lodash.map=map,lodash.mapKeys=function mapKeys(e,t){var r={};return t=getIteratee(t,3),baseForOwn(e,(function(e,n,i){baseAssignValue(r,t(e,n,i),e)})),r},lodash.mapValues=function mapValues(e,t){var r={};return t=getIteratee(t,3),baseForOwn(e,(function(e,n,i){baseAssignValue(r,n,t(e,n,i))})),r},lodash.matches=function matches(e){return baseMatches(baseClone(e,1))},lodash.matchesProperty=function matchesProperty(e,t){return baseMatchesProperty(e,baseClone(t,1))},lodash.memoize=memoize,lodash.merge=_n,lodash.mergeWith=Rn,lodash.method=Bn,lodash.methodOf=Wn,lodash.mixin=mixin,lodash.negate=negate,lodash.nthArg=function nthArg(e){return e=toInteger(e),baseRest((function(t){return baseNth(t,e)}))},lodash.omit=Cn,lodash.omitBy=function omitBy(e,t){return pickBy(e,negate(getIteratee(t)))},lodash.once=function once(e){return before(2,e)},lodash.orderBy=function orderBy(e,t,r,n){return null==e?[]:(sn(t)||(t=null==t?[]:[t]),sn(r=n?i:r)||(r=null==r?[]:[r]),baseOrderBy(e,t,r))},lodash.over=Un,lodash.overArgs=Jr,lodash.overEvery=Zn,lodash.overSome=Gn,lodash.partial=Qr,lodash.partialRight=Xr,lodash.partition=Wr,lodash.pick=Pn,lodash.pickBy=pickBy,lodash.property=property,lodash.propertyOf=function propertyOf(e){return function(t){return null==e?i:baseGet(e,t)}},lodash.pull=Rr,lodash.pullAll=pullAll,lodash.pullAllBy=function pullAllBy(e,t,r){return e&&e.length&&t&&t.length?basePullAll(e,t,getIteratee(r,2)):e},lodash.pullAllWith=function pullAllWith(e,t,r){return e&&e.length&&t&&t.length?basePullAll(e,t,i,r):e},lodash.pullAt=Cr,lodash.range=Hn,lodash.rangeRight=Kn,lodash.rearg=en,lodash.reject=function reject(e,t){return(sn(e)?arrayFilter:baseFilter)(e,negate(getIteratee(t,3)))},lodash.remove=function remove(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],s=e.length;for(t=getIteratee(t,3);++n<s;){var o=e[n];t(o,n,e)&&(r.push(o),i.push(n))}return basePullAt(e,i),r},lodash.rest=function rest(e,t){if("function"!=typeof e)throw new Te(s);return baseRest(e,t=t===i?t:toInteger(t))},lodash.reverse=reverse,lodash.sampleSize=function sampleSize(e,t,r){return t=(r?isIterateeCall(e,t,r):t===i)?1:toInteger(t),(sn(e)?arraySampleSize:baseSampleSize)(e,t)},lodash.set=function set(e,t,r){return null==e?e:baseSet(e,t,r)},lodash.setWith=function setWith(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:baseSet(e,t,r,n)},lodash.shuffle=function shuffle(e){return(sn(e)?arrayShuffle:baseShuffle)(e)},lodash.slice=function slice(e,t,r){var n=null==e?0:e.length;return n?(r&&"number"!=typeof r&&isIterateeCall(e,t,r)?(t=0,r=n):(t=null==t?0:toInteger(t),r=r===i?n:toInteger(r)),baseSlice(e,t,r)):[]},lodash.sortBy=Ur,lodash.sortedUniq=function sortedUniq(e){return e&&e.length?baseSortedUniq(e):[]},lodash.sortedUniqBy=function sortedUniqBy(e,t){return e&&e.length?baseSortedUniq(e,getIteratee(t,2)):[]},lodash.split=function split(e,t,r){return r&&"number"!=typeof r&&isIterateeCall(e,t,r)&&(t=r=i),(r=r===i?y:r>>>0)?(e=toString(e))&&("string"==typeof t||null!=t&&!ln(t))&&!(t=baseToString(t))&&hasUnicode(e)?castSlice(stringToArray(e),0,r):e.split(t,r):[]},lodash.spread=function spread(e,t){if("function"!=typeof e)throw new Te(s);return t=null==t?0:xt(toInteger(t),0),baseRest((function(r){var n=r[t],i=castSlice(r,0,t);return n&&arrayPush(i,n),apply(e,this,i)}))},lodash.tail=function tail(e){var t=null==e?0:e.length;return t?baseSlice(e,1,t):[]},lodash.take=function take(e,t,r){return e&&e.length?baseSlice(e,0,(t=r||t===i?1:toInteger(t))<0?0:t):[]},lodash.takeRight=function takeRight(e,t,r){var n=null==e?0:e.length;return n?baseSlice(e,(t=n-(t=r||t===i?1:toInteger(t)))<0?0:t,n):[]},lodash.takeRightWhile=function takeRightWhile(e,t){return e&&e.length?baseWhile(e,getIteratee(t,3),!1,!0):[]},lodash.takeWhile=function takeWhile(e,t){return e&&e.length?baseWhile(e,getIteratee(t,3)):[]},lodash.tap=function tap(e,t){return t(e),e},lodash.throttle=function throttle(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new Te(s);return isObject(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),debounce(e,t,{leading:n,maxWait:t,trailing:i})},lodash.thru=thru,lodash.toArray=toArray,lodash.toPairs=En,lodash.toPairsIn=Tn,lodash.toPath=function toPath(e){return sn(e)?arrayMap(e,toKey):isSymbol(e)?[e]:copyArray(vr(toString(e)))},lodash.toPlainObject=toPlainObject,lodash.transform=function transform(e,t,r){var n=sn(e),i=n||an(e)||fn(e);if(t=getIteratee(t,4),null==r){var s=e&&e.constructor;r=i?n?new s:[]:isObject(e)&&isFunction(s)?tr(Ge(e)):{}}return(i?arrayEach:baseForOwn)(e,(function(e,n,i){return t(r,e,n,i)})),r},lodash.unary=function unary(e){return ary(e,1)},lodash.union=Pr,lodash.unionBy=Er,lodash.unionWith=Tr,lodash.uniq=function uniq(e){return e&&e.length?baseUniq(e):[]},lodash.uniqBy=function uniqBy(e,t){return e&&e.length?baseUniq(e,getIteratee(t,2)):[]},lodash.uniqWith=function uniqWith(e,t){return t="function"==typeof t?t:i,e&&e.length?baseUniq(e,i,t):[]},lodash.unset=function unset(e,t){return null==e||baseUnset(e,t)},lodash.unzip=unzip,lodash.unzipWith=unzipWith,lodash.update=function update(e,t,r){return null==e?e:baseUpdate(e,t,castFunction(r))},lodash.updateWith=function updateWith(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:baseUpdate(e,t,castFunction(r),n)},lodash.values=values,lodash.valuesIn=function valuesIn(e){return null==e?[]:baseValues(e,keysIn(e))},lodash.without=Lr,lodash.words=words,lodash.wrap=function wrap(e,t){return Qr(castFunction(t),e)},lodash.xor=Dr,lodash.xorBy=xr,lodash.xorWith=kr,lodash.zip=jr,lodash.zipObject=function zipObject(e,t){return baseZipObject(e||[],t||[],assignValue)},lodash.zipObjectDeep=function zipObjectDeep(e,t){return baseZipObject(e||[],t||[],baseSet)},lodash.zipWith=qr,lodash.entries=En,lodash.entriesIn=Tn,lodash.extend=yn,lodash.extendWith=bn,mixin(lodash,lodash),lodash.add=Yn,lodash.attempt=Fn,lodash.camelCase=Ln,lodash.capitalize=capitalize,lodash.ceil=Jn,lodash.clamp=function clamp(e,t,r){return r===i&&(r=t,t=i),r!==i&&(r=(r=toNumber(r))==r?r:0),t!==i&&(t=(t=toNumber(t))==t?t:0),baseClamp(toNumber(e),t,r)},lodash.clone=function clone(e){return baseClone(e,4)},lodash.cloneDeep=function cloneDeep(e){return baseClone(e,5)},lodash.cloneDeepWith=function cloneDeepWith(e,t){return baseClone(e,5,t="function"==typeof t?t:i)},lodash.cloneWith=function cloneWith(e,t){return baseClone(e,4,t="function"==typeof t?t:i)},lodash.conformsTo=function conformsTo(e,t){return null==t||baseConformsTo(e,t,keys(t))},lodash.deburr=deburr,lodash.defaultTo=function defaultTo(e,t){return null==e||e!=e?t:e},lodash.divide=Qn,lodash.endsWith=function endsWith(e,t,r){e=toString(e),t=baseToString(t);var n=e.length,s=r=r===i?n:baseClamp(toInteger(r),0,n);return(r-=t.length)>=0&&e.slice(r,s)==t},lodash.eq=eq,lodash.escape=function escape(e){return(e=toString(e))&&Q.test(e)?e.replace(Y,Tt):e},lodash.escapeRegExp=function escapeRegExp(e){return(e=toString(e))&&oe.test(e)?e.replace(se,"\\$&"):e},lodash.every=function every(e,t,r){var n=sn(e)?arrayEvery:baseEvery;return r&&isIterateeCall(e,t,r)&&(t=i),n(e,getIteratee(t,3))},lodash.find=Fr,lodash.findIndex=findIndex,lodash.findKey=function findKey(e,t){return baseFindKey(e,getIteratee(t,3),baseForOwn)},lodash.findLast=$r,lodash.findLastIndex=findLastIndex,lodash.findLastKey=function findLastKey(e,t){return baseFindKey(e,getIteratee(t,3),baseForOwnRight)},lodash.floor=Xn,lodash.forEach=forEach,lodash.forEachRight=forEachRight,lodash.forIn=function forIn(e,t){return null==e?e:ir(e,getIteratee(t,3),keysIn)},lodash.forInRight=function forInRight(e,t){return null==e?e:sr(e,getIteratee(t,3),keysIn)},lodash.forOwn=function forOwn(e,t){return e&&baseForOwn(e,getIteratee(t,3))},lodash.forOwnRight=function forOwnRight(e,t){return e&&baseForOwnRight(e,getIteratee(t,3))},lodash.get=get,lodash.gt=tn,lodash.gte=rn,lodash.has=function has(e,t){return null!=e&&hasPath(e,t,baseHas)},lodash.hasIn=hasIn,lodash.head=head,lodash.identity=identity,lodash.includes=function includes(e,t,r,n){e=isArrayLike(e)?e:values(e),r=r&&!n?toInteger(r):0;var i=e.length;return r<0&&(r=xt(i+r,0)),isString(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&baseIndexOf(e,t,r)>-1},lodash.indexOf=function indexOf(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:toInteger(r);return i<0&&(i=xt(n+i,0)),baseIndexOf(e,t,i)},lodash.inRange=function inRange(e,t,r){return t=toFinite(t),r===i?(r=t,t=0):r=toFinite(r),function baseInRange(e,t,r){return e>=kt(t,r)&&e<xt(t,r)}(e=toNumber(e),t,r)},lodash.invoke=Sn,lodash.isArguments=nn,lodash.isArray=sn,lodash.isArrayBuffer=on,lodash.isArrayLike=isArrayLike,lodash.isArrayLikeObject=isArrayLikeObject,lodash.isBoolean=function isBoolean(e){return!0===e||!1===e||isObjectLike(e)&&baseGetTag(e)==w},lodash.isBuffer=an,lodash.isDate=un,lodash.isElement=function isElement(e){return isObjectLike(e)&&1===e.nodeType&&!isPlainObject(e)},lodash.isEmpty=function isEmpty(e){if(null==e)return!0;if(isArrayLike(e)&&(sn(e)||"string"==typeof e||"function"==typeof e.splice||an(e)||fn(e)||nn(e)))return!e.length;var t=pr(e);if(t==_||t==L)return!e.size;if(isPrototype(e))return!baseKeys(e).length;for(var r in e)if(qe.call(e,r))return!1;return!0},lodash.isEqual=function isEqual(e,t){return baseIsEqual(e,t)},lodash.isEqualWith=function isEqualWith(e,t,r){var n=(r="function"==typeof r?r:i)?r(e,t):i;return n===i?baseIsEqual(e,t,i,r):!!n},lodash.isError=isError,lodash.isFinite=function isFinite(e){return"number"==typeof e&&wt(e)},lodash.isFunction=isFunction,lodash.isInteger=isInteger,lodash.isLength=isLength,lodash.isMap=cn,lodash.isMatch=function isMatch(e,t){return e===t||baseIsMatch(e,t,getMatchData(t))},lodash.isMatchWith=function isMatchWith(e,t,r){return r="function"==typeof r?r:i,baseIsMatch(e,t,getMatchData(t),r)},lodash.isNaN=function isNaN(e){return isNumber(e)&&e!=+e},lodash.isNative=function isNative(e){if(mr(e))throw new ue("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return baseIsNative(e)},lodash.isNil=function isNil(e){return null==e},lodash.isNull=function isNull(e){return null===e},lodash.isNumber=isNumber,lodash.isObject=isObject,lodash.isObjectLike=isObjectLike,lodash.isPlainObject=isPlainObject,lodash.isRegExp=ln,lodash.isSafeInteger=function isSafeInteger(e){return isInteger(e)&&e>=-9007199254740991&&e<=p},lodash.isSet=dn,lodash.isString=isString,lodash.isSymbol=isSymbol,lodash.isTypedArray=fn,lodash.isUndefined=function isUndefined(e){return e===i},lodash.isWeakMap=function isWeakMap(e){return isObjectLike(e)&&pr(e)==k},lodash.isWeakSet=function isWeakSet(e){return isObjectLike(e)&&"[object WeakSet]"==baseGetTag(e)},lodash.join=function join(e,t){return null==e?"":It.call(e,t)},lodash.kebabCase=Dn,lodash.last=last,lodash.lastIndexOf=function lastIndexOf(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var s=n;return r!==i&&(s=(s=toInteger(r))<0?xt(n+s,0):kt(s,n-1)),t==t?function strictLastIndexOf(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,s):baseFindIndex(e,baseIsNaN,s,!0)},lodash.lowerCase=xn,lodash.lowerFirst=kn,lodash.lt=hn,lodash.lte=pn,lodash.max=function max(e){return e&&e.length?baseExtremum(e,identity,baseGt):i},lodash.maxBy=function maxBy(e,t){return e&&e.length?baseExtremum(e,getIteratee(t,2),baseGt):i},lodash.mean=function mean(e){return baseMean(e,identity)},lodash.meanBy=function meanBy(e,t){return baseMean(e,getIteratee(t,2))},lodash.min=function min(e){return e&&e.length?baseExtremum(e,identity,baseLt):i},lodash.minBy=function minBy(e,t){return e&&e.length?baseExtremum(e,getIteratee(t,2),baseLt):i},lodash.stubArray=stubArray,lodash.stubFalse=stubFalse,lodash.stubObject=function stubObject(){return{}},lodash.stubString=function stubString(){return""},lodash.stubTrue=function stubTrue(){return!0},lodash.multiply=ti,lodash.nth=function nth(e,t){return e&&e.length?baseNth(e,toInteger(t)):i},lodash.noConflict=function noConflict(){return yt._===this&&(yt._=Ve),this},lodash.noop=noop,lodash.now=Zr,lodash.pad=function pad(e,t,r){e=toString(e);var n=(t=toInteger(t))?stringSize(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return createPadding(mt(i),r)+e+createPadding(pt(i),r)},lodash.padEnd=function padEnd(e,t,r){e=toString(e);var n=(t=toInteger(t))?stringSize(e):0;return t&&n<t?e+createPadding(t-n,r):e},lodash.padStart=function padStart(e,t,r){e=toString(e);var n=(t=toInteger(t))?stringSize(e):0;return t&&n<t?createPadding(t-n,r)+e:e},lodash.parseInt=function parseInt(e,t,r){return r||null==t?t=0:t&&(t=+t),qt(toString(e).replace(ae,""),t||0)},lodash.random=function random(e,t,r){if(r&&"boolean"!=typeof r&&isIterateeCall(e,t,r)&&(t=r=i),r===i&&("boolean"==typeof t?(r=t,t=i):"boolean"==typeof e&&(r=e,e=i)),e===i&&t===i?(e=0,t=1):(e=toFinite(e),t===i?(t=e,e=0):t=toFinite(t)),e>t){var n=e;e=t,t=n}if(r||e%1||t%1){var s=Mt();return kt(e+s*(t-e+ft("1e-"+((s+"").length-1))),t)}return baseRandom(e,t)},lodash.reduce=function reduce(e,t,r){var n=sn(e)?arrayReduce:baseReduce,i=arguments.length<3;return n(e,getIteratee(t,4),r,i,rr)},lodash.reduceRight=function reduceRight(e,t,r){var n=sn(e)?arrayReduceRight:baseReduce,i=arguments.length<3;return n(e,getIteratee(t,4),r,i,nr)},lodash.repeat=function repeat(e,t,r){return t=(r?isIterateeCall(e,t,r):t===i)?1:toInteger(t),baseRepeat(toString(e),t)},lodash.replace=function replace(){var e=arguments,t=toString(e[0]);return e.length<3?t:t.replace(e[1],e[2])},lodash.result=function result(e,t,r){var n=-1,s=(t=castPath(t,e)).length;for(s||(s=1,e=i);++n<s;){var o=null==e?i:e[toKey(t[n])];o===i&&(n=s,o=r),e=isFunction(o)?o.call(e):o}return e},lodash.round=ri,lodash.runInContext=runInContext,lodash.sample=function sample(e){return(sn(e)?arraySample:baseSample)(e)},lodash.size=function size(e){if(null==e)return 0;if(isArrayLike(e))return isString(e)?stringSize(e):e.length;var t=pr(e);return t==_||t==L?e.size:baseKeys(e).length},lodash.snakeCase=jn,lodash.some=function some(e,t,r){var n=sn(e)?arraySome:baseSome;return r&&isIterateeCall(e,t,r)&&(t=i),n(e,getIteratee(t,3))},lodash.sortedIndex=function sortedIndex(e,t){return baseSortedIndex(e,t)},lodash.sortedIndexBy=function sortedIndexBy(e,t,r){return baseSortedIndexBy(e,t,getIteratee(r,2))},lodash.sortedIndexOf=function sortedIndexOf(e,t){var r=null==e?0:e.length;if(r){var n=baseSortedIndex(e,t);if(n<r&&eq(e[n],t))return n}return-1},lodash.sortedLastIndex=function sortedLastIndex(e,t){return baseSortedIndex(e,t,!0)},lodash.sortedLastIndexBy=function sortedLastIndexBy(e,t,r){return baseSortedIndexBy(e,t,getIteratee(r,2),!0)},lodash.sortedLastIndexOf=function sortedLastIndexOf(e,t){if(null==e?0:e.length){var r=baseSortedIndex(e,t,!0)-1;if(eq(e[r],t))return r}return-1},lodash.startCase=qn,lodash.startsWith=function startsWith(e,t,r){return e=toString(e),r=null==r?0:baseClamp(toInteger(r),0,e.length),t=baseToString(t),e.slice(r,r+t.length)==t},lodash.subtract=ni,lodash.sum=function sum(e){return e&&e.length?baseSum(e,identity):0},lodash.sumBy=function sumBy(e,t){return e&&e.length?baseSum(e,getIteratee(t,2)):0},lodash.template=function template(e,t,r){var n=lodash.templateSettings;r&&isIterateeCall(e,t,r)&&(t=i),e=toString(e),t=bn({},t,n,customDefaultsAssignIn);var s,o,a=bn({},t.imports,n.imports,customDefaultsAssignIn),u=keys(a),c=baseValues(a,u),l=0,d=t.interpolate||Oe,f="__p += '",h=Pe((t.escape||Oe).source+"|"+d.source+"|"+(d===te?me:Oe).source+"|"+(t.evaluate||Oe).source+"|$","g"),p="//# sourceURL="+(qe.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ut+"]")+"\n";e.replace(h,(function(t,r,n,i,a,u){return n||(n=i),f+=e.slice(l,u).replace(Se,escapeStringChar),r&&(s=!0,f+="' +\n__e("+r+") +\n'"),a&&(o=!0,f+="';\n"+a+";\n__p += '"),n&&(f+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),l=u+t.length,t})),f+="';\n";var m=qe.call(t,"variable")&&t.variable;if(m){if(he.test(m))throw new ue("Invalid `variable` option passed into `_.template`")}else f="with (obj) {\n"+f+"\n}\n";f=(o?f.replace(Z,""):f).replace(G,"$1").replace(H,"$1;"),f="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+f+"return __p\n}";var y=Fn((function(){return _e(u,p+"return "+f).apply(i,c)}));if(y.source=f,isError(y))throw y;return y},lodash.times=function times(e,t){if((e=toInteger(e))<1||e>p)return[];var r=y,n=kt(e,y);t=getIteratee(t),e-=y;for(var i=baseTimes(n,t);++r<e;)t(r);return i},lodash.toFinite=toFinite,lodash.toInteger=toInteger,lodash.toLength=toLength,lodash.toLower=function toLower(e){return toString(e).toLowerCase()},lodash.toNumber=toNumber,lodash.toSafeInteger=function toSafeInteger(e){return e?baseClamp(toInteger(e),-9007199254740991,p):0===e?e:0},lodash.toString=toString,lodash.toUpper=function toUpper(e){return toString(e).toUpperCase()},lodash.trim=function trim(e,t,r){if((e=toString(e))&&(r||t===i))return baseTrim(e);if(!e||!(t=baseToString(t)))return e;var n=stringToArray(e),s=stringToArray(t);return castSlice(n,charsStartIndex(n,s),charsEndIndex(n,s)+1).join("")},lodash.trimEnd=function trimEnd(e,t,r){if((e=toString(e))&&(r||t===i))return e.slice(0,trimmedEndIndex(e)+1);if(!e||!(t=baseToString(t)))return e;var n=stringToArray(e);return castSlice(n,0,charsEndIndex(n,stringToArray(t))+1).join("")},lodash.trimStart=function trimStart(e,t,r){if((e=toString(e))&&(r||t===i))return e.replace(ae,"");if(!e||!(t=baseToString(t)))return e;var n=stringToArray(e);return castSlice(n,charsStartIndex(n,stringToArray(t))).join("")},lodash.truncate=function truncate(e,t){var r=30,n="...";if(isObject(t)){var s="separator"in t?t.separator:s;r="length"in t?toInteger(t.length):r,n="omission"in t?baseToString(t.omission):n}var o=(e=toString(e)).length;if(hasUnicode(e)){var a=stringToArray(e);o=a.length}if(r>=o)return e;var u=r-stringSize(n);if(u<1)return n;var c=a?castSlice(a,0,u).join(""):e.slice(0,u);if(s===i)return c+n;if(a&&(u+=c.length-u),ln(s)){if(e.slice(u).search(s)){var l,d=c;for(s.global||(s=Pe(s.source,toString(ye.exec(s))+"g")),s.lastIndex=0;l=s.exec(d);)var f=l.index;c=c.slice(0,f===i?u:f)}}else if(e.indexOf(baseToString(s),u)!=u){var h=c.lastIndexOf(s);h>-1&&(c=c.slice(0,h))}return c+n},lodash.unescape=function unescape(e){return(e=toString(e))&&J.test(e)?e.replace(K,Lt):e},lodash.uniqueId=function uniqueId(e){var t=++Me;return toString(e)+t},lodash.upperCase=Mn,lodash.upperFirst=Nn,lodash.each=forEach,lodash.eachRight=forEachRight,lodash.first=head,mixin(lodash,(ei={},baseForOwn(lodash,(function(e,t){qe.call(lodash.prototype,t)||(ei[t]=e)})),ei),{chain:!1}),lodash.VERSION="4.17.21",arrayEach(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){lodash[e].placeholder=lodash})),arrayEach(["drop","take"],(function(e,t){LazyWrapper.prototype[e]=function(r){r=r===i?1:xt(toInteger(r),0);var n=this.__filtered__&&!t?new LazyWrapper(this):this.clone();return n.__filtered__?n.__takeCount__=kt(r,n.__takeCount__):n.__views__.push({size:kt(r,y),type:e+(n.__dir__<0?"Right":"")}),n},LazyWrapper.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),arrayEach(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;LazyWrapper.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:getIteratee(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),arrayEach(["head","last"],(function(e,t){var r="take"+(t?"Right":"");LazyWrapper.prototype[e]=function(){return this[r](1).value()[0]}})),arrayEach(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");LazyWrapper.prototype[e]=function(){return this.__filtered__?new LazyWrapper(this):this[r](1)}})),LazyWrapper.prototype.compact=function(){return this.filter(identity)},LazyWrapper.prototype.find=function(e){return this.filter(e).head()},LazyWrapper.prototype.findLast=function(e){return this.reverse().find(e)},LazyWrapper.prototype.invokeMap=baseRest((function(e,t){return"function"==typeof e?new LazyWrapper(this):this.map((function(r){return baseInvoke(r,e,t)}))})),LazyWrapper.prototype.reject=function(e){return this.filter(negate(getIteratee(e)))},LazyWrapper.prototype.slice=function(e,t){e=toInteger(e);var r=this;return r.__filtered__&&(e>0||t<0)?new LazyWrapper(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==i&&(r=(t=toInteger(t))<0?r.dropRight(-t):r.take(t-e)),r)},LazyWrapper.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},LazyWrapper.prototype.toArray=function(){return this.take(y)},baseForOwn(LazyWrapper.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),s=lodash[n?"take"+("last"==t?"Right":""):t],o=n||/^find/.test(t);s&&(lodash.prototype[t]=function(){var t=this.__wrapped__,a=n?[1]:arguments,u=t instanceof LazyWrapper,c=a[0],l=u||sn(t),interceptor=function(e){var t=s.apply(lodash,arrayPush([e],a));return n&&d?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(u=l=!1);var d=this.__chain__,f=!!this.__actions__.length,h=o&&!d,p=u&&!f;if(!o&&l){t=p?t:new LazyWrapper(this);var m=e.apply(t,a);return m.__actions__.push({func:thru,args:[interceptor],thisArg:i}),new LodashWrapper(m,d)}return h&&p?e.apply(this,a):(m=this.thru(interceptor),h?n?m.value()[0]:m.value():m)})})),arrayEach(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Le[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);lodash.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(sn(i)?i:[],e)}return this[r]((function(r){return t.apply(sn(r)?r:[],e)}))}})),baseForOwn(LazyWrapper.prototype,(function(e,t){var r=lodash[t];if(r){var n=r.name+"";qe.call(Zt,n)||(Zt[n]=[]),Zt[n].push({name:t,func:r})}})),Zt[createHybrid(i,2).name]=[{name:"wrapper",func:i}],LazyWrapper.prototype.clone=function lazyClone(){var e=new LazyWrapper(this.__wrapped__);return e.__actions__=copyArray(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=copyArray(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=copyArray(this.__views__),e},LazyWrapper.prototype.reverse=function lazyReverse(){if(this.__filtered__){var e=new LazyWrapper(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},LazyWrapper.prototype.value=function lazyValue(){var e=this.__wrapped__.value(),t=this.__dir__,r=sn(e),n=t<0,i=r?e.length:0,s=function getView(e,t,r){var n=-1,i=r.length;for(;++n<i;){var s=r[n],o=s.size;switch(s.type){case"drop":e+=o;break;case"dropRight":t-=o;break;case"take":t=kt(t,e+o);break;case"takeRight":e=xt(e,t-o)}}return{start:e,end:t}}(0,i,this.__views__),o=s.start,a=s.end,u=a-o,c=n?a:o-1,l=this.__iteratees__,d=l.length,f=0,h=kt(u,this.__takeCount__);if(!r||!n&&i==u&&h==u)return baseWrapperValue(e,this.__actions__);var p=[];e:for(;u--&&f<h;){for(var m=-1,y=e[c+=t];++m<d;){var b=l[m],g=b.iteratee,v=b.type,w=g(y);if(2==v)y=w;else if(!w){if(1==v)continue e;break e}}p[f++]=y}return p},lodash.prototype.at=Mr,lodash.prototype.chain=function wrapperChain(){return chain(this)},lodash.prototype.commit=function wrapperCommit(){return new LodashWrapper(this.value(),this.__chain__)},lodash.prototype.next=function wrapperNext(){this.__values__===i&&(this.__values__=toArray(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},lodash.prototype.plant=function wrapperPlant(e){for(var t,r=this;r instanceof baseLodash;){var n=wrapperClone(r);n.__index__=0,n.__values__=i,t?s.__wrapped__=n:t=n;var s=n;r=r.__wrapped__}return s.__wrapped__=e,t},lodash.prototype.reverse=function wrapperReverse(){var e=this.__wrapped__;if(e instanceof LazyWrapper){var t=e;return this.__actions__.length&&(t=new LazyWrapper(this)),(t=t.reverse()).__actions__.push({func:thru,args:[reverse],thisArg:i}),new LodashWrapper(t,this.__chain__)}return this.thru(reverse)},lodash.prototype.toJSON=lodash.prototype.valueOf=lodash.prototype.value=function wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__)},lodash.prototype.first=lodash.prototype.head,Qe&&(lodash.prototype[Qe]=function wrapperToIterator(){return this}),lodash}();yt._=Dt,(n=function(){return Dt}.call(t,r,t,e))===i||(e.exports=n)}.call(this)},3290:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class LuxonError extends Error{}class InvalidDateTimeError extends LuxonError{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class InvalidIntervalError extends LuxonError{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class InvalidDurationError extends LuxonError{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class ConflictingSpecificationError extends LuxonError{}class InvalidUnitError extends LuxonError{constructor(e){super(`Invalid unit ${e}`)}}class InvalidArgumentError extends LuxonError{}class ZoneIsAbstractError extends LuxonError{constructor(){super("Zone is an abstract class")}}const r="numeric",n="short",i="long",s={year:r,month:r,day:r},o={year:r,month:n,day:r},a={year:r,month:n,day:r,weekday:n},u={year:r,month:i,day:r},c={year:r,month:i,day:r,weekday:i},l={hour:r,minute:r},d={hour:r,minute:r,second:r},f={hour:r,minute:r,second:r,timeZoneName:n},h={hour:r,minute:r,second:r,timeZoneName:i},p={hour:r,minute:r,hourCycle:"h23"},m={hour:r,minute:r,second:r,hourCycle:"h23"},y={hour:r,minute:r,second:r,hourCycle:"h23",timeZoneName:n},b={hour:r,minute:r,second:r,hourCycle:"h23",timeZoneName:i},g={year:r,month:r,day:r,hour:r,minute:r},v={year:r,month:r,day:r,hour:r,minute:r,second:r},w={year:r,month:n,day:r,hour:r,minute:r},I={year:r,month:n,day:r,hour:r,minute:r,second:r},A={year:r,month:n,day:r,weekday:n,hour:r,minute:r},O={year:r,month:i,day:r,hour:r,minute:r,timeZoneName:n},S={year:r,month:i,day:r,hour:r,minute:r,second:r,timeZoneName:n},_={year:r,month:i,day:r,weekday:i,hour:r,minute:r,timeZoneName:i},R={year:r,month:i,day:r,weekday:i,hour:r,minute:r,second:r,timeZoneName:i};class Zone{get type(){throw new ZoneIsAbstractError}get name(){throw new ZoneIsAbstractError}get ianaName(){return this.name}get isUniversal(){throw new ZoneIsAbstractError}offsetName(e,t){throw new ZoneIsAbstractError}formatOffset(e,t){throw new ZoneIsAbstractError}offset(e){throw new ZoneIsAbstractError}equals(e){throw new ZoneIsAbstractError}get isValid(){throw new ZoneIsAbstractError}}let P=null;class SystemZone extends Zone{static get instance(){return null===P&&(P=new SystemZone),P}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return parseZoneInfo(e,t,r)}formatOffset(e,t){return formatOffset(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}let E={};const T={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};let L={};class IANAZone extends Zone{static create(e){return L[e]||(L[e]=new IANAZone(e)),L[e]}static resetCache(){L={},E={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}constructor(e){super(),this.zoneName=e,this.valid=IANAZone.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:r}){return parseZoneInfo(e,t,r,this.name)}formatOffset(e,t){return formatOffset(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const r=function makeDTF(e){return E[e]||(E[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),E[e]}(this.name);let[n,i,s,o,a,u,c]=r.formatToParts?function partsOffset(e,t){const r=e.formatToParts(t),n=[];for(let e=0;e<r.length;e++){const{type:t,value:i}=r[e],s=T[t];"era"===t?n[s]=i:isUndefined(s)||(n[s]=parseInt(i,10))}return n}(r,t):function hackyOffset(e,t){const r=e.format(t).replace(/\u200E/g,""),n=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(r),[,i,s,o,a,u,c,l]=n;return[o,i,s,a,u,c,l]}(r,t);"BC"===o&&(n=1-Math.abs(n));let l=+t;const d=l%1e3;return l-=d>=0?d:1e3+d,(objToLocalTS({year:n,month:i,day:s,hour:24===a?0:a,minute:u,second:c,millisecond:0})-l)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let D={};let x={};function getCachedDTF(e,t={}){const r=JSON.stringify([e,t]);let n=x[r];return n||(n=new Intl.DateTimeFormat(e,t),x[r]=n),n}let k={};let j={};let q=null;let M={};function listStuff(e,t,r,n){const i=e.listingMode();return"error"===i?null:"en"===i?r(t):n(t)}class PolyNumberFormatter{constructor(e,t,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:n,floor:i,...s}=r;if(!t||Object.keys(s).length>0){const t={useGrouping:!1,...r};r.padTo>0&&(t.minimumIntegerDigits=r.padTo),this.inf=function getCachedINF(e,t={}){const r=JSON.stringify([e,t]);let n=k[r];return n||(n=new Intl.NumberFormat(e,t),k[r]=n),n}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return padStart(this.floor?Math.floor(e):roundTo(e,3),this.padTo)}}class PolyDateFormatter{constructor(e,t,r){let n;if(this.opts=r,this.originalZone=void 0,this.opts.timeZone)this.dt=e;else if("fixed"===e.zone.type){const t=e.offset/60*-1,r=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&IANAZone.create(r).valid?(n=r,this.dt=e):(n="UTC",this.dt=0===e.offset?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else"system"===e.zone.type?this.dt=e:"iana"===e.zone.type?(this.dt=e,n=e.zone.name):(n="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const i={...this.opts};i.timeZone=i.timeZone||n,this.dtf=getCachedDTF(t,i)}format(){return this.originalZone?this.formatToParts().map((({value:e})=>e)).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map((e=>{if("timeZoneName"===e.type){const t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}return e})):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class PolyRelFormatter{constructor(e,t,r){this.opts={style:"long",...r},!t&&hasRelative()&&(this.rtf=function getCachedRTF(e,t={}){const{base:r,...n}=t,i=JSON.stringify([e,n]);let s=j[i];return s||(s=new Intl.RelativeTimeFormat(e,t),j[i]=s),s}(e,r))}format(e,t){return this.rtf?this.rtf.format(e,t):function formatRelativeTime(e,t,r="always",n=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},s=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===r&&s){const r="days"===e;switch(t){case 1:return r?"tomorrow":`next ${i[e][0]}`;case-1:return r?"yesterday":`last ${i[e][0]}`;case 0:return r?"today":`this ${i[e][0]}`}}const o=Object.is(t,-0)||t<0,a=Math.abs(t),u=1===a,c=i[e],l=n?u?c[1]:c[2]||c[1]:u?i[e][0]:e;return o?`${a} ${l} ago`:`in ${a} ${l}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const N={firstDay:1,minimalDays:4,weekend:[6,7]};class Locale{static fromOpts(e){return Locale.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,r,n,i=!1){const s=e||Settings.defaultLocale,o=s||(i?"en-US":function systemLocale(){return q||(q=(new Intl.DateTimeFormat).resolvedOptions().locale,q)}()),a=t||Settings.defaultNumberingSystem,u=r||Settings.defaultOutputCalendar,c=validateWeekSettings(n)||Settings.defaultWeekSettings;return new Locale(o,a,u,c,s)}static resetCache(){q=null,x={},k={},j={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:r,weekSettings:n}={}){return Locale.create(e,t,r,n)}constructor(e,t,r,n,i){const[s,o,a]=function parseLocaleString(e){const t=e.indexOf("-x-");-1!==t&&(e=e.substring(0,t));const r=e.indexOf("-u-");if(-1===r)return[e];{let t,n;try{t=getCachedDTF(e).resolvedOptions(),n=e}catch(i){const s=e.substring(0,r);t=getCachedDTF(s).resolvedOptions(),n=s}const{numberingSystem:i,calendar:s}=t;return[n,i,s]}}(e);this.locale=s,this.numberingSystem=t||o||null,this.outputCalendar=r||a||null,this.weekSettings=n,this.intl=function intlConfigString(e,t,r){return r||t?(e.includes("-u-")||(e+="-u"),r&&(e+=`-ca-${r}`),t&&(e+=`-nu-${t}`),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return null==this.fastNumbersCached&&(this.fastNumbersCached=function supportsFastNumbers(e){return(!e.numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)}(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?Locale.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,validateWeekSettings(e.weekSettings)||this.weekSettings,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return listStuff(this,e,months,(()=>{const r=t?{month:e,day:"numeric"}:{month:e},n=t?"format":"standalone";return this.monthsCache[n][e]||(this.monthsCache[n][e]=function mapMonths(e){const t=[];for(let r=1;r<=12;r++){const n=DateTime.utc(2009,r,1);t.push(e(n))}return t}((e=>this.extract(e,r,"month")))),this.monthsCache[n][e]}))}weekdays(e,t=!1){return listStuff(this,e,weekdays,(()=>{const r=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},n=t?"format":"standalone";return this.weekdaysCache[n][e]||(this.weekdaysCache[n][e]=function mapWeekdays(e){const t=[];for(let r=1;r<=7;r++){const n=DateTime.utc(2016,11,13+r);t.push(e(n))}return t}((e=>this.extract(e,r,"weekday")))),this.weekdaysCache[n][e]}))}meridiems(){return listStuff(this,void 0,(()=>te),(()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[DateTime.utc(2016,11,13,9),DateTime.utc(2016,11,13,19)].map((t=>this.extract(t,e,"dayperiod")))}return this.meridiemCache}))}eras(e){return listStuff(this,e,eras,(()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[DateTime.utc(-40,1,1),DateTime.utc(2017,1,1)].map((e=>this.extract(e,t,"era")))),this.eraCache[e]}))}extract(e,t,r){const n=this.dtFormatter(e,t).formatToParts().find((e=>e.type.toLowerCase()===r));return n?n.value:null}numberFormatter(e={}){return new PolyNumberFormatter(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new PolyDateFormatter(e,this.intl,t)}relFormatter(e={}){return new PolyRelFormatter(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function getCachedLF(e,t={}){const r=JSON.stringify([e,t]);let n=D[r];return n||(n=new Intl.ListFormat(e,t),D[r]=n),n}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:hasLocaleWeekInfo()?function getCachedWeekInfo(e){let t=M[e];if(!t){const r=new Intl.Locale(e);t="getWeekInfo"in r?r.getWeekInfo():r.weekInfo,M[e]=t}return t}(this.locale):N}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}let F=null;class FixedOffsetZone extends Zone{static get utcInstance(){return null===F&&(F=new FixedOffsetZone(0)),F}static instance(e){return 0===e?FixedOffsetZone.utcInstance:new FixedOffsetZone(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new FixedOffsetZone(signedOffset(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${formatOffset(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${formatOffset(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return formatOffset(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class InvalidZone extends Zone{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function normalizeZone(e,t){if(isUndefined(e)||null===e)return t;if(e instanceof Zone)return e;if(function isString(e){return"string"==typeof e}(e)){const r=e.toLowerCase();return"default"===r?t:"local"===r||"system"===r?SystemZone.instance:"utc"===r||"gmt"===r?FixedOffsetZone.utcInstance:FixedOffsetZone.parseSpecifier(r)||IANAZone.create(e)}return isNumber(e)?FixedOffsetZone.instance(e):"object"==typeof e&&"offset"in e&&"function"==typeof e.offset?e:new InvalidZone(e)}let $,now=()=>Date.now(),V="system",z=null,B=null,W=null,U=60,Z=null;class Settings{static get now(){return now}static set now(e){now=e}static set defaultZone(e){V=e}static get defaultZone(){return normalizeZone(V,SystemZone.instance)}static get defaultLocale(){return z}static set defaultLocale(e){z=e}static get defaultNumberingSystem(){return B}static set defaultNumberingSystem(e){B=e}static get defaultOutputCalendar(){return W}static set defaultOutputCalendar(e){W=e}static get defaultWeekSettings(){return Z}static set defaultWeekSettings(e){Z=validateWeekSettings(e)}static get twoDigitCutoffYear(){return U}static set twoDigitCutoffYear(e){U=e%100}static get throwOnInvalid(){return $}static set throwOnInvalid(e){$=e}static resetCaches(){Locale.resetCache(),IANAZone.resetCache()}}class Invalid{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const G=[0,31,59,90,120,151,181,212,243,273,304,334],H=[0,31,60,91,121,152,182,213,244,274,305,335];function unitOutOfRange(e,t){return new Invalid("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function dayOfWeek(e,t,r){const n=new Date(Date.UTC(e,t-1,r));e<100&&e>=0&&n.setUTCFullYear(n.getUTCFullYear()-1900);const i=n.getUTCDay();return 0===i?7:i}function computeOrdinal(e,t,r){return r+(isLeapYear(e)?H:G)[t-1]}function uncomputeOrdinal(e,t){const r=isLeapYear(e)?H:G,n=r.findIndex((e=>e<t));return{month:n+1,day:t-r[n]}}function isoWeekdayToLocal(e,t){return(e-t+7)%7+1}function gregorianToWeek(e,t=4,r=1){const{year:n,month:i,day:s}=e,o=computeOrdinal(n,i,s),a=isoWeekdayToLocal(dayOfWeek(n,i,s),r);let u,c=Math.floor((o-a+14-t)/7);return c<1?(u=n-1,c=weeksInWeekYear(u,t,r)):c>weeksInWeekYear(n,t,r)?(u=n+1,c=1):u=n,{weekYear:u,weekNumber:c,weekday:a,...timeObject(e)}}function weekToGregorian(e,t=4,r=1){const{weekYear:n,weekNumber:i,weekday:s}=e,o=isoWeekdayToLocal(dayOfWeek(n,1,t),r),a=daysInYear(n);let u,c=7*i+s-o-7+t;c<1?(u=n-1,c+=daysInYear(u)):c>a?(u=n+1,c-=daysInYear(n)):u=n;const{month:l,day:d}=uncomputeOrdinal(u,c);return{year:u,month:l,day:d,...timeObject(e)}}function gregorianToOrdinal(e){const{year:t,month:r,day:n}=e;return{year:t,ordinal:computeOrdinal(t,r,n),...timeObject(e)}}function ordinalToGregorian(e){const{year:t,ordinal:r}=e,{month:n,day:i}=uncomputeOrdinal(t,r);return{year:t,month:n,day:i,...timeObject(e)}}function usesLocalWeekValues(e,t){if(!isUndefined(e.localWeekday)||!isUndefined(e.localWeekNumber)||!isUndefined(e.localWeekYear)){if(!isUndefined(e.weekday)||!isUndefined(e.weekNumber)||!isUndefined(e.weekYear))throw new ConflictingSpecificationError("Cannot mix locale-based week fields with ISO-based week fields");return isUndefined(e.localWeekday)||(e.weekday=e.localWeekday),isUndefined(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),isUndefined(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function hasInvalidGregorianData(e){const t=isInteger(e.year),r=integerBetween(e.month,1,12),n=integerBetween(e.day,1,daysInMonth(e.year,e.month));return t?r?!n&&unitOutOfRange("day",e.day):unitOutOfRange("month",e.month):unitOutOfRange("year",e.year)}function hasInvalidTimeData(e){const{hour:t,minute:r,second:n,millisecond:i}=e,s=integerBetween(t,0,23)||24===t&&0===r&&0===n&&0===i,o=integerBetween(r,0,59),a=integerBetween(n,0,59),u=integerBetween(i,0,999);return s?o?a?!u&&unitOutOfRange("millisecond",i):unitOutOfRange("second",n):unitOutOfRange("minute",r):unitOutOfRange("hour",t)}function isUndefined(e){return void 0===e}function isNumber(e){return"number"==typeof e}function isInteger(e){return"number"==typeof e&&e%1==0}function hasRelative(){try{return"undefined"!=typeof Intl&&!!Intl.RelativeTimeFormat}catch(e){return!1}}function hasLocaleWeekInfo(){try{return"undefined"!=typeof Intl&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch(e){return!1}}function bestBy(e,t,r){if(0!==e.length)return e.reduce(((e,n)=>{const i=[t(n),n];return e&&r(e[0],i[0])===e[0]?e:i}),null)[1]}function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function validateWeekSettings(e){if(null==e)return null;if("object"!=typeof e)throw new InvalidArgumentError("Week settings must be an object");if(!integerBetween(e.firstDay,1,7)||!integerBetween(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some((e=>!integerBetween(e,1,7))))throw new InvalidArgumentError("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function integerBetween(e,t,r){return isInteger(e)&&e>=t&&e<=r}function padStart(e,t=2){let r;return r=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0"),r}function parseInteger(e){return isUndefined(e)||null===e||""===e?void 0:parseInt(e,10)}function parseFloating(e){return isUndefined(e)||null===e||""===e?void 0:parseFloat(e)}function parseMillis(e){if(!isUndefined(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function roundTo(e,t,r=!1){const n=10**t;return(r?Math.trunc:Math.round)(e*n)/n}function isLeapYear(e){return e%4==0&&(e%100!=0||e%400==0)}function daysInYear(e){return isLeapYear(e)?366:365}function daysInMonth(e,t){const r=function floorMod(e,t){return e-t*Math.floor(e/t)}(t-1,12)+1;return 2===r?isLeapYear(e+(t-r)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][r-1]}function objToLocalTS(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function firstWeekOffset(e,t,r){return-isoWeekdayToLocal(dayOfWeek(e,1,t),r)+t-1}function weeksInWeekYear(e,t=4,r=1){const n=firstWeekOffset(e,t,r),i=firstWeekOffset(e+1,t,r);return(daysInYear(e)-n+i)/7}function untruncateYear(e){return e>99?e:e>Settings.twoDigitCutoffYear?1900+e:2e3+e}function parseZoneInfo(e,t,r,n=null){const i=new Date(e),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};n&&(s.timeZone=n);const o={timeZoneName:t,...s},a=new Intl.DateTimeFormat(r,o).formatToParts(i).find((e=>"timezonename"===e.type.toLowerCase()));return a?a.value:null}function signedOffset(e,t){let r=parseInt(e,10);Number.isNaN(r)&&(r=0);const n=parseInt(t,10)||0;return 60*r+(r<0||Object.is(r,-0)?-n:n)}function asNumber(e){const t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new InvalidArgumentError(`Invalid unit value ${e}`);return t}function normalizeObject(e,t){const r={};for(const n in e)if(hasOwnProperty(e,n)){const i=e[n];if(null==i)continue;r[t(n)]=asNumber(i)}return r}function formatOffset(e,t){const r=Math.trunc(Math.abs(e/60)),n=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${padStart(r,2)}:${padStart(n,2)}`;case"narrow":return`${i}${r}${n>0?`:${n}`:""}`;case"techie":return`${i}${padStart(r,2)}${padStart(n,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function timeObject(e){return function pick(e,t){return t.reduce(((t,r)=>(t[r]=e[r],t)),{})}(e,["hour","minute","second","millisecond"])}const K=["January","February","March","April","May","June","July","August","September","October","November","December"],Y=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],J=["J","F","M","A","M","J","J","A","S","O","N","D"];function months(e){switch(e){case"narrow":return[...J];case"short":return[...Y];case"long":return[...K];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Q=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],X=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],ee=["M","T","W","T","F","S","S"];function weekdays(e){switch(e){case"narrow":return[...ee];case"short":return[...X];case"long":return[...Q];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const te=["AM","PM"],re=["Before Christ","Anno Domini"],ne=["BC","AD"],ie=["B","A"];function eras(e){switch(e){case"narrow":return[...ie];case"short":return[...ne];case"long":return[...re];default:return null}}function stringifyTokens(e,t){let r="";for(const n of e)n.literal?r+=n.val:r+=t(n.val);return r}const se={D:s,DD:o,DDD:u,DDDD:c,t:l,tt:d,ttt:f,tttt:h,T:p,TT:m,TTT:y,TTTT:b,f:g,ff:w,fff:O,ffff:_,F:v,FF:I,FFF:S,FFFF:R};class Formatter{static create(e,t={}){return new Formatter(e,t)}static parseFormat(e){let t=null,r="",n=!1;const i=[];for(let s=0;s<e.length;s++){const o=e.charAt(s);"'"===o?(r.length>0&&i.push({literal:n||/^\s+$/.test(r),val:r}),t=null,r="",n=!n):n||o===t?r+=o:(r.length>0&&i.push({literal:/^\s+$/.test(r),val:r}),r=o,t=o)}return r.length>0&&i.push({literal:n||/^\s+$/.test(r),val:r}),i}static macroTokenToFormatOpts(e){return se[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem());return this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return padStart(e,t);const r={...this.opts};return t>0&&(r.padTo=t),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,t){const r="en"===this.loc.listingMode(),n=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,string=(t,r)=>this.loc.extract(e,t,r),formatOffset=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",meridiem=()=>r?function meridiemForDateTime(e){return te[e.hour<12?0:1]}(e):string({hour:"numeric",hourCycle:"h12"},"dayperiod"),month=(t,n)=>r?function monthForDateTime(e,t){return months(t)[e.month-1]}(e,t):string(n?{month:t}:{month:t,day:"numeric"},"month"),weekday=(t,n)=>r?function weekdayForDateTime(e,t){return weekdays(t)[e.weekday-1]}(e,t):string(n?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),maybeMacro=t=>{const r=Formatter.macroTokenToFormatOpts(t);return r?this.formatWithSystemDefault(e,r):t},era=t=>r?function eraForDateTime(e,t){return eras(t)[e.year<0?0:1]}(e,t):string({era:t},"era");return stringifyTokens(Formatter.parseFormat(t),(t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return formatOffset({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return formatOffset({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return formatOffset({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return meridiem();case"d":return n?string({day:"numeric"},"day"):this.num(e.day);case"dd":return n?string({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return weekday("short",!0);case"cccc":return weekday("long",!0);case"ccccc":return weekday("narrow",!0);case"EEE":return weekday("short",!1);case"EEEE":return weekday("long",!1);case"EEEEE":return weekday("narrow",!1);case"L":return n?string({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return n?string({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return month("short",!0);case"LLLL":return month("long",!0);case"LLLLL":return month("narrow",!0);case"M":return n?string({month:"numeric"},"month"):this.num(e.month);case"MM":return n?string({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return month("short",!1);case"MMMM":return month("long",!1);case"MMMMM":return month("narrow",!1);case"y":return n?string({year:"numeric"},"year"):this.num(e.year);case"yy":return n?string({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return n?string({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return n?string({year:"numeric"},"year"):this.num(e.year,6);case"G":return era("short");case"GG":return era("long");case"GGGGG":return era("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return maybeMacro(t)}}))}formatDurationFromString(e,t){const tokenToField=e=>{switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},r=Formatter.parseFormat(t),n=r.reduce(((e,{literal:t,val:r})=>t?e:e.concat(r)),[]);return stringifyTokens(r,(e=>t=>{const r=tokenToField(t);return r?this.num(e.get(r),t.length):t})(e.shiftTo(...n.map(tokenToField).filter((e=>e)))))}}const oe=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function combineRegexes(...e){const t=e.reduce(((e,t)=>e+t.source),"");return RegExp(`^${t}$`)}function combineExtractors(...e){return t=>e.reduce((([e,r,n],i)=>{const[s,o,a]=i(t,n);return[{...e,...s},o||r,a]}),[{},null,1]).slice(0,2)}function parse(e,...t){if(null==e)return[null,null];for(const[r,n]of t){const t=r.exec(e);if(t)return n(t)}return[null,null]}function simpleParse(...e){return(t,r)=>{const n={};let i;for(i=0;i<e.length;i++)n[e[i]]=parseInteger(t[r+i]);return[n,null,r+i]}}const ae=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,ue=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,ce=RegExp(`${ue.source}${`(?:${ae.source}?(?:\\[(${oe.source})\\])?)?`}`),le=RegExp(`(?:T${ce.source})?`),de=simpleParse("weekYear","weekNumber","weekDay"),fe=simpleParse("year","ordinal"),he=RegExp(`${ue.source} ?(?:${ae.source}|(${oe.source}))?`),pe=RegExp(`(?: ${he.source})?`);function int(e,t,r){const n=e[t];return isUndefined(n)?r:parseInteger(n)}function extractISOTime(e,t){return[{hours:int(e,t,0),minutes:int(e,t+1,0),seconds:int(e,t+2,0),milliseconds:parseMillis(e[t+3])},null,t+4]}function extractISOOffset(e,t){const r=!e[t]&&!e[t+1],n=signedOffset(e[t+1],e[t+2]);return[{},r?null:FixedOffsetZone.instance(n),t+3]}function extractIANAZone(e,t){return[{},e[t]?IANAZone.create(e[t]):null,t+1]}const me=RegExp(`^T?${ue.source}$`),ye=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function extractISODuration(e){const[t,r,n,i,s,o,a,u,c]=e,l="-"===t[0],d=u&&"-"===u[0],maybeNegate=(e,t=!1)=>void 0!==e&&(t||e&&l)?-e:e;return[{years:maybeNegate(parseFloating(r)),months:maybeNegate(parseFloating(n)),weeks:maybeNegate(parseFloating(i)),days:maybeNegate(parseFloating(s)),hours:maybeNegate(parseFloating(o)),minutes:maybeNegate(parseFloating(a)),seconds:maybeNegate(parseFloating(u),"-0"===u),milliseconds:maybeNegate(parseMillis(c),d)}]}const be={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function fromStrings(e,t,r,n,i,s,o){const a={year:2===t.length?untruncateYear(parseInteger(t)):parseInteger(t),month:Y.indexOf(r)+1,day:parseInteger(n),hour:parseInteger(i),minute:parseInteger(s)};return o&&(a.second=parseInteger(o)),e&&(a.weekday=e.length>3?Q.indexOf(e)+1:X.indexOf(e)+1),a}const ge=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function extractRFC2822(e){const[,t,r,n,i,s,o,a,u,c,l,d]=e,f=fromStrings(t,i,n,r,s,o,a);let h;return h=u?be[u]:c?0:signedOffset(l,d),[f,new FixedOffsetZone(h)]}const ve=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,we=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Ie=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function extractRFC1123Or850(e){const[,t,r,n,i,s,o,a]=e;return[fromStrings(t,i,n,r,s,o,a),FixedOffsetZone.utcInstance]}function extractASCII(e){const[,t,r,n,i,s,o,a]=e;return[fromStrings(t,a,r,n,i,s,o),FixedOffsetZone.utcInstance]}const Ae=combineRegexes(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,le),Oe=combineRegexes(/(\d{4})-?W(\d\d)(?:-?(\d))?/,le),Se=combineRegexes(/(\d{4})-?(\d{3})/,le),_e=combineRegexes(ce),Re=combineExtractors((function extractISOYmd(e,t){return[{year:int(e,t),month:int(e,t+1,1),day:int(e,t+2,1)},null,t+3]}),extractISOTime,extractISOOffset,extractIANAZone),Ce=combineExtractors(de,extractISOTime,extractISOOffset,extractIANAZone),Pe=combineExtractors(fe,extractISOTime,extractISOOffset,extractIANAZone),Ee=combineExtractors(extractISOTime,extractISOOffset,extractIANAZone);const Te=combineExtractors(extractISOTime);const Le=combineRegexes(/(\d{4})-(\d\d)-(\d\d)/,pe),De=combineRegexes(he),xe=combineExtractors(extractISOTime,extractISOOffset,extractIANAZone);const ke="Invalid Duration",je={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},qe={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...je},Me=365.2425,Ne=30.436875,Fe={years:{quarters:4,months:12,weeks:52.1775,days:Me,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:Ne,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...je},$e=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Ve=$e.slice(0).reverse();function clone$1(e,t,r=!1){const n={values:r?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Duration(n)}function durationToMillis(e,t){var r;let n=null!=(r=t.milliseconds)?r:0;for(const r of Ve.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function normalizeValues(e,t){const r=durationToMillis(e,t)<0?-1:1;$e.reduceRight(((n,i)=>{if(isUndefined(t[i]))return n;if(n){const s=t[n]*r,o=e[i][n],a=Math.floor(s/o);t[i]+=a*r,t[n]-=a*o*r}return i}),null),$e.reduce(((r,n)=>{if(isUndefined(t[n]))return r;if(r){const i=t[r]%1;t[r]-=i,t[n]+=i*e[r][n]}return n}),null)}class Duration{constructor(e){const t="longterm"===e.conversionAccuracy||!1;let r=t?Fe:qe;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||Locale.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,t){return Duration.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new InvalidArgumentError("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new Duration({values:normalizeObject(e,Duration.normalizeUnit),loc:Locale.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(isNumber(e))return Duration.fromMillis(e);if(Duration.isDuration(e))return e;if("object"==typeof e)return Duration.fromObject(e);throw new InvalidArgumentError(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[r]=function parseISODuration(e){return parse(e,[ye,extractISODuration])}(e);return r?Duration.fromObject(r,t):Duration.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[r]=function parseISOTimeOnly(e){return parse(e,[me,Te])}(e);return r?Duration.fromObject(r,t):Duration.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new InvalidArgumentError("need to specify a reason the Duration is invalid");const r=e instanceof Invalid?e:new Invalid(e,t);if(Settings.throwOnInvalid)throw new InvalidDurationError(r);return new Duration({invalid:r})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new InvalidUnitError(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const r={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?Formatter.create(this.loc,r).formatDurationFromString(this,e):ke}toHuman(e={}){if(!this.isValid)return ke;const t=$e.map((t=>{const r=this.values[t];return isUndefined(r)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:t.slice(0,-1)}).format(r)})).filter((e=>e));return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=roundTo(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1};return DateTime.fromMillis(t,{zone:"UTC"}).toISOTime(e)}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?durationToMillis(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=Duration.fromDurationLike(e),r={};for(const e of $e)(hasOwnProperty(t.values,e)||hasOwnProperty(this.values,e))&&(r[e]=t.get(e)+this.get(e));return clone$1(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const t=Duration.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const r of Object.keys(this.values))t[r]=asNumber(e(this.values[r],r));return clone$1(this,{values:t},!0)}get(e){return this[Duration.normalizeUnit(e)]}set(e){if(!this.isValid)return this;return clone$1(this,{values:{...this.values,...normalizeObject(e,Duration.normalizeUnit)}})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:r,matrix:n}={}){return clone$1(this,{loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:n,conversionAccuracy:r})}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return normalizeValues(this.matrix,e),clone$1(this,{values:e},!0)}rescale(){if(!this.isValid)return this;return clone$1(this,{values:function removeZeroes(e){const t={};for(const[r,n]of Object.entries(e))0!==n&&(t[r]=n);return t}(this.normalize().shiftToAll().toObject())},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map((e=>Duration.normalizeUnit(e)));const t={},r={},n=this.toObject();let i;for(const s of $e)if(e.indexOf(s)>=0){i=s;let e=0;for(const t in r)e+=this.matrix[t][s]*r[t],r[t]=0;isNumber(n[s])&&(e+=n[s]);const o=Math.trunc(e);t[s]=o,r[s]=(1e3*e-1e3*o)/1e3}else isNumber(n[s])&&(r[s]=n[s]);for(const e in r)0!==r[e]&&(t[i]+=e===i?r[e]:r[e]/this.matrix[i][e]);return normalizeValues(this.matrix,t),clone$1(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return clone$1(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;for(const n of $e)if(t=this.values[n],r=e.values[n],!(void 0===t||0===t?void 0===r||0===r:t===r))return!1;var t,r;return!0}}const ze="Invalid Interval";class Interval{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new InvalidArgumentError("need to specify a reason the Interval is invalid");const r=e instanceof Invalid?e:new Invalid(e,t);if(Settings.throwOnInvalid)throw new InvalidIntervalError(r);return new Interval({invalid:r})}static fromDateTimes(e,t){const r=friendlyDateTime(e),n=friendlyDateTime(t),i=function validateStartEnd(e,t){return e&&e.isValid?t&&t.isValid?t<e?Interval.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null:Interval.invalid("missing or invalid end"):Interval.invalid("missing or invalid start")}(r,n);return null==i?new Interval({start:r,end:n}):i}static after(e,t){const r=Duration.fromDurationLike(t),n=friendlyDateTime(e);return Interval.fromDateTimes(n,n.plus(r))}static before(e,t){const r=Duration.fromDurationLike(t),n=friendlyDateTime(e);return Interval.fromDateTimes(n.minus(r),n)}static fromISO(e,t){const[r,n]=(e||"").split("/",2);if(r&&n){let e,i,s,o;try{e=DateTime.fromISO(r,t),i=e.isValid}catch(n){i=!1}try{s=DateTime.fromISO(n,t),o=s.isValid}catch(n){o=!1}if(i&&o)return Interval.fromDateTimes(e,s);if(i){const r=Duration.fromISO(n,t);if(r.isValid)return Interval.after(e,r)}else if(o){const e=Duration.fromISO(r,t);if(e.isValid)return Interval.before(s,e)}}return Interval.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return null===this.invalidReason}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e="milliseconds"){return this.isValid?this.toDuration(e).get(e):NaN}count(e="milliseconds",t){if(!this.isValid)return NaN;const r=this.start.startOf(e,t);let n;return n=null!=t&&t.useLocaleWeeks?this.end.reconfigure({locale:r.locale}):this.end,n=n.startOf(e,t),Math.floor(n.diff(r,e).get(e))+(n.valueOf()!==this.end.valueOf())}hasSame(e){return!!this.isValid&&(this.isEmpty()||this.e.minus(1).hasSame(this.s,e))}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return!!this.isValid&&this.s>e}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&(this.s<=e&&this.e>e)}set({start:e,end:t}={}){return this.isValid?Interval.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(friendlyDateTime).filter((e=>this.contains(e))).sort(((e,t)=>e.toMillis()-t.toMillis())),r=[];let{s:n}=this,i=0;for(;n<this.e;){const e=t[i]||this.e,s=+e>+this.e?this.e:e;r.push(Interval.fromDateTimes(n,s)),n=s,i+=1}return r}splitBy(e){const t=Duration.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let r,{s:n}=this,i=1;const s=[];for(;n<this.e;){const e=this.start.plus(t.mapUnits((e=>e*i)));r=+e>+this.e?this.e:e,s.push(Interval.fromDateTimes(n,r)),n=r,i+=1}return s}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return!!this.isValid&&+this.e==+e.s}abutsEnd(e){return!!this.isValid&&+e.e==+this.s}engulfs(e){return!!this.isValid&&(this.s<=e.s&&this.e>=e.e)}equals(e){return!(!this.isValid||!e.isValid)&&(this.s.equals(e.s)&&this.e.equals(e.e))}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,r=this.e<e.e?this.e:e.e;return t>=r?null:Interval.fromDateTimes(t,r)}union(e){if(!this.isValid)return this;const t=this.s<e.s?this.s:e.s,r=this.e>e.e?this.e:e.e;return Interval.fromDateTimes(t,r)}static merge(e){const[t,r]=e.sort(((e,t)=>e.s-t.s)).reduce((([e,t],r)=>t?t.overlaps(r)||t.abutsStart(r)?[e,t.union(r)]:[e.concat([t]),r]:[e,r]),[[],null]);return r&&t.push(r),t}static xor(e){let t=null,r=0;const n=[],i=e.map((e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}])),s=Array.prototype.concat(...i).sort(((e,t)=>e.time-t.time));for(const e of s)r+="s"===e.type?1:-1,1===r?t=e.time:(t&&+t!=+e.time&&n.push(Interval.fromDateTimes(t,e.time)),t=null);return Interval.merge(n)}difference(...e){return Interval.xor([this].concat(e)).map((e=>this.intersection(e))).filter((e=>e&&!e.isEmpty()))}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:ze}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=s,t={}){return this.isValid?Formatter.create(this.s.loc.clone(t),e).formatInterval(this):ze}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:ze}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ze}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:ze}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:ze}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):Duration.invalid(this.invalidReason)}mapEndpoints(e){return Interval.fromDateTimes(e(this.s),e(this.e))}}class Info{static hasDST(e=Settings.defaultZone){const t=DateTime.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return IANAZone.isValidZone(e)}static normalizeZone(e){return normalizeZone(e,Settings.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||Locale.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||Locale.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||Locale.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:i="gregory"}={}){return(n||Locale.create(t,r,i)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null,outputCalendar:i="gregory"}={}){return(n||Locale.create(t,r,i)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||Locale.create(t,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:r=null,locObj:n=null}={}){return(n||Locale.create(t,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Locale.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Locale.create(t,null,"gregory").eras(e)}static features(){return{relative:hasRelative(),localeWeek:hasLocaleWeekInfo()}}}function dayDiff(e,t){const utcDayStart=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=utcDayStart(t)-utcDayStart(e);return Math.floor(Duration.fromMillis(r).as("days"))}function diff(e,t,r,n){let[i,s,o,a]=function highOrderDiffs(e,t,r){const n=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter+4*(t.year-e.year)],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const r=dayDiff(e,t);return(r-r%7)/7}],["days",dayDiff]],i={},s=e;let o,a;for(const[u,c]of n)r.indexOf(u)>=0&&(o=u,i[u]=c(e,t),a=s.plus(i),a>t?(i[u]--,(e=s.plus(i))>t&&(a=e,i[u]--,e=s.plus(i))):e=a);return[e,i,a,o]}(e,t,r);const u=t-i,c=r.filter((e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0));0===c.length&&(o<t&&(o=i.plus({[a]:1})),o!==i&&(s[a]=(s[a]||0)+u/(o-i)));const l=Duration.fromObject(s,n);return c.length>0?Duration.fromMillis(u,n).shiftTo(...c).plus(l):l}const Be={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},We={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ue=Be.hanidec.replace(/[\[|\]]/g,"").split("");function digitRegex({numberingSystem:e},t=""){return new RegExp(`${Be[e||"latn"]}${t}`)}const Ze="missing Intl.DateTimeFormat.formatToParts support";function intUnit(e,t=(e=>e)){return{regex:e,deser:([e])=>t(function parseDigits(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let r=0;r<e.length;r++){const n=e.charCodeAt(r);if(-1!==e[r].search(Be.hanidec))t+=Ue.indexOf(e[r]);else for(const e in We){const[r,i]=We[e];n>=r&&n<=i&&(t+=n-r)}}return parseInt(t,10)}return t}(e))}}const Ge=`[ ${String.fromCharCode(160)}]`,He=new RegExp(Ge,"g");function fixListRegex(e){return e.replace(/\./g,"\\.?").replace(He,Ge)}function stripInsensitivities(e){return e.replace(/\./g,"").replace(He," ").toLowerCase()}function oneOf(e,t){return null===e?null:{regex:RegExp(e.map(fixListRegex).join("|")),deser:([r])=>e.findIndex((e=>stripInsensitivities(r)===stripInsensitivities(e)))+t}}function offset(e,t){return{regex:e,deser:([,e,t])=>signedOffset(e,t),groups:t}}function simple(e){return{regex:e,deser:([e])=>e}}const Ke={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};let Ye=null;function expandMacroTokens(e,t){return Array.prototype.concat(...e.map((e=>function maybeExpandMacroToken(e,t){if(e.literal)return e;const r=formatOptsToTokens(Formatter.macroTokenToFormatOpts(e.val),t);return null==r||r.includes(void 0)?e:r}(e,t))))}function explainFromTokens(e,t,r){const n=expandMacroTokens(Formatter.parseFormat(r),e),i=n.map((t=>function unitForToken(e,t){const r=digitRegex(t),n=digitRegex(t,"{2}"),i=digitRegex(t,"{3}"),s=digitRegex(t,"{4}"),o=digitRegex(t,"{6}"),a=digitRegex(t,"{1,2}"),u=digitRegex(t,"{1,3}"),c=digitRegex(t,"{1,6}"),l=digitRegex(t,"{1,9}"),d=digitRegex(t,"{2,4}"),f=digitRegex(t,"{4,6}"),literal=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},h=(h=>{if(e.literal)return literal(h);switch(h.val){case"G":return oneOf(t.eras("short"),0);case"GG":return oneOf(t.eras("long"),0);case"y":return intUnit(c);case"yy":case"kk":return intUnit(d,untruncateYear);case"yyyy":case"kkkk":return intUnit(s);case"yyyyy":return intUnit(f);case"yyyyyy":return intUnit(o);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return intUnit(a);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return intUnit(n);case"MMM":return oneOf(t.months("short",!0),1);case"MMMM":return oneOf(t.months("long",!0),1);case"LLL":return oneOf(t.months("short",!1),1);case"LLLL":return oneOf(t.months("long",!1),1);case"o":case"S":return intUnit(u);case"ooo":case"SSS":return intUnit(i);case"u":return simple(l);case"uu":return simple(a);case"uuu":case"E":case"c":return intUnit(r);case"a":return oneOf(t.meridiems(),0);case"EEE":return oneOf(t.weekdays("short",!1),1);case"EEEE":return oneOf(t.weekdays("long",!1),1);case"ccc":return oneOf(t.weekdays("short",!0),1);case"cccc":return oneOf(t.weekdays("long",!0),1);case"Z":case"ZZ":return offset(new RegExp(`([+-]${a.source})(?::(${n.source}))?`),2);case"ZZZ":return offset(new RegExp(`([+-]${a.source})(${n.source})?`),2);case"z":return simple(/[a-z_+-/]{1,256}?/i);case" ":return simple(/[^\S\n\r]/);default:return literal(h)}})(e)||{invalidReason:Ze};return h.token=e,h}(t,e))),s=i.find((e=>e.invalidReason));if(s)return{input:t,tokens:n,invalidReason:s.invalidReason};{const[e,r]=function buildRegex(e){return[`^${e.map((e=>e.regex)).reduce(((e,t)=>`${e}(${t.source})`),"")}$`,e]}(i),s=RegExp(e,"i"),[o,a]=function match(e,t,r){const n=e.match(t);if(n){const e={};let t=1;for(const i in r)if(hasOwnProperty(r,i)){const s=r[i],o=s.groups?s.groups+1:1;!s.literal&&s.token&&(e[s.token.val[0]]=s.deser(n.slice(t,t+o))),t+=o}return[n,e]}return[n,{}]}(t,s,r),[u,c,l]=a?function dateTimeFromMatches(e){let t,r=null;return isUndefined(e.z)||(r=IANAZone.create(e.z)),isUndefined(e.Z)||(r||(r=new FixedOffsetZone(e.Z)),t=e.Z),isUndefined(e.q)||(e.M=3*(e.q-1)+1),isUndefined(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),isUndefined(e.u)||(e.S=parseMillis(e.u)),[Object.keys(e).reduce(((t,r)=>{const n=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(r);return n&&(t[n]=e[r]),t}),{}),r,t]}(a):[null,null,void 0];if(hasOwnProperty(a,"a")&&hasOwnProperty(a,"H"))throw new ConflictingSpecificationError("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:n,regex:s,rawMatches:o,matches:a,result:u,zone:c,specificOffset:l}}}function formatOptsToTokens(e,t){if(!e)return null;const r=Formatter.create(t,e).dtFormatter(function getDummyDateTime(){return Ye||(Ye=DateTime.fromMillis(1555555555555)),Ye}()),n=r.formatToParts(),i=r.resolvedOptions();return n.map((t=>function tokenForPart(e,t,r){const{type:n,value:i}=e;if("literal"===n){const e=/^\s+$/.test(i);return{literal:!e,val:e?" ":i}}const s=t[n];let o=n;"hour"===n&&(o=null!=t.hour12?t.hour12?"hour12":"hour24":null!=t.hourCycle?"h11"===t.hourCycle||"h12"===t.hourCycle?"hour12":"hour24":r.hour12?"hour12":"hour24");let a=Ke[o];if("object"==typeof a&&(a=a[s]),a)return{literal:!1,val:a}}(t,e,i)))}const Je="Invalid DateTime",Qe=864e13;function unsupportedZone(e){return new Invalid("unsupported zone",`the zone "${e.name}" is not supported`)}function possiblyCachedWeekData(e){return null===e.weekData&&(e.weekData=gregorianToWeek(e.c)),e.weekData}function possiblyCachedLocalWeekData(e){return null===e.localWeekData&&(e.localWeekData=gregorianToWeek(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function clone(e,t){const r={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new DateTime({...r,...t,old:r})}function fixOffset(e,t,r){let n=e-60*t*1e3;const i=r.offset(n);if(t===i)return[n,t];n-=60*(i-t)*1e3;const s=r.offset(n);return i===s?[n,i]:[e-60*Math.min(i,s)*1e3,Math.max(i,s)]}function tsToObj(e,t){const r=new Date(e+=60*t*1e3);return{year:r.getUTCFullYear(),month:r.getUTCMonth()+1,day:r.getUTCDate(),hour:r.getUTCHours(),minute:r.getUTCMinutes(),second:r.getUTCSeconds(),millisecond:r.getUTCMilliseconds()}}function objToTS(e,t,r){return fixOffset(objToLocalTS(e),t,r)}function adjustTime(e,t){const r=e.o,n=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),s={...e.c,year:n,month:i,day:Math.min(e.c.day,daysInMonth(n,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},o=Duration.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),a=objToLocalTS(s);let[u,c]=fixOffset(a,r,e.zone);return 0!==o&&(u+=o,c=e.zone.offset(u)),{ts:u,o:c}}function parseDataToDateTime(e,t,r,n,i,s){const{setZone:o,zone:a}=r;if(e&&0!==Object.keys(e).length||t){const n=t||a,i=DateTime.fromObject(e,{...r,zone:n,specificOffset:s});return o?i:i.setZone(a)}return DateTime.invalid(new Invalid("unparsable",`the input "${i}" can't be parsed as ${n}`))}function toTechFormat(e,t,r=!0){return e.isValid?Formatter.create(Locale.create("en-US"),{allowZ:r,forceSimple:!0}).formatDateTimeFromString(e,t):null}function toISODate(e,t){const r=e.c.year>9999||e.c.year<0;let n="";return r&&e.c.year>=0&&(n+="+"),n+=padStart(e.c.year,r?6:4),t?(n+="-",n+=padStart(e.c.month),n+="-",n+=padStart(e.c.day)):(n+=padStart(e.c.month),n+=padStart(e.c.day)),n}function toISOTime(e,t,r,n,i,s){let o=padStart(e.c.hour);return t?(o+=":",o+=padStart(e.c.minute),0===e.c.millisecond&&0===e.c.second&&r||(o+=":")):o+=padStart(e.c.minute),0===e.c.millisecond&&0===e.c.second&&r||(o+=padStart(e.c.second),0===e.c.millisecond&&n||(o+=".",o+=padStart(e.c.millisecond,3))),i&&(e.isOffsetFixed&&0===e.offset&&!s?o+="Z":e.o<0?(o+="-",o+=padStart(Math.trunc(-e.o/60)),o+=":",o+=padStart(Math.trunc(-e.o%60))):(o+="+",o+=padStart(Math.trunc(e.o/60)),o+=":",o+=padStart(Math.trunc(e.o%60)))),s&&(o+="["+e.zone.ianaName+"]"),o}const Xe={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},et={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},tt={ordinal:1,hour:0,minute:0,second:0,millisecond:0},rt=["year","month","day","hour","minute","second","millisecond"],nt=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],it=["year","ordinal","hour","minute","second","millisecond"];function normalizeUnitWithLocalWeeks(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return function normalizeUnit(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new InvalidUnitError(e);return t}(e)}}function quickDT(e,t){const r=normalizeZone(t.zone,Settings.defaultZone),n=Locale.fromObject(t),i=Settings.now();let s,o;if(isUndefined(e.year))s=i;else{for(const t of rt)isUndefined(e[t])&&(e[t]=Xe[t]);const t=hasInvalidGregorianData(e)||hasInvalidTimeData(e);if(t)return DateTime.invalid(t);const n=r.offset(i);[s,o]=objToTS(e,n,r)}return new DateTime({ts:s,zone:r,loc:n,o})}function diffRelative(e,t,r){const n=!!isUndefined(r.round)||r.round,format=(e,i)=>{e=roundTo(e,n||r.calendary?0:2,!0);return t.loc.clone(r).relFormatter(r).format(e,i)},differ=n=>r.calendary?t.hasSame(e,n)?0:t.startOf(n).diff(e.startOf(n),n).get(n):t.diff(e,n).get(n);if(r.unit)return format(differ(r.unit),r.unit);for(const e of r.units){const t=differ(e);if(Math.abs(t)>=1)return format(t,e)}return format(e>t?-0:0,r.units[r.units.length-1])}function lastOpts(e){let t,r={};return e.length>0&&"object"==typeof e[e.length-1]?(r=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[r,t]}class DateTime{constructor(e){const t=e.zone||Settings.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new Invalid("invalid input"):null)||(t.isValid?null:unsupportedZone(t));this.ts=isUndefined(e.ts)?Settings.now():e.ts;let n=null,i=null;if(!r){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[n,i]=[e.old.c,e.old.o];else{const e=t.offset(this.ts);n=tsToObj(this.ts,e),r=Number.isNaN(n.year)?new Invalid("invalid input"):null,n=r?null:n,i=r?null:e}}this._zone=t,this.loc=e.loc||Locale.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=n,this.o=i,this.isLuxonDateTime=!0}static now(){return new DateTime({})}static local(){const[e,t]=lastOpts(arguments),[r,n,i,s,o,a,u]=t;return quickDT({year:r,month:n,day:i,hour:s,minute:o,second:a,millisecond:u},e)}static utc(){const[e,t]=lastOpts(arguments),[r,n,i,s,o,a,u]=t;return e.zone=FixedOffsetZone.utcInstance,quickDT({year:r,month:n,day:i,hour:s,minute:o,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const r=function isDate(e){return"[object Date]"===Object.prototype.toString.call(e)}(e)?e.valueOf():NaN;if(Number.isNaN(r))return DateTime.invalid("invalid input");const n=normalizeZone(t.zone,Settings.defaultZone);return n.isValid?new DateTime({ts:r,zone:n,loc:Locale.fromObject(t)}):DateTime.invalid(unsupportedZone(n))}static fromMillis(e,t={}){if(isNumber(e))return e<-Qe||e>Qe?DateTime.invalid("Timestamp out of range"):new DateTime({ts:e,zone:normalizeZone(t.zone,Settings.defaultZone),loc:Locale.fromObject(t)});throw new InvalidArgumentError(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(isNumber(e))return new DateTime({ts:1e3*e,zone:normalizeZone(t.zone,Settings.defaultZone),loc:Locale.fromObject(t)});throw new InvalidArgumentError("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const r=normalizeZone(t.zone,Settings.defaultZone);if(!r.isValid)return DateTime.invalid(unsupportedZone(r));const n=Locale.fromObject(t),i=normalizeObject(e,normalizeUnitWithLocalWeeks),{minDaysInFirstWeek:s,startOfWeek:o}=usesLocalWeekValues(i,n),a=Settings.now(),u=isUndefined(t.specificOffset)?r.offset(a):t.specificOffset,c=!isUndefined(i.ordinal),l=!isUndefined(i.year),d=!isUndefined(i.month)||!isUndefined(i.day),f=l||d,h=i.weekYear||i.weekNumber;if((f||c)&&h)throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&c)throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");const p=h||i.weekday&&!f;let m,y,b=tsToObj(a,u);p?(m=nt,y=et,b=gregorianToWeek(b,s,o)):c?(m=it,y=tt,b=gregorianToOrdinal(b)):(m=rt,y=Xe);let g=!1;for(const e of m){isUndefined(i[e])?i[e]=g?y[e]:b[e]:g=!0}const v=p?function hasInvalidWeekData(e,t=4,r=1){const n=isInteger(e.weekYear),i=integerBetween(e.weekNumber,1,weeksInWeekYear(e.weekYear,t,r)),s=integerBetween(e.weekday,1,7);return n?i?!s&&unitOutOfRange("weekday",e.weekday):unitOutOfRange("week",e.weekNumber):unitOutOfRange("weekYear",e.weekYear)}(i,s,o):c?function hasInvalidOrdinalData(e){const t=isInteger(e.year),r=integerBetween(e.ordinal,1,daysInYear(e.year));return t?!r&&unitOutOfRange("ordinal",e.ordinal):unitOutOfRange("year",e.year)}(i):hasInvalidGregorianData(i),w=v||hasInvalidTimeData(i);if(w)return DateTime.invalid(w);const I=p?weekToGregorian(i,s,o):c?ordinalToGregorian(i):i,[A,O]=objToTS(I,u,r),S=new DateTime({ts:A,zone:r,o:O,loc:n});return i.weekday&&f&&e.weekday!==S.weekday?DateTime.invalid("mismatched weekday",`you can't specify both a weekday of ${i.weekday} and a date of ${S.toISO()}`):S}static fromISO(e,t={}){const[r,n]=function parseISODate(e){return parse(e,[Ae,Re],[Oe,Ce],[Se,Pe],[_e,Ee])}(e);return parseDataToDateTime(r,n,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[r,n]=function parseRFC2822Date(e){return parse(function preprocessRFC2822(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[ge,extractRFC2822])}(e);return parseDataToDateTime(r,n,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[r,n]=function parseHTTPDate(e){return parse(e,[ve,extractRFC1123Or850],[we,extractRFC1123Or850],[Ie,extractASCII])}(e);return parseDataToDateTime(r,n,t,"HTTP",t)}static fromFormat(e,t,r={}){if(isUndefined(e)||isUndefined(t))throw new InvalidArgumentError("fromFormat requires an input string and a format");const{locale:n=null,numberingSystem:i=null}=r,s=Locale.fromOpts({locale:n,numberingSystem:i,defaultToEN:!0}),[o,a,u,c]=function parseFromTokens(e,t,r){const{result:n,zone:i,specificOffset:s,invalidReason:o}=explainFromTokens(e,t,r);return[n,i,s,o]}(s,e,t);return c?DateTime.invalid(c):parseDataToDateTime(o,a,r,`format ${t}`,e,u)}static fromString(e,t,r={}){return DateTime.fromFormat(e,t,r)}static fromSQL(e,t={}){const[r,n]=function parseSQL(e){return parse(e,[Le,Re],[De,xe])}(e);return parseDataToDateTime(r,n,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new InvalidArgumentError("need to specify a reason the DateTime is invalid");const r=e instanceof Invalid?e:new Invalid(e,t);if(Settings.throwOnInvalid)throw new InvalidDateTimeError(r);return new DateTime({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const r=formatOptsToTokens(e,Locale.fromObject(t));return r?r.map((e=>e?e.val:null)).join(""):null}static expandFormat(e,t={}){return expandMacroTokens(Formatter.parseFormat(e),Locale.fromObject(t)).map((e=>e.val)).join("")}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?possiblyCachedWeekData(this).weekYear:NaN}get weekNumber(){return this.isValid?possiblyCachedWeekData(this).weekNumber:NaN}get weekday(){return this.isValid?possiblyCachedWeekData(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?possiblyCachedLocalWeekData(this).weekday:NaN}get localWeekNumber(){return this.isValid?possiblyCachedLocalWeekData(this).weekNumber:NaN}get localWeekYear(){return this.isValid?possiblyCachedLocalWeekData(this).weekYear:NaN}get ordinal(){return this.isValid?gregorianToOrdinal(this.c).ordinal:NaN}get monthShort(){return this.isValid?Info.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Info.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Info.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Info.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,r=objToLocalTS(this.c),n=this.zone.offset(r-e),i=this.zone.offset(r+e),s=this.zone.offset(r-n*t),o=this.zone.offset(r-i*t);if(s===o)return[this];const a=r-s*t,u=r-o*t,c=tsToObj(a,s),l=tsToObj(u,o);return c.hour===l.hour&&c.minute===l.minute&&c.second===l.second&&c.millisecond===l.millisecond?[clone(this,{ts:a}),clone(this,{ts:u})]:[this]}get isInLeapYear(){return isLeapYear(this.year)}get daysInMonth(){return daysInMonth(this.year,this.month)}get daysInYear(){return this.isValid?daysInYear(this.year):NaN}get weeksInWeekYear(){return this.isValid?weeksInWeekYear(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?weeksInWeekYear(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:r,calendar:n}=Formatter.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:r,outputCalendar:n}}toUTC(e=0,t={}){return this.setZone(FixedOffsetZone.instance(e),t)}toLocal(){return this.setZone(Settings.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:r=!1}={}){if((e=normalizeZone(e,Settings.defaultZone)).equals(this.zone))return this;if(e.isValid){let n=this.ts;if(t||r){const t=e.offset(this.ts),r=this.toObject();[n]=objToTS(r,t,e)}return clone(this,{ts:n,zone:e})}return DateTime.invalid(unsupportedZone(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:r}={}){return clone(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:r})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=normalizeObject(e,normalizeUnitWithLocalWeeks),{minDaysInFirstWeek:r,startOfWeek:n}=usesLocalWeekValues(t,this.loc),i=!isUndefined(t.weekYear)||!isUndefined(t.weekNumber)||!isUndefined(t.weekday),s=!isUndefined(t.ordinal),o=!isUndefined(t.year),a=!isUndefined(t.month)||!isUndefined(t.day),u=o||a,c=t.weekYear||t.weekNumber;if((u||s)&&c)throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&s)throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");let l;i?l=weekToGregorian({...gregorianToWeek(this.c,r,n),...t},r,n):isUndefined(t.ordinal)?(l={...this.toObject(),...t},isUndefined(t.day)&&(l.day=Math.min(daysInMonth(l.year,l.month),l.day))):l=ordinalToGregorian({...gregorianToOrdinal(this.c),...t});const[d,f]=objToTS(l,this.o,this.zone);return clone(this,{ts:d,o:f})}plus(e){if(!this.isValid)return this;return clone(this,adjustTime(this,Duration.fromDurationLike(e)))}minus(e){if(!this.isValid)return this;return clone(this,adjustTime(this,Duration.fromDurationLike(e).negate()))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const r={},n=Duration.normalizeUnit(e);switch(n){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0}if("weeks"===n)if(t){const e=this.loc.getStartOfWeek(),{weekday:t}=this;t<e&&(r.weekNumber=this.weekNumber-1),r.weekday=e}else r.weekday=1;if("quarters"===n){const e=Math.ceil(this.month/3);r.month=3*(e-1)+1}return this.set(r)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?Formatter.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):Je}toLocaleString(e=s,t={}){return this.isValid?Formatter.create(this.loc.clone(t),e).formatDateTime(this):Je}toLocaleParts(e={}){return this.isValid?Formatter.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:r=!1,includeOffset:n=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;const s="extended"===e;let o=toISODate(this,s);return o+="T",o+=toISOTime(this,s,t,r,n,i),o}toISODate({format:e="extended"}={}){return this.isValid?toISODate(this,"extended"===e):null}toISOWeekDate(){return toTechFormat(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:r=!0,includePrefix:n=!1,extendedZone:i=!1,format:s="extended"}={}){if(!this.isValid)return null;return(n?"T":"")+toISOTime(this,"extended"===s,t,e,r,i)}toRFC2822(){return toTechFormat(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return toTechFormat(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?toISODate(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:r=!0}={}){let n="HH:mm:ss.SSS";return(t||e)&&(r&&(n+=" "),t?n+="z":e&&(n+="ZZ")),toTechFormat(this,n,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Je}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",r={}){if(!this.isValid||!e.isValid)return Duration.invalid("created by diffing an invalid DateTime");const n={locale:this.locale,numberingSystem:this.numberingSystem,...r},i=function maybeArray(e){return Array.isArray(e)?e:[e]}(t).map(Duration.normalizeUnit),s=e.valueOf()>this.valueOf(),o=diff(s?this:e,s?e:this,i,n);return s?o.negate():o}diffNow(e="milliseconds",t={}){return this.diff(DateTime.now(),e,t)}until(e){return this.isValid?Interval.fromDateTimes(this,e):this}hasSame(e,t,r){if(!this.isValid)return!1;const n=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,r)<=n&&n<=i.endOf(t,r)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||DateTime.fromObject({},{zone:this.zone}),r=e.padding?this<t?-e.padding:e.padding:0;let n=["years","months","days","hours","minutes","seconds"],i=e.unit;return Array.isArray(e.unit)&&(n=e.unit,i=void 0),diffRelative(t,this.plus(r),{...e,numeric:"always",units:n,unit:i})}toRelativeCalendar(e={}){return this.isValid?diffRelative(e.base||DateTime.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(DateTime.isDateTime))throw new InvalidArgumentError("min requires all arguments be DateTimes");return bestBy(e,(e=>e.valueOf()),Math.min)}static max(...e){if(!e.every(DateTime.isDateTime))throw new InvalidArgumentError("max requires all arguments be DateTimes");return bestBy(e,(e=>e.valueOf()),Math.max)}static fromFormatExplain(e,t,r={}){const{locale:n=null,numberingSystem:i=null}=r;return explainFromTokens(Locale.fromOpts({locale:n,numberingSystem:i,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,r={}){return DateTime.fromFormatExplain(e,t,r)}static get DATE_SHORT(){return s}static get DATE_MED(){return o}static get DATE_MED_WITH_WEEKDAY(){return a}static get DATE_FULL(){return u}static get DATE_HUGE(){return c}static get TIME_SIMPLE(){return l}static get TIME_WITH_SECONDS(){return d}static get TIME_WITH_SHORT_OFFSET(){return f}static get TIME_WITH_LONG_OFFSET(){return h}static get TIME_24_SIMPLE(){return p}static get TIME_24_WITH_SECONDS(){return m}static get TIME_24_WITH_SHORT_OFFSET(){return y}static get TIME_24_WITH_LONG_OFFSET(){return b}static get DATETIME_SHORT(){return g}static get DATETIME_SHORT_WITH_SECONDS(){return v}static get DATETIME_MED(){return w}static get DATETIME_MED_WITH_SECONDS(){return I}static get DATETIME_MED_WITH_WEEKDAY(){return A}static get DATETIME_FULL(){return O}static get DATETIME_FULL_WITH_SECONDS(){return S}static get DATETIME_HUGE(){return _}static get DATETIME_HUGE_WITH_SECONDS(){return R}}function friendlyDateTime(e){if(DateTime.isDateTime(e))return e;if(e&&e.valueOf&&isNumber(e.valueOf()))return DateTime.fromJSDate(e);if(e&&"object"==typeof e)return DateTime.fromObject(e);throw new InvalidArgumentError(`Unknown datetime argument: ${e}, of type ${typeof e}`)}t.DateTime=DateTime,t.Duration=Duration,t.FixedOffsetZone=FixedOffsetZone,t.IANAZone=IANAZone,t.Info=Info,t.Interval=Interval,t.InvalidZone=InvalidZone,t.Settings=Settings,t.SystemZone=SystemZone,t.VERSION="3.4.4",t.Zone=Zone},889:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.nameof=void 0;var n=r(3524);Object.defineProperty(t,"nameof",{enumerable:!0,get:function(){return n.nameof}})},3524:(e,t)=>{"use strict";function cleanseAssertionOperators(e){return e.replace(/[?!]/g,"")}Object.defineProperty(t,"__esModule",{value:!0}),t.nameof=void 0,t.nameof=function nameof(e,t){var r=e.toString();if(r.startsWith("class ")&&!r.startsWith("class =>"))return cleanseAssertionOperators(r.substring(6,r.indexOf(" {")));if(r.includes("=>"))return cleanseAssertionOperators(r.substring(r.indexOf(".")+1));var n=r.match(/function\s*\(\w+\)\s*\{[\r\n\s]*return\s+\w+\.((\w+\.)*(\w+))/i);if(n)return t&&t.lastProp?n[3]:n[1];if(r.startsWith("function "))return cleanseAssertionOperators(r.substring(9,r.indexOf("(")));throw new Error("ts-simple-nameof: Invalid function.")}},3870:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildInformation=void 0;const n=r(1391),i=r(2344),s=r(922),o=r(2984);t.buildInformation={version:"3.10.0",build:"73",date:"2024-04-22T15:09:27+00:00",commit:"af98434e2550967725b8ccbe38a854e88140cb7f",dependencies:{"@js-soft/docdb-querytranslator":"^1.1.4","@nmshd/iql":"^1.0.2","ts-simple-nameof":"^1.3.1"},libraries:{transport:o.buildInformation,crypto:s.buildInformation,serval:n.buildInformation,content:i.buildInformation}}},3128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsumptionBaseController=void 0;const n=r(2984);t.ConsumptionBaseController=class ConsumptionBaseController{get log(){return this._log}get parent(){return this._parent}constructor(e,t){this._parent=t,this._log=n.TransportLoggerFactory.getLogger(e)}init(){return Promise.resolve(this)}parseArray(e,t){return e.map((e=>t.fromAny(e)))}}},2501:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsumptionController=void 0;const n=r(2344),i=r(5168);t.ConsumptionController=class ConsumptionController{constructor(e,t){this.transport=e,this.accountController=t}get attributes(){return this._attributes}get drafts(){return this._drafts}get outgoingRequests(){return this._outgoingRequests}get incomingRequests(){return this._incomingRequests}get settings(){return this._settings}get attributeListeners(){return this._attributeListeners}get notifications(){return this._notifications}async init(e=new Map,t=new Map){this._attributes=await new i.AttributesController(this,this.transport.eventBus,this.accountController.identity).init(),this._drafts=await new i.DraftsController(this).init();const r=new i.RequestItemProcessorRegistry(this,this.getDefaultRequestItemProcessors());for(const[t,n]of e)r.registerOrReplaceProcessor(t,n);this._outgoingRequests=await new i.OutgoingRequestsController(await this.accountController.getSynchronizedCollection("Requests"),r,this,this.transport.eventBus,this.accountController.identity,this.accountController.relationships).init(),this._incomingRequests=await new i.IncomingRequestsController(await this.accountController.getSynchronizedCollection("Requests"),r,this,this.transport.eventBus,this.accountController.identity).init();const n=new i.NotificationItemProcessorRegistry(this,this.getDefaultNotificationItemProcessors());for(const[e,r]of t)n.registerOrReplaceProcessor(e,r);return this._notifications=await new i.NotificationsController(await this.accountController.getSynchronizedCollection("Notifications"),n,this,this.transport.eventBus,this.accountController.activeDevice).init(),this._settings=await new i.SettingsController(this).init(),this._attributeListeners=await new i.AttributeListenersController(this,this.transport.eventBus,this.accountController.identity).init(),this}getDefaultRequestItemProcessors(){return new Map([[n.ShareAttributeRequestItem,i.ShareAttributeRequestItemProcessor],[n.CreateAttributeRequestItem,i.CreateAttributeRequestItemProcessor],[n.DeleteAttributeRequestItem,i.DeleteAttributeRequestItemProcessor],[n.ReadAttributeRequestItem,i.ReadAttributeRequestItemProcessor],[n.ProposeAttributeRequestItem,i.ProposeAttributeRequestItemProcessor],[n.ConsentRequestItem,i.GenericRequestItemProcessor],[n.AuthenticationRequestItem,i.GenericRequestItemProcessor],[n.RegisterAttributeListenerRequestItem,i.RegisterAttributeListenerRequestItemProcessor],[n.FreeTextRequestItem,i.FreeTextRequestItemProcessor]])}getDefaultNotificationItemProcessors(){return new Map([[n.PeerSharedAttributeSucceededNotificationItem,i.PeerSharedAttributeSucceededNotificationItemProcessor],[n.OwnSharedAttributeDeletedByOwnerNotificationItem,i.OwnSharedAttributeDeletedByOwnerNotificationItemProcessor],[n.PeerSharedAttributeDeletedByPeerNotificationItem,i.PeerSharedAttributeDeletedByPeerNotificationItemProcessor],[n.ThirdPartyOwnedRelationshipAttributeDeletedByPeerNotificationItem,i.ThirdPartyOwnedRelationshipAttributeDeletedByPeerNotificationItemProcessor]])}}},282:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ConsumptionControllerName=void 0,function(e){e.AttributesController="AttributesController",e.AttributeListenersController="AttributeListenersController",e.DraftsController="DraftsController",e.RelationshipInfoController="RelationshipInfoController",e.SingleRelationshipController="SingleRelationshipController",e.OnboardingFlowController="OnboardingFlowController",e.OffboardingFlowController="OffboardingFlowController",e.RequestsController="Requestsontroller",e.SettingsController="SettingsController",e.SharedItemsController="SharedItemsController",e.NotificationsController="NotificationsController"}(r||(t.ConsumptionControllerName=r={}))},3347:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsumptionError=void 0;class ConsumptionError extends Error{}t.ConsumptionError=ConsumptionError},9979:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsumptionIds=void 0;const n=r(2984);class ConsumptionIds{static{this.draft=new n.CoreIdHelper("LCLDRF")}static{this.setting=new n.CoreIdHelper("LCLSET")}static{this.attribute=new n.CoreIdHelper("ATT")}static{this.request=new n.CoreIdHelper("REQ")}static{this.attributeListener=new n.CoreIdHelper("ATL")}static{this.notification=new n.CoreIdHelper("NOT")}}t.ConsumptionIds=ConsumptionIds},4768:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoreErrors=void 0;const n=r(1917),i=r(2984);class Attributes{successorIsNotAValidAttribute(e){return new i.CoreError("error.consumption.attributes.successorIsNotAValidAttribute","Validation failed during creation of successor.",e,void 0,e instanceof Error?e:void 0)}successionMustNotChangeKey(){return new i.CoreError("error.consumption.attributes.successionMustNotChangeKey","The predecessor attribute's key does not match that of the successor. The succession of a relationship attribute must not change the key.")}successionPeerIsNotOwner(){return new i.CoreError("error.consumption.attributes.successionPeerIsNotOwner","The peer of the succeeded attribute is not its owner. This may be an attempt of spoofing.")}predecessorSourceAttributeIsNotRepositoryAttribute(){return new i.CoreError("error.consumption.attributes.predecessorSourceAttributeIsNotRepositoryAttribute","Predecessor source attribute is not a repository attribute.")}successorSourceAttributeIsNotRepositoryAttribute(){return new i.CoreError("error.consumption.attributes.successorSourceAttributeIsNotRepositoryAttribute","Successor source attribute is not a repository attribute.")}successorSourceDoesNotSucceedPredecessorSource(){return new i.CoreError("error.consumption.attributes.successorSourceDoesNotSucceedPredecessorSource","Predecessor source attribute is not succeeded by successor source attribute.")}predecessorSourceContentIsNotEqualToCopyContent(){return new i.CoreError("error.consumption.attributes.predecessorSourceContentIsNotEqualToCopyContent","Predecessor source attribute content doesn't match predecessor shared attribute copy.")}successorSourceContentIsNotEqualToCopyContent(){return new i.CoreError("error.consumption.attributes.successorSourceContentIsNotEqualToCopyContent","Successor source attribute content doesn't match successor shared attribute copy.")}cannotSucceedChildOfComplexAttribute(e){return new i.CoreError("error.consumption.attributes.cannotSucceedChildOfComplexAttribute",`The attribute you want to succeed is child attribute of a complex attribute (id: ${e}), and cannot be succeeded on its own. Instead, succeed the parent which will implicitly succeed all its children.`)}successorMustNotYetExist(){return new i.CoreError("error.consumption.attributes.successorMustNotYetExist","The predecessor attribute's successor must not exist. It will be created by the succession handlers and must not be created manually.")}successorMustNotHaveASuccessor(e){let t="The successor must not have a successor itself.";return e&&(t+=` ${e}`),new i.CoreError("error.consumption.attributes.successorMustNotHaveASuccessor",t)}predecessorIsNotRepositoryAttribute(){return new i.CoreError("error.consumption.attributes.predecessorIsNotRepositoryAttribute","Predecessor is not a repository attribute.")}predecessorIsNotOwnSharedIdentityAttribute(){return new i.CoreError("error.consumption.attributes.predecessorIsNotOwnSharedIdentityAttribute","Predecessor is not an own shared identity attribute.")}predecessorIsNotPeerSharedIdentityAttribute(){return new i.CoreError("error.consumption.attributes.predecessorIsNotPeerSharedIdentityAttribute","Predecessor is not a peer shared identity attribute.")}predecessorIsNotOwnSharedRelationshipAttribute(){return new i.CoreError("error.consumption.attributes.predecessorIsNotOwnSharedRelationshipAttribute","Predecessor is not an own shared relationship attribute.")}predecessorIsNotPeerSharedRelationshipAttribute(){return new i.CoreError("error.consumption.attributes.predecessorIsNotPeerSharedRelationshipAttribute","Predecessor is not a peer shared relationship attribute.")}successorIsNotRepositoryAttribute(){return new i.CoreError("error.consumption.attributes.successorIsNotRepositoryAttribute","Successor is not a repository attribute.")}successorIsNotOwnSharedIdentityAttribute(){return new i.CoreError("error.consumption.attributes.successorIsNotOwnSharedIdentityAttribute","Successor is not an own shared identity attribute.")}successorIsNotPeerSharedIdentityAttribute(){return new i.CoreError("error.consumption.attributes.successorIsNotPeerSharedIdentityAttribute","Successor is not a peer shared identity attribute.")}successorIsNotOwnSharedRelationshipAttribute(){return new i.CoreError("error.consumption.attributes.successorIsNotOwnSharedRelationshipAttribute","Successor is not an own shared relationship attribute.")}successorIsNotPeerSharedRelationshipAttribute(){return new i.CoreError("error.consumption.attributes.successorIsNotPeerSharedRelationshipAttribute","Successor is not a peer shared relationship attribute.")}setPredecessorIdDoesNotMatchActualPredecessorId(){return new i.CoreError("error.consumption.attributes.setPredecessorIdDoesNotMatchActualPredecessorId","The predecessor's id and the explicitly set value for the successor's succeeds field don't match.")}predecessorDoesNotExist(){return new i.CoreError("error.consumption.attributes.predecessorDoesNotExist","The predecessor does not exist.")}successorDoesNotExist(){return new i.CoreError("error.consumption.attributes.successorDoesNotExist","The successor does not exist.")}successorSourceAttributeIsNotSpecified(){return new i.CoreError("error.consumption.attributes.successorSourceAttributeIsNotSpecified","You must specify the source attribute of the successor.")}successorSourceAttributeDoesNotExist(){return new i.CoreError("error.consumption.attributes.successorSourceAttributeDoesNotExist","The successor source Attribute does not exist.")}successionMustNotChangeOwner(){return new i.CoreError("error.consumption.attributes.successionMustNotChangeOwner","The successor attribute's owner does not match that of the predecessor. An attribute succession must not change the attribute's owner.")}successionMustNotChangeValueType(){return new i.CoreError("error.consumption.attributes.successionMustNotChangeValueType","The successor attribute's value type does not match that of the predecessor. An attribute succession must not change the attribute's value type.")}successionMustNotChangeContentType(){return new i.CoreError("error.consumption.attributes.successionMustNotChangeContentType","The successor attribute's content type does not match that of the predecessor. An attribute succession must not change the attribute's content type, i.e. an identity attribute must not be succeeded by a relationship attribute and v.v.")}successionMustNotChangePeer(e){let t="The peer of the shared attribute must not change.";return e&&(t+=` ${e}`),new i.CoreError("error.consumption.attributes.successionMustNotChangePeer",t)}cannotSucceedAttributesWithASuccessor(e){return new i.CoreError("error.consumption.attributes.cannotSucceedAttributesWithASuccessor",`The attribute you want to succeed has a successor (id: ${e}). You cannot succeed attributes with a successor. Instead, succeed the successor.`)}invalidParentSuccessor(e){return new i.CoreError("error.consumption.attributes.invalidParentSuccessor",`The complex parent successor (id: ${e}) does not exist.`)}cannotSucceedAttributesWithDeletionInfo(){return new i.CoreError("error.consumption.attributes.cannotSucceedAttributesWithDeletionInfo","You cannot succeed attributes with a deletionInfo, since the peer may have already deleted it or marked it for deletion.")}cannotSetDeletionInfoOfRepositoryAttributes(){return new i.CoreError("error.consumption.attributes.cannotSetDeletionInfoOfRepositoryAttributes","RepositoryAttributes can not have a deletionInfo, since they are not shared with a peer and you can delete them directly.")}invalidDeletionInfoOfOwnSharedAttribute(){return new i.CoreError("error.consumption.attributes.invalidDeletionInfoOfOwnSharedAttribute","The only valid deletionStatuses for own shared Attributes are 'DeletedByPeer' or 'ToBeDeletedByPeer'.")}invalidDeletionInfoOfPeerSharedAttribute(){return new i.CoreError("error.consumption.attributes.invalidDeletionInfoOfPeerSharedAttribute","The only valid deletionStatuses for peer shared Attributes are 'DeletedByOwner' or 'ToBeDeleted'.")}invalidDeletionInfoOfThirdPartyOwnedRelationshipAttribute(){return new i.CoreError("error.consumption.attributes.invalidDeletionInfoOfThirdPartyOwnedRelationshipAttribute","The only valid deletionStatus for third party owned RelationshipAttributes is 'DeletedByPeer'.")}invalidPropertyValue(e){return new i.CoreError("error.consumption.attributes.invalidPropertyValue",e)}isNotSharedAttribute(e){return new i.CoreError("error.consumption.attributes.isNotSharedAttribute",`The attribute (id: ${e}) is not a shared attribute.`)}isNotOwnSharedAttribute(e){return new i.CoreError("error.consumption.attributes.isNotOwnSharedAttribute",`The attribute (id: ${e}) is not an own shared attribute.`)}isNotPeerSharedAttribute(e){return new i.CoreError("error.consumption.attributes.isNotPeerSharedAttribute",`The attribute (id: ${e}) is not a peer shared attribute.`)}isNotThirdPartyOwnedRelationshipAttribute(e){return new i.CoreError("error.consumption.attributes.isNotThirdPartyOwnedRelationshipAttribute",`The attribute (id: ${e}) is not a third party owned RelationshipAttribute.`)}senderIsNotPeerOfSharedAttribute(e,t){return new i.CoreError("error.consumption.attributes.senderIsNotPeerOfSharedAttribute",`The sender (id: ${e}) is not the peer you shared the attribute (id: ${t}) with.`)}}class Requests{constructor(){this.decideValidation=new Requests._decideValidation}unexpectedErrorDuringRequestItemProcessing(e){return new i.CoreError("error.consumption.requests.unexpectedErrorDuringRequestItemProcessing",e instanceof Error?e.message:`Unknown error: '${JSON.stringify(e)}'`,void 0,void 0,e)}servalErrorDuringRequestItemProcessing(e){return new i.CoreError("error.consumption.requests.servalErrorDuringRequestItemProcessing",e instanceof Error?e.message:`Serval error: '${JSON.stringify(e)}'`,void 0,void 0,e)}invalidAcceptParameters(e){return new n.ApplicationError("error.consumption.requests.invalidAcceptParameters",e)}invalidRequestItem(e){return new i.CoreError("error.consumption.requests.invalidRequestItem",e)}static{this._decideValidation=class{invalidNumberOfItems(e){return new n.ApplicationError("error.consumption.requests.decide.validation.invalidNumberOfItems",e)}itemAcceptedButParentNotAccepted(e){return new n.ApplicationError("error.consumption.requests.decide.validation.itemAcceptedButParentNotAccepted",e)}mustBeAcceptedItemNotAccepted(e){return new n.ApplicationError("error.consumption.requests.decide.validation.mustBeAcceptedItemNotAccepted",e)}requestItemAnsweredAsRequestItemGroup(){return new n.ApplicationError("error.consumption.requests.decide.validation.requestItemAnsweredAsRequestItemGroup","The RequestItem was answered as a RequestItemGroup.")}requestItemGroupAnsweredAsRequestItem(){return new n.ApplicationError("error.consumption.requests.decide.validation.requestItemGroupAnsweredAsRequestItem","The RequestItemGroup was answered as a RequestItem.")}}}}class CoreErrors{static{this.attributes=new Attributes}static{this.requests=new Requests}}t.CoreErrors=CoreErrors},7806:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(3870),t),i(r(3128),t),i(r(2501),t),i(r(282),t),i(r(3347),t),i(r(9979),t),i(r(4768),t),i(r(5168),t)},3215:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeListenersController=void 0;const n=r(3128),i=r(282),s=r(9979),o=r(4568),a=r(9021),u=r(7203);class AttributeListenersController extends n.ConsumptionBaseController{constructor(e,t,r){super(i.ConsumptionControllerName.AttributeListenersController,e),this.eventBus=t,this.identity=r}async init(){return await super.init(),this.attributeListeners=await this.parent.accountController.getSynchronizedCollection("AttributeListeners"),this}async getAttributeListeners(e){const t=await this.attributeListeners.find(e);return this.parseArray(t,u.LocalAttributeListener)}async getAttributeListener(e){const t=await this.attributeListeners.read(e.toString());if(t)return u.LocalAttributeListener.from(t)}async createAttributeListener(e){const t=a.CreateLocalAttributeListenerParams.from(e),r=u.LocalAttributeListener.from({id:await s.ConsumptionIds.attributeListener.generate(),query:t.query,peer:t.peer});return await this.attributeListeners.create(r),this.eventBus.publish(new o.AttributeListenerCreatedEvent(this.identity.address.toString(),r)),r}}t.AttributeListenersController=AttributeListenersController},8384:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeListenerCreatedEvent=void 0;const n=r(2984);class AttributeListenerCreatedEvent extends n.TransportDataEvent{static{this.namespace="consumption.attributeListenerCreated"}constructor(e,t){super(AttributeListenerCreatedEvent.namespace,e,t)}}t.AttributeListenerCreatedEvent=AttributeListenerCreatedEvent},4568:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8384),t)},7796:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(3215),t),i(r(4568),t),i(r(9021),t),i(r(7203),t)},9021:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CreateLocalAttributeListenerParams=void 0;const s=r(1391),o=r(2344),a=r(2984);let u=class CreateLocalAttributeListenerParams extends s.Serializable{static from(e){return this.fromAny(e)}};t.CreateLocalAttributeListenerParams=u,n([(0,s.serialize)({unionTypes:[o.IdentityAttributeQuery,o.ThirdPartyRelationshipAttributeQuery]}),(0,s.validate)(),i("design:type",Object)],u.prototype,"query",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",a.CoreAddress)],u.prototype,"peer",void 0),t.CreateLocalAttributeListenerParams=u=n([(0,s.type)("CreateLocalAttributeListenerParams")],u)},7203:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.LocalAttributeListener=void 0;const s=r(1391),o=r(2344),a=r(2984),u=r(889);let c=class LocalAttributeListener extends a.CoreSynchronizable{constructor(){super(...arguments),this.userdataProperties=[(0,u.nameof)((e=>e.query)),(0,u.nameof)((e=>e.peer))]}static from(e){return this.fromAny(e)}toJSON(){return super.toJSON()}};t.LocalAttributeListener=c,n([(0,s.serialize)({unionTypes:[o.IdentityAttributeQuery,o.ThirdPartyRelationshipAttributeQuery]}),(0,s.validate)(),i("design:type",Object)],c.prototype,"query",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",a.CoreAddress)],c.prototype,"peer",void 0),t.LocalAttributeListener=c=n([(0,s.type)("LocalAttributeListener")],c)},6727:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AttributesController=void 0;const a=r(2344),u=s(r(7181)),c=r(2984),l=o(r(5250)),d=r(889),f=r(3128),h=r(282),p=r(3347),m=r(9979),y=r(4768),b=r(1180),g=r(1984),v=r(6858),w=r(8525),I=r(8697),A=r(4291),O=r(2512),S=r(494);class AttributesController extends f.ConsumptionBaseController{constructor(e,t,r){super(h.ConsumptionControllerName.AttributesController,e),this.eventBus=t,this.identity=r}async init(){return await super.init(),this.attributes=await this.parent.accountController.getSynchronizedCollection("Attributes"),this}checkValid(e){const t=c.CoreDate.utc();return!e.content.validFrom&&!e.content.validTo||(!(!e.content.validFrom||e.content.validTo||!e.content.validFrom.isSameOrBefore(t))||(!(e.content.validFrom||!e.content.validTo?.isSameOrAfter(t))||!!(e.content.validFrom&&e.content.validTo&&e.content.validFrom.isSameOrBefore(t)&&e.content.validTo.isSameOrAfter(t))))}findCurrent(e){const t=e.sort(((e,t)=>e.createdAt.compare(t.createdAt)));let r;for(const e of t)this.checkValid(e)&&(r=e);return r}filterCurrent(e){const t=e.sort(((e,t)=>e.createdAt.compare(t.createdAt))),r=[];for(const e of t)this.checkValid(e)&&r.push(e);return r}async getLocalAttribute(e){const t=await this.attributes.findOne({[(0,d.nameof)((e=>e.id))]:e.toString()});if(t)return A.LocalAttribute.from(t)}async getLocalAttributes(e,t=!1,r=!1){const n=this.enrichQuery(e,t),i=await this.attributes.find(n),s=this.parseArray(i,A.LocalAttribute);return r?this.filterCurrent(s):s}enrichQuery(e,t){if(!t)return e;const r={$or:[{[`${(0,d.nameof)((e=>e.content))}.@type`]:"IdentityAttribute"},{$and:[{[`${(0,d.nameof)((e=>e.content))}.@type`]:"RelationshipAttribute"},{[`${(0,d.nameof)((e=>e.content))}.${(0,d.nameof)((e=>e.isTechnical))}`]:!1}]}]};return e?{$and:[e,r]}:r}async getValidLocalAttributes(e,t=!1){return await this.getLocalAttributes(e,t,!0)}async executeIQLQuery(e){const t=await this.attributes.find({"content.@type":"IdentityAttribute",shareInfo:{$exists:!1}}),r=t.map((e=>e.content)),n=u.execute(e.queryString,r).map((e=>t[e]));return this.parseArray(n,A.LocalAttribute)}async executeRelationshipAttributeQuery(e){const t=a.RelationshipAttributeQuery.from(e),r=S.RelationshipAttributeQueryTranslator.translate(t);r["content.confidentiality"]={$ne:"private"};const n=await this.attributes.find(r);return n.length>0?A.LocalAttribute.from(n[0]):void 0}async executeThirdPartyRelationshipAttributeQuery(e){const t=a.ThirdPartyRelationshipAttributeQuery.from(e),r=S.ThirdPartyRelationshipAttributeQueryTranslator.translate(t);r["content.confidentiality"]={$ne:"private"};const n=await this.attributes.find(r);return this.parseArray(n,A.LocalAttribute)}async executeIdentityAttributeQuery(e){const t=a.IdentityAttributeQuery.from(e),r=S.IdentityAttributeQueryTranslator.translate(t);r["content.owner"]=this.identity.address.toString(),r.shareInfo={$exists:!1};const n=await this.attributes.find(r);return this.parseArray(n,A.LocalAttribute)}async createLocalAttribute(e){const t=w.CreateLocalAttributeParams.from(e),r=A.LocalAttribute.from({id:t.id??await m.ConsumptionIds.attribute.generate(),createdAt:c.CoreDate.utc(),content:t.content,parentId:t.parentId,succeeds:t.succeeds,shareInfo:t.shareInfo});return await this.attributes.create(r),r.content instanceof a.IdentityAttribute&&r.content.value instanceof a.AbstractComplexValue&&await this.createLocalAttributesForChildrenOfComplexAttribute(r),this.eventBus.publish(new g.AttributeCreatedEvent(this.identity.address.toString(),r)),r}async createLocalAttributesForChildrenOfComplexAttribute(e){if(!(e.content instanceof a.IdentityAttribute))throw new p.ConsumptionError("Only IdentityAttributes may have child Attributes.");const t=Object.values(e.content.value).filter((e=>e instanceof a.AbstractAttributeValue));for(const r of t){const t=a.IdentityAttribute.from({...e.content.toJSON(),value:r.toJSON()});await this.createLocalAttribute({content:t,parentId:e.id})}}async createSharedLocalAttributeCopy(e){const t=I.CreateSharedLocalAttributeCopyParams.from(e),r=await this.getLocalAttribute(t.sourceAttributeId);if(!r)throw c.CoreErrors.general.recordNotFound(A.LocalAttribute,t.sourceAttributeId.toString());const n=O.LocalAttributeShareInfo.from({peer:t.peer,requestReference:t.requestReference,sourceAttribute:t.sourceAttributeId}),i=await A.LocalAttribute.fromAttribute(r.content,void 0,n,t.attributeId);return await this.attributes.create(i),this.eventBus.publish(new g.SharedAttributeCopyCreatedEvent(this.identity.address.toString(),i)),i}async createPeerLocalAttribute(e){const t=O.LocalAttributeShareInfo.from({peer:e.peer,requestReference:e.requestReference}),r=A.LocalAttribute.from({id:e.id??await m.ConsumptionIds.attribute.generate(),content:e.content,shareInfo:t,createdAt:c.CoreDate.utc()});return await this.attributes.create(r),this.eventBus.publish(new g.AttributeCreatedEvent(this.identity.address.toString(),r)),r}async deleteAttribute(e){e.content instanceof a.IdentityAttribute&&e.content.value instanceof a.AbstractComplexValue&&await this.deleteChildAttributesOfComplexAttribute(e),await this.deleteAttributeUnsafe(e.id),this.eventBus.publish(new g.AttributeDeletedEvent(this.identity.address.toString(),e))}async deleteChildAttributesOfComplexAttribute(e){if(!(e.content instanceof a.IdentityAttribute))throw new p.ConsumptionError("Only IdentityAttributes may have child Attributes.");const t=await this.getLocalAttributes({parentId:e.id.toString()});for(const e of t)await this.deleteAttribute(e)}async succeedRepositoryAttribute(e,t,r=!0){const n=v.AttributeSuccessorParams.from(t);if(r){const t=await this.validateRepositoryAttributeSuccession(e,n);if(t.isError())throw t.error}const{predecessor:i,successor:s}=await this._succeedAttributeUnsafe(e,{id:n.id,content:n.content,succeeds:e,shareInfo:n.shareInfo,parentId:n.parentId,createdAt:n.createdAt,succeededBy:n.succeededBy});return i.isComplexAttribute()&&await this.succeedChildrenOfComplexAttribute(s.id),this.eventBus.publish(new g.RepositoryAttributeSucceededEvent(this.identity.address.toString(),i,s)),{predecessor:i,successor:s}}async succeedOwnSharedIdentityAttribute(e,t,r=!0){const n=v.AttributeSuccessorParams.from(t);if(r){const t=await this.validateOwnSharedIdentityAttributeSuccession(e,n);if(t.isError())throw t.error}const{predecessor:i,successor:s}=await this._succeedAttributeUnsafe(e,{id:n.id,content:n.content,succeeds:e,shareInfo:n.shareInfo,parentId:n.parentId,createdAt:n.createdAt,succeededBy:n.succeededBy});return this.eventBus.publish(new g.OwnSharedAttributeSucceededEvent(this.identity.address.toString(),i,s)),{predecessor:i,successor:s}}async succeedOwnSharedRelationshipAttribute(e,t,r=!0){const n=v.AttributeSuccessorParams.from(t);if(r){const t=await this.validateOwnSharedRelationshipAttributeSuccession(e,n);if(t.isError())throw t.error}const{predecessor:i,successor:s}=await this._succeedAttributeUnsafe(e,{id:n.id,content:n.content,succeeds:e,shareInfo:n.shareInfo,parentId:n.parentId,createdAt:n.createdAt,succeededBy:n.succeededBy});return this.eventBus.publish(new g.OwnSharedAttributeSucceededEvent(this.identity.address.toString(),i,s)),{predecessor:i,successor:s}}async succeedPeerSharedIdentityAttribute(e,t,r=!0){const n=v.AttributeSuccessorParams.from(t);if(r){const t=await this.validatePeerSharedIdentityAttributeSuccession(e,n);if(t.isError())throw t.error}const{predecessor:i,successor:s}=await this._succeedAttributeUnsafe(e,{id:n.id,content:n.content,succeeds:e,shareInfo:n.shareInfo,parentId:n.parentId,createdAt:n.createdAt,succeededBy:n.succeededBy});return{predecessor:i,successor:s}}async succeedPeerSharedRelationshipAttribute(e,t,r=!0){const n=v.AttributeSuccessorParams.from(t);if(r){const t=await this.validatePeerSharedRelationshipAttributeSuccession(e,n);if(t.isError())throw t.error}const{predecessor:i,successor:s}=await this._succeedAttributeUnsafe(e,{id:n.id,content:n.content,succeeds:e,shareInfo:n.shareInfo,parentId:n.parentId,createdAt:n.createdAt,succeededBy:n.succeededBy});return{predecessor:i,successor:s}}async succeedChildrenOfComplexAttribute(e){const t=await this.getLocalAttribute(e);if(void 0===t)throw y.CoreErrors.attributes.invalidParentSuccessor;const r=Object.values(t.content.value).filter((e=>e instanceof a.AbstractAttributeValue));for(const n of r){let r,i=await this.getLocalAttribute(e);for(;void 0===r&&i?.succeeds;){i=await this.getLocalAttribute(i.succeeds),r=await this.getChildAttributesByValueType(i.id,n.constructor)}const s=r?.id;void 0!==s?await this._succeedAttributeUnsafe(s,{content:a.IdentityAttribute.from({value:n.toJSON(),owner:this.identity.address}),parentId:e,createdAt:t.createdAt}):await this.createAttributeUnsafe({content:a.IdentityAttribute.from({value:n.toJSON(),owner:this.identity.address}),parentId:e,createdAt:t.createdAt})}}async getChildAttributesByValueType(e,t){return(await this.getLocalAttributes({parentId:e.toString()})).find((e=>e.content.value instanceof t))}async _succeedAttributeUnsafe(e,t){const r=await this.getLocalAttribute(e);if(void 0===r)throw y.CoreErrors.attributes.predecessorDoesNotExist;const n=await this.createAttributeUnsafe({id:t.id,content:t.content,succeeds:e,shareInfo:t.shareInfo,parentId:t.parentId,createdAt:t.createdAt,succeededBy:t.succeededBy});return r.succeededBy=n.id,await this.updateAttributeUnsafe(r),{predecessor:r,successor:n}}async validateRepositoryAttributeSuccession(e,t){let r;try{r=v.AttributeSuccessorParams.from(t)}catch(e){return b.ValidationResult.error(y.CoreErrors.attributes.successorIsNotAValidAttribute(e))}const n=await this.validateAttributeSuccessionCommon(e,r);if(n.isError())return n;const i=await this.getLocalAttribute(e),s=A.LocalAttribute.from({id:c.CoreId.from(r.id??"dummy"),content:r.content,createdAt:r.createdAt??c.CoreDate.utc(),succeeds:r.succeeds,succeededBy:r.succeededBy,shareInfo:r.shareInfo,parentId:r.parentId});return i.isRepositoryAttribute(this.identity.address)?s.isRepositoryAttribute(this.identity.address)?b.ValidationResult.success():b.ValidationResult.error(y.CoreErrors.attributes.successorIsNotRepositoryAttribute()):b.ValidationResult.error(y.CoreErrors.attributes.predecessorIsNotRepositoryAttribute())}async validateOwnSharedIdentityAttributeSuccession(e,t){let r;try{r=v.AttributeSuccessorParams.from(t)}catch(e){return b.ValidationResult.error(y.CoreErrors.attributes.successorIsNotAValidAttribute(e))}const n=await this.validateAttributeSuccessionCommon(e,r);if(n.isError())return n;const i=await this.getLocalAttribute(e),s=A.LocalAttribute.from({id:c.CoreId.from(r.id??"dummy"),content:r.content,createdAt:r.createdAt??c.CoreDate.utc(),succeeds:r.succeeds,succeededBy:r.succeededBy,shareInfo:r.shareInfo,parentId:r.parentId});if(!i.isOwnSharedIdentityAttribute(this.identity.address))return b.ValidationResult.error(y.CoreErrors.attributes.predecessorIsNotOwnSharedIdentityAttribute());if(!s.isOwnSharedIdentityAttribute(this.identity.address))return b.ValidationResult.error(y.CoreErrors.attributes.successorIsNotOwnSharedIdentityAttribute());if(!i.shareInfo.peer.equals(s.shareInfo.peer))return b.ValidationResult.error(y.CoreErrors.attributes.successionMustNotChangePeer());if(void 0===s.shareInfo.sourceAttribute)return b.ValidationResult.error(y.CoreErrors.attributes.successorSourceAttributeIsNotSpecified());const o=await this.getLocalAttribute(s.shareInfo.sourceAttribute);if(void 0===o)return b.ValidationResult.error(y.CoreErrors.attributes.successorSourceAttributeDoesNotExist());if(!o.isRepositoryAttribute(this.identity.address))return b.ValidationResult.error(y.CoreErrors.attributes.successorSourceAttributeIsNotRepositoryAttribute());if(!l.default.isEqual(o.content,s.content))return b.ValidationResult.error(y.CoreErrors.attributes.successorSourceContentIsNotEqualToCopyContent());let a;if(void 0!==i.shareInfo.sourceAttribute&&(a=await this.getLocalAttribute(i.shareInfo.sourceAttribute)),void 0!==a){if(!a.isRepositoryAttribute(this.identity.address))return b.ValidationResult.error(y.CoreErrors.attributes.predecessorSourceAttributeIsNotRepositoryAttribute());const e=(await this.getVersionsOfAttribute(o.id)).map((e=>e.id.toString()));if(void 0===a.succeededBy||!e.some((e=>e===a.succeededBy?.toString())))return b.ValidationResult.error(y.CoreErrors.attributes.successorSourceDoesNotSucceedPredecessorSource());if(!l.default.isEqual(a.content,i.content))return b.ValidationResult.error(y.CoreErrors.attributes.predecessorSourceContentIsNotEqualToCopyContent())}return b.ValidationResult.success()}async validateOwnSharedRelationshipAttributeSuccession(e,t){let r;try{r=v.AttributeSuccessorParams.from(t)}catch(e){return b.ValidationResult.error(y.CoreErrors.attributes.successorIsNotAValidAttribute(e))}const n=await this.validateAttributeSuccessionCommon(e,r);if(n.isError())return n;const i=await this.getLocalAttribute(e),s=A.LocalAttribute.from({id:c.CoreId.from(r.id??"dummy"),content:r.content,createdAt:r.createdAt??c.CoreDate.utc(),succeeds:r.succeeds,succeededBy:r.succeededBy,shareInfo:r.shareInfo,parentId:r.parentId});return i.isOwnSharedRelationshipAttribute(this.identity.address)?s.isOwnSharedRelationshipAttribute(this.identity.address)?s.content.key!==i.content.key?b.ValidationResult.error(y.CoreErrors.attributes.successionMustNotChangeKey()):i.shareInfo.peer.equals(s.shareInfo.peer)?b.ValidationResult.success():b.ValidationResult.error(y.CoreErrors.attributes.successionMustNotChangePeer()):b.ValidationResult.error(y.CoreErrors.attributes.successorIsNotOwnSharedRelationshipAttribute()):b.ValidationResult.error(y.CoreErrors.attributes.predecessorIsNotOwnSharedRelationshipAttribute())}async validatePeerSharedIdentityAttributeSuccession(e,t){let r;try{r=v.AttributeSuccessorParams.from(t)}catch(e){return b.ValidationResult.error(y.CoreErrors.attributes.successorIsNotAValidAttribute(e))}const n=await this.validateAttributeSuccessionCommon(e,r);if(n.isError())return n;const i=await this.getLocalAttribute(e),s=A.LocalAttribute.from({id:c.CoreId.from(r.id??"dummy"),content:r.content,createdAt:r.createdAt??c.CoreDate.utc(),succeeds:r.succeeds,succeededBy:r.succeededBy,shareInfo:r.shareInfo,parentId:r.parentId});return i.isPeerSharedIdentityAttribute()?s.isPeerSharedIdentityAttribute()?i.shareInfo.peer.equals(s.shareInfo.peer)?b.ValidationResult.success():b.ValidationResult.error(y.CoreErrors.attributes.successionMustNotChangePeer()):b.ValidationResult.error(y.CoreErrors.attributes.successorIsNotPeerSharedIdentityAttribute()):b.ValidationResult.error(y.CoreErrors.attributes.predecessorIsNotPeerSharedIdentityAttribute())}async validatePeerSharedRelationshipAttributeSuccession(e,t){let r;try{r=v.AttributeSuccessorParams.from(t)}catch(e){return b.ValidationResult.error(y.CoreErrors.attributes.successorIsNotAValidAttribute(e))}const n=await this.validateAttributeSuccessionCommon(e,r);if(n.isError())return n;const i=await this.getLocalAttribute(e),s=A.LocalAttribute.from({id:c.CoreId.from(r.id??"dummy"),content:r.content,createdAt:r.createdAt??c.CoreDate.utc(),succeeds:r.succeeds,succeededBy:r.succeededBy,shareInfo:r.shareInfo,parentId:r.parentId});return i.isPeerSharedRelationshipAttribute()?s.isPeerSharedRelationshipAttribute()?s.content.key!==i.content.key?b.ValidationResult.error(y.CoreErrors.attributes.successionMustNotChangeKey()):i.shareInfo.peer.equals(s.shareInfo.peer)?b.ValidationResult.success():b.ValidationResult.error(y.CoreErrors.attributes.successionMustNotChangePeer()):b.ValidationResult.error(y.CoreErrors.attributes.successorIsNotPeerSharedRelationshipAttribute()):b.ValidationResult.error(y.CoreErrors.attributes.predecessorIsNotPeerSharedRelationshipAttribute())}async validateAttributeSuccessionCommon(e,t){let r;try{r=v.AttributeSuccessorParams.from(t)}catch(e){return b.ValidationResult.error(y.CoreErrors.attributes.successorIsNotAValidAttribute(e))}const n=A.LocalAttribute.from({id:c.CoreId.from(r.id??"dummy"),content:r.content,createdAt:r.createdAt??c.CoreDate.utc(),succeeds:r.succeeds,succeededBy:r.succeededBy,shareInfo:r.shareInfo,parentId:r.parentId});if(void 0!==r.id){if(void 0!==await this.getLocalAttribute(c.CoreId.from(r.id)))return b.ValidationResult.error(y.CoreErrors.attributes.successorMustNotYetExist())}if(void 0!==n.succeeds&&!e.equals(n.succeeds.toString()))return b.ValidationResult.error(y.CoreErrors.attributes.setPredecessorIdDoesNotMatchActualPredecessorId());if(void 0!==n.succeededBy)return b.ValidationResult.error(y.CoreErrors.attributes.successorMustNotHaveASuccessor());if(void 0!==n.parentId)return b.ValidationResult.error(y.CoreErrors.attributes.cannotSucceedChildOfComplexAttribute(e.toString()));const i=await this.getLocalAttribute(e);return void 0===i?b.ValidationResult.error(y.CoreErrors.attributes.predecessorDoesNotExist()):void 0!==i.succeededBy?b.ValidationResult.error(y.CoreErrors.attributes.cannotSucceedAttributesWithASuccessor(i.succeededBy.toString())):void 0!==i.parentId?b.ValidationResult.error(y.CoreErrors.attributes.cannotSucceedChildOfComplexAttribute(e.toString())):i.content.owner.equals(c.CoreAddress.from(n.content.owner))?n.content.constructor!==i.content.constructor?b.ValidationResult.error(y.CoreErrors.attributes.successionMustNotChangeContentType()):i.content.value.constructor!==n.content.value.constructor?b.ValidationResult.error(y.CoreErrors.attributes.successionMustNotChangeValueType()):i.hasDeletionInfo()?b.ValidationResult.error(y.CoreErrors.attributes.cannotSucceedAttributesWithDeletionInfo()):b.ValidationResult.success():b.ValidationResult.error(y.CoreErrors.attributes.successionMustNotChangeOwner())}async createAttributeUnsafe(e){const t=A.LocalAttribute.from({id:e.id??await m.ConsumptionIds.attribute.generate(),content:e.content,createdAt:e.createdAt??c.CoreDate.utc(),shareInfo:e.shareInfo,parentId:e.parentId,succeededBy:e.succeededBy,succeeds:e.succeeds,deletionInfo:e.deletionInfo});return await this.attributes.create(t),t}async updateAttributeUnsafe(e){const t=await this.attributes.findOne({[(0,d.nameof)((e=>e.id))]:e.id.toString()});if(!t)throw c.CoreErrors.general.recordNotFound(A.LocalAttribute,e.id.toString());const r={id:e.id,content:e.content,createdAt:e.createdAt,parentId:e.parentId,shareInfo:e.shareInfo,succeededBy:e.succeededBy,succeeds:e.succeeds,deletionInfo:e.deletionInfo},n=A.LocalAttribute.from(r);return await this.attributes.update(t,n),n}async deleteAttributeUnsafe(e){await this.attributes.delete({id:e})}async executeFullAttributeDeletionProcess(e){const t=await this.validateFullAttributeDeletionProcess(e);if(t.isError())throw t.error;if(void 0!==e.succeededBy){const t=await this.getLocalAttribute(e.succeededBy);if(void 0===t)throw y.CoreErrors.attributes.successorDoesNotExist();await this.detachSuccessor(t)}const r=[...await this.getLocalAttributes({"shareInfo.sourceAttribute":e.id.toString()}),...await this.getSharedPredecessorsOfRepositoryAttribute(e)];await this.detachAttributeCopies(r),await this.deletePredecessorsOfAttribute(e.id),await this.deleteAttribute(e)}async validateFullAttributeDeletionProcess(e){const t=await this.validateSuccessor(e);if(t.isError())return t;const r=[...await this.getLocalAttributes({"shareInfo.sourceAttribute":e.id.toString()}),...await this.getSharedPredecessorsOfRepositoryAttribute(e)];return this.validateSharedAttributes(r)}async validateSuccessor(e){if(void 0!==e.succeededBy){if(void 0===await this.getLocalAttribute(e.succeededBy))return b.ValidationResult.error(y.CoreErrors.attributes.successorDoesNotExist())}return b.ValidationResult.success()}validateSharedAttributes(e){for(const t of e)if(!t.isShared())return b.ValidationResult.error(y.CoreErrors.attributes.isNotSharedAttribute(t.id));return b.ValidationResult.success()}async detachSuccessor(e){e.succeeds=void 0,await this.updateAttributeUnsafe(e)}async detachAttributeCopies(e){for(const t of e){if(!t.isShared())throw y.CoreErrors.attributes.isNotSharedAttribute(t.id);t.shareInfo.sourceAttribute=void 0,await this.updateAttributeUnsafe(t)}}async deletePredecessorsOfAttribute(e){const t=await this.getPredecessorsOfAttribute(e);for(const e of t)await this.deleteAttribute(e)}async getVersionsOfAttribute(e){const t=await this.getLocalAttribute(e);if(void 0===t)throw c.CoreErrors.general.recordNotFound(A.LocalAttribute,e.toString());const r=await this.getPredecessorsOfAttribute(e);return[...(await this.getSuccessorsOfAttribute(e)).reverse(),t,...r]}async getPredecessorsOfAttribute(e){let t=await this.getLocalAttribute(e);if(void 0===t)throw c.CoreErrors.general.recordNotFound(A.LocalAttribute,e.toString());const r=[];for(;void 0!==t.succeeds;){const e=await this.getLocalAttribute(t.succeeds);if(void 0===e)throw c.CoreErrors.general.recordNotFound(A.LocalAttribute,t.succeeds.toString());t=e,r.push(t)}return r}async getSuccessorsOfAttribute(e){let t=await this.getLocalAttribute(e);if(void 0===t)throw c.CoreErrors.general.recordNotFound(A.LocalAttribute,e.toString());const r=[];for(;void 0!==t.succeededBy;){const e=await this.getLocalAttribute(t.succeededBy);if(void 0===e)throw c.CoreErrors.general.recordNotFound(A.LocalAttribute,t.succeededBy.toString());t=e,r.push(e)}return r}async getSharedVersionsOfRepositoryAttribute(e,t,r=!0){const n=await this.getLocalAttribute(e);if(void 0===n)throw c.CoreErrors.general.recordNotFound(A.LocalAttribute,e.toString());if(!n.isRepositoryAttribute(this.identity.address))throw y.CoreErrors.attributes.invalidPropertyValue(`Attribute '${e}' isn't a repository attribute.`);const i={"shareInfo.sourceAttribute":n.id.toString()};void 0!==t&&(i["shareInfo.peer"]={$in:t.map((e=>e.toString()))}),r&&(i.succeededBy={$exists:!1});const s=await this.getLocalAttributes(i),o=await this.getSharedPredecessorsOfRepositoryAttribute(n,i);return[...(await this.getSharedSuccessorsOfRepositoryAttribute(n,i)).reverse(),...s,...o]}async getSharedPredecessorsOfRepositoryAttribute(e,t={}){const r=[];for(;void 0!==e.succeeds;){const n=await this.getLocalAttribute(e.succeeds);if(void 0===n)throw c.CoreErrors.general.recordNotFound(A.LocalAttribute,e.succeeds.toString());e=n,t["shareInfo.sourceAttribute"]=e.id.toString();const i=await this.getLocalAttributes(t);r.push(...i)}return r}async getSharedSuccessorsOfRepositoryAttribute(e,t={}){const r=[];for(;void 0!==e.succeededBy;){const n=await this.getLocalAttribute(e.succeededBy);if(void 0===n)throw c.CoreErrors.general.recordNotFound(A.LocalAttribute,e.succeededBy.toString());e=n,t["shareInfo.sourceAttribute"]=e.id.toString();const i=await this.getLocalAttributes(t);r.push(...i)}return r}}t.AttributesController=AttributesController},4928:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeCreatedEvent=void 0;const n=r(2984);class AttributeCreatedEvent extends n.TransportDataEvent{static{this.namespace="consumption.attributeCreated"}constructor(e,t){super(AttributeCreatedEvent.namespace,e,t)}}t.AttributeCreatedEvent=AttributeCreatedEvent},7775:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeDeletedEvent=void 0;const n=r(2984);class AttributeDeletedEvent extends n.TransportDataEvent{static{this.namespace="consumption.attributeDeleted"}constructor(e,t){super(AttributeDeletedEvent.namespace,e,t)}}t.AttributeDeletedEvent=AttributeDeletedEvent},427:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},784:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OwnSharedAttributeDeletedByOwnerEvent=void 0;const n=r(2984);class OwnSharedAttributeDeletedByOwnerEvent extends n.TransportDataEvent{static{this.namespace="consumption.ownSharedAttributeDeletedByOwner"}constructor(e,t){super(OwnSharedAttributeDeletedByOwnerEvent.namespace,e,t)}}t.OwnSharedAttributeDeletedByOwnerEvent=OwnSharedAttributeDeletedByOwnerEvent},7670:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OwnSharedAttributeSucceededEvent=void 0;const n=r(2984);class OwnSharedAttributeSucceededEvent extends n.TransportDataEvent{static{this.namespace="consumption.ownSharedAttributeSucceeded"}constructor(e,t,r){super(OwnSharedAttributeSucceededEvent.namespace,e,{predecessor:t,successor:r})}}t.OwnSharedAttributeSucceededEvent=OwnSharedAttributeSucceededEvent},895:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PeerSharedAttributeDeletedByPeerEvent=void 0;const n=r(2984);class PeerSharedAttributeDeletedByPeerEvent extends n.TransportDataEvent{static{this.namespace="consumption.peerSharedAttributeDeletedByPeer"}constructor(e,t){super(PeerSharedAttributeDeletedByPeerEvent.namespace,e,t)}}t.PeerSharedAttributeDeletedByPeerEvent=PeerSharedAttributeDeletedByPeerEvent},7316:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PeerSharedAttributeSucceededEvent=void 0;const n=r(2984);class PeerSharedAttributeSucceededEvent extends n.TransportDataEvent{static{this.namespace="consumption.peerSharedAttributeSucceeded"}constructor(e,t,r){super(PeerSharedAttributeSucceededEvent.namespace,e,{predecessor:t,successor:r})}}t.PeerSharedAttributeSucceededEvent=PeerSharedAttributeSucceededEvent},8259:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RepositoryAttributeSucceededEvent=void 0;const n=r(2984);class RepositoryAttributeSucceededEvent extends n.TransportDataEvent{static{this.namespace="consumption.repositoryAttributeSucceeded"}constructor(e,t,r){super(RepositoryAttributeSucceededEvent.namespace,e,{predecessor:t,successor:r})}}t.RepositoryAttributeSucceededEvent=RepositoryAttributeSucceededEvent},9606:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SharedAttributeCopyCreatedEvent=void 0;const n=r(2984);class SharedAttributeCopyCreatedEvent extends n.TransportDataEvent{static{this.namespace="consumption.sharedAttributeCopyCreated"}constructor(e,t){super(SharedAttributeCopyCreatedEvent.namespace,e,t)}}t.SharedAttributeCopyCreatedEvent=SharedAttributeCopyCreatedEvent},1692:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ThirdPartyOwnedRelationshipAttributeDeletedByPeerEvent=void 0;const n=r(2984);class ThirdPartyOwnedRelationshipAttributeDeletedByPeerEvent extends n.TransportDataEvent{static{this.namespace="consumption.thirdPartyOwnedRelationshipAttributeDeletedByPeer"}constructor(e,t){super(ThirdPartyOwnedRelationshipAttributeDeletedByPeerEvent.namespace,e,t)}}t.ThirdPartyOwnedRelationshipAttributeDeletedByPeerEvent=ThirdPartyOwnedRelationshipAttributeDeletedByPeerEvent},1984:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4928),t),i(r(7775),t),i(r(427),t),i(r(784),t),i(r(7670),t),i(r(895),t),i(r(7316),t),i(r(8259),t),i(r(9606),t),i(r(1692),t)},2188:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(6727),t),i(r(1984),t),i(r(6858),t),i(r(8525),t),i(r(1377),t),i(r(8697),t),i(r(4291),t),i(r(9945),t),i(r(2512),t)},6858:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeSuccessorParams=void 0;const s=r(1391),o=r(2344),a=r(2984),u=r(2512);let c=class AttributeSuccessorParams extends s.Serializable{static from(e){return this.fromAny(e)}};t.AttributeSuccessorParams=c,n([(0,s.validate)({nullable:!0}),(0,s.serialize)(),i("design:type",a.CoreId)],c.prototype,"id",void 0),n([(0,s.validate)(),(0,s.serialize)({unionTypes:[o.IdentityAttribute,o.RelationshipAttribute]}),i("design:type",Object)],c.prototype,"content",void 0),n([(0,s.validate)({nullable:!0}),(0,s.serialize)(),i("design:type",a.CoreDate)],c.prototype,"createdAt",void 0),n([(0,s.validate)({nullable:!0}),(0,s.serialize)(),i("design:type",a.CoreId)],c.prototype,"succeeds",void 0),n([(0,s.validate)({nullable:!0}),(0,s.serialize)(),i("design:type",a.CoreId)],c.prototype,"succeededBy",void 0),n([(0,s.validate)({nullable:!0}),(0,s.serialize)(),i("design:type",u.LocalAttributeShareInfo)],c.prototype,"shareInfo",void 0),n([(0,s.validate)({nullable:!0}),(0,s.serialize)(),i("design:type",a.CoreId)],c.prototype,"parentId",void 0),t.AttributeSuccessorParams=c=n([(0,s.type)("AttributeSuccessorParams")],c)},8525:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CreateLocalAttributeParams=void 0;const s=r(1391),o=r(2344),a=r(2984),u=r(2512);class CreateLocalAttributeParams extends s.Serializable{static from(e){return this.fromAny(e)}}t.CreateLocalAttributeParams=CreateLocalAttributeParams,n([(0,s.serialize)(),(0,s.validate)({nullable:!0}),i("design:type",a.CoreId)],CreateLocalAttributeParams.prototype,"id",void 0),n([(0,s.serialize)({unionTypes:[o.IdentityAttribute,o.RelationshipAttribute]}),(0,s.validate)(),i("design:type",Object)],CreateLocalAttributeParams.prototype,"content",void 0),n([(0,s.serialize)(),(0,s.validate)({nullable:!0}),i("design:type",a.CoreId)],CreateLocalAttributeParams.prototype,"parentId",void 0),n([(0,s.serialize)(),(0,s.validate)({nullable:!0}),i("design:type",a.CoreId)],CreateLocalAttributeParams.prototype,"succeeds",void 0),n([(0,s.serialize)(),(0,s.validate)({nullable:!0}),i("design:type",u.LocalAttributeShareInfo)],CreateLocalAttributeParams.prototype,"shareInfo",void 0)},1377:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CreatePeerLocalAttributeParams=void 0;const s=r(1391),o=r(2344),a=r(2984);class CreatePeerLocalAttributeParams extends s.Serializable{static from(e){return this.fromAny(e)}}t.CreatePeerLocalAttributeParams=CreatePeerLocalAttributeParams,n([(0,s.serialize)(),(0,s.validate)(),i("design:type",a.CoreId)],CreatePeerLocalAttributeParams.prototype,"id",void 0),n([(0,s.serialize)({unionTypes:[o.IdentityAttribute,o.RelationshipAttribute]}),(0,s.validate)(),i("design:type",Object)],CreatePeerLocalAttributeParams.prototype,"content",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",a.CoreId)],CreatePeerLocalAttributeParams.prototype,"requestReference",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",a.CoreAddress)],CreatePeerLocalAttributeParams.prototype,"peer",void 0)},8697:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CreateSharedLocalAttributeCopyParams=void 0;const s=r(1391),o=r(2984);class CreateSharedLocalAttributeCopyParams extends s.Serializable{static from(e){return this.fromAny(e)}}t.CreateSharedLocalAttributeCopyParams=CreateSharedLocalAttributeCopyParams,n([(0,s.serialize)(),(0,s.validate)({nullable:!0}),i("design:type",o.CoreId)],CreateSharedLocalAttributeCopyParams.prototype,"attributeId",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",o.CoreId)],CreateSharedLocalAttributeCopyParams.prototype,"sourceAttributeId",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",o.CoreAddress)],CreateSharedLocalAttributeCopyParams.prototype,"peer",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",o.CoreId)],CreateSharedLocalAttributeCopyParams.prototype,"requestReference",void 0)},4291:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.LocalAttribute=void 0;const s=r(1391),o=r(2344),a=r(2984),u=r(889),c=r(9979),l=r(4768),d=r(9945),f=r(2512);let h=class LocalAttribute extends a.CoreSynchronizable{constructor(){super(...arguments),this.technicalProperties=["@type","@context",(0,u.nameof)((e=>e.createdAt)),(0,u.nameof)((e=>e.succeeds)),(0,u.nameof)((e=>e.succeededBy)),(0,u.nameof)((e=>e.shareInfo)),(0,u.nameof)((e=>e.deletionInfo)),(0,u.nameof)((e=>e.parentId))],this.userdataProperties=[(0,u.nameof)((e=>e.content))]}isOwnSharedIdentityAttribute(e,t){return this.isIdentityAttribute()&&this.isOwnSharedAttribute(e,t)}isOwnSharedRelationshipAttribute(e,t){return this.isRelationshipAttribute()&&this.isOwnSharedAttribute(e,t)}isPeerSharedIdentityAttribute(e){return this.isIdentityAttribute()&&this.isPeerSharedAttribute(e)}isPeerSharedRelationshipAttribute(e){return this.isRelationshipAttribute()&&this.isPeerSharedAttribute(e)}isThirdPartyOwnedRelationshipAttribute(e,t){return this.isRelationshipAttribute()&&this.isThirdPartyOwnedAttribute(e,t)}isRepositoryAttribute(e){return this.isIdentityAttribute()&&!this.isShared()&&this.isOwnedBy(e)}isOwnSharedAttribute(e,t){let r=this.isShared()&&this.isOwnedBy(e);return void 0!==t&&(r&&=this.shareInfo.peer.equals(t)),r}isPeerSharedAttribute(e){let t=this.isShared()&&this.isOwnedBy(this.shareInfo.peer);return t&&=void 0===this.shareInfo.sourceAttribute,void 0!==e&&(t&&=this.isOwnedBy(e)),t}isThirdPartyOwnedAttribute(e,t){let r=this.isShared()&&!this.isOwnedBy(e)&&!this.isOwnedBy(this.shareInfo.peer);return void 0!==t&&(r&&=this.isOwnedBy(t)),r}isIdentityAttribute(){return this.content instanceof o.IdentityAttribute}isRelationshipAttribute(){return this.content instanceof o.RelationshipAttribute&&this.isShared()}isComplexAttribute(){return this.content.value instanceof o.AbstractComplexValue}isOwnedBy(e){return this.content.owner.equals(e)}isShared(){return void 0!==this.shareInfo}setDeletionInfo(e,t){if(this.isRepositoryAttribute(t))throw l.CoreErrors.attributes.cannotSetDeletionInfoOfRepositoryAttributes();if(this.isOwnSharedAttribute(t)&&!this.isOwnSharedAttributeDeletionInfo(e))throw l.CoreErrors.attributes.invalidDeletionInfoOfOwnSharedAttribute();if(this.isPeerSharedAttribute()&&!this.isPeerSharedAttributeDeletionInfo(e))throw l.CoreErrors.attributes.invalidDeletionInfoOfPeerSharedAttribute();if(this.isThirdPartyOwnedRelationshipAttribute(t)&&!this.isThirdPartyOwnedRelationshipAttributeDeletionInfo(e))throw l.CoreErrors.attributes.invalidDeletionInfoOfThirdPartyOwnedRelationshipAttribute();return this.deletionInfo=e,this}isPeerSharedAttributeDeletionInfo(e){return e.deletionStatus===d.DeletionStatus.DeletedByOwner||e.deletionStatus===d.DeletionStatus.ToBeDeleted}isOwnSharedAttributeDeletionInfo(e){return e.deletionStatus===d.DeletionStatus.DeletedByPeer||e.deletionStatus===d.DeletionStatus.ToBeDeletedByPeer}isThirdPartyOwnedRelationshipAttributeDeletionInfo(e){return e.deletionStatus===d.DeletionStatus.DeletedByPeer}hasDeletionInfo(){return void 0!==this.deletionInfo}static from(e){return this.fromAny(e)}static async fromAttribute(e,t,r,n,i){return this.from({id:n??await c.ConsumptionIds.attribute.generate(),createdAt:a.CoreDate.utc(),content:e,succeeds:t,shareInfo:r,parentId:i})}};t.LocalAttribute=h,n([(0,s.validate)(),(0,s.serialize)({unionTypes:[o.IdentityAttribute,o.RelationshipAttribute]}),i("design:type",Object)],h.prototype,"content",void 0),n([(0,s.validate)(),(0,s.serialize)(),i("design:type",a.CoreDate)],h.prototype,"createdAt",void 0),n([(0,s.validate)({nullable:!0}),(0,s.serialize)(),i("design:type",a.CoreId)],h.prototype,"succeeds",void 0),n([(0,s.validate)({nullable:!0}),(0,s.serialize)(),i("design:type",a.CoreId)],h.prototype,"succeededBy",void 0),n([(0,s.validate)({nullable:!0}),(0,s.serialize)(),i("design:type",f.LocalAttributeShareInfo)],h.prototype,"shareInfo",void 0),n([(0,s.validate)({nullable:!0}),(0,s.serialize)(),i("design:type",d.LocalAttributeDeletionInfo)],h.prototype,"deletionInfo",void 0),n([(0,s.validate)({nullable:!0}),(0,s.serialize)(),i("design:type",a.CoreId)],h.prototype,"parentId",void 0),t.LocalAttribute=h=n([(0,s.type)("LocalAttribute")],h)},9945:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.LocalAttributeDeletionInfo=t.DeletionStatus=void 0;const s=r(1391),o=r(2984);var a;!function(e){e.ToBeDeleted="ToBeDeleted",e.ToBeDeletedByPeer="ToBeDeletedByPeer",e.DeletedByPeer="DeletedByPeer",e.DeletedByOwner="DeletedByOwner"}(a||(t.DeletionStatus=a={}));class LocalAttributeDeletionInfo extends o.CoreSerializable{static from(e){return this.fromAny(e)}}t.LocalAttributeDeletionInfo=LocalAttributeDeletionInfo,n([(0,s.serialize)(),(0,s.validate)({customValidator:e=>Object.values(a).includes(e)?void 0:`must be one of: ${Object.values(a).map((e=>`"${e}"`))}`}),i("design:type",String)],LocalAttributeDeletionInfo.prototype,"deletionStatus",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",o.CoreDate)],LocalAttributeDeletionInfo.prototype,"deletionDate",void 0)},2512:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.LocalAttributeShareInfo=void 0;const s=r(1391),o=r(2984),a=r(889),u=r(3347);class LocalAttributeShareInfo extends o.CoreSerializable{static from(e){return super.fromAny(e)}static postFrom(e){if(!(e instanceof LocalAttributeShareInfo))throw new u.ConsumptionError("this should never happen");if(void 0===e.requestReference&&void 0===e.notificationReference)throw new s.ValidationError(LocalAttributeShareInfo.name,(0,a.nameof)((e=>e.requestReference)),`One of ${(0,a.nameof)((e=>e.requestReference))} or ${(0,a.nameof)((e=>e.notificationReference))} must be set.`);if(void 0!==e.requestReference&&void 0!==e.notificationReference)throw new s.ValidationError(LocalAttributeShareInfo.name,(0,a.nameof)((e=>e.requestReference)),`Both of ${(0,a.nameof)((e=>e.requestReference))} or ${(0,a.nameof)((e=>e.notificationReference))} must not be set.`);return e}}t.LocalAttributeShareInfo=LocalAttributeShareInfo,n([(0,s.serialize)(),(0,s.validate)({nullable:!0}),i("design:type",o.CoreId)],LocalAttributeShareInfo.prototype,"requestReference",void 0),n([(0,s.serialize)(),(0,s.validate)({nullable:!0}),i("design:type",o.CoreId)],LocalAttributeShareInfo.prototype,"notificationReference",void 0),n([(0,s.validate)(),(0,s.serialize)(),i("design:type",o.CoreAddress)],LocalAttributeShareInfo.prototype,"peer",void 0),n([(0,s.serialize)(),(0,s.validate)({nullable:!0}),i("design:type",o.CoreId)],LocalAttributeShareInfo.prototype,"sourceAttribute",void 0)},494:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ThirdPartyRelationshipAttributeQueryTranslator=t.RelationshipAttributeQueryTranslator=t.IdentityAttributeQueryTranslator=void 0;const n=r(7197),i=r(3290),s=r(889),o=r(3347);class IdentityAttributeQueryTranslator{static translate(e){return this.translator.parse({...e.toJSON(),attributeType:"IdentityAttribute"})}static{this.translator=new n.QueryTranslator({whitelist:{[(0,s.nameof)((e=>e.tags))]:!0,[(0,s.nameof)((e=>e.valueType))]:!0,[(0,s.nameof)((e=>e.validFrom))]:!0,[(0,s.nameof)((e=>e.validTo))]:!0,attributeType:!0},alias:{[(0,s.nameof)((e=>e.valueType))]:`${(0,s.nameof)((e=>e.content))}.${(0,s.nameof)((e=>e.value))}.@type`,attributeType:`${(0,s.nameof)((e=>e.content))}.@type`},custom:{[(0,s.nameof)((e=>e.tags))]:(e,t)=>{if(!t)return;if(!Array.isArray(t))throw new o.ConsumptionError("Invalid input: 'tags' must be an array");const r=t;e.$or=r.map((e=>({[`${(0,s.nameof)((e=>e.content))}.${(0,s.nameof)((e=>e.tags))}`]:{$contains:e}})))},[(0,s.nameof)((e=>e.validFrom))]:(e,t)=>{if(!t)return;const r=i.DateTime.fromISO(t).toUTC().toString();e[`${(0,s.nameof)((e=>e.content))}.${(0,s.nameof)((e=>e.validFrom))}`]={$gte:r}},[(0,s.nameof)((e=>e.validTo))]:(e,t)=>{if(!t)return;const r=i.DateTime.fromISO(t).toUTC().toString();e[`${(0,s.nameof)((e=>e.content))}.${(0,s.nameof)((e=>e.validTo))}`]={$lte:r}}}})}}t.IdentityAttributeQueryTranslator=IdentityAttributeQueryTranslator;class RelationshipAttributeQueryTranslator{static translate(e){return this.translator.parse({...e.toJSON(),attributeType:"RelationshipAttribute"})}static{this.translator=new n.QueryTranslator({whitelist:{[(0,s.nameof)((e=>e.key))]:!0,[(0,s.nameof)((e=>e.validFrom))]:!0,[(0,s.nameof)((e=>e.validTo))]:!0,[(0,s.nameof)((e=>e.owner))]:!0,attributeType:!0},alias:{[(0,s.nameof)((e=>e.key))]:`${(0,s.nameof)((e=>e.content))}.${(0,s.nameof)((e=>e.key))}`,attributeType:`${(0,s.nameof)((e=>e.content))}.@type`,[(0,s.nameof)((e=>e.owner))]:`${(0,s.nameof)((e=>e.content))}.${(0,s.nameof)((e=>e.owner))}`},custom:{[(0,s.nameof)((e=>e.validFrom))]:(e,t)=>{if(!t)return;const r=i.DateTime.fromISO(t).toUTC().toString();e[`${(0,s.nameof)((e=>e.content))}.${(0,s.nameof)((e=>e.validFrom))}`]={$gte:r}},[(0,s.nameof)((e=>e.validTo))]:(e,t)=>{if(!t)return;const r=i.DateTime.fromISO(t).toUTC().toString();e[`${(0,s.nameof)((e=>e.content))}.${(0,s.nameof)((e=>e.validTo))}`]={$lte:r}}}})}}t.RelationshipAttributeQueryTranslator=RelationshipAttributeQueryTranslator;class ThirdPartyRelationshipAttributeQueryTranslator{static translate(e){return this.translator.parse({...e.toJSON(),attributeType:"RelationshipAttribute"})}static{this.translator=new n.QueryTranslator({whitelist:{[(0,s.nameof)((e=>e.key))]:!0,[(0,s.nameof)((e=>e.validFrom))]:!0,[(0,s.nameof)((e=>e.validTo))]:!0,[(0,s.nameof)((e=>e.owner))]:!0,[(0,s.nameof)((e=>e.thirdParty))]:!0,attributeType:!0},alias:{[(0,s.nameof)((e=>e.key))]:`${(0,s.nameof)((e=>e.content))}.${(0,s.nameof)((e=>e.key))}`,attributeType:`${(0,s.nameof)((e=>e.content))}.@type`,[(0,s.nameof)((e=>e.owner))]:`${(0,s.nameof)((e=>e.content))}.${(0,s.nameof)((e=>e.owner))}`,[(0,s.nameof)((e=>e.thirdParty))]:`${(0,s.nameof)((e=>e.shareInfo))}.${(0,s.nameof)((e=>e.peer))}`},custom:{[(0,s.nameof)((e=>e.validFrom))]:(e,t)=>{if(!t)return;const r=i.DateTime.fromISO(t).toUTC().toString();e[`${(0,s.nameof)((e=>e.content))}.${(0,s.nameof)((e=>e.validFrom))}`]={$gte:r}},[(0,s.nameof)((e=>e.validTo))]:(e,t)=>{if(!t)return;const r=i.DateTime.fromISO(t).toUTC().toString();e[`${(0,s.nameof)((e=>e.content))}.${(0,s.nameof)((e=>e.validTo))}`]={$lte:r}}}})}}t.ThirdPartyRelationshipAttributeQueryTranslator=ThirdPartyRelationshipAttributeQueryTranslator},9316:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorValidationResult=t.SuccessfulValidationResult=t.ValidationResult=void 0;const n=r(1917);class ValidationResult{constructor(e){this.items=e}isSuccess(){return this instanceof SuccessfulValidationResult}isError(){return this instanceof ErrorValidationResult}static success(e=[]){return new SuccessfulValidationResult(e)}static error(e,t=[]){return new ErrorValidationResult(e,t)}static fromItems(e){return e.some((e=>e.isError()))?ValidationResult.error(new n.ApplicationError("inheritedFromItem","Some child items have errors."),e):ValidationResult.success(e)}}t.ValidationResult=ValidationResult;class SuccessfulValidationResult extends ValidationResult{constructor(e){super(e)}}t.SuccessfulValidationResult=SuccessfulValidationResult;class ErrorValidationResult extends ValidationResult{constructor(e,t){super(t),this.error=e}}t.ErrorValidationResult=ErrorValidationResult},1180:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(9316),t)},2437:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DraftsController=void 0;const n=r(2984),i=r(3128),s=r(282),o=r(3347),a=r(9979),u=r(9646);class DraftsController extends i.ConsumptionBaseController{constructor(e){super(s.ConsumptionControllerName.DraftsController,e)}async init(){return await super.init(),this.drafts=await this.parent.accountController.getSynchronizedCollection("Drafts"),this}async getDraft(e){const t=await this.drafts.read(e.toString());return t?u.Draft.from(t):void 0}async getDrafts(e){const t=await this.drafts.find(e);return this.parseArray(t,u.Draft)}async createDraft(e,t=""){const r=u.Draft.from({id:await a.ConsumptionIds.draft.generate(),content:e,createdAt:new n.CoreDate,lastModifiedAt:new n.CoreDate,type:t});return await this.drafts.create(r),r}async updateDraft(e){const t=await this.drafts.read(e.id.toString());if(!t)throw new o.ConsumptionError("Draft Not Found");await this.drafts.update(t,e)}async deleteDraft(e){await this.drafts.delete(e)}}t.DraftsController=DraftsController},8645:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(2437),t),i(r(9646),t)},9646:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Draft=void 0;const s=r(1391),o=r(2984),a=r(889);let u=class Draft extends o.CoreSynchronizable{constructor(){super(...arguments),this.technicalProperties=["@type","@context",(0,a.nameof)((e=>e.type)),(0,a.nameof)((e=>e.createdAt)),(0,a.nameof)((e=>e.lastModifiedAt))],this.userdataProperties=[(0,a.nameof)((e=>e.content))],this.metadataProperties=[(0,a.nameof)((e=>e.metadata)),(0,a.nameof)((e=>e.metadataModifiedAt))]}static from(e){return this.fromAny(e)}};t.Draft=u,n([(0,s.validate)(),(0,s.serialize)(),i("design:type",String)],u.prototype,"type",void 0),n([(0,s.validate)(),(0,s.serialize)(),i("design:type",o.CoreDate)],u.prototype,"createdAt",void 0),n([(0,s.validate)(),(0,s.serialize)(),i("design:type",o.CoreDate)],u.prototype,"lastModifiedAt",void 0),n([(0,s.validate)(),(0,s.serialize)(),i("design:type",s.Serializable)],u.prototype,"content",void 0),n([(0,s.validate)({nullable:!0}),(0,s.serialize)({any:!0}),i("design:type",Object)],u.prototype,"metadata",void 0),n([(0,s.validate)({nullable:!0}),(0,s.serialize)(),i("design:type",o.CoreDate)],u.prototype,"metadataModifiedAt",void 0),t.Draft=u=n([(0,s.type)("Draft")],u)},5168:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7796),t),i(r(2188),t),i(r(1180),t),i(r(8645),t),i(r(2963),t),i(r(4015),t),i(r(2728),t)},3939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationsController=void 0;const n=r(2344),i=r(2984),s=r(3128),o=r(282),a=r(127),u=r(6046);class NotificationsController extends s.ConsumptionBaseController{constructor(e,t,r,n,i){super(o.ConsumptionControllerName.NotificationsController,r),this.localNotifications=e,this.processorRegistry=t,this.eventBus=n,this.device=i}async getNotifications(e){return(await this.localNotifications.find(e)).map((e=>a.LocalNotification.from(e)))}async getNotification(e){const t=await this.localNotifications.findOne({id:e.toString()});if(!t)throw i.CoreErrors.general.recordNotFound(a.LocalNotification,e.toString());return a.LocalNotification.from(t)}async sent(e){if(!e.isOwn)throw new Error("Cannot send a Notification from a foreign message.");const t=this.extractNotificationFromMessage(e),r=e.cache.recipients;if(r.length>1)throw new Error("Message contains more than one recipient.");const n=a.LocalNotification.from({id:t.id,content:t,status:a.LocalNotificationStatus.Sent,isOwn:!0,createdAt:e.cache.createdAt,peer:r[0].address,source:u.LocalNotificationSource.message(e.id)});return await this.localNotifications.create(n),n}async received(e){if(e.isOwn)throw new Error("Cannot receive a Notification from an own message.");const t=this.extractNotificationFromMessage(e),r=a.LocalNotification.from({id:t.id,content:t,status:a.LocalNotificationStatus.Open,isOwn:!1,createdAt:e.cache.createdAt,peer:e.cache.createdBy,source:u.LocalNotificationSource.message(e.id),receivedByDevice:this.device.id});return await this.localNotifications.create(r),r}extractNotificationFromMessage(e){if(!(e.cache.content instanceof n.Notification))throw new Error("Message does not contain a Notification.");return e.cache.content}async processOpenNotifactionsReceivedByCurrentDevice(){const e=await this.localNotifications.find({receivedByDevice:this.device.id.toString(),isOwn:!1,status:a.LocalNotificationStatus.Open});for(const t of e){const e=a.LocalNotification.from(t);await this.process(t,e)}}async processNotificationById(e){const t=await this.localNotifications.findOne({id:e.toString()});if(!t)throw i.CoreErrors.general.recordNotFound(a.LocalNotification,e.toString());const r=a.LocalNotification.from(t);return await this.process(t,r)}async process(e,t){if(t.isOwn)throw new Error("Cannot process own notification.");if(!t.receivedByDevice?.equals(this.device.id))throw new Error("Notification is not received by current device.");if(![a.LocalNotificationStatus.Open,a.LocalNotificationStatus.Error].includes(t.status))throw new Error(`Cannot process notification with status ${t.status}.`);const r=[],n=[];try{for(const e of t.content.items){const i=this.processorRegistry.getProcessorForItem(e),s=await i.checkPrerequisitesOfIncomingNotificationItem(e,t);if(s.isError()){const r=t.content.items.indexOf(e);throw new Error(`Prerequisites of notificationItem with index '${r}' of Notification ${t.id} not met. Root cause: ${s.error}`)}const o=await i.process(e,t);r.push(e),o&&n.push(o)}}catch(n){this._log.error(`Error while processing notification ${t.id}: ${n}`);for(const e of r.reverse()){const r=this.processorRegistry.getProcessorForItem(e);await r.rollback(e,t)}return t.status=a.LocalNotificationStatus.Error,await this.localNotifications.update(e,t),t}t.status=a.LocalNotificationStatus.Completed,await this.localNotifications.update(e,t);for(const e of n)this.eventBus.publish(e);return t}}t.NotificationsController=NotificationsController},2963:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(408),t),i(r(3250),t),i(r(4729),t),i(r(6998),t),i(r(1942),t),i(r(8410),t),i(r(2556),t),i(r(9241),t),i(r(127),t),i(r(6046),t),i(r(3939),t)},408:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractNotificationItemProcessor=void 0;t.AbstractNotificationItemProcessor=class AbstractNotificationItemProcessor{constructor(e){this.consumptionController=e,this.accountController=this.consumptionController.accountController,this.currentIdentityAddress=this.accountController.identity.address}}},8410:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2556:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9241:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NotificationItemProcessorRegistry=void 0;const n=r(3347);t.NotificationItemProcessorRegistry=class NotificationItemProcessorRegistry{constructor(e,t=new Map){this.consumptionController=e,this.processors=t}registerProcessor(e,t){if(this.processors.has(e))throw new n.ConsumptionError(`There is already a processor registered for '${e.name}'. Use 'replaceProcessorForType' if you want to replace it.`);this.processors.set(e,t)}registerOrReplaceProcessor(e,t){this.processors.set(e,t)}getProcessorForItem(e){const t=this.processors.get(e.constructor);if(!t)throw new n.ConsumptionError(`There was no processor registered for '${e.constructor.name}'.`);return new t(this.consumptionController)}}},3250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OwnSharedAttributeDeletedByOwnerNotificationItemProcessor=void 0;const n=r(2984),i=r(4768),s=r(2188),o=r(1180),a=r(408);class OwnSharedAttributeDeletedByOwnerNotificationItemProcessor extends a.AbstractNotificationItemProcessor{constructor(e){super(e),this._logger=n.TransportLoggerFactory.getLogger(OwnSharedAttributeDeletedByOwnerNotificationItemProcessor)}async checkPrerequisitesOfIncomingNotificationItem(e,t){const r=await this.consumptionController.attributes.getLocalAttribute(e.attributeId);return void 0===r?o.ValidationResult.success():r.isPeerSharedAttribute()?t.peer.equals(r.shareInfo.peer)?o.ValidationResult.success():o.ValidationResult.error(i.CoreErrors.attributes.senderIsNotPeerOfSharedAttribute(t.peer,e.attributeId)):o.ValidationResult.error(i.CoreErrors.attributes.isNotPeerSharedAttribute(e.attributeId))}async process(e,t){const r=await this.consumptionController.attributes.getLocalAttribute(e.attributeId);if(void 0===r)return;const i=s.LocalAttributeDeletionInfo.from({deletionStatus:s.DeletionStatus.DeletedByOwner,deletionDate:n.CoreDate.utc()}),o=await this.consumptionController.attributes.getPredecessorsOfAttribute(r.id);for(const e of[r,...o])void 0===e.deletionInfo&&(e.setDeletionInfo(i,this.accountController.identity.address),await this.consumptionController.attributes.updateAttributeUnsafe(e));return new s.OwnSharedAttributeDeletedByOwnerEvent(this.currentIdentityAddress.toString(),r)}async rollback(e,t){const r=await this.consumptionController.attributes.getLocalAttribute(e.attributeId);if(void 0===r)return;const n=await this.consumptionController.attributes.getPredecessorsOfAttribute(r.id);for(const e of[r,...n])e.deletionInfo=void 0,await this.consumptionController.attributes.updateAttributeUnsafe(e)}}t.OwnSharedAttributeDeletedByOwnerNotificationItemProcessor=OwnSharedAttributeDeletedByOwnerNotificationItemProcessor},4729:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PeerSharedAttributeDeletedByPeerNotificationItemProcessor=void 0;const n=r(2984),i=r(4768),s=r(2188),o=r(9945),a=r(1180),u=r(408);class PeerSharedAttributeDeletedByPeerNotificationItemProcessor extends u.AbstractNotificationItemProcessor{constructor(e){super(e),this._logger=n.TransportLoggerFactory.getLogger(PeerSharedAttributeDeletedByPeerNotificationItemProcessor)}async checkPrerequisitesOfIncomingNotificationItem(e,t){const r=await this.consumptionController.attributes.getLocalAttribute(e.attributeId);return void 0===r?a.ValidationResult.success():r.isOwnSharedAttribute(this.currentIdentityAddress)?t.peer.equals(r.shareInfo.peer)?a.ValidationResult.success():a.ValidationResult.error(i.CoreErrors.attributes.senderIsNotPeerOfSharedAttribute(t.peer,e.attributeId)):a.ValidationResult.error(i.CoreErrors.attributes.isNotOwnSharedAttribute(e.attributeId))}async process(e,t){const r=await this.consumptionController.attributes.getLocalAttribute(e.attributeId);if(void 0===r)return;const i=n.CoreDate.utc(),a=o.LocalAttributeDeletionInfo.from({deletionStatus:o.DeletionStatus.DeletedByPeer,deletionDate:i}),u=await this.consumptionController.attributes.getPredecessorsOfAttribute(r.id);for(const e of[r,...u])e.setDeletionInfo(a,this.accountController.identity.address),await this.consumptionController.attributes.updateAttributeUnsafe(e);return new s.PeerSharedAttributeDeletedByPeerEvent(this.currentIdentityAddress.toString(),r)}async rollback(e,t){const r=await this.consumptionController.attributes.getLocalAttribute(e.attributeId);if(void 0===r)return;const n=await this.consumptionController.attributes.getPredecessorsOfAttribute(r.id);for(const e of[r,...n])e.deletionInfo=void 0,await this.consumptionController.attributes.updateAttributeUnsafe(e)}}t.PeerSharedAttributeDeletedByPeerNotificationItemProcessor=PeerSharedAttributeDeletedByPeerNotificationItemProcessor},6998:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ThirdPartyOwnedRelationshipAttributeDeletedByPeerNotificationItemProcessor=void 0;const n=r(2984),i=r(4768),s=r(2188),o=r(9945),a=r(1180),u=r(408);class ThirdPartyOwnedRelationshipAttributeDeletedByPeerNotificationItemProcessor extends u.AbstractNotificationItemProcessor{constructor(e){super(e),this._logger=n.TransportLoggerFactory.getLogger(ThirdPartyOwnedRelationshipAttributeDeletedByPeerNotificationItemProcessor)}async checkPrerequisitesOfIncomingNotificationItem(e,t){const r=await this.consumptionController.attributes.getLocalAttribute(e.attributeId);return void 0===r?a.ValidationResult.success():r.isThirdPartyOwnedRelationshipAttribute(this.currentIdentityAddress)?t.peer.equals(r.shareInfo.peer)?a.ValidationResult.success():a.ValidationResult.error(i.CoreErrors.attributes.senderIsNotPeerOfSharedAttribute(t.peer,e.attributeId)):a.ValidationResult.error(i.CoreErrors.attributes.isNotThirdPartyOwnedRelationshipAttribute(e.attributeId))}async process(e,t){const r=await this.consumptionController.attributes.getLocalAttribute(e.attributeId);if(void 0===r)return;const i=n.CoreDate.utc(),a=o.LocalAttributeDeletionInfo.from({deletionStatus:o.DeletionStatus.DeletedByPeer,deletionDate:i}),u=await this.consumptionController.attributes.getPredecessorsOfAttribute(r.id);for(const e of[r,...u])e.setDeletionInfo(a,this.accountController.identity.address),await this.consumptionController.attributes.updateAttributeUnsafe(e);return new s.ThirdPartyOwnedRelationshipAttributeDeletedByPeerEvent(this.currentIdentityAddress.toString(),r)}async rollback(e,t){const r=await this.consumptionController.attributes.getLocalAttribute(e.attributeId);if(void 0===r)return;const n=await this.consumptionController.attributes.getPredecessorsOfAttribute(r.id);for(const e of[r,...n])e.deletionInfo=void 0,await this.consumptionController.attributes.updateAttributeUnsafe(e)}}t.ThirdPartyOwnedRelationshipAttributeDeletedByPeerNotificationItemProcessor=ThirdPartyOwnedRelationshipAttributeDeletedByPeerNotificationItemProcessor},1942:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PeerSharedAttributeSucceededNotificationItemProcessor=void 0;const n=r(2344),i=r(2984),s=r(4768),o=r(2188),a=r(1180),u=r(408);class PeerSharedAttributeSucceededNotificationItemProcessor extends u.AbstractNotificationItemProcessor{constructor(e){super(e),this._logger=i.TransportLoggerFactory.getLogger(PeerSharedAttributeSucceededNotificationItemProcessor)}async checkPrerequisitesOfIncomingNotificationItem(e,t){if(!t.peer.equals(e.successorContent.owner))return a.ValidationResult.error(s.CoreErrors.attributes.successionPeerIsNotOwner());const r={id:e.successorId,content:e.successorContent,shareInfo:{notificationReference:t.id,peer:t.peer}};if(e.successorContent instanceof n.IdentityAttribute){return await this.consumptionController.attributes.validatePeerSharedIdentityAttributeSuccession(e.predecessorId,r)}return await this.consumptionController.attributes.validatePeerSharedRelationshipAttributeSuccession(e.predecessorId,r)}async process(e,t){const r={id:e.successorId,content:e.successorContent,shareInfo:{notificationReference:t.id,peer:t.peer}};let i,s;try{e.successorContent instanceof n.IdentityAttribute?({predecessor:i,successor:s}=await this.consumptionController.attributes.succeedPeerSharedIdentityAttribute(e.predecessorId,r,!1)):({predecessor:i,successor:s}=await this.consumptionController.attributes.succeedPeerSharedRelationshipAttribute(e.predecessorId,r,!1))}catch(r){throw await this.rollbackPartialWork(e,t).catch((e=>this._logger.error(`Rollback failed for notification item (notification id: ${t.id}).`,e))),r}const a=this.consumptionController.accountController.identity.address;return new o.PeerSharedAttributeSucceededEvent(a.toString(),i,s)}async rollback(e,t){await this.rollbackPartialWork(e,t)}async rollbackPartialWork(e,t){const r=await this.consumptionController.attributes.getLocalAttribute(e.successorId);void 0!==r&&await this.consumptionController.attributes.deleteAttributeUnsafe(r.id).catch((e=>this._logger.error(`Deletion failed for attribute (attribute id: ${r.id}).`,e)));const n=await this.consumptionController.attributes.getLocalAttribute(e.predecessorId);void 0!==n?.succeededBy&&(n.succeededBy=void 0,await this.consumptionController.attributes.updateAttributeUnsafe(n).catch((t=>this._logger.error(`Update failed for attribute (attribute id: ${e.predecessorId}).`,t))))}}t.PeerSharedAttributeSucceededNotificationItemProcessor=PeerSharedAttributeSucceededNotificationItemProcessor},127:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.LocalNotification=t.LocalNotificationStatus=void 0;const o=r(1391),a=r(2344),u=r(2984),c=r(889),l=r(3347),d=r(6046);var f;!function(e){e.Open="Open",e.Sent="Sent",e.Completed="Completed",e.Error="Error"}(f||(t.LocalNotificationStatus=f={}));let h=n=class LocalNotification extends u.CoreSynchronizable{constructor(){super(...arguments),this.technicalProperties=["@type","@context",(0,c.nameof)((e=>e.isOwn)),(0,c.nameof)((e=>e.peer)),(0,c.nameof)((e=>e.createdAt)),(0,c.nameof)((e=>e.receivedByDevice)),(0,c.nameof)((e=>e.status)),(0,c.nameof)((e=>e.source))],this.userdataProperties=[(0,c.nameof)((e=>e.content))]}static postFrom(e){if(!(e instanceof n))throw new l.ConsumptionError("this should never happen");if(e.isOwn&&void 0!==e.receivedByDevice)throw new o.ValidationError(n.name,(0,c.nameof)((e=>e.receivedByDevice)),`You cannot define ${(0,c.nameof)((e=>e.receivedByDevice))} for an own message.`);if(!e.isOwn&&void 0===e.receivedByDevice)throw new o.ValidationError(n.name,(0,c.nameof)((e=>e.receivedByDevice)),`You must define ${(0,c.nameof)((e=>e.receivedByDevice))} for a peer message.`);return e}static from(e){return this.fromAny(e)}};t.LocalNotification=h,i([(0,o.serialize)(),(0,o.validate)(),s("design:type",Boolean)],h.prototype,"isOwn",void 0),i([(0,o.serialize)(),(0,o.validate)(),s("design:type",u.CoreAddress)],h.prototype,"peer",void 0),i([(0,o.serialize)(),(0,o.validate)(),s("design:type",u.CoreDate)],h.prototype,"createdAt",void 0),i([(0,o.serialize)(),(0,o.validate)({nullable:!0}),s("design:type",u.CoreId)],h.prototype,"receivedByDevice",void 0),i([(0,o.serialize)(),(0,o.validate)(),s("design:type",a.Notification)],h.prototype,"content",void 0),i([(0,o.serialize)(),(0,o.validate)(),s("design:type",String)],h.prototype,"status",void 0),i([(0,o.serialize)(),(0,o.validate)(),s("design:type",d.LocalNotificationSource)],h.prototype,"source",void 0),t.LocalNotification=h=n=i([(0,o.type)("LocalNotification")],h)},6046:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.LocalNotificationSource=void 0;const o=r(1391),a=r(2984);let u=n=class LocalNotificationSource extends a.CoreSerializable{static from(e){return this.fromAny(e)}static message(e){return n.from({type:"Message",reference:e})}};t.LocalNotificationSource=u,i([(0,o.serialize)(),(0,o.validate)(),s("design:type",String)],u.prototype,"type",void 0),i([(0,o.serialize)(),(0,o.validate)(),s("design:type",a.CoreId)],u.prototype,"reference",void 0),t.LocalNotificationSource=u=n=i([(0,o.type)("LocalNotificationSource")],u)},4307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IncomingRequestReceivedEvent=void 0;const n=r(2984),i=r(3347);class IncomingRequestReceivedEvent extends n.TransportDataEvent{static{this.namespace="consumption.incomingRequestReceived"}constructor(e,t){if(super(IncomingRequestReceivedEvent.namespace,e,t),t.isOwn)throw new i.ConsumptionError("Cannot create this event for an outgoing Request")}}t.IncomingRequestReceivedEvent=IncomingRequestReceivedEvent},2050:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IncomingRequestStatusChangedEvent=void 0;const n=r(2984),i=r(3347);class IncomingRequestStatusChangedEvent extends n.TransportDataEvent{static{this.namespace="consumption.incomingRequestStatusChanged"}constructor(e,t){if(super(IncomingRequestStatusChangedEvent.namespace,e,t),t.request.isOwn)throw new i.ConsumptionError("Cannot create this event for an outgoing Request")}}t.IncomingRequestStatusChangedEvent=IncomingRequestStatusChangedEvent},5208:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OutgoingRequestCreatedAndCompletedEvent=void 0;const n=r(2984),i=r(3347);class OutgoingRequestCreatedAndCompletedEvent extends n.TransportDataEvent{static{this.namespace="consumption.outgoingRequestCreatedAndCompleted"}constructor(e,t){if(super(OutgoingRequestCreatedAndCompletedEvent.namespace,e,t),!t.isOwn)throw new i.ConsumptionError("Cannot create this event for an incoming Request")}}t.OutgoingRequestCreatedAndCompletedEvent=OutgoingRequestCreatedAndCompletedEvent},9598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OutgoingRequestCreatedEvent=void 0;const n=r(2984),i=r(3347);class OutgoingRequestCreatedEvent extends n.TransportDataEvent{static{this.namespace="consumption.outgoingRequestCreated"}constructor(e,t){if(super(OutgoingRequestCreatedEvent.namespace,e,t),!t.isOwn)throw new i.ConsumptionError("Cannot create this event for an incoming Request")}}t.OutgoingRequestCreatedEvent=OutgoingRequestCreatedEvent},7264:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OutgoingRequestStatusChangedEvent=void 0;const n=r(2984),i=r(3347);class OutgoingRequestStatusChangedEvent extends n.TransportDataEvent{static{this.namespace="consumption.outgoingRequestStatusChanged"}constructor(e,t){if(super(OutgoingRequestStatusChangedEvent.namespace,e,t),!t.request.isOwn)throw new i.ConsumptionError("Cannot create this event for an incoming Request")}}t.OutgoingRequestStatusChangedEvent=OutgoingRequestStatusChangedEvent},4069:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4307),t),i(r(2050),t),i(r(5208),t),i(r(9598),t),i(r(7264),t)},5915:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DecideRequestParametersValidator=void 0;const n=r(2344),i=r(2984),s=r(4768),o=r(9316),a=r(8484),u=r(7871);t.DecideRequestParametersValidator=class DecideRequestParametersValidator{validate(e,t){if(!t.id.equals(i.CoreId.from(e.requestId)))throw new Error("The response is invalid because the id of the Request does not match the id of the Response.");if(e.items.length!==t.content.items.length)return o.ValidationResult.error(s.CoreErrors.requests.decideValidation.invalidNumberOfItems("Number of items in Request and Response do not match"));const r=t.content.items.map(((t,r)=>this.checkItemOrGroup(t,e.items[r],e.accept)));return o.ValidationResult.fromItems(r)}checkItemOrGroup(e,t,r){return e instanceof n.RequestItem?this.checkItem(e,t,r):this.checkItemGroup(e,t,r)}checkItem(e,t,r){return(0,a.isDecideRequestItemGroupParametersJSON)(t)?o.ValidationResult.error(s.CoreErrors.requests.decideValidation.requestItemAnsweredAsRequestItemGroup()):!r&&t.accept?o.ValidationResult.error(s.CoreErrors.requests.decideValidation.itemAcceptedButParentNotAccepted("The RequestItem was accepted, but the parent was not accepted.")):r&&e.mustBeAccepted&&!t.accept?o.ValidationResult.error(s.CoreErrors.requests.decideValidation.mustBeAcceptedItemNotAccepted("The RequestItem is flagged as 'mustBeAccepted', but it was not accepted.")):o.ValidationResult.success()}checkItemGroup(e,t,r){if((0,u.isDecideRequestItemParametersJSON)(t))return o.ValidationResult.error(s.CoreErrors.requests.decideValidation.requestItemGroupAnsweredAsRequestItem());if(t.items.length!==e.items.length)return o.ValidationResult.error(s.CoreErrors.requests.decideValidation.invalidNumberOfItems("Number of items in RequestItemGroup and ResponseItemGroup do not match"));const n=t.items.some((e=>e.accept));if(!r&&n)return o.ValidationResult.error(s.CoreErrors.requests.decideValidation.itemAcceptedButParentNotAccepted("The RequestItemGroup was accepted, but the parent was not accepted."));if(r&&e.mustBeAccepted&&!n)return o.ValidationResult.error(s.CoreErrors.requests.decideValidation.mustBeAcceptedItemNotAccepted("The RequestItemGroup is flagged as 'mustBeAccepted', but it was not accepted. Please accept all 'mustBeAccepted' items in this group."));const i=e.items.map(((e,r)=>this.checkItem(e,t.items[r],n)));return o.ValidationResult.fromItems(i)}}},1920:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IncomingRequestsController=void 0;const n=r(1391),i=r(2344),s=r(2984),o=r(3128),a=r(282),u=r(3347),c=r(9979),l=r(4768),d=r(9316),f=r(4069),h=r(9747),p=r(1673),m=r(7847),y=r(5915),b=r(989),g=r(5718),v=r(8987),w=r(786),I=r(4757);class IncomingRequestsController extends o.ConsumptionBaseController{constructor(e,t,r,n,i){super(a.ConsumptionControllerName.RequestsController,r),this.localRequests=e,this.processorRegistry=t,this.eventBus=n,this.identity=i,this.decideRequestParamsValidator=new y.DecideRequestParametersValidator}async received(e){const t=w.ReceivedIncomingRequestParameters.from(e),r=this.extractInfoFromSource(t.requestSourceObject),n=h.LocalRequest.from({id:t.receivedRequest.id??await c.ConsumptionIds.request.generate(),createdAt:s.CoreDate.utc(),status:p.LocalRequestStatus.Open,content:t.receivedRequest,isOwn:!1,peer:r.peer,source:r.source,statusLog:[]});return await this.localRequests.create(n),this.eventBus.publish(new f.IncomingRequestReceivedEvent(this.identity.address.toString(),n)),n}extractInfoFromSource(e){return e instanceof s.Message?this.extractInfoFromMessage(e):this.extractInfoFromRelationshipTemplate(e)}extractInfoFromMessage(e){if(e.isOwn)throw new u.ConsumptionError("Cannot create incoming Request from own Message");return{peer:e.cache.createdBy,source:{reference:e.id,type:"Message"}}}extractInfoFromRelationshipTemplate(e){if(e.isOwn)throw new u.ConsumptionError("Cannot create incoming Request from own Relationship Template");return{peer:e.cache.createdBy,source:{reference:e.id,type:"RelationshipTemplate"}}}async checkPrerequisites(e){const t=b.CheckPrerequisitesOfIncomingRequestParameters.from(e),r=await this.getOrThrow(t.requestId);this.assertRequestStatus(r,p.LocalRequestStatus.Open);for(const e of r.content.items)if(e instanceof i.RequestItem){const t=this.processorRegistry.getProcessorForItem(e);if(!await t.checkPrerequisitesOfIncomingRequestItem(e,r))return r}else for(const t of e.items){const e=this.processorRegistry.getProcessorForItem(t);if(!await e.checkPrerequisitesOfIncomingRequestItem(t,r))return r}return r.changeStatus(p.LocalRequestStatus.DecisionRequired),await this.update(r),this.eventBus.publish(new f.IncomingRequestStatusChangedEvent(this.identity.address.toString(),{request:r,oldStatus:p.LocalRequestStatus.Open,newStatus:r.status})),r}async requireManualDecision(e){const t=I.RequireManualDecisionOfIncomingRequestParameters.from(e),r=await this.getOrThrow(t.requestId);return this.assertRequestStatus(r,p.LocalRequestStatus.DecisionRequired),r.changeStatus(p.LocalRequestStatus.ManualDecisionRequired),await this.update(r),this.eventBus.publish(new f.IncomingRequestStatusChangedEvent(this.identity.address.toString(),{request:r,oldStatus:p.LocalRequestStatus.DecisionRequired,newStatus:r.status})),r}async canAccept(e){return await this.canDecide({...e,accept:!0})}async canReject(e){return await this.canDecide({...e,accept:!1})}async canDecide(e){v.InternalDecideRequestParameters.from(e);const t=await this.getOrThrow(e.requestId);this.assertRequestStatus(t,p.LocalRequestStatus.DecisionRequired,p.LocalRequestStatus.ManualDecisionRequired);const r=this.decideRequestParamsValidator.validate(e,t);if(r.isError())return r;const n=await this.canDecideItems(e.items,t.content.items,t);return d.ValidationResult.fromItems(n)}async canDecideGroup(e,t,r){const n=await this.canDecideItems(e.items,t.items,r);return d.ValidationResult.fromItems(n)}async canDecideItems(e,t,r){const n=[];for(let s=0;s<e.length;s++){const o=e[s],a=t[s];if(a instanceof i.RequestItemGroup){const e=await this.canDecideGroup(o,a,r);n.push(e)}else{const e=await this.canDecideItem(o,a,r);n.push(e)}}return n}async canDecideItem(e,t,r){const i=this.processorRegistry.getProcessorForItem(t);try{return e.accept?await i.canAccept(t,e,r):await i.canReject(t,e,r)}catch(e){return e instanceof n.ServalError?d.ValidationResult.error(l.CoreErrors.requests.servalErrorDuringRequestItemProcessing(e)):d.ValidationResult.error(l.CoreErrors.requests.unexpectedErrorDuringRequestItemProcessing(e))}}async accept(e){if(!(await this.canAccept(e)).isSuccess())throw new u.ConsumptionError("Cannot accept the Request with the given parameters. Call 'canAccept' to get more information.");return await this.decide({...e,accept:!0})}async reject(e){if(!(await this.canReject(e)).isSuccess())throw new u.ConsumptionError("Cannot reject the Request with the given parameters. Call 'canReject' to get more information.");return await this.decide({...e,accept:!1})}async decide(e){const t=await this.getOrThrow(e.requestId);this.assertRequestStatus(t,p.LocalRequestStatus.DecisionRequired,p.LocalRequestStatus.ManualDecisionRequired);const r=await this.createLocalResponse(e,t),n=t.status;return t.response=r,t.changeStatus(p.LocalRequestStatus.Decided),await this.update(t),this.eventBus.publish(new f.IncomingRequestStatusChangedEvent(this.identity.address.toString(),{request:t,oldStatus:n,newStatus:t.status})),t}async createLocalResponse(e,t){const r=t.content.items,n=await this.decideItems(e.items,r,t),o=i.Response.from({result:e.accept?i.ResponseResult.Accepted:i.ResponseResult.Rejected,requestId:t.id,items:n});return m.LocalResponse.from({content:o,createdAt:s.CoreDate.utc()})}async decideGroup(e,t,r){const n=await this.decideItems(e.items,t.items,r);return i.ResponseItemGroup.from({items:n})}async decideItems(e,t,r){const n=[];for(let s=0;s<e.length;s++){const o=e[s],a=t[s];a instanceof i.RequestItemGroup?n.push(await this.decideGroup(o,a,r)):n.push(await this.decideItem(o,t[s],r))}return n}async decideItem(e,t,r){const n=this.processorRegistry.getProcessorForItem(t);try{return e.accept?await n.accept(t,e,r):await n.reject(t,e,r)}catch(e){let r="";throw e instanceof Error&&(r=` Details: ${e.message}`),new u.ConsumptionError(`An error occurred while processing a '${t.constructor.name}'. You should contact the developer of this RequestItem.${r}}`)}}async complete(e){const t=g.CompleteIncomingRequestParameters.from(e),r=await this.getOrThrow(t.requestId);if(r.isOwn)throw new u.ConsumptionError("Cannot decide own Request");this.assertRequestStatus(r,p.LocalRequestStatus.Decided);const n=r.response.content.result===i.ResponseResult.Rejected,o="RelationshipTemplate"===r.source.type;if(t.responseSourceObject)r.response.source=m.LocalResponseSource.from({type:t.responseSourceObject instanceof s.Message?"Message":"RelationshipChange",reference:t.responseSourceObject.id});else if(!n||!o)throw new u.ConsumptionError("A Request can only be completed without a responseSource if the Request is rejected and the Request is from a Relationship Template");return r.changeStatus(p.LocalRequestStatus.Completed),await this.update(r),this.eventBus.publish(new f.IncomingRequestStatusChangedEvent(this.identity.address.toString(),{request:r,oldStatus:p.LocalRequestStatus.Decided,newStatus:r.status})),r}async getIncomingRequests(e){const t=(await this.localRequests.find({...e,isOwn:!1})).map((e=>this.updateRequestExpiry(h.LocalRequest.from(e))));return await Promise.all(t)}async getIncomingRequest(e){const t=await this.localRequests.findOne({id:e.toString(),isOwn:!1});if(!t)return;const r=h.LocalRequest.from(t);return await this.updateRequestExpiry(r)}async getOrThrow(e){const t=await this.getIncomingRequest(s.CoreId.from(e));if(!t)throw s.CoreErrors.general.recordNotFound(h.LocalRequest,e.toString());return t}async update(e){const t=await this.localRequests.findOne({id:e.id.toString(),isOwn:!1});if(!t)throw s.CoreErrors.general.recordNotFound(h.LocalRequest,e.id.toString());await this.localRequests.update(t,e)}assertRequestStatus(e,...t){if(!t.includes(e.status))throw new u.ConsumptionError(`Local Request has to be in status '${t.join("/")}'.`)}async updateRequestExpiry(e){return e.updateStatusBasedOnExpiration()&&await this.update(e),e}}t.IncomingRequestsController=IncomingRequestsController},989:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CheckPrerequisitesOfIncomingRequestParameters=void 0;const s=r(1391),o=r(2984);let a=class CheckPrerequisitesOfIncomingRequestParameters extends s.Serializable{static from(e){return this.fromAny(e)}};t.CheckPrerequisitesOfIncomingRequestParameters=a,n([(0,s.serialize)(),(0,s.validate)(),i("design:type",o.CoreId)],a.prototype,"requestId",void 0),t.CheckPrerequisitesOfIncomingRequestParameters=a=n([(0,s.type)("CheckPrerequisitesOfIncomingRequestParameters")],a)},5718:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CompleteIncomingRequestParameters=void 0;const s=r(1391),o=r(2984);class CompleteIncomingRequestParameters extends s.Serializable{static from(e){return this.fromAny(e)}}t.CompleteIncomingRequestParameters=CompleteIncomingRequestParameters,n([(0,s.serialize)(),(0,s.validate)(),i("design:type",o.CoreId)],CompleteIncomingRequestParameters.prototype,"requestId",void 0),n([(0,s.serialize)({unionTypes:[o.Message,o.RelationshipChange]}),(0,s.validate)({nullable:!0}),i("design:type",Object)],CompleteIncomingRequestParameters.prototype,"responseSourceObject",void 0)},5659:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8484:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDecideRequestItemGroupParametersJSON=void 0,t.isDecideRequestItemGroupParametersJSON=function isDecideRequestItemGroupParametersJSON(e){return void 0!==e.items&&void 0===e.accept}},7871:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDecideRequestItemParametersJSON=void 0,t.isDecideRequestItemParametersJSON=function isDecideRequestItemParametersJSON(e){return void 0===e.items&&void 0!==e.accept}},6704:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8987:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.InternalDecideRequestParameters=void 0;const s=r(1391),o=r(2984);let a=class InternalDecideRequestParameters extends s.Serializable{static from(e){return this.fromAny(e)}};t.InternalDecideRequestParameters=a,n([(0,s.serialize)(),(0,s.validate)(),i("design:type",o.CoreId)],a.prototype,"requestId",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",Array)],a.prototype,"items",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",Boolean)],a.prototype,"accept",void 0),t.InternalDecideRequestParameters=a=n([(0,s.type)("InternalDecideRequestParameters")],a)},3882:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},786:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.ReceivedIncomingRequestParameters=void 0;const s=r(1391),o=r(2344),a=r(2984);let u=class ReceivedIncomingRequestParameters extends s.Serializable{static from(e){return this.fromAny(e)}};t.ReceivedIncomingRequestParameters=u,n([(0,s.serialize)(),(0,s.validate)(),i("design:type",o.Request)],u.prototype,"receivedRequest",void 0),n([(0,s.serialize)({unionTypes:[a.Message,a.RelationshipTemplate]}),(0,s.validate)(),i("design:type",Object)],u.prototype,"requestSourceObject",void 0),t.ReceivedIncomingRequestParameters=u=n([(0,s.type)("ReceivedIncomingRequestParameters")],u)},4757:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.RequireManualDecisionOfIncomingRequestParameters=void 0;const s=r(1391),o=r(2984);class RequireManualDecisionOfIncomingRequestParameters extends s.Serializable{static from(e){return this.fromAny(e)}}t.RequireManualDecisionOfIncomingRequestParameters=RequireManualDecisionOfIncomingRequestParameters,n([(0,s.serialize)(),(0,s.validate)(),i("design:type",o.CoreId)],RequireManualDecisionOfIncomingRequestParameters.prototype,"requestId",void 0)},4015:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4069),t),i(r(989),t),i(r(5718),t),i(r(5659),t),i(r(8484),t),i(r(7871),t),i(r(6704),t),i(r(3882),t),i(r(5915),t),i(r(1920),t),i(r(786),t),i(r(4757),t),i(r(8208),t),i(r(2367),t),i(r(3223),t),i(r(3923),t),i(r(3087),t),i(r(9259),t),i(r(1169),t),i(r(9811),t),i(r(1277),t),i(r(1561),t),i(r(2839),t),i(r(467),t),i(r(2398),t),i(r(3088),t),i(r(8813),t),i(r(6179),t),i(r(9747),t),i(r(1673),t),i(r(8455),t),i(r(7847),t),i(r(8177),t),i(r(3220),t),i(r(5897),t),i(r(2549),t),i(r(1584),t),i(r(4137),t)},8208:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractRequestItemProcessor=void 0;t.AbstractRequestItemProcessor=class AbstractRequestItemProcessor{constructor(e){this.consumptionController=e,this.accountController=this.consumptionController.accountController,this.currentIdentityAddress=this.accountController.identity.address}}},1169:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GenericRequestItemProcessor=void 0;const n=r(2344),i=r(9316),s=r(8208);class GenericRequestItemProcessor extends s.AbstractRequestItemProcessor{checkPrerequisitesOfIncomingRequestItem(e,t){return!0}canAccept(e,t,r){return i.ValidationResult.success()}canReject(e,t,r){return i.ValidationResult.success()}accept(e,t,r){return n.AcceptResponseItem.from({result:n.ResponseItemResult.Accepted})}reject(e,t,r){return n.RejectResponseItem.from({result:n.ResponseItemResult.Rejected})}canCreateOutgoingRequestItem(e,t,r){return i.ValidationResult.success()}canApplyIncomingResponseItem(e,t,r){return i.ValidationResult.success()}applyIncomingResponseItem(e,t,r){}}t.GenericRequestItemProcessor=GenericRequestItemProcessor},9811:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2398:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},3088:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8813:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RequestItemProcessorRegistry=void 0;const n=r(3347);t.RequestItemProcessorRegistry=class RequestItemProcessorRegistry{constructor(e,t=new Map){this.consumptionController=e,this.processors=t}registerProcessor(e,t){if(this.processors.has(e))throw new n.ConsumptionError(`There is already a processor registered for '${e.name}'. Use 'replaceProcessorForType' if you want to replace it.`);this.processors.set(e,t)}registerOrReplaceProcessor(e,t){this.processors.set(e,t)}getProcessorForItem(e){const t=this.processors.get(e.constructor);if(!t)throw new n.ConsumptionError(`There was no processor registered for '${e.constructor.name}'.`);return new t(this.consumptionController)}}},2367:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CreateAttributeRequestItemProcessor=void 0;const n=r(2344),i=r(4768),s=r(9316),o=r(1169);class CreateAttributeRequestItemProcessor extends o.GenericRequestItemProcessor{canCreateOutgoingRequestItem(e,t,r){const o=e.attribute.owner.equals(r),a=e.attribute.owner.equals(this.currentIdentityAddress),u=""===e.attribute.owner.toString();return e.attribute instanceof n.IdentityAttribute?a?s.ValidationResult.error(i.CoreErrors.requests.invalidRequestItem("Cannot create own Attributes with a CreateAttributeRequestItem. Use a ShareAttributeRequestItem instead.")):o||u||void 0===r?s.ValidationResult.success():s.ValidationResult.error(i.CoreErrors.requests.invalidRequestItem("The owner of the given `attribute` can only be the recipient's address or an empty string. The latter will default to the recipient's address.")):o||a||u||void 0===r?s.ValidationResult.success():s.ValidationResult.error(i.CoreErrors.requests.invalidRequestItem("The owner of the given 'attribute' can only be the sender's address, the recipient's address or an empty string. The latter will default to the recipient's address."))}async accept(e,t,r){let i;if(""===e.attribute.owner.toString()&&(e.attribute.owner=this.currentIdentityAddress),e.attribute instanceof n.IdentityAttribute){const t=await this.consumptionController.attributes.createLocalAttribute({content:e.attribute});i=await this.consumptionController.attributes.createSharedLocalAttributeCopy({peer:r.peer,requestReference:r.id,sourceAttributeId:t.id})}else i=await this.consumptionController.attributes.createPeerLocalAttribute({content:e.attribute,peer:r.peer,requestReference:r.id});return n.CreateAttributeAcceptResponseItem.from({result:n.ResponseItemResult.Accepted,attributeId:i.id})}async applyIncomingResponseItem(e,t,r){e instanceof n.CreateAttributeAcceptResponseItem&&(""===t.attribute.owner.toString()&&(t.attribute.owner=r.peer),await this.consumptionController.attributes.createPeerLocalAttribute({id:e.attributeId,content:t.attribute,peer:r.peer,requestReference:r.id}))}}t.CreateAttributeRequestItemProcessor=CreateAttributeRequestItemProcessor},3223:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.AcceptDeleteAttributeRequestItemParameters=void 0;const s=r(1391),o=r(2984);let a=class AcceptDeleteAttributeRequestItemParameters extends s.Serializable{static from(e){return this.fromAny(e)}};t.AcceptDeleteAttributeRequestItemParameters=a,n([(0,s.serialize)(),(0,s.validate)(),i("design:type",o.CoreDate)],a.prototype,"deletionDate",void 0),t.AcceptDeleteAttributeRequestItemParameters=a=n([(0,s.type)("AcceptDeleteAttributeRequestItemParameters")],a)},3923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeleteAttributeRequestItemProcessor=void 0;const n=r(2344),i=r(2984),s=r(4768),o=r(2188),a=r(9316),u=r(1169);class DeleteAttributeRequestItemProcessor extends u.GenericRequestItemProcessor{async canCreateOutgoingRequestItem(e,t,r){const n=await this.consumptionController.attributes.getLocalAttribute(e.attributeId);return void 0===n?a.ValidationResult.error(s.CoreErrors.requests.invalidRequestItem(`The Attribute '${e.attributeId.toString()}' could not be found.`)):n.isOwnSharedAttribute(this.accountController.identity.address)?n.deletionInfo?.deletionStatus===o.DeletionStatus.DeletedByPeer?a.ValidationResult.error(s.CoreErrors.requests.invalidRequestItem("The Attribute was already deleted by the peer.")):n.deletionInfo?.deletionStatus===o.DeletionStatus.ToBeDeletedByPeer?a.ValidationResult.error(s.CoreErrors.requests.invalidRequestItem("The peer already accepted the deletion of the Attribute.")):n.shareInfo.peer.equals(r)?a.ValidationResult.success():a.ValidationResult.error(s.CoreErrors.requests.invalidRequestItem("The deletion of a shared Attribute can only be requested from the peer the Attribute is shared with.")):a.ValidationResult.error(s.CoreErrors.requests.invalidRequestItem(`The Attribute '${e.attributeId.toString()}' is not an own shared Attribute. You can only request the deletion of own shared Attributes.`))}async canAccept(e,t,r){if(void 0===await this.consumptionController.attributes.getLocalAttribute(e.attributeId))return a.ValidationResult.success();const n=i.CoreDate.from(t.deletionDate);return n.dateTime.isValid?n.isBefore(i.CoreDate.utc())?a.ValidationResult.error(s.CoreErrors.requests.invalidAcceptParameters("The deletionDate must be in the future.")):a.ValidationResult.success():a.ValidationResult.error(s.CoreErrors.requests.invalidAcceptParameters("The deletionDate is invalid."))}async accept(e,t,r){const s=await this.consumptionController.attributes.getLocalAttribute(e.attributeId);if(void 0===s)return n.AcceptResponseItem.from({result:n.ResponseItemResult.Accepted});const a=i.CoreDate.from(t.deletionDate),u=o.LocalAttributeDeletionInfo.from({deletionStatus:o.DeletionStatus.ToBeDeleted,deletionDate:a}),c=await this.consumptionController.attributes.getPredecessorsOfAttribute(s.id);for(const e of[s,...c])e.setDeletionInfo(u,this.accountController.identity.address),await this.consumptionController.attributes.updateAttributeUnsafe(e);return n.DeleteAttributeAcceptResponseItem.from({deletionDate:a,result:n.ResponseItemResult.Accepted})}async applyIncomingResponseItem(e,t,r){if(!(e instanceof n.DeleteAttributeAcceptResponseItem))return;const i=await this.consumptionController.attributes.getLocalAttribute(t.attributeId);if(void 0===i)return;if(i.deletionInfo?.deletionStatus===o.DeletionStatus.DeletedByPeer)return;const s=o.LocalAttributeDeletionInfo.from({deletionStatus:o.DeletionStatus.ToBeDeletedByPeer,deletionDate:e.deletionDate}),a=await this.consumptionController.attributes.getPredecessorsOfAttribute(i.id);for(const e of[i,...a])e.deletionInfo?.deletionStatus!==o.DeletionStatus.DeletedByPeer&&(e.setDeletionInfo(s,this.accountController.identity.address),await this.consumptionController.attributes.updateAttributeUnsafe(e))}}t.DeleteAttributeRequestItemProcessor=DeleteAttributeRequestItemProcessor},3087:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.AcceptFreeTextRequestItemParameters=void 0;const s=r(1391);let o=class AcceptFreeTextRequestItemParameters extends s.Serializable{static from(e){return this.fromAny(e)}};t.AcceptFreeTextRequestItemParameters=o,n([(0,s.serialize)(),(0,s.validate)(),i("design:type",String)],o.prototype,"freeText",void 0),t.AcceptFreeTextRequestItemParameters=o=n([(0,s.type)("AcceptFreeTextRequestItemParameters")],o)},9259:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FreeTextRequestItemProcessor=void 0;const n=r(1391),i=r(2344),s=r(9316),o=r(1169),a=r(4768),u=r(3087);class FreeTextRequestItemProcessor extends o.GenericRequestItemProcessor{canAccept(e,t){try{u.AcceptFreeTextRequestItemParameters.from(t)}catch(e){if(!(e instanceof n.ParsingError))throw e;return s.ValidationResult.error(a.CoreErrors.requests.invalidAcceptParameters("The RequestItem was answered with incorrect parameters."))}return s.ValidationResult.success()}accept(e,t){const r=u.AcceptFreeTextRequestItemParameters.from(t);return i.FreeTextAcceptResponseItem.from({result:i.ResponseItemResult.Accepted,freeText:r.freeText})}}t.FreeTextRequestItemProcessor=FreeTextRequestItemProcessor},1277:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.AcceptProposeAttributeRequestItemParameters=void 0;const o=r(1391),a=r(2344),u=r(2984),c=r(889),l=r(3347);let d=n=class AcceptProposeAttributeRequestItemParameters extends o.Serializable{isWithExistingAttribute(){return void 0!==this.attributeId}isWithNewAttribute(){return void 0!==this.attribute}static from(e){return this.fromAny(e)}static postFrom(e){if(!(e instanceof n))throw new l.ConsumptionError("this should never happen");if(e.attributeId&&e.attribute)throw new o.ValidationError(n.name,(0,c.nameof)((e=>e.attribute)),`You cannot specify both ${(0,c.nameof)((e=>e.attribute))} and ${(0,c.nameof)((e=>e.attributeId))}.`);if(!e.attributeId&&!e.attribute)throw new o.ValidationError(n.name,(0,c.nameof)((e=>e.attribute)),`You have to specify either ${(0,c.nameof)((e=>e.attribute))} or ${(0,c.nameof)((e=>e.attributeId))}.`);return e}};t.AcceptProposeAttributeRequestItemParameters=d,i([(0,o.serialize)(),(0,o.validate)({nullable:!0}),s("design:type",u.CoreId)],d.prototype,"attributeId",void 0),i([(0,o.serialize)({unionTypes:[a.IdentityAttribute,a.RelationshipAttribute]}),(0,o.validate)({nullable:!0}),s("design:type",Object)],d.prototype,"attribute",void 0),t.AcceptProposeAttributeRequestItemParameters=d=n=i([(0,o.type)("AcceptProposeAttributeRequestItemParameters")],d)},1561:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ProposeAttributeRequestItemProcessor=void 0;const i=r(2344),s=r(2984),o=r(4768),a=r(4291),u=r(9316),c=r(1169),l=n(r(1803)),d=r(1277);class ProposeAttributeRequestItemProcessor extends c.GenericRequestItemProcessor{canCreateOutgoingRequestItem(e,t,r){const n=this.validateQuery(e,r);if(n.isError())return n;const i=this.validateAttribute(e.attribute);return i.isError()?i:u.ValidationResult.success()}validateAttribute(e){return""!==e.owner.toString()?u.ValidationResult.error(o.CoreErrors.requests.invalidRequestItem("The owner of the given `attribute` can only be an empty string. This is because you can only propose Attributes where the recipient of the Request is the owner anyway. And in order to avoid mistakes, the owner will be automatically filled for you.")):u.ValidationResult.success()}validateQuery(e,t){const r=(0,l.default)(e.query,this.currentIdentityAddress,t);return r.isError()?r:e.query instanceof i.RelationshipAttributeQuery&&""!==e.query.owner.toString()?u.ValidationResult.error(o.CoreErrors.requests.invalidRequestItem("The owner of the given `query` can only be an empty string. This is because you can only propose Attributes where the recipient of the Request is the owner anyway. And in order to avoid mistakes, the owner will be automatically filled for you.")):u.ValidationResult.success()}async canAccept(e,t,r){const n=d.AcceptProposeAttributeRequestItemParameters.from(t);let i=n.attribute;if(n.isWithExistingAttribute()){const e=await this.consumptionController.attributes.getLocalAttribute(n.attributeId);if(!e)return u.ValidationResult.error(s.CoreErrors.general.recordNotFound(a.LocalAttribute,r.id.toString()));i=e.content}const c=i.owner.equals(""),l=i.owner.equals(this.currentIdentityAddress);return c||l?u.ValidationResult.success():u.ValidationResult.error(o.CoreErrors.requests.invalidAcceptParameters("The given Attribute belongs to someone else. You can only share own Attributes."))}async accept(e,t,r){const n=d.AcceptProposeAttributeRequestItemParameters.from(t);let s;return s=n.isWithExistingAttribute()?await this.copyExistingAttribute(n.attributeId,r):await this.createNewAttribute(n.attribute,r),i.ProposeAttributeAcceptResponseItem.from({result:i.ResponseItemResult.Accepted,attributeId:s.id,attribute:s.content})}async copyExistingAttribute(e,t){return await this.consumptionController.attributes.createSharedLocalAttributeCopy({sourceAttributeId:s.CoreId.from(e),peer:s.CoreAddress.from(t.peer),requestReference:s.CoreId.from(t.id)})}async createNewAttribute(e,t){if(e instanceof i.IdentityAttribute){const r=await this.consumptionController.attributes.createLocalAttribute({content:e});return await this.consumptionController.attributes.createSharedLocalAttributeCopy({sourceAttributeId:s.CoreId.from(r.id),peer:s.CoreAddress.from(t.peer),requestReference:s.CoreId.from(t.id)})}return await this.consumptionController.attributes.createPeerLocalAttribute({content:e,peer:t.peer,requestReference:s.CoreId.from(t.id)})}async applyIncomingResponseItem(e,t,r){e instanceof i.ProposeAttributeAcceptResponseItem&&await this.consumptionController.attributes.createPeerLocalAttribute({id:e.attributeId,content:e.attribute,peer:r.peer,requestReference:r.id})}}t.ProposeAttributeRequestItemProcessor=ProposeAttributeRequestItemProcessor},7903:function(e,t,r){"use strict";var n,i=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},s=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.AcceptReadAttributeRequestItemParameters=void 0;const o=r(1391),a=r(2344),u=r(2984),c=r(889),l=r(3347);let d=n=class AcceptReadAttributeRequestItemParameters extends o.Serializable{isWithExistingAttribute(){return void 0!==this.existingAttributeId}isWithNewAttribute(){return void 0!==this.newAttribute}static from(e){return this.fromAny(e)}static postFrom(e){if(!(e instanceof n))throw new l.ConsumptionError("this should never happen");if(e.existingAttributeId&&e.newAttribute)throw new o.ValidationError(n.name,(0,c.nameof)((e=>e.newAttribute)),`You cannot specify both ${(0,c.nameof)((e=>e.newAttribute))} and ${(0,c.nameof)((e=>e.existingAttributeId))}.`);if(!e.existingAttributeId&&!e.newAttribute)throw new o.ValidationError(n.name,(0,c.nameof)((e=>e.newAttribute)),`You have to specify either ${(0,c.nameof)((e=>e.newAttribute))} or ${(0,c.nameof)((e=>e.existingAttributeId))}.`);return e}};t.AcceptReadAttributeRequestItemParameters=d,i([(0,o.serialize)(),(0,o.validate)({nullable:!0}),s("design:type",u.CoreId)],d.prototype,"existingAttributeId",void 0),i([(0,o.serialize)({unionTypes:[a.IdentityAttribute,a.RelationshipAttribute]}),(0,o.validate)({nullable:!0}),s("design:type",Object)],d.prototype,"newAttribute",void 0),t.AcceptReadAttributeRequestItemParameters=d=n=i([(0,o.type)("AcceptReadAttributeRequestItemParameters")],d)},2839:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ReadAttributeRequestItemProcessor=void 0;const i=r(2344),s=r(2984),o=r(4768),a=r(4291),u=r(9316),c=r(1169),l=n(r(1803)),d=r(7903);class ReadAttributeRequestItemProcessor extends c.GenericRequestItemProcessor{canCreateOutgoingRequestItem(e,t,r){const n=(0,l.default)(e.query,this.currentIdentityAddress,r);return n.isError()?n:u.ValidationResult.success()}async canAccept(e,t,r){const n=d.AcceptReadAttributeRequestItemParameters.from(t);if(n.isWithExistingAttribute()){const e=await this.consumptionController.attributes.getLocalAttribute(n.existingAttributeId);if(!e)return u.ValidationResult.error(s.CoreErrors.general.recordNotFound(a.LocalAttribute,r.id.toString()));if(!this.accountController.identity.isMe(e.content.owner)&&e.content instanceof i.IdentityAttribute)return u.ValidationResult.error(o.CoreErrors.requests.invalidAcceptParameters("The given Attribute belongs to someone else. You can only share own Attributes."))}return u.ValidationResult.success()}async accept(e,t,r){const n=d.AcceptReadAttributeRequestItemParameters.from(t);let s;return s=n.isWithExistingAttribute()?await this.copyExistingAttribute(n.existingAttributeId,r):await this.createNewAttribute(n.newAttribute,r),i.ReadAttributeAcceptResponseItem.from({result:i.ResponseItemResult.Accepted,attributeId:s.id,attribute:s.content})}async copyExistingAttribute(e,t){return await this.consumptionController.attributes.createSharedLocalAttributeCopy({sourceAttributeId:s.CoreId.from(e),peer:s.CoreAddress.from(t.peer),requestReference:s.CoreId.from(t.id)})}async createNewAttribute(e,t){if(e instanceof i.IdentityAttribute){const r=await this.consumptionController.attributes.createLocalAttribute({content:e});return await this.consumptionController.attributes.createSharedLocalAttributeCopy({sourceAttributeId:s.CoreId.from(r.id),peer:s.CoreAddress.from(t.peer),requestReference:s.CoreId.from(t.id)})}return await this.consumptionController.attributes.createPeerLocalAttribute({content:e,peer:t.peer,requestReference:s.CoreId.from(t.id)})}async applyIncomingResponseItem(e,t,r){e instanceof i.ReadAttributeAcceptResponseItem&&await this.consumptionController.attributes.createPeerLocalAttribute({id:e.attributeId,content:e.attribute,peer:r.peer,requestReference:r.id})}}t.ReadAttributeRequestItemProcessor=ReadAttributeRequestItemProcessor},467:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RegisterAttributeListenerRequestItemProcessor=void 0;const n=r(2344),i=r(1169);class RegisterAttributeListenerRequestItemProcessor extends i.GenericRequestItemProcessor{async accept(e,t,r){const i=await this.consumptionController.attributeListeners.createAttributeListener({peer:r.peer,query:e.query});return n.RegisterAttributeListenerAcceptResponseItem.from({result:n.ResponseItemResult.Accepted,listenerId:i.id.toString()})}}t.RegisterAttributeListenerRequestItemProcessor=RegisterAttributeListenerRequestItemProcessor},6179:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ShareAttributeRequestItemProcessor=void 0;const i=r(2344),s=n(r(5250)),o=r(4768),a=r(9316),u=r(1169);class ShareAttributeRequestItemProcessor extends u.GenericRequestItemProcessor{async canCreateOutgoingRequestItem(e,t,r){const n=await this.consumptionController.attributes.getLocalAttribute(e.sourceAttributeId);if(!n)return a.ValidationResult.error(o.CoreErrors.requests.invalidRequestItem(`The Attribute with the given sourceAttributeId '${e.sourceAttributeId.toString()}' could not be found.`));const u=e.attribute.toJSON();return""===u.owner&&(u.owner=this.currentIdentityAddress.toString()),s.default.isEqual(n.content.toJSON(),u)?e.attribute instanceof i.IdentityAttribute?this.canCreateWithIdentityAttribute(e):this.canCreateWithRelationshipAttribute(e.attribute,r):a.ValidationResult.error(o.CoreErrors.requests.invalidRequestItem(`The Attribute with the given sourceAttributeId '${e.sourceAttributeId.toString()}' does not match the given attribute.`))}canCreateWithIdentityAttribute(e){const t=""===e.attribute.owner.toString(),r=e.attribute.owner.equals(this.currentIdentityAddress);return t||r?a.ValidationResult.success():a.ValidationResult.error(o.CoreErrors.requests.invalidRequestItem("The owner of the given `attribute` can only be an empty string. This is because you can only send Attributes where the recipient of the Request is the owner anyway. And in order to avoid mistakes, the owner will be automatically filled for you."))}canCreateWithRelationshipAttribute(e,t){return e.confidentiality===i.RelationshipAttributeConfidentiality.Private?a.ValidationResult.error(o.CoreErrors.requests.invalidRequestItem("The confidentiality of the given `attribute` is private. Therefore you are not allowed to share it.")):e.owner.equals(t)?a.ValidationResult.error(o.CoreErrors.requests.invalidRequestItem("It doesn't make sense to share a RelationshipAttribute with its owner.")):a.ValidationResult.success()}async accept(e,t,r){""===e.attribute.owner.toString()&&(e.attribute.owner=r.peer);const n=await this.consumptionController.attributes.createPeerLocalAttribute({content:e.attribute,peer:r.peer,requestReference:r.id});return i.ShareAttributeAcceptResponseItem.from({attributeId:n.id,result:i.ResponseItemResult.Accepted})}async applyIncomingResponseItem(e,t,r){e instanceof i.ShareAttributeAcceptResponseItem&&await this.consumptionController.attributes.createSharedLocalAttributeCopy({attributeId:e.attributeId,sourceAttributeId:t.sourceAttributeId,peer:r.peer,requestReference:r.id})}}t.ShareAttributeRequestItemProcessor=ShareAttributeRequestItemProcessor},1803:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2344),i=r(7181),s=r(4768),o=r(9316);function validateThirdParty(e,t,r){return e.equals(t)?o.ValidationResult.error(s.CoreErrors.requests.invalidRequestItem("Cannot query an Attribute with the own address as third party.")):e.equals(r)?o.ValidationResult.error(s.CoreErrors.requests.invalidRequestItem("Cannot query an Attribute with the recipient's address as third party.")):o.ValidationResult.success()}t.default=function validateQuery(e,t,r){if(e instanceof n.ThirdPartyRelationshipAttributeQuery){for(const n of e.thirdParty){const e=validateThirdParty(n,t,r);if(e.isError())return e}if(e.owner.equals(t))return o.ValidationResult.error(s.CoreErrors.requests.invalidRequestItem("Cannot query own Attributes from a third party."))}else if(e instanceof n.IQLQuery){const t=(0,i.validate)(e.queryString);if(!t.isValid)return o.ValidationResult.error(s.CoreErrors.requests.invalidRequestItem(`IQL query syntax error at character ${t.error.location.start.column}`))}return o.ValidationResult.success()}},9747:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.LocalRequest=t.LocalRequestSource=void 0;const s=r(1391),o=r(2344),a=r(2984),u=r(889),c=r(3347),l=r(1673),d=r(8455),f=r(7847);let h=class LocalRequestSource extends a.CoreSerializable{static from(e){return this.fromAny(e)}};t.LocalRequestSource=h,n([(0,s.serialize)(),(0,s.validate)(),i("design:type",String)],h.prototype,"type",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",a.CoreId)],h.prototype,"reference",void 0),t.LocalRequestSource=h=n([(0,s.type)("LocalRequestSource")],h);let p=class LocalRequest extends a.CoreSynchronizable{constructor(){super(...arguments),this.technicalProperties=["@type","@context",(0,u.nameof)((e=>e.isOwn)),(0,u.nameof)((e=>e.peer)),(0,u.nameof)((e=>e.createdAt)),(0,u.nameof)((e=>e.source)),(0,u.nameof)((e=>e.status)),(0,u.nameof)((e=>e.statusLog))],this.userdataProperties=[(0,u.nameof)((e=>e.content)),(0,u.nameof)((e=>e.response))]}changeStatus(e){if(this.status===e)throw new c.ConsumptionError("cannot change status to the same status");const t=d.LocalRequestStatusLogEntry.from({createdAt:a.CoreDate.utc(),oldStatus:this.status,newStatus:e});this.statusLog.push(t),this.status=e}sent(e){if(this.status!==l.LocalRequestStatus.Draft)throw new c.ConsumptionError("Local Request has to be in status 'Draft'.");this.source=e,this.changeStatus(l.LocalRequestStatus.Open)}static from(e){return this.fromAny(e)}isExpired(e=a.CoreDate.utc()){return!!this.content.expiresAt&&e.isAfter(this.content.expiresAt.add({seconds:10}))}updateStatusBasedOnExpiration(e=a.CoreDate.utc()){return this.status!==l.LocalRequestStatus.Completed&&this.status!==l.LocalRequestStatus.Expired&&(!!this.isExpired(e)&&(this.changeStatus(l.LocalRequestStatus.Expired),!0))}};t.LocalRequest=p,n([(0,s.serialize)(),(0,s.validate)(),i("design:type",Boolean)],p.prototype,"isOwn",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",a.CoreAddress)],p.prototype,"peer",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",a.CoreDate)],p.prototype,"createdAt",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",o.Request)],p.prototype,"content",void 0),n([(0,s.serialize)(),(0,s.validate)({nullable:!0}),i("design:type",h)],p.prototype,"source",void 0),n([(0,s.serialize)(),(0,s.validate)({nullable:!0}),i("design:type",f.LocalResponse)],p.prototype,"response",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",String)],p.prototype,"status",void 0),n([(0,s.serialize)({type:d.LocalRequestStatusLogEntry}),(0,s.validate)(),i("design:type",Array)],p.prototype,"statusLog",void 0),t.LocalRequest=p=n([(0,s.type)("LocalRequest")],p)},1673:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.LocalRequestStatus=void 0,function(e){e.Draft="Draft",e.Open="Open",e.DecisionRequired="DecisionRequired",e.ManualDecisionRequired="ManualDecisionRequired",e.Decided="Decided",e.Completed="Completed",e.Expired="Expired"}(r||(t.LocalRequestStatus=r={}))},8455:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.LocalRequestStatusLogEntry=void 0;const s=r(1391),o=r(2984);r(1673);let a=class LocalRequestStatusLogEntry extends o.CoreSerializable{static from(e){return this.fromAny(e)}};t.LocalRequestStatusLogEntry=a,n([(0,s.serialize)(),(0,s.validate)(),i("design:type",o.CoreDate)],a.prototype,"createdAt",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",String)],a.prototype,"oldStatus",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",String)],a.prototype,"newStatus",void 0),n([(0,s.serialize)(),(0,s.validate)({nullable:!0}),i("design:type",Object)],a.prototype,"data",void 0),n([(0,s.serialize)(),(0,s.validate)({nullable:!0}),i("design:type",String)],a.prototype,"code",void 0),t.LocalRequestStatusLogEntry=a=n([(0,s.type)("LocalRequestStatusLogEntry")],a)},7847:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.LocalResponse=t.LocalResponseSource=void 0;const s=r(1391),o=r(2344),a=r(2984);let u=class LocalResponseSource extends a.CoreSerializable{static from(e){return this.fromAny(e)}};t.LocalResponseSource=u,n([(0,s.serialize)(),(0,s.validate)(),i("design:type",String)],u.prototype,"type",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",a.CoreId)],u.prototype,"reference",void 0),t.LocalResponseSource=u=n([(0,s.type)("LocalResponseSource")],u);let c=class LocalResponse extends a.CoreSerializable{static from(e){return this.fromAny(e)}};t.LocalResponse=c,n([(0,s.serialize)(),(0,s.validate)(),i("design:type",a.CoreDate)],c.prototype,"createdAt",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",o.Response)],c.prototype,"content",void 0),n([(0,s.serialize)(),(0,s.validate)({nullable:!0}),i("design:type",u)],c.prototype,"source",void 0),t.LocalResponse=c=n([(0,s.type)("LocalResponse")],c)},1584:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OutgoingRequestsController=void 0;const n=r(2344),i=r(2984),s=r(3128),o=r(282),a=r(3347),u=r(9979),c=r(9316),l=r(4069),d=r(9747),f=r(1673),h=r(7847),p=r(8177),m=r(3220),y=r(5897),b=r(2549),g=r(4137);class OutgoingRequestsController extends s.ConsumptionBaseController{constructor(e,t,r,n,i,s){super(o.ConsumptionControllerName.RequestsController,r),this.localRequests=e,this.processorRegistry=t,this.eventBus=n,this.identity=i,this.relationshipResolver=s}async canCreate(e){const t=y.CanCreateOutgoingRequestParameters.from(e),r=await this.canCreateItems(t.content,t.peer);return c.ValidationResult.fromItems(r)}async canCreateItems(e,t){const r=[];for(const i of e.items)if(i instanceof n.RequestItem){const n=await this.canCreateItem(i,e,t);r.push(n)}else{const n=await this.canCreateItemGroup(i,e,t);r.push(n)}return r}async canCreateItem(e,t,r){const n=this.processorRegistry.getProcessorForItem(e);return await n.canCreateOutgoingRequestItem(e,t,r)}async canCreateItemGroup(e,t,r){const n=[];for(const i of e.items){const e=await this.canCreateItem(i,t,r);n.push(e)}return c.ValidationResult.fromItems(n)}async create(e){const t=b.CreateOutgoingRequestParameters.from(e),r=await u.ConsumptionIds.request.generate();t.content.id=r;const n=await this._create(r,t.content,t.peer);return this.eventBus.publish(new l.OutgoingRequestCreatedEvent(this.identity.address.toString(),n)),n}async _create(e,t,r){const n=await this.canCreate({content:t,peer:r});if(n.isError())throw n.error;const s=d.LocalRequest.from({id:e,content:t,createdAt:i.CoreDate.utc(),isOwn:!0,peer:r,status:f.LocalRequestStatus.Draft,statusLog:[]});return await this.localRequests.create(s),s}async createAndCompleteFromRelationshipTemplateResponse(e){const t=m.CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponseParameters.from(e),r=t.responseSource instanceof i.RelationshipChange?t.responseSource.request.createdBy:t.responseSource.cache.createdBy,s=t.response,o=s.requestId,u=t.template.cache.content;if(!(u instanceof n.RelationshipTemplateContent))throw new a.ConsumptionError("The content of the template is not supported as it is not type of RelationshipTemplateContent.");const c=t.responseSource instanceof i.RelationshipChange&&"Creation"===t.responseSource.type?u.onNewRelationship:u.onExistingRelationship;if(!c)throw new a.ConsumptionError("The request content is undefined. This can happen when there were invalid params when executing createAndCompleteFromRelationshipTemplateResponse.");await this._create(o,c,r),await this._sent(o,t.template);const d=await this._complete(o,t.responseSource,s);return this.eventBus.publish(new l.OutgoingRequestCreatedAndCompletedEvent(this.identity.address.toString(),d)),d}async sent(e){const t=g.SentOutgoingRequestParameters.from(e),r=await this._sent(t.requestId,t.requestSourceObject);return this.eventBus.publish(new l.OutgoingRequestStatusChangedEvent(this.identity.address.toString(),{request:r,oldStatus:f.LocalRequestStatus.Draft,newStatus:r.status})),r}async _sent(e,t){const r=await this.getOrThrow(e);return this.assertRequestStatus(r,f.LocalRequestStatus.Draft),r.changeStatus(f.LocalRequestStatus.Open),r.source=d.LocalRequestSource.from({reference:t.id,type:this.getSourceType(t)}),await this.update(r),r}getSourceType(e){if(e instanceof i.Message){if(!e.isOwn)throw new a.ConsumptionError("Cannot create outgoing Request from a peer Message");return"Message"}if(e instanceof i.RelationshipTemplate){if(!e.isOwn)throw new a.ConsumptionError("Cannot create outgoing Request from a peer Relationship Template");return"RelationshipTemplate"}throw new a.ConsumptionError("The given sourceObject is not of a valid type. Valid types are 'Message' and 'RelationshipTemplate'.")}async complete(e){const t=p.CompleteOutgoingRequestParameters.from(e),r=await this._complete(t.requestId,t.responseSourceObject,t.receivedResponse);return this.eventBus.publish(new l.OutgoingRequestStatusChangedEvent(this.identity.address.toString(),{request:r,oldStatus:f.LocalRequestStatus.Open,newStatus:r.status})),r}async _complete(e,t,r){const n=await this.getOrThrow(e);this.assertRequestStatus(n,f.LocalRequestStatus.Open,f.LocalRequestStatus.Expired);const s=t instanceof i.Message?t.cache.createdAt:t.request.createdAt;if(n.status===f.LocalRequestStatus.Expired&&n.isExpired(s))throw new a.ConsumptionError("Cannot complete an expired request with a response that was created before the expiration date");const o=await this.canComplete(n,r);if(o.isError())throw o.error;let u;if(await this.applyItems(n.content.items,r.items,n),t instanceof i.Message)u="Message";else{if(!(t instanceof i.RelationshipChange))throw new a.ConsumptionError("Invalid responseSourceObject");u="RelationshipChange"}const c=h.LocalResponse.from({content:r,createdAt:i.CoreDate.utc(),source:{reference:t.id,type:u}});return n.response=c,n.changeStatus(f.LocalRequestStatus.Completed),await this.update(n),n}async canComplete(e,t){for(let r=0;r<t.items.length;r++){const i=e.content.items[r];if(i instanceof n.RequestItem){const n=t.items[r],s=this.processorRegistry.getProcessorForItem(i),o=await s.canApplyIncomingResponseItem(n,i,e);if(o.isError())return o}else if(i instanceof n.RequestItemGroup){const n=t.items[r];for(let t=0;t<i.items.length;t++){const r=i.items[t],s=n.items[t],o=this.processorRegistry.getProcessorForItem(r),a=await o.canApplyIncomingResponseItem(s,r,e);if(a.isError())return a}}}return c.ValidationResult.success()}async applyItems(e,t,r){for(let i=0;i<t.length;i++){const s=e[i];if(s instanceof n.RequestItem){const e=t[i];await this.applyItem(s,e,r)}else{const e=t[i];await this.applyItems(s.items,e.items,r)}}}async applyItem(e,t,r){const n=this.processorRegistry.getProcessorForItem(e);await n.applyIncomingResponseItem(t,e,r)}async getOutgoingRequests(e){const t=(await this.localRequests.find({...e,isOwn:!0})).map((e=>this.updateRequestExpiry(d.LocalRequest.from(e))));return await Promise.all(t)}async discardOutgoingRequest(e){const t=await this.getOrThrow(e);this.assertRequestStatus(t,f.LocalRequestStatus.Draft),await this.localRequests.delete(t)}async getOutgoingRequest(e){const t=await this.localRequests.findOne({id:e.toString(),isOwn:!0});if(!t)return;const r=d.LocalRequest.from(t);return await this.updateRequestExpiry(r)}async getOrThrow(e){const t=await this.getOutgoingRequest(e);if(!t)throw i.CoreErrors.general.recordNotFound(d.LocalRequest,e.toString());return t}async update(e){const t=await this.localRequests.findOne({id:e.id.toString(),isOwn:!0});if(!t)throw i.CoreErrors.general.recordNotFound(d.LocalRequest,e.id.toString());await this.localRequests.update(t,e)}assertRequestStatus(e,...t){if(!t.includes(e.status))throw new a.ConsumptionError(`Local Request has to be in status '${t.join("/")}'.`)}async updateRequestExpiry(e){return e.updateStatusBasedOnExpiration()&&await this.update(e),e}}t.OutgoingRequestsController=OutgoingRequestsController},8177:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CompleteOutgoingRequestParameters=void 0;const s=r(1391),o=r(2344),a=r(2984);let u=class CompleteOutgoingRequestParameters extends s.Serializable{static from(e){return this.fromAny(e)}};t.CompleteOutgoingRequestParameters=u,n([(0,s.serialize)(),(0,s.validate)(),i("design:type",a.CoreId)],u.prototype,"requestId",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",a.Message)],u.prototype,"responseSourceObject",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",o.Response)],u.prototype,"receivedResponse",void 0),t.CompleteOutgoingRequestParameters=u=n([(0,s.type)("CompleteOutgoingRequestParameters")],u)},3220:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponseParameters=void 0;const s=r(1391),o=r(2344),a=r(2984);let u=class CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponseParameters extends s.Serializable{static from(e){return this.fromAny(e)}};t.CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponseParameters=u,n([(0,s.serialize)(),(0,s.validate)(),i("design:type",a.RelationshipTemplate)],u.prototype,"template",void 0),n([(0,s.serialize)({unionTypes:[a.RelationshipChange,a.Message]}),(0,s.validate)(),i("design:type",Object)],u.prototype,"responseSource",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",o.Response)],u.prototype,"response",void 0),t.CreateAndCompleteOutgoingRequestFromRelationshipTemplateResponseParameters=u=n([(0,s.type)("CreateAndCompleteOutgoingRequestFromRelationshipCreationChangeParameters")],u)},5897:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CanCreateOutgoingRequestParameters=void 0;const s=r(1391),o=r(2344),a=r(2984);let u=class CanCreateOutgoingRequestParameters extends s.Serializable{static from(e){return this.fromAny(e)}};t.CanCreateOutgoingRequestParameters=u,n([(0,s.serialize)(),(0,s.validate)(),i("design:type",o.Request)],u.prototype,"content",void 0),n([(0,s.serialize)(),(0,s.validate)({nullable:!0}),i("design:type",a.CoreAddress)],u.prototype,"peer",void 0),t.CanCreateOutgoingRequestParameters=u=n([(0,s.type)("CanCreateOutgoingRequestParameters")],u)},2549:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.CreateOutgoingRequestParameters=void 0;const s=r(1391),o=r(2344),a=r(2984);let u=class CreateOutgoingRequestParameters extends s.Serializable{static from(e){return this.fromAny(e)}};t.CreateOutgoingRequestParameters=u,n([(0,s.serialize)(),(0,s.validate)(),i("design:type",o.Request)],u.prototype,"content",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",a.CoreAddress)],u.prototype,"peer",void 0),t.CreateOutgoingRequestParameters=u=n([(0,s.type)("CreateOutgoingRequestParameters")],u)},4137:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.SentOutgoingRequestParameters=void 0;const s=r(1391),o=r(2984);let a=class SentOutgoingRequestParameters extends s.Serializable{static from(e){return this.fromAny(e)}};t.SentOutgoingRequestParameters=a,n([(0,s.serialize)(),(0,s.validate)(),i("design:type",o.CoreId)],a.prototype,"requestId",void 0),n([(0,s.serialize)(),(0,s.validate)(),i("design:type",o.Message)],a.prototype,"requestSourceObject",void 0),t.SentOutgoingRequestParameters=a=n([(0,s.type)("SentOutgoingRequestParameters")],a)},8055:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.SettingsController=void 0;const s=r(1917),o=r(2984),a=r(3128),u=r(282),c=r(9979),l=r(2520);class SettingsController extends a.ConsumptionBaseController{constructor(e){super(u.ConsumptionControllerName.SettingsController,e)}async init(){return await super.init(),this.settings=await this.parent.accountController.getSynchronizedCollection("Settings"),this}async getSetting(e){const t=await this.settings.read(e.toString());return t?l.Setting.from(t):void 0}async getSettings(e){const t=await this.settings.find(e);return this.parseArray(t,l.Setting)}async createSetting(e){const t=l.Setting.from({id:await c.ConsumptionIds.setting.generate(),createdAt:o.CoreDate.utc(),key:e.key,scope:e.scope??l.SettingScope.Identity,value:e.value,reference:e.reference,succeedsAt:e.succeedsAt,succeedsItem:e.succeedsItem});return await this.settings.create(t),t}async updateSetting(e){const t=await this.settings.read(e.id.toString());if(!t)throw o.CoreErrors.general.recordNotFound(l.Setting,e.id.toString());await this.settings.update(t,e)}async deleteSetting(e){await this.settings.delete(e)}}t.SettingsController=SettingsController,n([(0,s.log)(),i("design:type",Function),i("design:paramtypes",[l.Setting]),i("design:returntype",Promise)],SettingsController.prototype,"updateSetting",null)},2728:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(9925),t),i(r(2520),t),i(r(8055),t)},9925:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2520:function(e,t,r){"use strict";var n=this&&this.__decorate||function(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(t,"__esModule",{value:!0}),t.Setting=t.SettingScope=void 0;const s=r(1391),o=r(2984),a=r(889);var u;!function(e){e.Identity="Identity",e.Device="Device",e.Relationship="Relationship"}(u||(t.SettingScope=u={}));let c=class Setting extends o.CoreSynchronizable{constructor(){super(...arguments),this.technicalProperties=["@type","@context",(0,a.nameof)((e=>e.key)),(0,a.nameof)((e=>e.scope)),(0,a.nameof)((e=>e.reference)),(0,a.nameof)((e=>e.createdAt)),(0,a.nameof)((e=>e.succeedsItem)),(0,a.nameof)((e=>e.succeedsAt))],this.userdataProperties=[(0,a.nameof)((e=>e.value))],this.metadataProperties=[(0,a.nameof)((e=>e.metadata)),(0,a.nameof)((e=>e.metadataModifiedAt))]}static from(e){return this.fromAny(e)}};t.Setting=c,n([(0,s.validate)(),(0,s.serialize)(),i("design:type",String)],c.prototype,"key",void 0),n([(0,s.validate)(),(0,s.serialize)(),i("design:type",String)],c.prototype,"scope",void 0),n([(0,s.validate)({nullable:!0}),(0,s.serialize)(),i("design:type",o.CoreId)],c.prototype,"reference",void 0),n([(0,s.validate)(),(0,s.serialize)(),i("design:type",s.Serializable)],c.prototype,"value",void 0),n([(0,s.validate)(),(0,s.serialize)(),i("design:type",o.CoreDate)],c.prototype,"createdAt",void 0),n([(0,s.validate)({nullable:!0}),(0,s.serialize)(),i("design:type",o.CoreId)],c.prototype,"succeedsItem",void 0),n([(0,s.validate)({nullable:!0}),(0,s.serialize)(),i("design:type",o.CoreDate)],c.prototype,"succeedsAt",void 0),n([(0,s.validate)({nullable:!0}),(0,s.serialize)({any:!0}),i("design:type",Object)],c.prototype,"metadata",void 0),n([(0,s.validate)({nullable:!0}),(0,s.serialize)(),i("design:type",o.CoreDate)],c.prototype,"metadataModifiedAt",void 0),t.Setting=c=n([(0,s.type)("Setting")],c)},7181:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validate=t.execute=void 0;const n=r(3887);t.execute=function execute(e,t){return(0,n.parse)(e,{attributes:t})},t.validate=function validate(e){try{return(0,n.parse)(e,{attributes:[]}),{isValid:!0}}catch(e){if(e instanceof n.SyntaxError){const t=e;return{isValid:!1,error:{message:t.message,location:{start:t.location.start,end:t.location.end}}}}return{isValid:!1,error:{message:JSON.stringify(e),location:{start:{column:0,line:0,offset:0},end:{column:0,line:0,offset:0}}}}}}},3887:e=>{"use strict";function resolvePath(e,t,r=null){let n=e;for(const e of t){if(!Object.keys(n).includes(e))return r;n=n[e]}return n}function match(e,t,r,n=void 0){const i=[];for(let s=0;s<e.length;s++){const o=resolvePath(e[s],t,null);void 0!==n&&e[s].value["@type"]!==n||null!==o&&r(o)&&i.push(s)}return i}function peg$SyntaxError(e,t,r,n){var i=Error.call(this,e);return Object.setPrototypeOf&&Object.setPrototypeOf(i,peg$SyntaxError.prototype),i.expected=t,i.found=r,i.location=n,i.name="SyntaxError",i}function peg$padEnd(e,t,r){return r=r||" ",e.length>t?e:(t-=e.length,e+(r+=r.repeat(t)).slice(0,t))}!function peg$subclass(e,t){function C(){this.constructor=e}C.prototype=t.prototype,e.prototype=new C}(peg$SyntaxError,Error),peg$SyntaxError.prototype.format=function(e){var t="Error: "+this.message;if(this.location){var r,n=null;for(r=0;r<e.length;r++)if(e[r].source===this.location.source){n=e[r].text.split(/\r\n|\n|\r/g);break}var i=this.location.start,s=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(i):i,o=this.location.source+":"+s.line+":"+s.column;if(n){var a=this.location.end,u=peg$padEnd("",s.line.toString().length," "),c=n[i.line-1],l=(i.line===a.line?a.column:c.length+1)-i.column||1;t+="\n --\x3e "+o+"\n"+u+" |\n"+s.line+" | "+c+"\n"+u+" | "+peg$padEnd("",i.column-1," ")+peg$padEnd("",l,"^")}else t+="\n at "+o}return t},peg$SyntaxError.buildMessage=function(e,t){var r={literal:function(e){return'"'+literalEscape(e.text)+'"'},class:function(e){var t=e.parts.map((function(e){return Array.isArray(e)?classEscape(e[0])+"-"+classEscape(e[1]):classEscape(e)}));return"["+(e.inverted?"^":"")+t.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(e){return e.description}};function hex(e){return e.charCodeAt(0).toString(16).toUpperCase()}function literalEscape(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+hex(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+hex(e)}))}function classEscape(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+hex(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+hex(e)}))}function describeExpectation(e){return r[e.type](e)}return"Expected "+function describeExpected(e){var t,r,n=e.map(describeExpectation);if(n.sort(),n.length>0){for(t=1,r=1;t<n.length;t++)n[t-1]!==n[t]&&(n[r]=n[t],r++);n.length=r}switch(n.length){case 1:return n[0];case 2:return n[0]+" or "+n[1];default:return n.slice(0,-1).join(", ")+", or "+n[n.length-1]}}(e)+" but "+function describeFound(e){return e?'"'+literalEscape(e)+'"':"end of input"}(t)+" found."},e.exports={StartRules:["Expr"],SyntaxError:peg$SyntaxError,parse:function peg$parse(e,t){var r,n={},i=(t=void 0!==t?t:{}).grammarSource,s={Expr:peg$parseExpr},o=peg$parseExpr,a="||",u="&&",c="!",l="(",d=")",f=".",h="#",p="'",m="\\\\",y="\\'",b=/^[=><~]/,g=/^[?]/,v=/^[^'\\]/,w=/^[^'\\ ]/,I=/^[a-z]/,A=/^[A-Za-z0-9]/,O=/^[A-Z]/,S=/^[ \t\n\r]/,_=peg$literalExpectation("||",!1),R=peg$literalExpectation("&&",!1),P=peg$literalExpectation("!",!1),E=peg$literalExpectation("(",!1),T=peg$literalExpectation(")",!1),L=peg$otherExpectation("metadata field term"),D=peg$literalExpectation(".",!1),x=peg$otherExpectation("tag term"),k=peg$literalExpectation("#",!1),j=peg$otherExpectation("primary field term"),q=peg$classExpectation(["=",">","<","~"],!1,!1),M=peg$classExpectation(["?"],!1,!1),N=peg$literalExpectation("'",!1),F=peg$literalExpectation("\\\\",!1),$=peg$literalExpectation("\\'",!1),V=peg$classExpectation(["'","\\"],!0,!1),z=peg$classExpectation(["'","\\"," "],!0,!1),B=peg$classExpectation([["a","z"]],!1,!1),W=peg$classExpectation([["A","Z"],["a","z"],["0","9"]],!1,!1),U=peg$otherExpectation("attribute type"),Z=peg$classExpectation([["A","Z"]],!1,!1),G=peg$otherExpectation("whitespace"),H=peg$classExpectation([" ","\t","\n","\r"],!1,!1),peg$f0=function(e,t){return t.reduce(((e,t)=>function union(e,t){const r=Array.from(new Set([...e,...t]));return r.sort(((e,t)=>e-t)),r}(e,t)),e)},peg$f1=function(e,t){return t.reduce(((e,t)=>function intersect(e,...t){const r=[e,...t].reduce(((e,t)=>e.filter((e=>t.includes(e)))));return r.sort(((e,t)=>e-t)),r}(e,t)),e)},peg$f2=function(e){return function diffAsym(e,t){const r=e.filter((e=>!t.includes(e)));return r.sort(((e,t)=>e-t)),r}([...Array(t.attributes.length).keys()],e)},peg$f3=function(e,r,n){return match(t.attributes,[e,...r],n)},peg$f4=function(e){return match(t.attributes,["tags"],(t=>Array.isArray(t)&&t.includes(e)))},peg$f5=function(e,r,n){return match(t.attributes,["value",...r],n,e)},peg$f6=function(e,r){return match(t.attributes,["value","value"],r,e)},peg$f7=function(e){return match(t.attributes,["value","@type"],(t=>t===e))},peg$f8=function(e,t){switch(e){case"=":return e=>String(e)===t;case">":return e=>new Date(e)>=new Date(t);case"<":return e=>new Date(e)<=new Date(t);case"~":return e=>Array.isArray(e)&&e.includes(t)}},peg$f9=function(e){if("?"===e)return e=>Array.isArray(e)?e.length>0:"Object"===e.constructor.name?Object.keys(e).length>0:null!=e},peg$f10=function(e){return e.join("").replaceAll("\\\\","\\").replaceAll("\\'","'")},peg$f11=function(e){return e.join("").replaceAll("\\\\","\\").replaceAll("\\'","'")},K=0|t.peg$currPos,Y=[{line:1,column:1}],J=K,Q=t.peg$maxFailExpected||[],X=0|t.peg$silentFails;if(t.startRule){if(!(t.startRule in s))throw new Error("Can't start parsing from rule \""+t.startRule+'".');o=s[t.startRule]}function peg$literalExpectation(e,t){return{type:"literal",text:e,ignoreCase:t}}function peg$classExpectation(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function peg$otherExpectation(e){return{type:"other",description:e}}function peg$computePosDetails(t){var r,n=Y[t];if(n)return n;if(t>=Y.length)r=Y.length-1;else for(r=t;!Y[--r];);for(n={line:(n=Y[r]).line,column:n.column};r<t;)10===e.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return Y[t]=n,n}function peg$computeLocation(e,t,r){var n=peg$computePosDetails(e),s=peg$computePosDetails(t),o={source:i,start:{offset:e,line:n.line,column:n.column},end:{offset:t,line:s.line,column:s.column}};return r&&i&&"function"==typeof i.offset&&(o.start=i.offset(o.start),o.end=i.offset(o.end)),o}function peg$fail(e){K<J||(K>J&&(J=K,Q=[]),Q.push(e))}function peg$buildStructuredError(e,t,r){return new peg$SyntaxError(peg$SyntaxError.buildMessage(e,t),e,t,r)}function peg$parseExpr(){var t,r,i,s,o,u,c,l;if(t=K,(r=peg$parseExpr0())!==n){if(i=[],s=K,o=[],(u=peg$parse_())!==n)for(;u!==n;)o.push(u),u=peg$parse_();else o=n;if(o!==n)if(e.substr(K,2)===a?(u=a,K+=2):(u=n,0===X&&peg$fail(_)),u!==n){if(c=[],(l=peg$parse_())!==n)for(;l!==n;)c.push(l),l=peg$parse_();else c=n;c!==n&&(l=peg$parseExpr0())!==n?s=l:(K=s,s=n)}else K=s,s=n;else K=s,s=n;for(;s!==n;){if(i.push(s),s=K,o=[],(u=peg$parse_())!==n)for(;u!==n;)o.push(u),u=peg$parse_();else o=n;if(o!==n)if(e.substr(K,2)===a?(u=a,K+=2):(u=n,0===X&&peg$fail(_)),u!==n){if(c=[],(l=peg$parse_())!==n)for(;l!==n;)c.push(l),l=peg$parse_();else c=n;c!==n&&(l=peg$parseExpr0())!==n?s=l:(K=s,s=n)}else K=s,s=n;else K=s,s=n}t,t=peg$f0(r,i)}else K=t,t=n;return t}function peg$parseExpr0(){var t,r,i,s,o,a,c,l;if(t=K,(r=peg$parseExpr1())!==n){if(i=[],s=K,o=[],(a=peg$parse_())!==n)for(;a!==n;)o.push(a),a=peg$parse_();else o=n;if(o!==n)if(e.substr(K,2)===u?(a=u,K+=2):(a=n,0===X&&peg$fail(R)),a!==n){if(c=[],(l=peg$parse_())!==n)for(;l!==n;)c.push(l),l=peg$parse_();else c=n;c!==n&&(l=peg$parseExpr1())!==n?s=l:(K=s,s=n)}else K=s,s=n;else K=s,s=n;for(;s!==n;){if(i.push(s),s=K,o=[],(a=peg$parse_())!==n)for(;a!==n;)o.push(a),a=peg$parse_();else o=n;if(o!==n)if(e.substr(K,2)===u?(a=u,K+=2):(a=n,0===X&&peg$fail(R)),a!==n){if(c=[],(l=peg$parse_())!==n)for(;l!==n;)c.push(l),l=peg$parse_();else c=n;c!==n&&(l=peg$parseExpr1())!==n?s=l:(K=s,s=n)}else K=s,s=n;else K=s,s=n}t,t=peg$f1(r,i)}else K=t,t=n;return t}function peg$parseExpr1(){var t,r,i;return t=K,33===e.charCodeAt(K)?(r=c,K++):(r=n,0===X&&peg$fail(P)),r!==n&&(i=peg$parseExpr1())!==n?(t,t=peg$f2(i)):(K=t,t=n),t===n&&(t=function peg$parseExpr2(){var t,r,i,s,o,a;t=K,40===e.charCodeAt(K)?(r=l,K++):(r=n,0===X&&peg$fail(E));if(r!==n){if(i=[],(s=peg$parse_())!==n)for(;s!==n;)i.push(s),s=peg$parse_();else i=n;if(i!==n)if((s=peg$parseExpr())!==n){if(o=[],(a=peg$parse_())!==n)for(;a!==n;)o.push(a),a=peg$parse_();else o=n;o!==n?(41===e.charCodeAt(K)?(a=d,K++):(a=n,0===X&&peg$fail(T)),a!==n?t=s:(K=t,t=n)):(K=t,t=n)}else K=t,t=n;else K=t,t=n}else K=t,t=n;t===n&&(t=function peg$parseTerm(){var t;t=function peg$parsePrimaryFieldTerm(){var t,r,i,s,o,a;if(X++,t=K,r=peg$parseAttributeType(),r!==n){if(i=[],s=K,46===e.charCodeAt(K)?(o=f,K++):(o=n,0===X&&peg$fail(D)),o!==n&&(a=peg$parsePathSegment())!==n?s=a:(K=s,s=n),s!==n)for(;s!==n;)i.push(s),s=K,46===e.charCodeAt(K)?(o=f,K++):(o=n,0===X&&peg$fail(D)),o!==n&&(a=peg$parsePathSegment())!==n?s=a:(K=s,s=n);else i=n;i!==n&&(s=peg$parsePredicate())!==n?(t,t=peg$f5(r,i,s)):(K=t,t=n)}else K=t,t=n;t===n&&(t=K,(r=peg$parseAttributeType())!==n&&(i=peg$parsePredicate())!==n?(t,t=peg$f6(r,i)):(K=t,t=n),t===n&&(t=K,(r=peg$parseAttributeType())!==n&&(t,r=peg$f7(r)),t=r));X--,t===n&&(r=n,0===X&&peg$fail(j));return t}(),t===n&&(t=function peg$parseMetadataFieldTerm(){var t,r,i,s,o,a;if(X++,t=K,r=peg$parsePathSegment(),r!==n){for(i=[],s=K,46===e.charCodeAt(K)?(o=f,K++):(o=n,0===X&&peg$fail(D)),o!==n&&(a=peg$parsePathSegment())!==n?s=a:(K=s,s=n);s!==n;)i.push(s),s=K,46===e.charCodeAt(K)?(o=f,K++):(o=n,0===X&&peg$fail(D)),o!==n&&(a=peg$parsePathSegment())!==n?s=a:(K=s,s=n);(s=peg$parsePredicate())!==n?(t,t=peg$f3(r,i,s)):(K=t,t=n)}else K=t,t=n;X--,t===n&&(r=n,0===X&&peg$fail(L));return t}(),t===n&&(t=function peg$parseTagTerm(){var t,r,i;X++,t=K,35===e.charCodeAt(K)?(r=h,K++):(r=n,0===X&&peg$fail(k));r!==n&&(i=peg$parsePredicateRHS())!==n?(t,t=peg$f4(i)):(K=t,t=n);X--,t===n&&(r=n,0===X&&peg$fail(x));return t}()));return t}());return t}()),t}function peg$parsePredicate(){var t,r,i;return t=K,r=e.charAt(K),b.test(r)?K++:(r=n,0===X&&peg$fail(q)),r!==n&&(i=peg$parsePredicateRHS())!==n?(t,t=peg$f8(r,i)):(K=t,t=n),t===n&&(t=K,r=e.charAt(K),g.test(r)?K++:(r=n,0===X&&peg$fail(M)),r!==n&&(t,r=peg$f9(r)),t=r),t}function peg$parsePredicateRHS(){var t,r,i,s;if(t=K,39===e.charCodeAt(K)?(r=p,K++):(r=n,0===X&&peg$fail(N)),r!==n){for(i=[],e.substr(K,2)===m?(s=m,K+=2):(s=n,0===X&&peg$fail(F)),s===n&&(e.substr(K,2)===y?(s=y,K+=2):(s=n,0===X&&peg$fail($)),s===n&&(s=e.charAt(K),v.test(s)?K++:(s=n,0===X&&peg$fail(V))));s!==n;)i.push(s),e.substr(K,2)===m?(s=m,K+=2):(s=n,0===X&&peg$fail(F)),s===n&&(e.substr(K,2)===y?(s=y,K+=2):(s=n,0===X&&peg$fail($)),s===n&&(s=e.charAt(K),v.test(s)?K++:(s=n,0===X&&peg$fail(V))));39===e.charCodeAt(K)?(s=p,K++):(s=n,0===X&&peg$fail(N)),s!==n?(t,t=peg$f10(i)):(K=t,t=n)}else K=t,t=n;if(t===n){for(t=K,r=[],e.substr(K,2)===m?(i=m,K+=2):(i=n,0===X&&peg$fail(F)),i===n&&(e.substr(K,2)===y?(i=y,K+=2):(i=n,0===X&&peg$fail($)),i===n&&(i=e.charAt(K),w.test(i)?K++:(i=n,0===X&&peg$fail(z))));i!==n;)r.push(i),e.substr(K,2)===m?(i=m,K+=2):(i=n,0===X&&peg$fail(F)),i===n&&(e.substr(K,2)===y?(i=y,K+=2):(i=n,0===X&&peg$fail($)),i===n&&(i=e.charAt(K),w.test(i)?K++:(i=n,0===X&&peg$fail(z))));t,t=r=peg$f11(r)}return t}function peg$parsePathSegment(){var t,r,i,s,o;if(t=K,r=K,i=e.charAt(K),I.test(i)?K++:(i=n,0===X&&peg$fail(B)),i!==n){if(s=[],o=e.charAt(K),A.test(o)?K++:(o=n,0===X&&peg$fail(W)),o!==n)for(;o!==n;)s.push(o),o=e.charAt(K),A.test(o)?K++:(o=n,0===X&&peg$fail(W));else s=n;s!==n?r=i=[i,s]:(K=r,r=n)}else K=r,r=n;return t=r!==n?e.substring(t,K):r}function peg$parseAttributeType(){var t,r,i,s,o;if(X++,t=K,r=K,i=e.charAt(K),O.test(i)?K++:(i=n,0===X&&peg$fail(Z)),i!==n){for(s=[],o=e.charAt(K),A.test(o)?K++:(o=n,0===X&&peg$fail(W));o!==n;)s.push(o),o=e.charAt(K),A.test(o)?K++:(o=n,0===X&&peg$fail(W));r=i=[i,s]}else K=r,r=n;return t=r!==n?e.substring(t,K):r,X--,t===n&&(r=n,0===X&&peg$fail(U)),t}function peg$parse_(){var t;return X++,t=e.charAt(K),S.test(t)?K++:(t=n,0===X&&peg$fail(H)),X--,t===n&&(n,0===X&&peg$fail(G)),t}if(r=o(),t.peg$library)return{peg$result:r,peg$currPos:K,peg$FAILED:n,peg$maxFailExpected:Q,peg$maxFailPos:J};if(r!==n&&K===e.length)return r;throw r!==n&&K<e.length&&peg$fail({type:"end"}),peg$buildStructuredError(Q,J<e.length?e.charAt(J):null,J<e.length?peg$computeLocation(J,J+1):peg$computeLocation(J,J))}}},2344:e=>{"use strict";e.exports=NMSHDContent},922:e=>{"use strict";e.exports=NMSHDCrypto},2984:e=>{"use strict";e.exports=NMSHDTransport},1391:e=>{"use strict";e.exports=TSServal}},t={};function __webpack_require__(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r].call(i.exports,i,i.exports,__webpack_require__),i.loaded=!0,i.exports}__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var r=__webpack_require__(7806);NMSHDConsumption=r})();
|
|
3
|
-
//# sourceMappingURL=nmshd.consumption.min.js.map
|