UNPKG

@accordproject/concerto-core

Version:

Core Implementation for the Concerto Modeling Language

2 lines • 883 kB
/*! For license information please see concerto-core.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["concerto-core"]=t():e["concerto-core"]=t()}(self,()=>(()=>{var e={3348(e,t,r){"use strict";const n=r(3954),{DcsCto:o,DcsNamespace:a}=r(5497);e.exports={MetaModelUtil:n,MetaModelNamespace:"concerto.metamodel@1.0.0",DcsCto:o,DcsNamespace:a}},5497(e){"use strict";e.exports={DcsCto:'/*\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nnamespace org.accordproject.decoratorcommands@0.4.0\n\nimport concerto.metamodel@1.0.0.Decorator\n\n/**\n * A reference to an existing named & versioned DecoratorCommandSet\n */\nconcept DecoratorCommandSetReference {\n o String name\n o String version\n}\n\n/**\n * Whether to upsert or append the decorator\n */\nenum CommandType {\n o UPSERT\n o APPEND\n}\n\n/**\n * Which models elements to add the decorator to. Any null\n * elements are \'wildcards\'.\n */\nconcept CommandTarget {\n o String namespace optional\n o String declaration optional\n o String property optional\n o String[] properties optional // property and properties are mutually exclusive\n o String type optional\n o MapElement mapElement optional\n}\n\n/**\n * Map Declaration elements which might be used as a target\n */\nenum MapElement {\n o KEY\n o VALUE\n o KEY_VALUE\n}\n\n/**\n * Applies a decorator to a given target\n */\nconcept Command {\n o CommandTarget target\n o Decorator decorator\n o CommandType type\n o String decoratorNamespace optional\n}\n\n/**\n * A named and versioned set of commands. Includes are supported for modularity/reuse.\n */\nconcept DecoratorCommandSet {\n o String name\n o String version\n o DecoratorCommandSetReference[] includes optional // not yet supported\n o Command[] commands\n}',DcsNamespace:"org.accordproject.decoratorcommands@0.4.0"}},4702(e){"use strict";e.exports='/*\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n@DotNetNamespace("AccordProject.Concerto.Metamodel")\nnamespace concerto.metamodel@1.0.0\n\nconcept Position {\n o Integer line\n o Integer column\n o Integer offset\n}\n\nconcept Range {\n o Position start\n o Position end\n o String source optional\n}\n\nconcept TypeIdentifier {\n o String name\n o String namespace optional\n o String resolvedName optional\n}\n\nabstract concept DecoratorLiteral {\n o Range location optional\n}\n\nconcept DecoratorString extends DecoratorLiteral {\n o String value\n}\n\nconcept DecoratorNumber extends DecoratorLiteral {\n o Double value\n}\n\nconcept DecoratorBoolean extends DecoratorLiteral {\n o Boolean value\n}\n\nconcept DecoratorTypeReference extends DecoratorLiteral {\n o TypeIdentifier type\n o Boolean isArray default=false\n}\n\nconcept Decorator {\n o String name\n o DecoratorLiteral[] arguments optional\n o Range location optional\n}\n\nconcept Identified {\n}\n\nconcept IdentifiedBy extends Identified {\n o String name\n}\n\nabstract concept Declaration {\n o String name regex=/^(\\p{Lu}|\\p{Ll}|\\p{Lt}|\\p{Lm}|\\p{Lo}|\\p{Nl}|\\$|_|\\\\u[0-9A-Fa-f]{4})(?:\\p{Lu}|\\p{Ll}|\\p{Lt}|\\p{Lm}|\\p{Lo}|\\p{Nl}|\\$|_|\\\\u[0-9A-Fa-f]{4}|\\p{Mn}|\\p{Mc}|\\p{Nd}|\\p{Pc}|\\u200C|\\u200D)*$/u\n o Decorator[] decorators optional\n o Range location optional\n}\n\nabstract concept MapKeyType {\n o Decorator[] decorators optional\n o Range location optional\n}\n\nabstract concept MapValueType {\n o Decorator[] decorators optional\n o Range location optional\n}\n\nconcept MapDeclaration extends Declaration {\n o MapKeyType key\n o MapValueType value\n}\n\nconcept StringMapKeyType extends MapKeyType {}\nconcept DateTimeMapKeyType extends MapKeyType {}\n\nconcept ObjectMapKeyType extends MapKeyType {\n o TypeIdentifier type\n}\n\nconcept BooleanMapValueType extends MapValueType {}\nconcept DateTimeMapValueType extends MapValueType {}\nconcept StringMapValueType extends MapValueType {}\nconcept IntegerMapValueType extends MapValueType {}\nconcept LongMapValueType extends MapValueType {}\nconcept DoubleMapValueType extends MapValueType {}\n\nconcept ObjectMapValueType extends MapValueType {\n o TypeIdentifier type\n}\n\nconcept RelationshipMapValueType extends MapValueType {\n o TypeIdentifier type\n}\n\nconcept EnumDeclaration extends Declaration {\n o EnumProperty[] properties\n}\n\nconcept EnumProperty {\n o String name regex=/^(\\p{Lu}|\\p{Ll}|\\p{Lt}|\\p{Lm}|\\p{Lo}|\\p{Nl}|\\$|_|\\\\u[0-9A-Fa-f]{4})(?:\\p{Lu}|\\p{Ll}|\\p{Lt}|\\p{Lm}|\\p{Lo}|\\p{Nl}|\\$|_|\\\\u[0-9A-Fa-f]{4}|\\p{Mn}|\\p{Mc}|\\p{Nd}|\\p{Pc}|\\u200C|\\u200D)*$/u\n o Decorator[] decorators optional\n o Range location optional\n}\n\nconcept ConceptDeclaration extends Declaration {\n o Boolean isAbstract default=false\n o Identified identified optional\n o TypeIdentifier superType optional\n o Property[] properties\n}\n\nconcept AssetDeclaration extends ConceptDeclaration {\n}\n\nconcept ParticipantDeclaration extends ConceptDeclaration {\n}\n\nconcept TransactionDeclaration extends ConceptDeclaration {\n}\n\nconcept EventDeclaration extends ConceptDeclaration {\n}\n\nabstract concept Property {\n o String name regex=/^(\\p{Lu}|\\p{Ll}|\\p{Lt}|\\p{Lm}|\\p{Lo}|\\p{Nl}|\\$|_|\\\\u[0-9A-Fa-f]{4})(?:\\p{Lu}|\\p{Ll}|\\p{Lt}|\\p{Lm}|\\p{Lo}|\\p{Nl}|\\$|_|\\\\u[0-9A-Fa-f]{4}|\\p{Mn}|\\p{Mc}|\\p{Nd}|\\p{Pc}|\\u200C|\\u200D)*$/u\n o Boolean isArray default=false\n o Boolean isOptional default=false\n o Decorator[] decorators optional\n o Range location optional\n}\n\nconcept RelationshipProperty extends Property {\n o TypeIdentifier type\n}\n\nconcept ObjectProperty extends Property {\n o String defaultValue optional\n o TypeIdentifier type\n}\n\nconcept BooleanProperty extends Property {\n o Boolean defaultValue optional\n}\n\nconcept DateTimeProperty extends Property {\n}\n\nconcept StringProperty extends Property {\n o String defaultValue optional\n o StringRegexValidator validator optional\n o StringLengthValidator lengthValidator optional\n}\n\nconcept StringRegexValidator {\n o String pattern\n o String flags\n}\n\nconcept StringLengthValidator {\n o Integer minLength optional\n o Integer maxLength optional\n}\n\nconcept DoubleProperty extends Property {\n o Double defaultValue optional\n o DoubleDomainValidator validator optional\n}\n\nconcept DoubleDomainValidator {\n o Double lower optional\n o Double upper optional\n}\n\nconcept IntegerProperty extends Property {\n o Integer defaultValue optional\n o IntegerDomainValidator validator optional\n}\n\nconcept IntegerDomainValidator {\n o Integer lower optional\n o Integer upper optional\n}\n\nconcept LongProperty extends Property {\n o Long defaultValue optional\n o LongDomainValidator validator optional\n}\n\nconcept LongDomainValidator {\n o Long lower optional\n o Long upper optional\n}\n\nconcept AliasedType{\n o String name\n o String aliasedName\n}\nabstract concept Import {\n o String namespace\n o String uri optional\n}\n\nconcept ImportAll extends Import {\n}\n\nconcept ImportType extends Import {\n o String name\n}\n\nconcept ImportTypes extends Import {\n o String[] types\n o AliasedType[] aliasedTypes optional\n}\n\nconcept Model {\n o String namespace\n o String sourceUri optional\n o String concertoVersion optional\n o Import[] imports optional\n o Declaration[] declarations optional\n o Decorator[] decorators optional\n}\n\nconcept Models {\n o Model[] models\n}\n\nabstract concept ScalarDeclaration extends Declaration {\n o String namespace optional\n}\n\nconcept BooleanScalar extends ScalarDeclaration {\n o Boolean defaultValue optional\n}\n\nconcept IntegerScalar extends ScalarDeclaration {\n o Integer defaultValue optional\n o IntegerDomainValidator validator optional\n}\n\nconcept LongScalar extends ScalarDeclaration {\n o Long defaultValue optional\n o LongDomainValidator validator optional\n}\n\nconcept DoubleScalar extends ScalarDeclaration {\n o Double defaultValue optional\n o DoubleDomainValidator validator optional\n}\n\nconcept StringScalar extends ScalarDeclaration {\n o String defaultValue optional\n o StringRegexValidator validator optional\n o StringLengthValidator lengthValidator optional\n}\n\nconcept DateTimeScalar extends ScalarDeclaration {\n o String defaultValue optional\n}\n'},3954(e,t,r){"use strict";const n=r(4865),o="concerto.metamodel@1.0.0",a=r(4702);function i(e,t){return e.declarations.find(e=>e.name===t)}function s(e,t){if(!t[e])throw new Error(`Name ${e} not found`);return t[e].namespace}function u(e,t){switch((e.decorators||[]).forEach(e=>{u(e,t)}),e.$class){case`${o}.Model`:(e.declarations||[]).forEach(e=>{u(e,t)});break;case`${o}.EnumDeclaration`:case`${o}.AssetDeclaration`:case`${o}.ConceptDeclaration`:case`${o}.EventDeclaration`:case`${o}.TransactionDeclaration`:case`${o}.ParticipantDeclaration`:if(e.superType){const r=e.superType.name;e.superType.namespace=s(r,t),e.superType.name=t[r].name,t[r]?.resolvedName&&(e.superType.resolvedName=t[r].resolvedName)}(e.properties||[]).forEach(e=>{u(e,t)});break;case`${o}.MapDeclaration`:u(e.key,t),u(e.value,t);break;case`${o}.Decorator`:(e.arguments||[]).forEach(e=>{u(e,t)});break;case`${o}.ObjectProperty`:case`${o}.RelationshipProperty`:case`${o}.DecoratorTypeReference`:case`${o}.ObjectMapKeyType`:case`${o}.ObjectMapValueType`:case`${o}.RelationshipMapValueType`:e.type.namespace=s(e.type.name,t),e.type.name=t[e.type.name].name,t[e.type.name]?.resolvedName&&(e.type.resolvedName=t[e.type.name].resolvedName);break;case`${o}.StringScalar`:case`${o}.BooleanScalar`:case`${o}.DateTimeScalar`:case`${o}.DoubleScalar`:case`${o}.LongScalar`:case`${o}.IntegerScalar`:e.namespace=s(e.name,t),e.name=t[e.name].name}return e}function c(e,t){const r=JSON.parse(JSON.stringify(t)),n=function(e,t){const r="concerto@1.0.0",n={Concept:{namespace:r,name:"Concept"},Asset:{namespace:r,name:"Asset"},Participant:{namespace:r,name:"Participant"},Transaction:{namespace:r,name:"Transaction"},Event:{namespace:r,name:"Event"}};return(t.imports||[]).forEach(t=>{const r=t.namespace,a=function(e,t){return e.models.find(e=>e.namespace===t)}(e,r);if(t.$class===`${o}.ImportType`){if(!i(a,t.name))throw new Error(`Declaration ${t.name} in namespace ${r} not found`);n[t.name]={namespace:r,name:t.name}}else if(t.$class===`${o}.ImportTypes`){const e=t.aliasedTypes?new Map(t.aliasedTypes.map(({name:e,aliasedName:t})=>[e,t])):new Map;t.types.forEach(t=>{const o=e.get(t)||t;if(!i(a,t))throw new Error(`Declaration ${t} in namespace ${r} not found`);n[o]=o!==t?{namespace:r,name:o,resolvedName:t}:{namespace:r,name:t}})}else(a.declarations||[]).forEach(e=>{n[e.name]={namespace:r,name:e.name}})}),(t.declarations||[]).forEach(e=>{n[e.name]={namespace:t.namespace,name:e.name}}),n}(e,t);return u(r,n),r}function l(e){const t=[];switch(e.$class){case`${o}.ImportAll`:t.push(`${e.namespace}.*`);break;case`${o}.ImportType`:t.push(`${e.namespace}.${e.name}`);break;case`${o}.ImportTypes`:e.types.forEach(r=>{t.push(`${e.namespace}.${r}`)});break;default:throw new Error(`Unrecognized imports ${e.$class}`)}return t}e.exports={metaModelAst:n,metaModelCto:a,resolveLocalNames:c,resolveLocalNamesForAll:function(e){const t={$class:`${o}.Models`,models:[]};return e.models.forEach(r=>{const n=c(e,r);t.models.push(n)}),t},importFullyQualifiedNames:l,getExternalImports:function(e){const t={};return e.imports&&e.imports.forEach(e=>{const r=l(e);e.uri&&(t[r[0]]=e.uri)}),t}}},6093(e,t,r){"use strict";var n=r(9907),o=r(4364);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function s(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=function(e){if("object"!==a(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===a(t)?t:String(t)}var c,l,p=r(1342).codes,f=p.ERR_AMBIGUOUS_ARGUMENT,d=p.ERR_INVALID_ARG_TYPE,h=p.ERR_INVALID_ARG_VALUE,m=p.ERR_INVALID_RETURN_VALUE,y=p.ERR_MISSING_ARGS,g=r(9801),D=r(9208).inspect,A=r(9208).types,E=A.isPromise,v=A.isRegExp,b=r(3225)(),C=r(1937)(),F=r(9818)("RegExp.prototype.test");function w(){var e=r(5656);c=e.isDeepEqual,l=e.isDeepStrictEqual}new Map;var O=!1,S=e.exports=$,B={};function T(e){if(e.message instanceof Error)throw e.message;throw new g(e)}function x(e,t,r,n){if(!r){var o=!1;if(0===t)o=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var a=new g({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw a.generatedMessage=o,a}}function $(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];x.apply(void 0,[$,t.length].concat(t))}S.fail=function e(t,r,a,i,s){var u,c=arguments.length;if(0===c?u="Failed":1===c?(a=t,t=void 0):(!1===O&&(O=!0,(n.emitWarning?n.emitWarning:o.warn.bind(o))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===c&&(i="!=")),a instanceof Error)throw a;var l={actual:t,expected:r,operator:void 0===i?"fail":i,stackStartFn:s||e};void 0!==a&&(l.message=a);var p=new g(l);throw u&&(p.message=u,p.generatedMessage=!0),p},S.AssertionError=g,S.ok=$,S.equal=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");t!=r&&T({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},S.notEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");t==r&&T({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},S.deepEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");void 0===c&&w(),c(t,r)||T({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},S.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");void 0===c&&w(),c(t,r)&&T({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},S.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");void 0===c&&w(),l(t,r)||T({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},S.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");void 0===c&&w(),l(t,r)&&T({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},S.strictEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");C(t,r)||T({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},S.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new y("actual","expected");C(t,r)&&T({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var I=s(function e(t,r,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach(function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&v(t[e])&&F(t[e],n[e])?o[e]=n[e]:o[e]=t[e])})});function N(e,t,r,n){if("function"!=typeof t){if(v(t))return F(t,e);if(2===arguments.length)throw new d("expected",["Function","RegExp"],t);if("object"!==a(e)||null===e){var o=new g({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw o.operator=n.name,o}var i=Object.keys(t);if(t instanceof Error)i.push("name","message");else if(0===i.length)throw new h("error",t,"may not be an empty object");return void 0===c&&w(),i.forEach(function(o){"string"==typeof e[o]&&v(t[o])&&F(t[o],e[o])||function(e,t,r,n,o,a){if(!(r in e)||!l(e[r],t[r])){if(!n){var i=new I(e,o),s=new I(t,o,e),u=new g({actual:i,expected:s,operator:"deepStrictEqual",stackStartFn:a});throw u.actual=e,u.expected=t,u.operator=a.name,u}T({actual:e,expected:t,message:n,operator:a.name,stackStartFn:a})}}(e,t,o,r,i,n)}),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function j(e){if("function"!=typeof e)throw new d("fn","Function",e);try{e()}catch(e){return e}return B}function P(e){return E(e)||null!==e&&"object"===a(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function M(e){return Promise.resolve().then(function(){var t;if("function"==typeof e){if(!P(t=e()))throw new m("instance of Promise","promiseFn",t)}else{if(!P(e))throw new d("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then(function(){return t}).then(function(){return B}).catch(function(e){return e})})}function k(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new d("error",["Object","Error","Function","RegExp"],r);if("object"===a(t)&&null!==t){if(t.message===r)throw new f("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new f("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==a(r)&&"function"!=typeof r)throw new d("error",["Object","Error","Function","RegExp"],r);if(t===B){var o="";r&&r.name&&(o+=" (".concat(r.name,")")),o+=n?": ".concat(n):".";var i="rejects"===e.name?"rejection":"exception";T({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(i).concat(o),stackStartFn:e})}if(r&&!N(t,r,n,e))throw t}function R(e,t,r,n){if(t!==B){if("string"==typeof r&&(n=r,r=void 0),!r||N(t,r)){var o=n?": ".concat(n):".",a="doesNotReject"===e.name?"rejection":"exception";T({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(a).concat(o,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function _(e,t,r,n,o){if(!v(t))throw new d("regexp","RegExp",t);var i="match"===o;if("string"!=typeof e||F(t,e)!==i){if(r instanceof Error)throw r;var s=!r;r=r||("string"!=typeof e?'The "string" argument must be of type string. Received type '+"".concat(a(e)," (").concat(D(e),")"):(i?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(D(t),". Input:\n\n").concat(D(e),"\n"));var u=new g({actual:e,expected:t,message:r,operator:o,stackStartFn:n});throw u.generatedMessage=s,u}}function L(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];x.apply(void 0,[L,t.length].concat(t))}S.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];k.apply(void 0,[e,j(t)].concat(n))},S.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return M(t).then(function(t){return k.apply(void 0,[e,t].concat(n))})},S.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];R.apply(void 0,[e,j(t)].concat(n))},S.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return M(t).then(function(t){return R.apply(void 0,[e,t].concat(n))})},S.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===a(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=D(t);var n=new g({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),o=t.stack;if("string"==typeof o){var i=o.split("\n");i.shift();for(var s=n.stack.split("\n"),u=0;u<i.length;u++){var c=s.indexOf(i[u]);if(-1!==c){s=s.slice(0,c);break}}n.stack="".concat(s.join("\n"),"\n").concat(i.join("\n"))}throw n}},S.match=function e(t,r,n){_(t,r,n,e,"match")},S.doesNotMatch=function e(t,r,n){_(t,r,n,e,"doesNotMatch")},S.strict=b(L,S,{equal:S.strictEqual,deepEqual:S.deepStrictEqual,notEqual:S.notStrictEqual,notDeepEqual:S.notDeepStrictEqual}),S.strict.strict=S.strict},9801(e,t,r){"use strict";var n=r(9907);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){var n,o,a;n=e,o=t,a=r[t],(o=s(o))in n?Object.defineProperty(n,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):n[o]=a}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,s(n.key),n)}}function s(e){var t=function(e){if("object"!==m(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===m(t)?t:String(t)}function u(e,t){if(t&&("object"===m(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e){var t="function"==typeof Map?new Map:void 0;return l=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return p(e,arguments,h(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,e)},l(e)}function p(e,t,r){return p=f()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&d(o,r.prototype),o},p.apply(null,arguments)}function f(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}var y=r(9208).inspect,g=r(1342).codes.ERR_INVALID_ARG_TYPE;function D(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var A="",E="",v="",b="",C={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function F(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){r[t]=e[t]}),Object.defineProperty(r,"message",{value:e.message}),r}function w(e){return y(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var O=function(e,t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(O,e);var r,o,s,l,p=(r=O,o=f(),function(){var e,t=h(r);if(o){var n=h(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return u(this,e)});function O(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,O),"object"!==m(e)||null===e)throw new g("options","Object",e);var r=e.message,o=e.operator,a=e.stackStartFn,i=e.actual,s=e.expected,l=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=r)t=p.call(this,String(r));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(A="",E="",b="",v=""):(A="",E="",b="",v="")),"object"===m(i)&&null!==i&&"object"===m(s)&&null!==s&&"stack"in i&&i instanceof Error&&"stack"in s&&s instanceof Error&&(i=F(i),s=F(s)),"deepStrictEqual"===o||"strictEqual"===o)t=p.call(this,function(e,t,r){var o="",a="",i=0,s="",u=!1,c=w(e),l=c.split("\n"),p=w(t).split("\n"),f=0,d="";if("strictEqual"===r&&"object"===m(e)&&"object"===m(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===l.length&&1===p.length&&l[0]!==p[0]){var h=l[0].length+p[0].length;if(h<=10){if(!("object"===m(e)&&null!==e||"object"===m(t)&&null!==t||0===e&&0===t))return"".concat(C[r],"\n\n")+"".concat(l[0]," !== ").concat(p[0],"\n")}else if("strictEqualObject"!==r&&h<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;l[0][f]===p[0][f];)f++;f>2&&(d="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",f),"^"),f=0)}}for(var y=l[l.length-1],g=p[p.length-1];y===g&&(f++<2?s="\n ".concat(y).concat(s):o=y,l.pop(),p.pop(),0!==l.length&&0!==p.length);)y=l[l.length-1],g=p[p.length-1];var F=Math.max(l.length,p.length);if(0===F){var O=c.split("\n");if(O.length>30)for(O[26]="".concat(A,"...").concat(b);O.length>27;)O.pop();return"".concat(C.notIdentical,"\n\n").concat(O.join("\n"),"\n")}f>3&&(s="\n".concat(A,"...").concat(b).concat(s),u=!0),""!==o&&(s="\n ".concat(o).concat(s),o="");var S=0,B=C[r]+"\n".concat(E,"+ actual").concat(b," ").concat(v,"- expected").concat(b),T=" ".concat(A,"...").concat(b," Lines skipped");for(f=0;f<F;f++){var x=f-i;if(l.length<f+1)x>1&&f>2&&(x>4?(a+="\n".concat(A,"...").concat(b),u=!0):x>3&&(a+="\n ".concat(p[f-2]),S++),a+="\n ".concat(p[f-1]),S++),i=f,o+="\n".concat(v,"-").concat(b," ").concat(p[f]),S++;else if(p.length<f+1)x>1&&f>2&&(x>4?(a+="\n".concat(A,"...").concat(b),u=!0):x>3&&(a+="\n ".concat(l[f-2]),S++),a+="\n ".concat(l[f-1]),S++),i=f,a+="\n".concat(E,"+").concat(b," ").concat(l[f]),S++;else{var $=p[f],I=l[f],N=I!==$&&(!D(I,",")||I.slice(0,-1)!==$);N&&D($,",")&&$.slice(0,-1)===I&&(N=!1,I+=","),N?(x>1&&f>2&&(x>4?(a+="\n".concat(A,"...").concat(b),u=!0):x>3&&(a+="\n ".concat(l[f-2]),S++),a+="\n ".concat(l[f-1]),S++),i=f,a+="\n".concat(E,"+").concat(b," ").concat(I),o+="\n".concat(v,"-").concat(b," ").concat($),S+=2):(a+=o,o="",1!==x&&0!==f||(a+="\n ".concat(I),S++))}if(S>20&&f<F-2)return"".concat(B).concat(T,"\n").concat(a,"\n").concat(A,"...").concat(b).concat(o,"\n")+"".concat(A,"...").concat(b)}return"".concat(B).concat(u?T:"","\n").concat(a).concat(o).concat(s).concat(d)}(i,s,o));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var f=C[o],d=w(i).split("\n");if("notStrictEqual"===o&&"object"===m(i)&&null!==i&&(f=C.notStrictEqualObject),d.length>30)for(d[26]="".concat(A,"...").concat(b);d.length>27;)d.pop();t=1===d.length?p.call(this,"".concat(f," ").concat(d[0])):p.call(this,"".concat(f,"\n\n").concat(d.join("\n"),"\n"))}else{var h=w(i),y="",S=C[o];"notDeepEqual"===o||"notEqual"===o?(h="".concat(C[o],"\n\n").concat(h)).length>1024&&(h="".concat(h.slice(0,1021),"...")):(y="".concat(w(s)),h.length>512&&(h="".concat(h.slice(0,509),"...")),y.length>512&&(y="".concat(y.slice(0,509),"...")),"deepEqual"===o||"equal"===o?h="".concat(S,"\n\n").concat(h,"\n\nshould equal\n\n"):y=" ".concat(o," ").concat(y)),t=p.call(this,"".concat(h).concat(y))}return Error.stackTraceLimit=l,t.generatedMessage=!r,Object.defineProperty(c(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=i,t.expected=s,t.operator=o,Error.captureStackTrace&&Error.captureStackTrace(c(t),a),t.stack,t.name="AssertionError",u(t)}return s=O,(l=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:t,value:function(e,t){return y(this,a(a({},t),{},{customInspect:!1,depth:0}))}}])&&i(s.prototype,l),Object.defineProperty(s,"prototype",{writable:!1}),O}(l(Error),y.custom);e.exports=O},1342(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},o(e,t)}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}var i,s,u={};function c(e,t,r){r||(r=Error);var i=function(r){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&o(e,t)}(l,r);var i,s,u,c=(s=l,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=a(s);if(u){var r=a(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function l(r,n,o){var a;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),a=c.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,o)),a.code=e,a}return i=l,Object.defineProperty(i,"prototype",{writable:!1}),i}(r);u[e]=i}function l(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",function(e,t,o){var a,s,u,c,p;if(void 0===i&&(i=r(6093)),i("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(s="not ",t.substr(0,4)===s)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))u="The ".concat(e," ").concat(a," ").concat(l(t,"type"));else{var f=("number"!=typeof p&&(p=0),p+1>(c=e).length||-1===c.indexOf(".",p)?"argument":"property");u='The "'.concat(e,'" ').concat(f," ").concat(a," ").concat(l(t,"type"))}return u+". Received type ".concat(n(o))},TypeError),c("ERR_INVALID_ARG_VALUE",function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=r(9208));var o=s.inspect(t);return o.length>128&&(o="".concat(o.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(o)},TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",function(e,t,r){var o;return o=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(o,".")},TypeError),c("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===i&&(i=r(6093)),i(t.length>0,"At least one arg needs to be specified");var o="The ",a=t.length;switch(t=t.map(function(e){return'"'.concat(e,'"')}),a){case 1:o+="".concat(t[0]," argument");break;case 2:o+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:o+=t.slice(0,a-1).join(", "),o+=", and ".concat(t[a-1]," arguments")}return"".concat(o," must be specified")},TypeError),e.exports.codes=u},5656(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}var i=void 0!==/a/g.flags,s=function(e){var t=[];return e.forEach(function(e){return t.push(e)}),t},u=function(e){var t=[];return e.forEach(function(e,r){return t.push([r,e])}),t},c=Object.is?Object.is:r(5968),l=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},p=Number.isNaN?Number.isNaN:r(7838);function f(e){return e.call.bind(e)}var d=f(Object.prototype.hasOwnProperty),h=f(Object.prototype.propertyIsEnumerable),m=f(Object.prototype.toString),y=r(9208).types,g=y.isAnyArrayBuffer,D=y.isArrayBufferView,A=y.isDate,E=y.isMap,v=y.isRegExp,b=y.isSet,C=y.isNativeError,F=y.isBoxedPrimitive,w=y.isNumberObject,O=y.isStringObject,S=y.isBooleanObject,B=y.isBigIntObject,T=y.isSymbolObject,x=y.isFloat32Array,$=y.isFloat64Array;function I(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function N(e){return Object.keys(e).filter(I).concat(l(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function j(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,o=0,a=Math.min(r,n);o<a;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0}function P(e,t,r,n){if(e===t)return 0!==e||!r||c(e,t);if(r){if("object"!==a(e))return"number"==typeof e&&p(e)&&p(t);if("object"!==a(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==a(e))return(null===t||"object"!==a(t))&&e==t;if(null===t||"object"!==a(t))return!1}var o,s,u,l,f=m(e);if(f!==m(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var d=N(e),h=N(t);return d.length===h.length&&k(e,t,r,n,1,d)}if("[object Object]"===f&&(!E(e)&&E(t)||!b(e)&&b(t)))return!1;if(A(e)){if(!A(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(v(e)){if(!v(t)||(u=e,l=t,!(i?u.source===l.source&&u.flags===l.flags:RegExp.prototype.toString.call(u)===RegExp.prototype.toString.call(l))))return!1}else if(C(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(D(e)){if(r||!x(e)&&!$(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===j(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var y=N(e),I=N(t);return y.length===I.length&&k(e,t,r,n,0,y)}if(b(e))return!(!b(t)||e.size!==t.size)&&k(e,t,r,n,2);if(E(e))return!(!E(t)||e.size!==t.size)&&k(e,t,r,n,3);if(g(e)){if(s=t,(o=e).byteLength!==s.byteLength||0!==j(new Uint8Array(o),new Uint8Array(s)))return!1}else if(F(e)&&!function(e,t){return w(e)?w(t)&&c(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):O(e)?O(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):S(e)?S(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):B(e)?B(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):T(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return k(e,t,r,n,0)}function M(e,t){return t.filter(function(t){return h(e,t)})}function k(e,t,r,o,i,c){if(5===arguments.length){c=Object.keys(e);var p=Object.keys(t);if(c.length!==p.length)return!1}for(var f=0;f<c.length;f++)if(!d(t,c[f]))return!1;if(r&&5===arguments.length){var m=l(e);if(0!==m.length){var y=0;for(f=0;f<m.length;f++){var g=m[f];if(h(e,g)){if(!h(t,g))return!1;c.push(g),y++}else if(h(t,g))return!1}var D=l(t);if(m.length!==D.length&&M(t,D).length!==y)return!1}else{var A=l(t);if(0!==A.length&&0!==M(t,A).length)return!1}}if(0===c.length&&(0===i||1===i&&0===e.length||0===e.size))return!0;if(void 0===o)o={val1:new Map,val2:new Map,position:0};else{var E=o.val1.get(e);if(void 0!==E){var v=o.val2.get(t);if(void 0!==v)return E===v}o.position++}o.val1.set(e,o.position),o.val2.set(t,o.position);var b=function(e,t,r,o,i,c){var l=0;if(2===c){if(!function(e,t,r,n){for(var o=null,i=s(e),u=0;u<i.length;u++){var c=i[u];if("object"===a(c)&&null!==c)null===o&&(o=new Set),o.add(c);else if(!t.has(c)){if(r)return!1;if(!L(e,t,c))return!1;null===o&&(o=new Set),o.add(c)}}if(null!==o){for(var l=s(t),p=0;p<l.length;p++){var f=l[p];if("object"===a(f)&&null!==f){if(!R(o,f,r,n))return!1}else if(!r&&!e.has(f)&&!R(o,f,r,n))return!1}return 0===o.size}return!0}(e,t,r,i))return!1}else if(3===c){if(!function(e,t,r,o){for(var i=null,s=u(e),c=0;c<s.length;c++){var l=n(s[c],2),p=l[0],f=l[1];if("object"===a(p)&&null!==p)null===i&&(i=new Set),i.add(p);else{var d=t.get(p);if(void 0===d&&!t.has(p)||!P(f,d,r,o)){if(r)return!1;if(!U(e,t,p,f,o))return!1;null===i&&(i=new Set),i.add(p)}}}if(null!==i){for(var h=u(t),m=0;m<h.length;m++){var y=n(h[m],2),g=y[0],D=y[1];if("object"===a(g)&&null!==g){if(!V(i,e,g,D,r,o))return!1}else if(!(r||e.has(g)&&P(e.get(g),D,!1,o)||V(i,e,g,D,!1,o)))return!1}return 0===i.size}return!0}(e,t,r,i))return!1}else if(1===c)for(;l<e.length;l++){if(!d(e,l)){if(d(t,l))return!1;for(var p=Object.keys(e);l<p.length;l++){var f=p[l];if(!d(t,f)||!P(e[f],t[f],r,i))return!1}return p.length===Object.keys(t).length}if(!d(t,l)||!P(e[l],t[l],r,i))return!1}for(l=0;l<o.length;l++){var h=o[l];if(!P(e[h],t[h],r,i))return!1}return!0}(e,t,r,c,o,i);return o.val1.delete(e),o.val2.delete(t),b}function R(e,t,r,n){for(var o=s(e),a=0;a<o.length;a++){var i=o[a];if(P(t,i,r,n))return e.delete(i),!0}return!1}function _(e){switch(a(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(p(e))return!1}return!0}function L(e,t,r){var n=_(r);return null!=n?n:t.has(n)&&!e.has(n)}function U(e,t,r,n,o){var a=_(r);if(null!=a)return a;var i=t.get(a);return!(void 0===i&&!t.has(a)||!P(n,i,!1,o))&&!e.has(a)&&P(n,i,!1,o)}function V(e,t,r,n,o,a){for(var i=s(e),u=0;u<i.length;u++){var c=i[u];if(P(r,c,o,a)&&P(n,t.get(c),o,a))return e.delete(c),!0}return!1}e.exports={isDeepEqual:function(e,t){return P(e,t,!1)},isDeepStrictEqual:function(e,t){return P(e,t,!0)}}},8941(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const a=r(1161),i=r(8487),s=i.DefaultFileLoader,u=i.FileDownloader,c=i.ModelWriter,l=r(3348),p=l.MetaModelUtil,f=l.MetaModelNamespace,d=r(5628),h=r(5469),m=r(8544),y=r(495),g=r(7979),D=r(9596),A=r(2266),E=r(6387);void 0===r.g&&(r(7252),r(1242),r(9070),r(2192),r(5698),r(1707),r(519),r(4734),r(7533),r(6850));const v=r(124)("concerto:BaseModelManager"),b=(e,t)=>({ast:t,definitions:null,fileName:e}),C={missingDecorator:void 0,invalidDecorator:void 0},F=["concerto@1.0.0","concerto","concerto.decorator@1.0.0"];class w{constructor(e,t){this.processFile=t||b,this.modelFiles={},this.factory=new d(this),this.serializer=new D(this.factory,this,e),this.decoratorFactories=[],this.options=e,this.addDecoratorModel(),this.addRootModel(),this.decoratorValidation=null!=e&&e.decoratorValidation?null==e?void 0:e.decoratorValidation:C,this.metamodelModelFile=new y(this,p.metaModelAst,void 0,f),null!=e&&e.addMetamodel&&this.addModelFile(this.metamodelModelFile)}isModelManager(){return!0}addRootModel(){const e=r(475),t=e.getRootModel||e;if("function"!=typeof t)throw new Error("Failed to load getRootModel. Got: ".concat(typeof t,". Module keys: ").concat(Object.keys(e)));const n=t(),o=n.rootModelAst,a=n.rootModelCto,i=n.rootModelFile,s=new y(this,o,a,i);this.addModelFile(s,a,i,!0)}isAliasedTypeEnabled(){return!0}accept(e,t){return e.visit(this,t)}validateModelFile(e,t){if("string"==typeof e){const r=this.processFile(t,e).ast;new y(this,r,e,t).validate()}else e.validate()}addDecoratorModel(){const e=r(1426),t=e.getDecoratorModel||e;if("function"!=typeof t)throw new Error("Failed to load getDecoratorModel. Got: ".concat(typeof t));const n=t(),o=n.decoratorModelAst,a=n.decoratorModelCto,i=n.decoratorModelFile,s=new y(this,o,a,i);this.addModelFile(s,a,i,!0)}_throwAlreadyExists(e){const t=this.modelFiles[e.getNamespace()].getName(),r=t?" in file ".concat(t):"",n=e.getName()?" specified in file ".concat(e.getName()):"";let o="Namespace ".concat(e.getNamespace()).concat(n," is already declared").concat(r);throw new Error(o)}addModelFile(e,t,r,n){if(v("addModelFile","addModelFile",e,r),!e.getVersion())throw new Error("Cannot add an unversioned namespace: ".concat(e.getNamespace()));var o;this.modelFiles[e.getNamespace()]?this._throwAlreadyExists(e):(n||(null!==(o=this.options)&&void 0!==o&&o.metamodelValidation&&this.validateAst(e),e.validate()),this.modelFiles[e.getNamespace()]=e);return e}validateAst(e){const t=g.parseNamespace(g.getNamespace(e.getAst().$class)).version,r=g.parseNamespace(f).version;if(t!==r)throw new E("Model file version ".concat(t," does not match metamodel version ").concat(r));const n=!!this.getModelFile(f);n||this.addModelFile(this.metamodelModelFile,void 0,f,!0);try{this.getSerializer().fromJSON(e.getAst())}catch(e){throw new E(e.message)}n||this.deleteModelFile(f)}addModel(e,t,r,n){v("addModel","addModel",e,r);const o=this.processFile(r,e),a=o.ast,i=o.definitions,s=t||i,u=new y(this,a,s,r);return this.addModelFile(u,s,r,n),u}updateModelFile(e,t,r){if(v("updateModelFile","updateModelFile",e,t),"string"==typeof e){const n=this.processFile(t,e).ast;let o=new y(this,n,e,t);return this.updateModelFile(o,t,r)}if(!this.modelFiles[e.getNamespace()])throw new Error("Model file for namespace ".concat(e.getNamespace()," not found"));if(!e.getVersion())throw new Error("Cannot update with an unversioned namespace: ".concat(e.getNamespace()));return r||e.validate(),this.modelFiles[e.getNamespace()]=e,e}deleteModelFile(e){if(!this.modelFiles[e])throw new Error("Model file does not exist");delete this.modelFiles[e]}addModelFiles(e,t,r){const n="addModelFiles";v(n,"addModelFiles",e,t);const o={};Object.assign(o,this.modelFiles);let a=[];try{for(let r=0;r<e.length;r++){const n=e[r];let o,i=null;if(t&&(i=t[r]),"string"==typeof n){const e=this.processFile(i,n).ast;o=new y(this,e,n,i)}else o=n;if(!o.getVersion())throw new Error("Cannot add an unversioned namespace: ".concat(o.getNamespace()));this.modelFiles[o.getNamespace()]?this._throwAlreadyExists(o):(this.modelFiles[o.getNamespace()]=o,a.push(o))}return r||this.validateModelFiles(),a}catch(e){throw this.modelFiles={},Object.assign(this.modelFiles,o),e}finally{v(n,a)}}validateModelFiles(){for(let e in this.modelFiles)this.modelFiles[e].validate()}async updateExternalModels(e,t){v("updateExternalModels","updateExternalModels",e);const r=null!=t?t:new u(new s(this.processFile),e=>p.getExternalImports(e.ast)),n={};Object.assign(n,this.modelFiles);try{const t=await r.downloadExternalDependencies(this.getModelFiles(),e),n=[];return t.forEach(e=>{const t=new y(this,e.ast,e.definitions,e.fileName);this.modelFiles[t.getNamespace()]?n.push(this.updateModelFile(t,t.getName(),!0)):n.push(this.addModelFile(t,null,t.getName(),!0))}),this.validateModelFiles(),n}catch(e){throw this.modelFiles={},Object.assign(this.modelFiles,n),e}}writeModelsToFileSystem(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};c.writeModelsToFileSystem(this.getModelFiles(),e,t)}getDecoratorValidation(){return this.decoratorValidation}getModelFiles(e){let t=Object.keys(this.modelFiles),r=[];for(let n=0;n<t.length;n++){const o=t[n];!e&&F.includes(o)||r.push(this.modelFiles[o])}return r}getModels(e){const t=this.getModelFiles();let r=[];const n=Object.assign({includeExternalModels:!0},e);return t.forEach(function(e){if(e.isExternal()&&!n.includeExternalModels)return;let t;if("UNKNOWN"!==e.fileName&&null!==e.fileName&&e.fileName){let r=e.fileName;t=a.basename(r)}else t=e.namespace+".cto";r.push({name:t,content:e.definitions})}),r}resolveType(e,t){if(g.isPrimitiveType(t))return t;let r=g.getNamespace(t),n=this.getModelFile(r);if(!n){let r=h.messageFormatter("modelmanager-resolvetype-nonsfortype");throw new m(r({type:t,context:e}))}if(n.isLocalType(t))return t;let o=h.messageFormatter("modelmanager-resolvetype-notypeinnsforcontext");throw new m(o({context:e,type:t,namespace:n.getNamespace()}))}clearModelFiles(){this.modelFiles={},this.addDecoratorModel(),this.addRootModel()}getModelFile(e){return this.modelFiles[e]}getModelFileByFileName(e){return this.getModelFiles().filter(t=>t.getName()===e)[0]}getNamespaces(){return Object.keys(this.modelFiles)}getType(e){const t=g.getNamespace(e),r=this.getModelFile(t);if(!r){const t=h.messageFormatter("modelmanager-gettype-noregisteredns");throw new A(e,t({type:e}))}const n=r.getType(e);if(!n){const r=h.messageFormatter("modelmanager-gettype-notypeinns");throw new A(e,r({type:g.getShortName(e),namespace:t}))}return n}getAssetDeclarations(){return this.getModelFiles().reduce((e,t)=>e.concat(t.getAssetDeclarations()),[])}getTransactionDeclarations(){return this.getModelFiles().reduce((e,t)=>e.concat(t.getTransactionDeclarations()),[])}getEventDeclarations(){return this.getModelFiles().reduce((e,t)=>e.concat(t.getEventDeclarations()),[])}getParticipantDeclarations(){return this.getModelFiles().reduce((e,t)=>e.concat(t.getParticipantDeclarations()),[])}getMapDeclarations(){return this.getModelFiles().reduce((e,t)=>e.concat(t.getMapDeclarations()),[])}getEnumDeclarations(){return this.getModelFiles().reduce((e,t)=>e.concat(t.getEnumDeclarations()),[])}getConceptDeclarations(){return this.getModelFiles().reduce((e,t)=>e.concat(t.getConceptDeclarations()),[])}getFactory(){return this.factory}getSerializer(){return this.serializer}getDecoratorFactories(){return this.decoratorFactories}addDecoratorFactory(e){this.decoratorFactories.push(e)}derivesFrom(e,t){let r=this.getType(e);for(;r;){if(r.getFullyQualifiedName()===t)return!0;r=r.getSuperTypeDeclaration()}return!1}resolveMetaModel(e){const t=this.getAst(!1,!0);return p.resolveLocalNames(t,e)}fromAst(e,t){this.clearModelFiles(),e.models.forEach(e=>{if(!F.includes(e.namespace)){const t=new y(this,e);this.addModelFile(t,null,null,!0)}}),null!=t&&t.disableValidation||this.validateModelFiles()}getAst(e,t){const r={$class:"".conca