@snapshot-labs/snapshot.js 0.11.39 → 0.11.40

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.
@@ -1618,7 +1618,7 @@ var networks = {
1618
1618
  },
1619
1619
  "56": {
1620
1620
  key: "56",
1621
- name: "Binance Smart Chain",
1621
+ name: "BNB Smart Chain",
1622
1622
  shortName: "BSC",
1623
1623
  chainId: 56,
1624
1624
  network: "mainnet",
@@ -1722,7 +1722,7 @@ var networks = {
1722
1722
  },
1723
1723
  "97": {
1724
1724
  key: "97",
1725
- name: "Binance Smart Chain Testnet",
1725
+ name: "BNB Smart Chain Testnet",
1726
1726
  shortName: "BSC Testnet",
1727
1727
  chainId: 97,
1728
1728
  network: "testnet",
@@ -1608,7 +1608,7 @@ var networks = {
1608
1608
  },
1609
1609
  "56": {
1610
1610
  key: "56",
1611
- name: "Binance Smart Chain",
1611
+ name: "BNB Smart Chain",
1612
1612
  shortName: "BSC",
1613
1613
  chainId: 56,
1614
1614
  network: "mainnet",
@@ -1712,7 +1712,7 @@ var networks = {
1712
1712
  },
1713
1713
  "97": {
1714
1714
  key: "97",
1715
- name: "Binance Smart Chain Testnet",
1715
+ name: "BNB Smart Chain Testnet",
1716
1716
  shortName: "BSC Testnet",
1717
1717
  chainId: 97,
1718
1718
  network: "testnet",
@@ -18,4 +18,4 @@
18
18
  || ${u} === "boolean" || ${o} === null`).assign(l,Zu._`[${o}]`)}}n.else(),h(t),n.endIf(),n.if(Zu._`${l} !== undefined`,(()=>{n.assign(o,l),function({gen:t,parentData:e,parentDataProperty:r},n){t.if(Zu._`${e} !== undefined`,(()=>t.assign(Zu._`${e}[${r}]`,n)))}(t,l)}))}(t,e,u):h(t)}))}return l};const i=new Set(["string","number","integer","boolean","null"]);function o(t,e,n,i=r.Correct){const o=i===r.Correct?Zu.operators.EQ:Zu.operators.NEQ;let s;switch(t){case"null":return Zu._`${e} ${o} null`;case"array":s=Zu._`Array.isArray(${e})`;break;case"object":s=Zu._`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=a(Zu._`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=a();break;default:return Zu._`typeof ${e} ${o} ${t}`}return i===r.Correct?s:(0,Zu.not)(s);function a(t=Zu.nil){return(0,Zu.and)(Zu._`typeof ${e} == "number"`,t,n?Zu._`isFinite(${e})`:Zu.nil)}}function s(t,e,r,n){if(1===t.length)return o(t[0],e,r,n);let i;const s=(0,Yu.toHash)(t);if(s.array&&s.object){const t=Zu._`typeof ${e} != "object"`;i=s.null?t:Zu._`!${e} || ${t}`,delete s.null,delete s.array,delete s.object}else i=Zu.nil;s.number&&delete s.integer;for(const t in s)i=(0,Zu.and)(i,o(t,e,r,n));return i}e.checkDataType=o,e.checkDataTypes=s;const a={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>"string"==typeof t?Zu._`{type: ${t}}`:Zu._`{type: ${e}}`};function h(t){const e=function(t){const{gen:e,data:r,schema:n}=t,i=(0,Yu.schemaRefOrVal)(t,n,"type");return{gen:e,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:t}}(t);(0,tl.reportError)(e,a)}e.reportTypeError=h})),ol=o((function(t,e){function r(t,e,r){const{gen:n,compositeRule:i,data:o,opts:s}=t;if(void 0===r)return;const a=Zu._`${o}${(0,Zu.getProperty)(e)}`;if(i)return void(0,Yu.checkStrictMode)(t,`default is ignored for: ${a}`);let h=Zu._`${a} === undefined`;"empty"===s.useDefaults&&(h=Zu._`${h} || ${a} === null || ${a} === ""`),n.if(h,Zu._`${a} = ${(0,Zu.stringify)(r)}`)}Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0,e.assignDefaults=function(t,e){const{properties:n,items:i}=t.schema;if("object"===e&&n)for(const e in n)r(t,e,n[e].default);else"array"===e&&Array.isArray(i)&&i.forEach(((e,n)=>r(t,n,e.default)))}})),sl=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;const r=Yu;function n(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Zu._`Object.prototype.hasOwnProperty`})}function i(t,e,r){return Zu._`${n(t)}.call(${e}, ${r})`}function o(t,e,r,n){const o=Zu._`${e}${(0,Zu.getProperty)(r)} === undefined`;return n?(0,Zu.or)(o,(0,Zu.not)(i(t,e,r))):o}function s(t){return t?Object.keys(t).filter((t=>"__proto__"!==t)):[]}e.checkReportMissingProp=function(t,e){const{gen:r,data:n,it:i}=t;r.if(o(r,n,e,i.opts.ownProperties),(()=>{t.setParams({missingProperty:Zu._`${e}`},!0),t.error()}))},e.checkMissingProp=function({gen:t,data:e,it:{opts:r}},n,i){return(0,Zu.or)(...n.map((n=>(0,Zu.and)(o(t,e,n,r.ownProperties),Zu._`${i} = ${n}`))))},e.reportMissingProp=function(t,e){t.setParams({missingProperty:e},!0),t.error()},e.hasPropFunc=n,e.isOwnProperty=i,e.propertyInData=function(t,e,r,n){const o=Zu._`${e}${(0,Zu.getProperty)(r)} !== undefined`;return n?Zu._`${o} && ${i(t,e,r)}`:o},e.noPropertyInData=o,e.allSchemaProperties=s,e.schemaProperties=function(t,e){return s(e).filter((r=>!(0,Yu.alwaysValidSchema)(t,e[r])))},e.callValidateCode=function({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:s},a,h,u){const l=u?Zu._`${t}, ${e}, ${n}${i}`:e,c=[[Xu.default.instancePath,(0,Zu.strConcat)(Xu.default.instancePath,o)],[Xu.default.parentData,s.parentData],[Xu.default.parentDataProperty,s.parentDataProperty],[Xu.default.rootData,Xu.default.rootData]];s.opts.dynamicRef&&c.push([Xu.default.dynamicAnchors,Xu.default.dynamicAnchors]);const f=Zu._`${l}, ${r.object(...c)}`;return h!==Zu.nil?Zu._`${a}.call(${h}, ${f})`:Zu._`${a}(${f})`};const a=Zu._`new RegExp`;e.usePattern=function({gen:t,it:{opts:e}},n){const i=e.unicodeRegExp?"u":"",{regExp:o}=e.code,s=o(n,i);return t.scopeValue("pattern",{key:s.toString(),ref:s,code:Zu._`${"new RegExp"===o.code?a:(0,r.useFunc)(t,o)}(${n}, ${i})`})},e.validateArray=function(t){const{gen:e,data:r,keyword:n,it:i}=t,o=e.name("valid");if(i.allErrors){const t=e.let("valid",!0);return s((()=>e.assign(t,!1))),t}return e.var(o,!0),s((()=>e.break())),o;function s(i){const s=e.const("len",Zu._`${r}.length`);e.forRange("i",0,s,(r=>{t.subschema({keyword:n,dataProp:r,dataPropType:Yu.Type.Num},o),e.if((0,Zu.not)(o),i)}))}},e.validateUnion=function(t){const{gen:e,schema:r,keyword:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some((t=>(0,Yu.alwaysValidSchema)(i,t)))&&!i.opts.unevaluated)return;const o=e.let("valid",!1),s=e.name("_valid");e.block((()=>r.forEach(((r,i)=>{const a=t.subschema({keyword:n,schemaProp:i,compositeRule:!0},s);e.assign(o,Zu._`${o} || ${s}`);t.mergeValidEvaluated(a,s)||e.if((0,Zu.not)(o))})))),t.result(o,(()=>t.reset()),(()=>t.error(!0)))}})),al=o((function(t,e){function r(t){const{gen:e,data:r,it:n}=t;e.if(n.parentData,(()=>e.assign(r,Zu._`${n.parentData}[${n.parentDataProperty}]`)))}function n(t,e,r){if(void 0===r)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,Zu.stringify)(r)})}Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0,e.macroKeywordCode=function(t,e){const{gen:r,keyword:i,schema:o,parentSchema:s,it:a}=t,h=e.macro.call(a.self,o,s,a),u=n(r,i,h);!1!==a.opts.validateSchema&&a.self.validateSchema(h,!0);const l=r.name("valid");t.subschema({schema:h,schemaPath:Zu.nil,errSchemaPath:`${a.errSchemaPath}/${i}`,topSchemaRef:u,compositeRule:!0},l),t.pass(l,(()=>t.error(!0)))},e.funcKeywordCode=function(t,e){var i;const{gen:o,keyword:s,schema:a,parentSchema:h,$data:u,it:l}=t;!function({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}(l,e);const c=!u&&e.compile?e.compile.call(l.self,a,h,l):e.validate,f=n(o,s,c),d=o.let("valid");function m(r=(e.async?Zu._`await `:Zu.nil)){const n=l.opts.passContext?Xu.default.this:Xu.default.self,i=!("compile"in e&&!u||!1===e.schema);o.assign(d,Zu._`${r}${(0,sl.callValidateCode)(t,f,n,i)}`,e.modifying)}function p(t){var r;o.if((0,Zu.not)(null!==(r=e.valid)&&void 0!==r?r:d),t)}t.block$data(d,(function(){if(!1===e.errors)m(),e.modifying&&r(t),p((()=>t.error()));else{const n=e.async?function(){const t=o.let("ruleErrs",null);return o.try((()=>m(Zu._`await `)),(e=>o.assign(d,!1).if(Zu._`${e} instanceof ${l.ValidationError}`,(()=>o.assign(t,Zu._`${e}.errors`)),(()=>o.throw(e))))),t}():function(){const t=Zu._`${f}.errors`;return o.assign(t,null),m(Zu.nil),t}();e.modifying&&r(t),p((()=>function(t,e){const{gen:r}=t;r.if(Zu._`Array.isArray(${e})`,(()=>{r.assign(Xu.default.vErrors,Zu._`${Xu.default.vErrors} === null ? ${e} : ${Xu.default.vErrors}.concat(${e})`).assign(Xu.default.errors,Zu._`${Xu.default.vErrors}.length`),(0,tl.extendErrors)(t)}),(()=>t.error()))}(t,n)))}})),t.ok(null!==(i=e.valid)&&void 0!==i?i:d)},e.validSchemaType=function(t,e,r=!1){return!e.length||e.some((e=>"array"===e?Array.isArray(t):"object"===e?t&&"object"==typeof t&&!Array.isArray(t):typeof t==e||r&&void 0===t))},e.validateKeywordUsage=function({schema:t,opts:e,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");const s=i.dependencies;if(null==s?void 0:s.some((e=>!Object.prototype.hasOwnProperty.call(t,e))))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(i.validateSchema){if(!i.validateSchema(t[o])){const t=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if("log"!==e.validateSchema)throw new Error(t);r.logger.error(t)}}}})),hl=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0,e.getSubschema=function(t,{keyword:e,schemaProp:r,schema:n,schemaPath:i,errSchemaPath:o,topSchemaRef:s}){if(void 0!==e&&void 0!==n)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==e){const n=t.schema[e];return void 0===r?{schema:n,schemaPath:Zu._`${t.schemaPath}${(0,Zu.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:n[r],schemaPath:Zu._`${t.schemaPath}${(0,Zu.getProperty)(e)}${(0,Zu.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,Yu.escapeFragment)(r)}`}}if(void 0!==n){if(void 0===i||void 0===o||void 0===s)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:n,schemaPath:i,topSchemaRef:s,errSchemaPath:o}}throw new Error('either "keyword" or "schema" must be passed')},e.extendSubschemaData=function(t,e,{dataProp:r,dataPropType:n,data:i,dataTypes:o,propertyName:s}){if(void 0!==i&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:a}=e;if(void 0!==r){const{errorPath:i,dataPathArr:o,opts:s}=e;h(a.let("data",Zu._`${e.data}${(0,Zu.getProperty)(r)}`,!0)),t.errorPath=Zu.str`${i}${(0,Yu.getErrorPath)(r,n,s.jsPropertySyntax)}`,t.parentDataProperty=Zu._`${r}`,t.dataPathArr=[...o,t.parentDataProperty]}if(void 0!==i){h(i instanceof Zu.Name?i:a.let("data",i,!0)),void 0!==s&&(t.propertyName=s)}function h(r){t.data=r,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,r]}o&&(t.dataTypes=o)},e.extendSubschemaMode=function(t,{jtdDiscriminator:e,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){void 0!==n&&(t.compositeRule=n),void 0!==i&&(t.createErrors=i),void 0!==o&&(t.allErrors=o),t.jtdDiscriminator=e,t.jtdMetadata=r}})),ul=function t(e,r){if(e===r)return!0;if(e&&r&&"object"==typeof e&&"object"==typeof r){if(e.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(e)){if((n=e.length)!=r.length)return!1;for(i=n;0!=i--;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if((n=(o=Object.keys(e)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var s=o[i];if(!t(e[s],r[s]))return!1}return!0}return e!=e&&r!=r},ll=o((function(t){var e=t.exports=function(t,e,n){"function"==typeof e&&(n=e,e={}),r(e,"function"==typeof(n=e.cb||n)?n:n.pre||function(){},n.post||function(){},t,"",t)};function r(t,n,i,o,s,a,h,u,l,c){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var f in n(o,s,a,h,u,l,c),o){var d=o[f];if(Array.isArray(d)){if(f in e.arrayKeywords)for(var m=0;m<d.length;m++)r(t,n,i,d[m],s+"/"+f+"/"+m,a,s,f,o,m)}else if(f in e.propsKeywords){if(d&&"object"==typeof d)for(var p in d)r(t,n,i,d[p],s+"/"+f+"/"+p.replace(/~/g,"~0").replace(/\//g,"~1"),a,s,f,o,p)}else(f in e.keywords||t.allKeys&&!(f in e.skipKeywords))&&r(t,n,i,d,s+"/"+f,a,s,f,o)}i(o,s,a,h,u,l,c)}}e.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},e.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},e.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},e.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}})),cl=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;const r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);e.inlineRef=function(t,e=!0){return"boolean"==typeof t||(!0===e?!i(t):!!e&&o(t)<=e)};const n=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function i(t){for(const e in t){if(n.has(e))return!0;const r=t[e];if(Array.isArray(r)&&r.some(i))return!0;if("object"==typeof r&&i(r))return!0}return!1}function o(t){let e=0;for(const n in t){if("$ref"===n)return 1/0;if(e++,!r.has(n)&&("object"==typeof t[n]&&(0,Yu.eachItem)(t[n],(t=>e+=o(t))),e===1/0))return 1/0}return e}function s(t,e="",r){!1!==r&&(e=u(e));const n=t.parse(e);return a(t,n)}function a(t,e){return t.serialize(e).split("#")[0]+"#"}e.getFullPath=s,e._getFullPath=a;const h=/#\/?$/;function u(t){return t?t.replace(h,""):""}e.normalizeId=u,e.resolveUrl=function(t,e,r){return r=u(r),t.resolve(e,r)};const l=/^[a-z_][-a-z0-9._]*$/i;e.getSchemaRefs=function(t,e){if("boolean"==typeof t)return{};const{schemaId:r,uriResolver:n}=this.opts,i=u(t[r]||e),o={"":i},a=s(n,i,!1),h={},c=new Set;return ll(t,{allKeys:!0},((t,e,n,i)=>{if(void 0===i)return;const s=a+e;let m=o[i];function p(e){const r=this.opts.uriResolver.resolve;if(e=u(m?r(m,e):e),c.has(e))throw d(e);c.add(e);let n=this.refs[e];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?f(t,n.schema,e):e!==u(s)&&("#"===e[0]?(f(t,h[e],e),h[e]=t):this.refs[e]=s),e}function g(t){if("string"==typeof t){if(!l.test(t))throw new Error(`invalid anchor "${t}"`);p.call(this,`#${t}`)}}"string"==typeof t[r]&&(m=p.call(this,t[r])),g.call(this,t.$anchor),g.call(this,t.$dynamicAnchor),o[e]=m})),h;function f(t,e,r){if(void 0!==e&&!ul(t,e))throw d(r)}function d(t){return new Error(`reference "${t}" resolves to more than one schema`)}}})),fl=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;const r=il;function n({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,Zu._`${Xu.default.data}, ${Xu.default.valCxt}`,n.$async,(()=>{t.code(Zu._`"use strict"; ${i(r,o)}`),function(t,e){t.if(Xu.default.valCxt,(()=>{t.var(Xu.default.instancePath,Zu._`${Xu.default.valCxt}.${Xu.default.instancePath}`),t.var(Xu.default.parentData,Zu._`${Xu.default.valCxt}.${Xu.default.parentData}`),t.var(Xu.default.parentDataProperty,Zu._`${Xu.default.valCxt}.${Xu.default.parentDataProperty}`),t.var(Xu.default.rootData,Zu._`${Xu.default.valCxt}.${Xu.default.rootData}`),e.dynamicRef&&t.var(Xu.default.dynamicAnchors,Zu._`${Xu.default.valCxt}.${Xu.default.dynamicAnchors}`)}),(()=>{t.var(Xu.default.instancePath,Zu._`""`),t.var(Xu.default.parentData,Zu._`undefined`),t.var(Xu.default.parentDataProperty,Zu._`undefined`),t.var(Xu.default.rootData,Xu.default.data),e.dynamicRef&&t.var(Xu.default.dynamicAnchors,Zu._`{}`)}))}(t,o),t.code(s)})):t.func(e,Zu._`${Xu.default.data}, ${function(t){return Zu._`{${Xu.default.instancePath}="", ${Xu.default.parentData}, ${Xu.default.parentDataProperty}, ${Xu.default.rootData}=${Xu.default.data}${t.dynamicRef?Zu._`, ${Xu.default.dynamicAnchors}={}`:Zu.nil}}={}`}(o)}`,n.$async,(()=>t.code(i(r,o)).code(s)))}function i(t,e){const r="object"==typeof t&&t[e.schemaId];return r&&(e.code.source||e.code.process)?Zu._`/*# sourceURL=${r} */`:Zu.nil}function o(t,e){a(t)&&(h(t),s(t))?function(t,e){const{schema:r,gen:n,opts:i}=t;i.$comment&&r.$comment&&l(t);(function(t){const e=t.schema[t.opts.schemaId];e&&(t.baseId=(0,cl.resolveUrl)(t.opts.uriResolver,t.baseId,e))})(t),function(t){if(t.schema.$async&&!t.schemaEnv.$async)throw new Error("async schema in sync schema")}(t);const o=n.const("_errs",Xu.default.errors);u(t,o),n.var(e,Zu._`${o} === ${Xu.default.errors}`)}(t,e):(0,el.boolOrEmptySchema)(t,e)}function s({schema:t,self:e}){if("boolean"==typeof t)return!t;for(const r in t)if(e.RULES.all[r])return!0;return!1}function a(t){return"boolean"!=typeof t.schema}function h(t){(0,Yu.checkUnknownRules)(t),function(t){const{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,Yu.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(t)}function u(t,e){if(t.opts.jtd)return c(t,[],!1,e);const r=(0,il.getSchemaTypes)(t.schema);c(t,r,!(0,il.coerceAndCheckDataType)(t,r),e)}function l({gen:t,schemaEnv:e,schema:r,errSchemaPath:n,opts:i}){const o=r.$comment;if(!0===i.$comment)t.code(Zu._`${Xu.default.self}.logger.log(${o})`);else if("function"==typeof i.$comment){const r=Zu.str`${n}/$comment`,i=t.scopeValue("root",{ref:e.root});t.code(Zu._`${Xu.default.self}.opts.$comment(${o}, ${r}, ${i}.schema)`)}}function c(t,e,n,i){const{gen:o,schema:s,data:a,allErrors:h,opts:u,self:l}=t,{RULES:c}=l;function g(l){(0,nl.shouldUseGroup)(s,l)&&(l.type?(o.if((0,r.checkDataType)(l.type,a,u.strictNumbers)),f(t,l),1===e.length&&e[0]===l.type&&n&&(o.else(),(0,r.reportTypeError)(t)),o.endIf()):f(t,l),h||o.if(Zu._`${Xu.default.errors} === ${i||0}`))}!s.$ref||!u.ignoreKeywordsWithRef&&(0,Yu.schemaHasRulesButRef)(s,c)?(u.jtd||function(t,e){if(t.schemaEnv.meta||!t.opts.strictTypes)return;(function(t,e){if(!e.length)return;if(!t.dataTypes.length)return void(t.dataTypes=e);e.forEach((e=>{m(t.dataTypes,e)||p(t,`type "${e}" not allowed by context "${t.dataTypes.join(",")}"`)})),t.dataTypes=t.dataTypes.filter((t=>m(e,t)))})(t,e),t.opts.allowUnionTypes||function(t,e){e.length>1&&(2!==e.length||!e.includes("null"))&&p(t,"use allowUnionTypes to allow union type keyword")}(t,e);!function(t,e){const r=t.self.RULES.all;for(const n in r){const i=r[n];if("object"==typeof i&&(0,nl.shouldUseRule)(t.schema,i)){const{type:r}=i.definition;r.length&&!r.some((t=>d(e,t)))&&p(t,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(t,t.dataTypes)}(t,e),o.block((()=>{for(const t of c.rules)g(t);g(c.post)}))):o.block((()=>y(t,"$ref",c.all.$ref.definition)))}function f(t,e){const{gen:r,schema:n,opts:{useDefaults:i}}=t;i&&(0,ol.assignDefaults)(t,e.type),r.block((()=>{for(const r of e.rules)(0,nl.shouldUseRule)(n,r)&&y(t,r.keyword,r.definition,e.type)}))}function d(t,e){return t.includes(e)||"number"===e&&t.includes("integer")}function m(t,e){return t.includes(e)||"integer"===e&&t.includes("number")}function p(t,e){e+=` at "${t.schemaEnv.baseId+t.errSchemaPath}" (strictTypes)`,(0,Yu.checkStrictMode)(t,e,t.opts.strictTypes)}e.validateFunctionCode=function(t){a(t)&&(h(t),s(t))?function(t){const{schema:e,opts:r,gen:i}=t;n(t,(()=>{r.$comment&&e.$comment&&l(t),function(t){const{schema:e,opts:r}=t;void 0!==e.default&&r.useDefaults&&r.strictSchema&&(0,Yu.checkStrictMode)(t,"default is ignored in the schema root")}(t),i.let(Xu.default.vErrors,null),i.let(Xu.default.errors,0),r.unevaluated&&function(t){const{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",Zu._`${r}.evaluated`),e.if(Zu._`${t.evaluated}.dynamicProps`,(()=>e.assign(Zu._`${t.evaluated}.props`,Zu._`undefined`))),e.if(Zu._`${t.evaluated}.dynamicItems`,(()=>e.assign(Zu._`${t.evaluated}.items`,Zu._`undefined`)))}(t),u(t),function(t){const{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=t;r.$async?e.if(Zu._`${Xu.default.errors} === 0`,(()=>e.return(Xu.default.data)),(()=>e.throw(Zu._`new ${i}(${Xu.default.vErrors})`))):(e.assign(Zu._`${n}.errors`,Xu.default.vErrors),o.unevaluated&&function({gen:t,evaluated:e,props:r,items:n}){r instanceof Zu.Name&&t.assign(Zu._`${e}.props`,r);n instanceof Zu.Name&&t.assign(Zu._`${e}.items`,n)}(t),e.return(Zu._`${Xu.default.errors} === 0`))}(t)}))}(t):n(t,(()=>(0,el.topBoolOrEmptySchema)(t)))};class g{constructor(t,e,r){if((0,al.validateKeywordUsage)(t,e,r),this.gen=t.gen,this.allErrors=t.allErrors,this.keyword=r,this.data=t.data,this.schema=t.schema[r],this.$data=e.$data&&t.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,Yu.schemaRefOrVal)(t,this.schema,r,this.$data),this.schemaType=e.schemaType,this.parentSchema=t.schema,this.params={},this.it=t,this.def=e,this.$data)this.schemaCode=t.gen.const("vSchema",b(this.$data,t));else if(this.schemaCode=this.schemaValue,!(0,al.validSchemaType)(this.schema,e.schemaType,e.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(e.schemaType)}`);("code"in e?e.trackErrors:!1!==e.errors)&&(this.errsCount=t.gen.const("_errs",Xu.default.errors))}result(t,e,r){this.failResult((0,Zu.not)(t),e,r)}failResult(t,e,r){this.gen.if(t),r?r():this.error(),e?(this.gen.else(),e(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(t,e){this.failResult((0,Zu.not)(t),void 0,e)}fail(t){if(void 0===t)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(t),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(t){if(!this.$data)return this.fail(t);const{schemaCode:e}=this;this.fail(Zu._`${e} !== undefined && (${(0,Zu.or)(this.invalid$data(),t)})`)}error(t,e,r){if(e)return this.setParams(e),this._error(t,r),void this.setParams({});this._error(t,r)}_error(t,e){(t?tl.reportExtraError:tl.reportError)(this,this.def.error,e)}$dataError(){(0,tl.reportError)(this,this.def.$dataError||tl.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,tl.resetErrorsCount)(this.gen,this.errsCount)}ok(t){this.allErrors||this.gen.if(t)}setParams(t,e){e?Object.assign(this.params,t):this.params=t}block$data(t,e,r=Zu.nil){this.gen.block((()=>{this.check$data(t,r),e()}))}check$data(t=Zu.nil,e=Zu.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:i,def:o}=this;r.if((0,Zu.or)(Zu._`${n} === undefined`,e)),t!==Zu.nil&&r.assign(t,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),t!==Zu.nil&&r.assign(t,!1)),r.else()}invalid$data(){const{gen:t,schemaCode:e,schemaType:n,def:i,it:o}=this;return(0,Zu.or)(function(){if(n.length){if(!(e instanceof Zu.Name))throw new Error("ajv implementation error");const t=Array.isArray(n)?n:[n];return Zu._`${(0,r.checkDataTypes)(t,e,o.opts.strictNumbers,r.DataType.Wrong)}`}return Zu.nil}(),function(){if(i.validateSchema){const r=t.scopeValue("validate$data",{ref:i.validateSchema});return Zu._`!${r}(${e})`}return Zu.nil}())}subschema(t,e){const r=(0,hl.getSubschema)(this.it,t);(0,hl.extendSubschemaData)(r,this.it,t),(0,hl.extendSubschemaMode)(r,t);const n={...this.it,...r,items:void 0,props:void 0};return o(n,e),n}mergeEvaluated(t,e){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==t.props&&(r.props=Yu.mergeEvaluated.props(n,t.props,r.props,e)),!0!==r.items&&void 0!==t.items&&(r.items=Yu.mergeEvaluated.items(n,t.items,r.items,e)))}mergeValidEvaluated(t,e){const{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(e,(()=>this.mergeEvaluated(t,Zu.Name))),!0}}function y(t,e,r,n){const i=new g(t,r,e);"code"in r?r.code(i,n):i.$data&&r.validate?(0,al.funcKeywordCode)(i,r):"macro"in r?(0,al.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,al.funcKeywordCode)(i,r)}e.KeywordCxt=g;const v=/^\/(?:[^~]|~0|~1)*$/,w=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function b(t,{dataLevel:e,dataNames:r,dataPathArr:n}){let i,o;if(""===t)return Xu.default.rootData;if("/"===t[0]){if(!v.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,o=Xu.default.rootData}else{const s=w.exec(t);if(!s)throw new Error(`Invalid JSON-pointer: ${t}`);const a=+s[1];if(i=s[2],"#"===i){if(a>=e)throw new Error(h("property/index",a));return n[e-a]}if(a>e)throw new Error(h("data",a));if(o=r[e-a],!i)return o}let s=o;const a=i.split("/");for(const t of a)t&&(o=Zu._`${o}${(0,Zu.getProperty)((0,Yu.unescapeJsonPointer)(t))}`,s=Zu._`${s} && ${o}`);return s;function h(t,r){return`Cannot access ${t} ${r} levels up, current level is ${e}`}}e.getData=b}));class dl extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}var ml=dl,pl=Object.defineProperty({default:ml},"__esModule",{value:!0});class gl extends Error{constructor(t,e,r,n){super(n||`can't resolve reference ${r} from id ${e}`),this.missingRef=(0,cl.resolveUrl)(t,e,r),this.missingSchema=(0,cl.normalizeId)((0,cl.getFullPath)(t,this.missingRef))}}var yl=gl,vl=Object.defineProperty({default:yl},"__esModule",{value:!0}),wl=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;class r{constructor(t){var e;let r;this.refs={},this.dynamicAnchors={},"object"==typeof t.schema&&(r=t.schema),this.schema=t.schema,this.schemaId=t.schemaId,this.root=t.root||this,this.baseId=null!==(e=t.baseId)&&void 0!==e?e:(0,cl.normalizeId)(null==r?void 0:r[t.schemaId||"$id"]),this.schemaPath=t.schemaPath,this.localRefs=t.localRefs,this.meta=t.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function n(t){const e=o.call(this,t);if(e)return e;const r=(0,cl.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new Zu.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s});let h;t.$async&&(h=a.scopeValue("Error",{ref:pl.default,code:Zu._`require("ajv/dist/runtime/validation_error").default`}));const u=a.scopeName("validate");t.validateName=u;const l={gen:a,allErrors:this.opts.allErrors,data:Xu.default.data,parentData:Xu.default.parentData,parentDataProperty:Xu.default.parentDataProperty,dataNames:[Xu.default.data],dataPathArr:[Zu.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",!0===this.opts.code.source?{ref:t.schema,code:(0,Zu.stringify)(t.schema)}:{ref:t.schema}),validateName:u,ValidationError:h,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Zu.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:Zu._`""`,opts:this.opts,self:this};let c;try{this._compilations.add(t),(0,fl.validateFunctionCode)(l),a.optimize(this.opts.code.optimize);const e=a.toString();c=`${a.scopeRefs(Xu.default.scope)}return ${e}`,this.opts.code.process&&(c=this.opts.code.process(c,t));const r=new Function(`${Xu.default.self}`,`${Xu.default.scope}`,c)(this,this.scope.get());if(this.scope.value(u,{ref:r}),r.errors=null,r.schema=t.schema,r.schemaEnv=t,t.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:u,validateCode:e,scopeValues:a._values}),this.opts.unevaluated){const{props:t,items:e}=l;r.evaluated={props:t instanceof Zu.Name?void 0:t,items:e instanceof Zu.Name?void 0:e,dynamicProps:t instanceof Zu.Name,dynamicItems:e instanceof Zu.Name},r.source&&(r.source.evaluated=(0,Zu.stringify)(r.evaluated))}return t.validate=r,t}catch(e){throw delete t.validate,delete t.validateName,c&&this.logger.error("Error compiling schema, function code:",c),e}finally{this._compilations.delete(t)}}function i(t){return(0,cl.inlineRef)(t.schema,this.opts.inlineRefs)?t.schema:t.validate?t:n.call(this,t)}function o(t){for(const n of this._compilations)if(r=t,(e=n).schema===r.schema&&e.root===r.root&&e.baseId===r.baseId)return n;var e,r}function s(t,e){let r;for(;"string"==typeof(r=this.refs[e]);)e=r;return r||this.schemas[e]||a.call(this,t,e)}function a(t,e){const i=this.opts.uriResolver.parse(e),o=(0,cl._getFullPath)(this.opts.uriResolver,i);let s=(0,cl.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&o===s)return u.call(this,i,t);const h=(0,cl.normalizeId)(o),l=this.refs[h]||this.schemas[h];if("string"==typeof l){const e=a.call(this,t,l);if("object"!=typeof(null==e?void 0:e.schema))return;return u.call(this,i,e)}if("object"==typeof(null==l?void 0:l.schema)){if(l.validate||n.call(this,l),h===(0,cl.normalizeId)(e)){const{schema:e}=l,{schemaId:n}=this.opts,i=e[n];return i&&(s=(0,cl.resolveUrl)(this.opts.uriResolver,s,i)),new r({schema:e,schemaId:n,root:t,baseId:s})}return u.call(this,i,l)}}e.SchemaEnv=r,e.compileSchema=n,e.resolveRef=function(t,e,n){var o;n=(0,cl.resolveUrl)(this.opts.uriResolver,e,n);const a=t.refs[n];if(a)return a;let h=s.call(this,t,n);if(void 0===h){const i=null===(o=t.localRefs)||void 0===o?void 0:o[n],{schemaId:s}=this.opts;i&&(h=new r({schema:i,schemaId:s,root:t,baseId:e}))}return void 0!==h?t.refs[n]=i.call(this,h):void 0},e.getCompilingSchema=o,e.resolveSchema=a;const h=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function u(t,{baseId:e,schema:n,root:i}){var o;if("/"!==(null===(o=t.fragment)||void 0===o?void 0:o[0]))return;for(const r of t.fragment.slice(1).split("/")){if("boolean"==typeof n)return;const t=n[(0,Yu.unescapeFragment)(r)];if(void 0===t)return;const i="object"==typeof(n=t)&&n[this.opts.schemaId];!h.has(r)&&i&&(e=(0,cl.resolveUrl)(this.opts.uriResolver,e,i))}let s;if("boolean"!=typeof n&&n.$ref&&!(0,Yu.schemaHasRulesButRef)(n,this.RULES)){const t=(0,cl.resolveUrl)(this.opts.uriResolver,e,n.$ref);s=a.call(this,i,t)}const{schemaId:u}=this.opts;return s=s||new r({schema:n,schemaId:u,root:i,baseId:e}),s.schema!==s.root.schema?s:void 0}})),bl={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1},El=o((function(t,e){!function(t){function e(){for(var t=arguments.length,e=Array(t),r=0;r<t;r++)e[r]=arguments[r];if(e.length>1){e[0]=e[0].slice(0,-1);for(var n=e.length-1,i=1;i<n;++i)e[i]=e[i].slice(1,-1);return e[n]=e[n].slice(1),e.join("")}return e[0]}function r(t){return"(?:"+t+")"}function n(t){return void 0===t?"undefined":null===t?"null":Object.prototype.toString.call(t).split(" ").pop().split("]").shift().toLowerCase()}function i(t){return t.toUpperCase()}function o(t){return null!=t?t instanceof Array?t:"number"!=typeof t.length||t.split||t.setInterval||t.call?[t]:Array.prototype.slice.call(t):[]}function s(t,e){var r=t;if(e)for(var n in e)r[n]=e[n];return r}function a(t){var n="[A-Za-z]",i="[0-9]",o=e(i,"[A-Fa-f]"),s=r(r("%[EFef]"+o+"%"+o+o+"%"+o+o)+"|"+r("%[89A-Fa-f]"+o+"%"+o+o)+"|"+r("%"+o+o)),a="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",h=e("[\\:\\/\\?\\#\\[\\]\\@]",a),u=t?"[\\uE000-\\uF8FF]":"[]",l=e(n,i,"[\\-\\.\\_\\~]",t?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),c=(r(n+e(n,i,"[\\+\\-\\.]")+"*"),r(r(s+"|"+e(l,a,"[\\:]"))+"*"),r(r("25[0-5]")+"|"+r("2[0-4]"+i)+"|"+r("1"+i+i)+"|"+r("0?[1-9]"+i)+"|0?0?"+i)),f=r(c+"\\."+c+"\\."+c+"\\."+c),d=r(o+"{1,4}"),m=r(r(d+"\\:"+d)+"|"+f),p=r(r(d+"\\:")+"{6}"+m),g=r("\\:\\:"+r(d+"\\:")+"{5}"+m),y=r(r(d)+"?\\:\\:"+r(d+"\\:")+"{4}"+m),v=r(r(r(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+r(d+"\\:")+"{3}"+m),w=r(r(r(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+r(d+"\\:")+"{2}"+m),b=r(r(r(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+m),E=r(r(r(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+m),_=r(r(r(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),A=r(r(r(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),M=r([p,g,y,v,w,b,E,_,A].join("|")),k=r(r(l+"|"+s)+"+"),x=(r("[vV]"+o+"+\\."+e(l,a,"[\\:]")+"+"),r(r(s+"|"+e(l,a))+"*"),r(s+"|"+e(l,a,"[\\:\\@]")));return r(r(s+"|"+e(l,a,"[\\@]"))+"+"),r(r(x+"|"+e("[\\/\\?]",u))+"*"),{NOT_SCHEME:new RegExp(e("[^]",n,i,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(e("[^\\%\\:]",l,a),"g"),NOT_HOST:new RegExp(e("[^\\%\\[\\]\\:]",l,a),"g"),NOT_PATH:new RegExp(e("[^\\%\\/\\:\\@]",l,a),"g"),NOT_PATH_NOSCHEME:new RegExp(e("[^\\%\\/\\@]",l,a),"g"),NOT_QUERY:new RegExp(e("[^\\%]",l,a,"[\\:\\@\\/\\?]",u),"g"),NOT_FRAGMENT:new RegExp(e("[^\\%]",l,a,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(e("[^]",l,a),"g"),UNRESERVED:new RegExp(l,"g"),OTHER_CHARS:new RegExp(e("[^\\%]",l,h),"g"),PCT_ENCODED:new RegExp(s,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+M+")"+r(r("\\%25|\\%(?!"+o+"{2})")+"("+k+")")+"?\\]?$")}}var h=a(!1),u=a(!0),l=function(){function t(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}return r}return function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,r);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e<t.length;e++)r[e]=t[e];return r}return Array.from(t)},f=2147483647,d=36,m=1,p=26,g=38,y=700,v=72,w=128,b="-",E=/^xn--/,_=/[^\0-\x7E]/,A=/[\x2E\u3002\uFF0E\uFF61]/g,M={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=d-m,x=Math.floor,N=String.fromCharCode;function S(t){throw new RangeError(M[t])}function P(t,e){for(var r=[],n=t.length;n--;)r[n]=e(t[n]);return r}function I(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+P((t=t.replace(A,".")).split("."),e).join(".")}function R(t){for(var e=[],r=0,n=t.length;r<n;){var i=t.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){var o=t.charCodeAt(r++);56320==(64512&o)?e.push(((1023&i)<<10)+(1023&o)+65536):(e.push(i),r--)}else e.push(i)}return e}var C=function(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:d},T=function(t,e){return t+22+75*(t<26)-((0!=e)<<5)},O=function(t,e,r){var n=0;for(t=r?x(t/y):t>>1,t+=x(t/e);t>k*p>>1;n+=d)t=x(t/k);return x(n+(k+1)*t/(t+g))},$=function(t){var e=[],r=t.length,n=0,i=w,o=v,s=t.lastIndexOf(b);s<0&&(s=0);for(var a=0;a<s;++a)t.charCodeAt(a)>=128&&S("not-basic"),e.push(t.charCodeAt(a));for(var h=s>0?s+1:0;h<r;){for(var u=n,l=1,c=d;;c+=d){h>=r&&S("invalid-input");var g=C(t.charCodeAt(h++));(g>=d||g>x((f-n)/l))&&S("overflow"),n+=g*l;var y=c<=o?m:c>=o+p?p:c-o;if(g<y)break;var E=d-y;l>x(f/E)&&S("overflow"),l*=E}var _=e.length+1;o=O(n-u,_,0==u),x(n/_)>f-i&&S("overflow"),i+=x(n/_),n%=_,e.splice(n++,0,i)}return String.fromCodePoint.apply(String,e)},B=function(t){var e=[],r=(t=R(t)).length,n=w,i=0,o=v,s=!0,a=!1,h=void 0;try{for(var u,l=t[Symbol.iterator]();!(s=(u=l.next()).done);s=!0){var c=u.value;c<128&&e.push(N(c))}}catch(t){a=!0,h=t}finally{try{!s&&l.return&&l.return()}finally{if(a)throw h}}var g=e.length,y=g;for(g&&e.push(b);y<r;){var E=f,_=!0,A=!1,M=void 0;try{for(var k,P=t[Symbol.iterator]();!(_=(k=P.next()).done);_=!0){var I=k.value;I>=n&&I<E&&(E=I)}}catch(t){A=!0,M=t}finally{try{!_&&P.return&&P.return()}finally{if(A)throw M}}var C=y+1;E-n>x((f-i)/C)&&S("overflow"),i+=(E-n)*C,n=E;var $=!0,B=!1,F=void 0;try{for(var j,D=t[Symbol.iterator]();!($=(j=D.next()).done);$=!0){var U=j.value;if(U<n&&++i>f&&S("overflow"),U==n){for(var L=i,z=d;;z+=d){var q=z<=o?m:z>=o+p?p:z-o;if(L<q)break;var V=L-q,G=d-q;e.push(N(T(q+V%G,0))),L=x(V/G)}e.push(N(T(L,0))),o=O(i,C,y==g),i=0,++y}}}catch(t){B=!0,F=t}finally{try{!$&&D.return&&D.return()}finally{if(B)throw F}}++i,++n}return e.join("")},F=function(t){return I(t,(function(t){return E.test(t)?$(t.slice(4).toLowerCase()):t}))},j=function(t){return I(t,(function(t){return _.test(t)?"xn--"+B(t):t}))},D={version:"2.1.0",ucs2:{decode:R,encode:function(t){return String.fromCodePoint.apply(String,c(t))}},decode:$,encode:B,toASCII:j,toUnicode:F},U={};function L(t){var e=t.charCodeAt(0);return e<16?"%0"+e.toString(16).toUpperCase():e<128?"%"+e.toString(16).toUpperCase():e<2048?"%"+(e>>6|192).toString(16).toUpperCase()+"%"+(63&e|128).toString(16).toUpperCase():"%"+(e>>12|224).toString(16).toUpperCase()+"%"+(e>>6&63|128).toString(16).toUpperCase()+"%"+(63&e|128).toString(16).toUpperCase()}function z(t){for(var e="",r=0,n=t.length;r<n;){var i=parseInt(t.substr(r+1,2),16);if(i<128)e+=String.fromCharCode(i),r+=3;else if(i>=194&&i<224){if(n-r>=6){var o=parseInt(t.substr(r+4,2),16);e+=String.fromCharCode((31&i)<<6|63&o)}else e+=t.substr(r,6);r+=6}else if(i>=224){if(n-r>=9){var s=parseInt(t.substr(r+4,2),16),a=parseInt(t.substr(r+7,2),16);e+=String.fromCharCode((15&i)<<12|(63&s)<<6|63&a)}else e+=t.substr(r,9);r+=9}else e+=t.substr(r,3),r+=3}return e}function q(t,e){function r(t){var r=z(t);return r.match(e.UNRESERVED)?r:t}return t.scheme&&(t.scheme=String(t.scheme).replace(e.PCT_ENCODED,r).toLowerCase().replace(e.NOT_SCHEME,"")),void 0!==t.userinfo&&(t.userinfo=String(t.userinfo).replace(e.PCT_ENCODED,r).replace(e.NOT_USERINFO,L).replace(e.PCT_ENCODED,i)),void 0!==t.host&&(t.host=String(t.host).replace(e.PCT_ENCODED,r).toLowerCase().replace(e.NOT_HOST,L).replace(e.PCT_ENCODED,i)),void 0!==t.path&&(t.path=String(t.path).replace(e.PCT_ENCODED,r).replace(t.scheme?e.NOT_PATH:e.NOT_PATH_NOSCHEME,L).replace(e.PCT_ENCODED,i)),void 0!==t.query&&(t.query=String(t.query).replace(e.PCT_ENCODED,r).replace(e.NOT_QUERY,L).replace(e.PCT_ENCODED,i)),void 0!==t.fragment&&(t.fragment=String(t.fragment).replace(e.PCT_ENCODED,r).replace(e.NOT_FRAGMENT,L).replace(e.PCT_ENCODED,i)),t}function V(t){return t.replace(/^0*(.*)/,"$1")||"0"}function G(t,e){var r=t.match(e.IPV4ADDRESS)||[],n=l(r,2)[1];return n?n.split(".").map(V).join("."):t}function H(t,e){var r=t.match(e.IPV6ADDRESS)||[],n=l(r,3),i=n[1],o=n[2];if(i){for(var s=i.toLowerCase().split("::").reverse(),a=l(s,2),h=a[0],u=a[1],c=u?u.split(":").map(V):[],f=h.split(":").map(V),d=e.IPV4ADDRESS.test(f[f.length-1]),m=d?7:8,p=f.length-m,g=Array(m),y=0;y<m;++y)g[y]=c[y]||f[p+y]||"";d&&(g[m-1]=G(g[m-1],e));var v=g.reduce((function(t,e,r){if(!e||"0"===e){var n=t[t.length-1];n&&n.index+n.length===r?n.length++:t.push({index:r,length:1})}return t}),[]),w=v.sort((function(t,e){return e.length-t.length}))[0],b=void 0;if(w&&w.length>1){var E=g.slice(0,w.index),_=g.slice(w.index+w.length);b=E.join(":")+"::"+_.join(":")}else b=g.join(":");return o&&(b+="%"+o),b}return t}var K=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,Q=void 0==="".match(/(){0}/)[1];function J(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==e.iri?u:h;"suffix"===e.reference&&(t=(e.scheme?e.scheme+":":"")+"//"+t);var i=t.match(K);if(i){Q?(r.scheme=i[1],r.userinfo=i[3],r.host=i[4],r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=i[7],r.fragment=i[8],isNaN(r.port)&&(r.port=i[5])):(r.scheme=i[1]||void 0,r.userinfo=-1!==t.indexOf("@")?i[3]:void 0,r.host=-1!==t.indexOf("//")?i[4]:void 0,r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=-1!==t.indexOf("?")?i[7]:void 0,r.fragment=-1!==t.indexOf("#")?i[8]:void 0,isNaN(r.port)&&(r.port=t.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),r.host&&(r.host=H(G(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",e.reference&&"suffix"!==e.reference&&e.reference!==r.reference&&(r.error=r.error||"URI is not a "+e.reference+" reference.");var o=U[(e.scheme||r.scheme||"").toLowerCase()];if(e.unicodeSupport||o&&o.unicodeSupport)q(r,n);else{if(r.host&&(e.domainHost||o&&o.domainHost))try{r.host=D.toASCII(r.host.replace(n.PCT_ENCODED,z).toLowerCase())}catch(t){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+t}q(r,h)}o&&o.parse&&o.parse(r,e)}else r.error=r.error||"URI can not be parsed.";return r}function Z(t,e){var r=!1!==e.iri?u:h,n=[];return void 0!==t.userinfo&&(n.push(t.userinfo),n.push("@")),void 0!==t.host&&n.push(H(G(String(t.host),r),r).replace(r.IPV6ADDRESS,(function(t,e,r){return"["+e+(r?"%25"+r:"")+"]"}))),"number"!=typeof t.port&&"string"!=typeof t.port||(n.push(":"),n.push(String(t.port))),n.length?n.join(""):void 0}var Y=/^\.\.?\//,W=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,tt=/^\/?(?:.|\n)*?(?=\/|$)/;function et(t){for(var e=[];t.length;)if(t.match(Y))t=t.replace(Y,"");else if(t.match(W))t=t.replace(W,"/");else if(t.match(X))t=t.replace(X,"/"),e.pop();else if("."===t||".."===t)t="";else{var r=t.match(tt);if(!r)throw new Error("Unexpected dot segment condition");var n=r[0];t=t.slice(n.length),e.push(n)}return e.join("")}function rt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.iri?u:h,n=[],i=U[(e.scheme||t.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(t,e),t.host)if(r.IPV6ADDRESS.test(t.host));else if(e.domainHost||i&&i.domainHost)try{t.host=e.iri?D.toUnicode(t.host):D.toASCII(t.host.replace(r.PCT_ENCODED,z).toLowerCase())}catch(r){t.error=t.error||"Host's domain name can not be converted to "+(e.iri?"Unicode":"ASCII")+" via punycode: "+r}q(t,r),"suffix"!==e.reference&&t.scheme&&(n.push(t.scheme),n.push(":"));var o=Z(t,e);if(void 0!==o&&("suffix"!==e.reference&&n.push("//"),n.push(o),t.path&&"/"!==t.path.charAt(0)&&n.push("/")),void 0!==t.path){var s=t.path;e.absolutePath||i&&i.absolutePath||(s=et(s)),void 0===o&&(s=s.replace(/^\/\//,"/%2F")),n.push(s)}return void 0!==t.query&&(n.push("?"),n.push(t.query)),void 0!==t.fragment&&(n.push("#"),n.push(t.fragment)),n.join("")}function nt(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={};return arguments[3]||(t=J(rt(t,r),r),e=J(rt(e,r),r)),!(r=r||{}).tolerant&&e.scheme?(n.scheme=e.scheme,n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=et(e.path||""),n.query=e.query):(void 0!==e.userinfo||void 0!==e.host||void 0!==e.port?(n.userinfo=e.userinfo,n.host=e.host,n.port=e.port,n.path=et(e.path||""),n.query=e.query):(e.path?("/"===e.path.charAt(0)?n.path=et(e.path):(void 0===t.userinfo&&void 0===t.host&&void 0===t.port||t.path?t.path?n.path=t.path.slice(0,t.path.lastIndexOf("/")+1)+e.path:n.path=e.path:n.path="/"+e.path,n.path=et(n.path)),n.query=e.query):(n.path=t.path,void 0!==e.query?n.query=e.query:n.query=t.query),n.userinfo=t.userinfo,n.host=t.host,n.port=t.port),n.scheme=t.scheme),n.fragment=e.fragment,n}function it(t,e,r){var n=s({scheme:"null"},r);return rt(nt(J(t,n),J(e,n),n,!0),n)}function ot(t,e){return"string"==typeof t?t=rt(J(t,e),e):"object"===n(t)&&(t=J(rt(t,e),e)),t}function st(t,e,r){return"string"==typeof t?t=rt(J(t,r),r):"object"===n(t)&&(t=rt(t,r)),"string"==typeof e?e=rt(J(e,r),r):"object"===n(e)&&(e=rt(e,r)),t===e}function at(t,e){return t&&t.toString().replace(e&&e.iri?u.ESCAPE:h.ESCAPE,L)}function ht(t,e){return t&&t.toString().replace(e&&e.iri?u.PCT_ENCODED:h.PCT_ENCODED,z)}var ut={scheme:"http",domainHost:!0,parse:function(t,e){return t.host||(t.error=t.error||"HTTP URIs must have a host."),t},serialize:function(t,e){var r="https"===String(t.scheme).toLowerCase();return t.port!==(r?443:80)&&""!==t.port||(t.port=void 0),t.path||(t.path="/"),t}},lt={scheme:"https",domainHost:ut.domainHost,parse:ut.parse,serialize:ut.serialize};function ct(t){return"boolean"==typeof t.secure?t.secure:"wss"===String(t.scheme).toLowerCase()}var ft={scheme:"ws",domainHost:!0,parse:function(t,e){var r=t;return r.secure=ct(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(t,e){if(t.port!==(ct(t)?443:80)&&""!==t.port||(t.port=void 0),"boolean"==typeof t.secure&&(t.scheme=t.secure?"wss":"ws",t.secure=void 0),t.resourceName){var r=t.resourceName.split("?"),n=l(r,2),i=n[0],o=n[1];t.path=i&&"/"!==i?i:void 0,t.query=o,t.resourceName=void 0}return t.fragment=void 0,t}},dt={scheme:"wss",domainHost:ft.domainHost,parse:ft.parse,serialize:ft.serialize},mt={},pt="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",gt="[0-9A-Fa-f]",yt=r(r("%[EFef]"+gt+"%"+gt+gt+"%"+gt+gt)+"|"+r("%[89A-Fa-f]"+gt+"%"+gt+gt)+"|"+r("%"+gt+gt)),vt="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",wt=e("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),bt="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",Et=new RegExp(pt,"g"),_t=new RegExp(yt,"g"),At=new RegExp(e("[^]",vt,"[\\.]",'[\\"]',wt),"g"),Mt=new RegExp(e("[^]",pt,bt),"g"),kt=Mt;function xt(t){var e=z(t);return e.match(Et)?e:t}var Nt={scheme:"mailto",parse:function(t,e){var r=t,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var i=!1,o={},s=r.query.split("&"),a=0,h=s.length;a<h;++a){var u=s[a].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),c=0,f=l.length;c<f;++c)n.push(l[c]);break;case"subject":r.subject=ht(u[1],e);break;case"body":r.body=ht(u[1],e);break;default:i=!0,o[ht(u[0],e)]=ht(u[1],e)}}i&&(r.headers=o)}r.query=void 0;for(var d=0,m=n.length;d<m;++d){var p=n[d].split("@");if(p[0]=ht(p[0]),e.unicodeSupport)p[1]=ht(p[1],e).toLowerCase();else try{p[1]=D.toASCII(ht(p[1],e).toLowerCase())}catch(t){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+t}n[d]=p.join("@")}return r},serialize:function(t,e){var r=t,n=o(t.to);if(n){for(var s=0,a=n.length;s<a;++s){var h=String(n[s]),u=h.lastIndexOf("@"),l=h.slice(0,u).replace(_t,xt).replace(_t,i).replace(At,L),c=h.slice(u+1);try{c=e.iri?D.toUnicode(c):D.toASCII(ht(c,e).toLowerCase())}catch(t){r.error=r.error||"Email address's domain name can not be converted to "+(e.iri?"Unicode":"ASCII")+" via punycode: "+t}n[s]=l+"@"+c}r.path=n.join(",")}var f=t.headers=t.headers||{};t.subject&&(f.subject=t.subject),t.body&&(f.body=t.body);var d=[];for(var m in f)f[m]!==mt[m]&&d.push(m.replace(_t,xt).replace(_t,i).replace(Mt,L)+"="+f[m].replace(_t,xt).replace(_t,i).replace(kt,L));return d.length&&(r.query=d.join("&")),r}},St=/^([^\:]+)\:(.*)/,Pt={scheme:"urn",parse:function(t,e){var r=t.path&&t.path.match(St),n=t;if(r){var i=e.scheme||n.scheme||"urn",o=r[1].toLowerCase(),s=r[2],a=i+":"+(e.nid||o),h=U[a];n.nid=o,n.nss=s,n.path=void 0,h&&(n=h.parse(n,e))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(t,e){var r=e.scheme||t.scheme||"urn",n=t.nid,i=r+":"+(e.nid||n),o=U[i];o&&(t=o.serialize(t,e));var s=t,a=t.nss;return s.path=(n||e.nid)+":"+a,s}},It=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Rt={scheme:"urn:uuid",parse:function(t,e){var r=t;return r.uuid=r.nss,r.nss=void 0,e.tolerant||r.uuid&&r.uuid.match(It)||(r.error=r.error||"UUID is not valid."),r},serialize:function(t,e){var r=t;return r.nss=(t.uuid||"").toLowerCase(),r}};U[ut.scheme]=ut,U[lt.scheme]=lt,U[ft.scheme]=ft,U[dt.scheme]=dt,U[Nt.scheme]=Nt,U[Pt.scheme]=Pt,U[Rt.scheme]=Rt,t.SCHEMES=U,t.pctEncChar=L,t.pctDecChars=z,t.parse=J,t.removeDotSegments=et,t.serialize=rt,t.resolveComponents=nt,t.resolve=it,t.normalize=ot,t.equal=st,t.escapeComponent=at,t.unescapeComponent=ht,Object.defineProperty(t,"__esModule",{value:!0})}(e)}));El.code='require("ajv/dist/runtime/uri").default';var _l=El,Al=Object.defineProperty({default:_l},"__esModule",{value:!0}),Ml=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0,Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return fl.KeywordCxt}}),Object.defineProperty(e,"_",{enumerable:!0,get:function(){return Zu._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return Zu.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return Zu.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return Zu.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return Zu.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return Zu.CodeGen}});const r=Zu,n=(t,e)=>new RegExp(t,e);n.code="new RegExp";const i=["removeAdditional","useDefaults","coerceTypes"],o=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),s={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},a={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function h(t){var e,r,i,o,s,a,h,u,l,c,f,d,m,p,g,y,v,w,b,E,_,A,M,k,x;const N=t.strict,S=null===(e=t.code)||void 0===e?void 0:e.optimize,P=!0===S||void 0===S?1:S||0,I=null!==(i=null===(r=t.code)||void 0===r?void 0:r.regExp)&&void 0!==i?i:n,R=null!==(o=t.uriResolver)&&void 0!==o?o:Al.default;return{strictSchema:null===(a=null!==(s=t.strictSchema)&&void 0!==s?s:N)||void 0===a||a,strictNumbers:null===(u=null!==(h=t.strictNumbers)&&void 0!==h?h:N)||void 0===u||u,strictTypes:null!==(c=null!==(l=t.strictTypes)&&void 0!==l?l:N)&&void 0!==c?c:"log",strictTuples:null!==(d=null!==(f=t.strictTuples)&&void 0!==f?f:N)&&void 0!==d?d:"log",strictRequired:null!==(p=null!==(m=t.strictRequired)&&void 0!==m?m:N)&&void 0!==p&&p,code:t.code?{...t.code,optimize:P,regExp:I}:{optimize:P,regExp:I},loopRequired:null!==(g=t.loopRequired)&&void 0!==g?g:200,loopEnum:null!==(y=t.loopEnum)&&void 0!==y?y:200,meta:null===(v=t.meta)||void 0===v||v,messages:null===(w=t.messages)||void 0===w||w,inlineRefs:null===(b=t.inlineRefs)||void 0===b||b,schemaId:null!==(E=t.schemaId)&&void 0!==E?E:"$id",addUsedSchema:null===(_=t.addUsedSchema)||void 0===_||_,validateSchema:null===(A=t.validateSchema)||void 0===A||A,validateFormats:null===(M=t.validateFormats)||void 0===M||M,unicodeRegExp:null===(k=t.unicodeRegExp)||void 0===k||k,int32range:null===(x=t.int32range)||void 0===x||x,uriResolver:R}}class u{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...h(t)};const{es5:e,lines:n}=this.opts.code;this.scope=new r.ValueScope({scope:{},prefixes:o,es5:e,lines:n}),this.logger=function(t){if(!1===t)return g;if(void 0===t)return console;if(t.log&&t.warn&&t.error)return t;throw new Error("logger must implement log, warn and error methods")}(t.logger);const i=t.validateFormats;t.validateFormats=!1,this.RULES=(0,rl.getRules)(),l.call(this,s,t,"NOT SUPPORTED"),l.call(this,a,t,"DEPRECATED","warn"),this._metaOpts=p.call(this),t.formats&&d.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&m.call(this,t.keywords),"object"==typeof t.meta&&this.addMetaSchema(t.meta),f.call(this),t.validateFormats=i}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:t,meta:e,schemaId:r}=this.opts;let n=bl;"id"===r&&(n={...bl},n.id=n.$id,delete n.$id),e&&t&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){const{meta:t,schemaId:e}=this.opts;return this.opts.defaultMeta="object"==typeof t?t[e]||t:void 0}validate(t,e){let r;if("string"==typeof t){if(r=this.getSchema(t),!r)throw new Error(`no schema with key or ref "${t}"`)}else r=this.compile(t);const n=r(e);return"$async"in r||(this.errors=r.errors),n}compile(t,e){const r=this._addSchema(t,e);return r.validate||this._compileSchemaEnv(r)}compileAsync(t,e){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,t,e);async function n(t,e){await i.call(this,t.$schema);const r=this._addSchema(t,e);return r.validate||o.call(this,r)}async function i(t){t&&!this.getSchema(t)&&await n.call(this,{$ref:t},!0)}async function o(t){try{return this._compileSchemaEnv(t)}catch(e){if(!(e instanceof vl.default))throw e;return s.call(this,e),await a.call(this,e.missingSchema),o.call(this,t)}}function s({missingSchema:t,missingRef:e}){if(this.refs[t])throw new Error(`AnySchema ${t} is loaded but ${e} cannot be resolved`)}async function a(t){const r=await h.call(this,t);this.refs[t]||await i.call(this,r.$schema),this.refs[t]||this.addSchema(r,t,e)}async function h(t){const e=this._loading[t];if(e)return e;try{return await(this._loading[t]=r(t))}finally{delete this._loading[t]}}}addSchema(t,e,r,n=this.opts.validateSchema){if(Array.isArray(t)){for(const e of t)this.addSchema(e,void 0,r,n);return this}let i;if("object"==typeof t){const{schemaId:e}=this.opts;if(i=t[e],void 0!==i&&"string"!=typeof i)throw new Error(`schema ${e} must be string`)}return e=(0,cl.normalizeId)(e||i),this._checkUnique(e),this.schemas[e]=this._addSchema(t,r,e,n,!0),this}addMetaSchema(t,e,r=this.opts.validateSchema){return this.addSchema(t,e,!0,r),this}validateSchema(t,e){if("boolean"==typeof t)return!0;let r;if(r=t.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,t);if(!n&&e){const t="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(t);this.logger.error(t)}return n}getSchema(t){let e;for(;"string"==typeof(e=c.call(this,t));)t=e;if(void 0===e){const{schemaId:r}=this.opts,n=new wl.SchemaEnv({schema:{},schemaId:r});if(e=wl.resolveSchema.call(this,n,t),!e)return;this.refs[t]=e}return e.validate||this._compileSchemaEnv(e)}removeSchema(t){if(t instanceof RegExp)return this._removeAllSchemas(this.schemas,t),this._removeAllSchemas(this.refs,t),this;switch(typeof t){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const e=c.call(this,t);return"object"==typeof e&&this._cache.delete(e.schema),delete this.schemas[t],delete this.refs[t],this}case"object":{const e=t;this._cache.delete(e);let r=t[this.opts.schemaId];return r&&(r=(0,cl.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(t){for(const e of t)this.addKeyword(e);return this}addKeyword(t,e){let r;if("string"==typeof t)r=t,"object"==typeof e&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),e.keyword=r);else{if("object"!=typeof t||void 0!==e)throw new Error("invalid addKeywords parameters");if(r=(e=t).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(v.call(this,r,e),!e)return(0,Yu.eachItem)(r,(t=>w.call(this,t))),this;E.call(this,e);const n={...e,type:(0,il.getJSONTypes)(e.type),schemaType:(0,il.getJSONTypes)(e.schemaType)};return(0,Yu.eachItem)(r,0===n.type.length?t=>w.call(this,t,n):t=>n.type.forEach((e=>w.call(this,t,n,e)))),this}getKeyword(t){const e=this.RULES.all[t];return"object"==typeof e?e.definition:!!e}removeKeyword(t){const{RULES:e}=this;delete e.keywords[t],delete e.all[t];for(const r of e.rules){const e=r.rules.findIndex((e=>e.keyword===t));e>=0&&r.rules.splice(e,1)}return this}addFormat(t,e){return"string"==typeof e&&(e=new RegExp(e)),this.formats[t]=e,this}errorsText(t=this.errors,{separator:e=", ",dataVar:r="data"}={}){return t&&0!==t.length?t.map((t=>`${r}${t.instancePath} ${t.message}`)).reduce(((t,r)=>t+e+r)):"No errors"}$dataMetaSchema(t,e){const r=this.RULES.all;t=JSON.parse(JSON.stringify(t));for(const n of e){const e=n.split("/").slice(1);let i=t;for(const t of e)i=i[t];for(const t in r){const e=r[t];if("object"!=typeof e)continue;const{$data:n}=e.definition,o=i[t];n&&o&&(i[t]=A(o))}}return t}_removeAllSchemas(t,e){for(const r in t){const n=t[r];e&&!e.test(r)||("string"==typeof n?delete t[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete t[r]))}}_addSchema(t,e,r,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let o;const{schemaId:s}=this.opts;if("object"==typeof t)o=t[s];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof t)throw new Error("schema must be object or boolean")}let a=this._cache.get(t);if(void 0!==a)return a;r=(0,cl.normalizeId)(o||r);const h=cl.getSchemaRefs.call(this,t,r);return a=new wl.SchemaEnv({schema:t,schemaId:s,meta:e,baseId:r,localRefs:h}),this._cache.set(a.schema,a),i&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=a),n&&this.validateSchema(t,!0),a}_checkUnique(t){if(this.schemas[t]||this.refs[t])throw new Error(`schema with key or id "${t}" already exists`)}_compileSchemaEnv(t){if(t.meta?this._compileMetaSchema(t):wl.compileSchema.call(this,t),!t.validate)throw new Error("ajv implementation error");return t.validate}_compileMetaSchema(t){const e=this.opts;this.opts=this._metaOpts;try{wl.compileSchema.call(this,t)}finally{this.opts=e}}}function l(t,e,r,n="error"){for(const i in t){const o=i;o in e&&this.logger[n](`${r}: option ${i}. ${t[o]}`)}}function c(t){return t=(0,cl.normalizeId)(t),this.schemas[t]||this.refs[t]}function f(){const t=this.opts.schemas;if(t)if(Array.isArray(t))this.addSchema(t);else for(const e in t)this.addSchema(t[e],e)}function d(){for(const t in this.opts.formats){const e=this.opts.formats[t];e&&this.addFormat(t,e)}}function m(t){if(Array.isArray(t))this.addVocabulary(t);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const e in t){const r=t[e];r.keyword||(r.keyword=e),this.addKeyword(r)}}}function p(){const t={...this.opts};for(const e of i)delete t[e];return t}e.default=u,u.ValidationError=pl.default,u.MissingRefError=vl.default;const g={log(){},warn(){},error(){}};const y=/^[a-z_$][a-z0-9_$:-]*$/i;function v(t,e){const{RULES:r}=this;if((0,Yu.eachItem)(t,(t=>{if(r.keywords[t])throw new Error(`Keyword ${t} is already defined`);if(!y.test(t))throw new Error(`Keyword ${t} has invalid name`)})),e&&e.$data&&!("code"in e)&&!("validate"in e))throw new Error('$data keyword must have "code" or "validate" function')}function w(t,e,r){var n;const i=null==e?void 0:e.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let s=i?o.post:o.rules.find((({type:t})=>t===r));if(s||(s={type:r,rules:[]},o.rules.push(s)),o.keywords[t]=!0,!e)return;const a={keyword:t,definition:{...e,type:(0,il.getJSONTypes)(e.type),schemaType:(0,il.getJSONTypes)(e.schemaType)}};e.before?b.call(this,s,a,e.before):s.rules.push(a),o.all[t]=a,null===(n=e.implements)||void 0===n||n.forEach((t=>this.addKeyword(t)))}function b(t,e,r){const n=t.rules.findIndex((t=>t.keyword===r));n>=0?t.rules.splice(n,0,e):(t.rules.push(e),this.logger.warn(`rule ${r} is not defined`))}function E(t){let{metaSchema:e}=t;void 0!==e&&(t.$data&&this.opts.$data&&(e=A(e)),t.validateSchema=this.compile(e,!0))}const _={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function A(t){return{anyOf:[t,_]}}}));var kl={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}},xl=Object.defineProperty({default:kl},"__esModule",{value:!0}),Nl=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;const r={keyword:"$ref",schemaType:"string",code(t){const{gen:e,schema:r,it:o}=t,{baseId:s,schemaEnv:a,validateName:h,opts:u,self:l}=o,{root:c}=a;if(("#"===r||"#/"===r)&&s===c.baseId)return function(){if(a===c)return i(t,h,a,a.$async);const r=e.scopeValue("root",{ref:c});return i(t,Zu._`${r}.validate`,c,c.$async)}();const f=wl.resolveRef.call(l,c,s,r);if(void 0===f)throw new vl.default(o.opts.uriResolver,s,r);return f instanceof wl.SchemaEnv?function(e){const r=n(t,e);i(t,r,e,e.$async)}(f):function(n){const i=e.scopeValue("schema",!0===u.code.source?{ref:n,code:(0,Zu.stringify)(n)}:{ref:n}),o=e.name("valid"),s=t.subschema({schema:n,dataTypes:[],schemaPath:Zu.nil,topSchemaRef:i,errSchemaPath:r},o);t.mergeEvaluated(s),t.ok(o)}(f)}};function n(t,e){const{gen:r}=t;return e.validate?r.scopeValue("validate",{ref:e.validate}):Zu._`${r.scopeValue("wrapper",{ref:e})}.validate`}function i(t,e,r,n){const{gen:i,it:o}=t,{allErrors:s,schemaEnv:a,opts:h}=o,u=h.passContext?Xu.default.this:Zu.nil;function l(t){const e=Zu._`${t}.errors`;i.assign(Xu.default.vErrors,Zu._`${Xu.default.vErrors} === null ? ${e} : ${Xu.default.vErrors}.concat(${e})`),i.assign(Xu.default.errors,Zu._`${Xu.default.vErrors}.length`)}function c(t){var e;if(!o.opts.unevaluated)return;const n=null===(e=null==r?void 0:r.validate)||void 0===e?void 0:e.evaluated;if(!0!==o.props)if(n&&!n.dynamicProps)void 0!==n.props&&(o.props=Yu.mergeEvaluated.props(i,n.props,o.props));else{const e=i.var("props",Zu._`${t}.evaluated.props`);o.props=Yu.mergeEvaluated.props(i,e,o.props,Zu.Name)}if(!0!==o.items)if(n&&!n.dynamicItems)void 0!==n.items&&(o.items=Yu.mergeEvaluated.items(i,n.items,o.items));else{const e=i.var("items",Zu._`${t}.evaluated.items`);o.items=Yu.mergeEvaluated.items(i,e,o.items,Zu.Name)}}n?function(){if(!a.$async)throw new Error("async schema referenced by sync schema");const r=i.let("valid");i.try((()=>{i.code(Zu._`await ${(0,sl.callValidateCode)(t,e,u)}`),c(e),s||i.assign(r,!0)}),(t=>{i.if(Zu._`!(${t} instanceof ${o.ValidationError})`,(()=>i.throw(t))),l(t),s||i.assign(r,!1)})),t.ok(r)}():t.result((0,sl.callValidateCode)(t,e,u),(()=>c(e)),(()=>l(e)))}e.getValidate=n,e.callRef=i,e.default=r}));var Sl=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",xl.default,Nl.default],Pl=Object.defineProperty({default:Sl},"__esModule",{value:!0});const Il=Zu.operators,Rl={maximum:{okStr:"<=",ok:Il.LTE,fail:Il.GT},minimum:{okStr:">=",ok:Il.GTE,fail:Il.LT},exclusiveMaximum:{okStr:"<",ok:Il.LT,fail:Il.GTE},exclusiveMinimum:{okStr:">",ok:Il.GT,fail:Il.LTE}},Cl={message:({keyword:t,schemaCode:e})=>Zu.str`must be ${Rl[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>Zu._`{comparison: ${Rl[t].okStr}, limit: ${e}}`},Tl={keyword:Object.keys(Rl),type:"number",schemaType:"number",$data:!0,error:Cl,code(t){const{keyword:e,data:r,schemaCode:n}=t;t.fail$data(Zu._`${r} ${Rl[e].fail} ${n} || isNaN(${r})`)}};var Ol=Tl,$l=Object.defineProperty({default:Ol},"__esModule",{value:!0});var Bl={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:t})=>Zu.str`must be multiple of ${t}`,params:({schemaCode:t})=>Zu._`{multipleOf: ${t}}`},code(t){const{gen:e,data:r,schemaCode:n,it:i}=t,o=i.opts.multipleOfPrecision,s=e.let("res"),a=o?Zu._`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:Zu._`${s} !== parseInt(${s})`;t.fail$data(Zu._`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}},Fl=Object.defineProperty({default:Bl},"__esModule",{value:!0});function jl(t){const e=t.length;let r,n=0,i=0;for(;i<e;)n++,r=t.charCodeAt(i++),r>=55296&&r<=56319&&i<e&&(r=t.charCodeAt(i),56320==(64512&r)&&i++);return n}var Dl=jl;jl.code='require("ajv/dist/runtime/ucs2length").default';var Ul=Object.defineProperty({default:Dl},"__esModule",{value:!0});const Ll={message({keyword:t,schemaCode:e}){const r="maxLength"===t?"more":"fewer";return Zu.str`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>Zu._`{limit: ${t}}`},zl={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Ll,code(t){const{keyword:e,data:r,schemaCode:n,it:i}=t,o="maxLength"===e?Zu.operators.GT:Zu.operators.LT,s=!1===i.opts.unicode?Zu._`${r}.length`:Zu._`${(0,Yu.useFunc)(t.gen,Ul.default)}(${r})`;t.fail$data(Zu._`${s} ${o} ${n}`)}};var ql=zl,Vl=Object.defineProperty({default:ql},"__esModule",{value:!0});var Gl={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>Zu.str`must match pattern "${t}"`,params:({schemaCode:t})=>Zu._`{pattern: ${t}}`},code(t){const{data:e,$data:r,schema:n,schemaCode:i,it:o}=t,s=o.opts.unicodeRegExp?"u":"",a=r?Zu._`(new RegExp(${i}, ${s}))`:(0,sl.usePattern)(t,n);t.fail$data(Zu._`!${a}.test(${e})`)}},Hl=Object.defineProperty({default:Gl},"__esModule",{value:!0});const Kl={message({keyword:t,schemaCode:e}){const r="maxProperties"===t?"more":"fewer";return Zu.str`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>Zu._`{limit: ${t}}`},Ql={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Kl,code(t){const{keyword:e,data:r,schemaCode:n}=t,i="maxProperties"===e?Zu.operators.GT:Zu.operators.LT;t.fail$data(Zu._`Object.keys(${r}).length ${i} ${n}`)}};var Jl=Ql,Zl=Object.defineProperty({default:Jl},"__esModule",{value:!0});var Yl={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:t}})=>Zu.str`must have required property '${t}'`,params:({params:{missingProperty:t}})=>Zu._`{missingProperty: ${t}}`},code(t){const{gen:e,schema:r,schemaCode:n,data:i,$data:o,it:s}=t,{opts:a}=s;if(!o&&0===r.length)return;const h=r.length>=a.loopRequired;if(s.allErrors?function(){if(h||o)t.block$data(Zu.nil,u);else for(const e of r)(0,sl.checkReportMissingProp)(t,e)}():function(){const s=e.let("missing");if(h||o){const r=e.let("valid",!0);t.block$data(r,(()=>function(r,o){t.setParams({missingProperty:r}),e.forOf(r,n,(()=>{e.assign(o,(0,sl.propertyInData)(e,i,r,a.ownProperties)),e.if((0,Zu.not)(o),(()=>{t.error(),e.break()}))}),Zu.nil)}(s,r))),t.ok(r)}else e.if((0,sl.checkMissingProp)(t,r,s)),(0,sl.reportMissingProp)(t,s),e.else()}(),a.strictRequired){const e=t.parentSchema.properties,{definedProperties:n}=t.it;for(const t of r)if(void 0===(null==e?void 0:e[t])&&!n.has(t)){const e=`required property "${t}" is not defined at "${s.schemaEnv.baseId+s.errSchemaPath}" (strictRequired)`;(0,Yu.checkStrictMode)(s,e,s.opts.strictRequired)}}function u(){e.forOf("prop",n,(r=>{t.setParams({missingProperty:r}),e.if((0,sl.noPropertyInData)(e,i,r,a.ownProperties),(()=>t.error()))}))}}},Wl=Object.defineProperty({default:Yl},"__esModule",{value:!0});const Xl={message({keyword:t,schemaCode:e}){const r="maxItems"===t?"more":"fewer";return Zu.str`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>Zu._`{limit: ${t}}`},tc={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:Xl,code(t){const{keyword:e,data:r,schemaCode:n}=t,i="maxItems"===e?Zu.operators.GT:Zu.operators.LT;t.fail$data(Zu._`${r}.length ${i} ${n}`)}};var ec=tc,rc=Object.defineProperty({default:ec},"__esModule",{value:!0});ul.code='require("ajv/dist/runtime/equal").default';var nc=ul,ic=Object.defineProperty({default:nc},"__esModule",{value:!0});var oc={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:t,j:e}})=>Zu.str`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>Zu._`{i: ${t}, j: ${e}}`},code(t){const{gen:e,data:r,$data:n,schema:i,parentSchema:o,schemaCode:s,it:a}=t;if(!n&&!i)return;const h=e.let("valid"),u=o.items?(0,il.getSchemaTypes)(o.items):[];function l(n,i){const o=e.name("item"),s=(0,il.checkDataTypes)(u,o,a.opts.strictNumbers,il.DataType.Wrong),l=e.const("indices",Zu._`{}`);e.for(Zu._`;${n}--;`,(()=>{e.let(o,Zu._`${r}[${n}]`),e.if(s,Zu._`continue`),u.length>1&&e.if(Zu._`typeof ${o} == "string"`,Zu._`${o} += "_"`),e.if(Zu._`typeof ${l}[${o}] == "number"`,(()=>{e.assign(i,Zu._`${l}[${o}]`),t.error(),e.assign(h,!1).break()})).code(Zu._`${l}[${o}] = ${n}`)}))}function c(n,i){const o=(0,Yu.useFunc)(e,ic.default),s=e.name("outer");e.label(s).for(Zu._`;${n}--;`,(()=>e.for(Zu._`${i} = ${n}; ${i}--;`,(()=>e.if(Zu._`${o}(${r}[${n}], ${r}[${i}])`,(()=>{t.error(),e.assign(h,!1).break(s)}))))))}t.block$data(h,(function(){const n=e.let("i",Zu._`${r}.length`),i=e.let("j");t.setParams({i:n,j:i}),e.assign(h,!0),e.if(Zu._`${n} > 1`,(()=>(u.length>0&&!u.some((t=>"object"===t||"array"===t))?l:c)(n,i)))}),Zu._`${s} === false`),t.ok(h)}},sc=Object.defineProperty({default:oc},"__esModule",{value:!0});var ac={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:t})=>Zu._`{allowedValue: ${t}}`},code(t){const{gen:e,data:r,$data:n,schemaCode:i,schema:o}=t;n||o&&"object"==typeof o?t.fail$data(Zu._`!${(0,Yu.useFunc)(e,ic.default)}(${r}, ${i})`):t.fail(Zu._`${o} !== ${r}`)}},hc=Object.defineProperty({default:ac},"__esModule",{value:!0});var uc={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:t})=>Zu._`{allowedValues: ${t}}`},code(t){const{gen:e,data:r,$data:n,schema:i,schemaCode:o,it:s}=t;if(!n&&0===i.length)throw new Error("enum must have non-empty array");const a=i.length>=s.opts.loopEnum;let h;const u=()=>null!=h?h:h=(0,Yu.useFunc)(e,ic.default);let l;if(a||n)l=e.let("valid"),t.block$data(l,(function(){e.assign(l,!1),e.forOf("v",o,(t=>e.if(Zu._`${u()}(${r}, ${t})`,(()=>e.assign(l,!0).break()))))}));else{if(!Array.isArray(i))throw new Error("ajv implementation error");const t=e.const("vSchema",o);l=(0,Zu.or)(...i.map(((e,n)=>function(t,e){const n=i[e];return"object"==typeof n&&null!==n?Zu._`${u()}(${r}, ${t}[${e}])`:Zu._`${r} === ${n}`}(t,n))))}t.pass(l)}},lc=Object.defineProperty({default:uc},"__esModule",{value:!0});var cc=[$l.default,Fl.default,Vl.default,Hl.default,Zl.default,Wl.default,rc.default,sc.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},hc.default,lc.default],fc=Object.defineProperty({default:cc},"__esModule",{value:!0}),dc=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;const r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:t}})=>Zu.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>Zu._`{limit: ${t}}`},code(t){const{parentSchema:e,it:r}=t,{items:i}=e;Array.isArray(i)?n(t,i):(0,Yu.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function n(t,e){const{gen:r,schema:n,data:i,keyword:o,it:s}=t;s.items=!0;const a=r.const("len",Zu._`${i}.length`);if(!1===n)t.setParams({len:e.length}),t.pass(Zu._`${a} <= ${e.length}`);else if("object"==typeof n&&!(0,Yu.alwaysValidSchema)(s,n)){const n=r.var("valid",Zu._`${a} <= ${e.length}`);r.if((0,Zu.not)(n),(()=>function(n){r.forRange("i",e.length,a,(e=>{t.subschema({keyword:o,dataProp:e,dataPropType:Yu.Type.Num},n),s.allErrors||r.if((0,Zu.not)(n),(()=>r.break()))}))}(n))),t.ok(n)}}e.validateAdditionalItems=n,e.default=r})),mc=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;const r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(t){const{schema:e,it:r}=t;if(Array.isArray(e))return n(t,"additionalItems",e);r.items=!0,(0,Yu.alwaysValidSchema)(r,e)||t.ok((0,sl.validateArray)(t))}};function n(t,e,r=t.schema){const{gen:n,parentSchema:i,data:o,keyword:s,it:a}=t;!function(t){const{opts:n,errSchemaPath:i}=a,o=r.length,h=o===t.minItems&&(o===t.maxItems||!1===t[e]);if(n.strictTuples&&!h){const t=`"${s}" is ${o}-tuple, but minItems or maxItems/${e} are not specified or different at path "${i}"`;(0,Yu.checkStrictMode)(a,t,n.strictTuples)}}(i),a.opts.unevaluated&&r.length&&!0!==a.items&&(a.items=Yu.mergeEvaluated.items(n,r.length,a.items));const h=n.name("valid"),u=n.const("len",Zu._`${o}.length`);r.forEach(((e,r)=>{(0,Yu.alwaysValidSchema)(a,e)||(n.if(Zu._`${u} > ${r}`,(()=>t.subschema({keyword:s,schemaProp:r,dataProp:r},h))),t.ok(h))}))}e.validateTuple=n,e.default=r}));var pc={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,mc.validateTuple)(t,"items")},gc=Object.defineProperty({default:pc},"__esModule",{value:!0});const yc={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:t}})=>Zu.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>Zu._`{limit: ${t}}`},code(t){const{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,(0,Yu.alwaysValidSchema)(n,e)||(i?(0,dc.validateAdditionalItems)(t,i):t.ok((0,sl.validateArray)(t)))}};var vc=yc,wc=Object.defineProperty({default:vc},"__esModule",{value:!0});var bc={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:t,max:e}})=>void 0===e?Zu.str`must contain at least ${t} valid item(s)`:Zu.str`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>void 0===e?Zu._`{minContains: ${t}}`:Zu._`{minContains: ${t}, maxContains: ${e}}`},code(t){const{gen:e,schema:r,parentSchema:n,data:i,it:o}=t;let s,a;const{minContains:h,maxContains:u}=n;o.opts.next?(s=void 0===h?1:h,a=u):s=1;const l=e.const("len",Zu._`${i}.length`);if(t.setParams({min:s,max:a}),void 0===a&&0===s)return void(0,Yu.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==a&&s>a)return(0,Yu.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),void t.fail();if((0,Yu.alwaysValidSchema)(o,r)){let e=Zu._`${l} >= ${s}`;return void 0!==a&&(e=Zu._`${e} && ${l} <= ${a}`),void t.pass(e)}o.items=!0;const c=e.name("valid");function f(){const t=e.name("_valid"),r=e.let("count",0);d(t,(()=>e.if(t,(()=>function(t){e.code(Zu._`${t}++`),void 0===a?e.if(Zu._`${t} >= ${s}`,(()=>e.assign(c,!0).break())):(e.if(Zu._`${t} > ${a}`,(()=>e.assign(c,!1).break())),1===s?e.assign(c,!0):e.if(Zu._`${t} >= ${s}`,(()=>e.assign(c,!0))))}(r)))))}function d(r,n){e.forRange("i",0,l,(e=>{t.subschema({keyword:"contains",dataProp:e,dataPropType:Yu.Type.Num,compositeRule:!0},r),n()}))}void 0===a&&1===s?d(c,(()=>e.if(c,(()=>e.break())))):0===s?(e.let(c,!0),void 0!==a&&e.if(Zu._`${i}.length > 0`,f)):(e.let(c,!1),f()),t.result(c,(()=>t.reset()))}},Ec=Object.defineProperty({default:bc},"__esModule",{value:!0}),_c=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0,e.error={message:({params:{property:t,depsCount:e,deps:r}})=>{const n=1===e?"property":"properties";return Zu.str`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>Zu._`{property: ${t},
19
19
  missingProperty: ${n},
20
20
  depsCount: ${e},
21
- deps: ${r}}`};const r={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(t){const[e,r]=function({schema:t}){const e={},r={};for(const n in t){if("__proto__"===n)continue;(Array.isArray(t[n])?e:r)[n]=t[n]}return[e,r]}(t);n(t,e),i(t,r)}};function n(t,e=t.schema){const{gen:r,data:n,it:i}=t;if(0===Object.keys(e).length)return;const o=r.let("missing");for(const s in e){const a=e[s];if(0===a.length)continue;const h=(0,sl.propertyInData)(r,n,s,i.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(h,(()=>{for(const e of a)(0,sl.checkReportMissingProp)(t,e)})):(r.if(Zu._`${h} && (${(0,sl.checkMissingProp)(t,a,o)})`),(0,sl.reportMissingProp)(t,o),r.else())}}function i(t,e=t.schema){const{gen:r,data:n,keyword:i,it:o}=t,s=r.name("valid");for(const a in e)(0,Yu.alwaysValidSchema)(o,e[a])||(r.if((0,sl.propertyInData)(r,n,a,o.opts.ownProperties),(()=>{const e=t.subschema({keyword:i,schemaProp:a},s);t.mergeValidEvaluated(e,s)}),(()=>r.var(s,!0))),t.ok(s))}e.validatePropertyDeps=n,e.validateSchemaDeps=i,e.default=r}));const Ac={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:t})=>Zu._`{propertyName: ${t.propertyName}}`},code(t){const{gen:e,schema:r,data:n,it:i}=t;if((0,Yu.alwaysValidSchema)(i,r))return;const o=e.name("valid");e.forIn("key",n,(r=>{t.setParams({propertyName:r}),t.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},o),e.if((0,Zu.not)(o),(()=>{t.error(!0),i.allErrors||e.break()}))})),t.ok(o)}};var Mc=Ac,kc=Object.defineProperty({default:Mc},"__esModule",{value:!0});const xc={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:t})=>Zu._`{additionalProperty: ${t.additionalProperty}}`},code(t){const{gen:e,schema:r,parentSchema:n,data:i,errsCount:o,it:s}=t;if(!o)throw new Error("ajv implementation error");const{allErrors:a,opts:h}=s;if(s.props=!0,"all"!==h.removeAdditional&&(0,Yu.alwaysValidSchema)(s,r))return;const u=(0,sl.allSchemaProperties)(n.properties),l=(0,sl.allSchemaProperties)(n.patternProperties);function c(t){e.code(Zu._`delete ${i}[${t}]`)}function f(n){if("all"===h.removeAdditional||h.removeAdditional&&!1===r)c(n);else{if(!1===r)return t.setParams({additionalProperty:n}),t.error(),void(a||e.break());if("object"==typeof r&&!(0,Yu.alwaysValidSchema)(s,r)){const r=e.name("valid");"failing"===h.removeAdditional?(d(n,r,!1),e.if((0,Zu.not)(r),(()=>{t.reset(),c(n)}))):(d(n,r),a||e.if((0,Zu.not)(r),(()=>e.break())))}}}function d(e,r,n){const i={keyword:"additionalProperties",dataProp:e,dataPropType:Yu.Type.Str};!1===n&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(i,r)}e.forIn("key",i,(r=>{u.length||l.length?e.if(function(r){let i;if(u.length>8){const t=(0,Yu.schemaRefOrVal)(s,n.properties,"properties");i=(0,sl.isOwnProperty)(e,t,r)}else i=u.length?(0,Zu.or)(...u.map((t=>Zu._`${r} === ${t}`))):Zu.nil;return l.length&&(i=(0,Zu.or)(i,...l.map((e=>Zu._`${(0,sl.usePattern)(t,e)}.test(${r})`)))),(0,Zu.not)(i)}(r),(()=>f(r))):f(r)})),t.ok(Zu._`${o} === ${Xu.default.errors}`)}};var Nc=xc,Sc=Object.defineProperty({default:Nc},"__esModule",{value:!0});const Pc={keyword:"properties",type:"object",schemaType:"object",code(t){const{gen:e,schema:r,parentSchema:n,data:i,it:o}=t;"all"===o.opts.removeAdditional&&void 0===n.additionalProperties&&Sc.default.code(new fl.KeywordCxt(o,Sc.default,"additionalProperties"));const s=(0,sl.allSchemaProperties)(r);for(const t of s)o.definedProperties.add(t);o.opts.unevaluated&&s.length&&!0!==o.props&&(o.props=Yu.mergeEvaluated.props(e,(0,Yu.toHash)(s),o.props));const a=s.filter((t=>!(0,Yu.alwaysValidSchema)(o,r[t])));if(0===a.length)return;const h=e.name("valid");for(const r of a)u(r)?l(r):(e.if((0,sl.propertyInData)(e,i,r,o.opts.ownProperties)),l(r),o.allErrors||e.else().var(h,!0),e.endIf()),t.it.definedProperties.add(r),t.ok(h);function u(t){return o.opts.useDefaults&&!o.compositeRule&&void 0!==r[t].default}function l(e){t.subschema({keyword:"properties",schemaProp:e,dataProp:e},h)}}};var Ic=Pc,Rc=Object.defineProperty({default:Ic},"__esModule",{value:!0});const Cc=Yu,Tc={keyword:"patternProperties",type:"object",schemaType:"object",code(t){const{gen:e,schema:r,data:n,parentSchema:i,it:o}=t,{opts:s}=o,a=(0,sl.allSchemaProperties)(r),h=a.filter((t=>(0,Yu.alwaysValidSchema)(o,r[t])));if(0===a.length||h.length===a.length&&(!o.opts.unevaluated||!0===o.props))return;const u=s.strictSchema&&!s.allowMatchingProperties&&i.properties,l=e.name("valid");!0===o.props||o.props instanceof Zu.Name||(o.props=(0,Cc.evaluatedPropsToName)(e,o.props));const{props:c}=o;function f(t){for(const e in u)new RegExp(t).test(e)&&(0,Yu.checkStrictMode)(o,`property ${e} matches pattern ${t} (use allowMatchingProperties)`)}function d(r){e.forIn("key",n,(n=>{e.if(Zu._`${(0,sl.usePattern)(t,r)}.test(${n})`,(()=>{const i=h.includes(r);i||t.subschema({keyword:"patternProperties",schemaProp:r,dataProp:n,dataPropType:Cc.Type.Str},l),o.opts.unevaluated&&!0!==c?e.assign(Zu._`${c}[${n}]`,!0):i||o.allErrors||e.if((0,Zu.not)(l),(()=>e.break()))}))}))}!function(){for(const t of a)u&&f(t),o.allErrors?d(t):(e.var(l,!0),d(t),e.if(l))}()}};var Oc=Tc,$c=Object.defineProperty({default:Oc},"__esModule",{value:!0});var Bc={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){const{gen:e,schema:r,it:n}=t;if((0,Yu.alwaysValidSchema)(n,r))return void t.fail();const i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,(()=>t.reset()),(()=>t.error()))},error:{message:"must NOT be valid"}},Fc=Object.defineProperty({default:Bc},"__esModule",{value:!0});var jc={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:sl.validateUnion,error:{message:"must match a schema in anyOf"}},Dc=Object.defineProperty({default:jc},"__esModule",{value:!0});var Uc={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:t})=>Zu._`{passingSchemas: ${t.passing}}`},code(t){const{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;const o=r,s=e.let("valid",!1),a=e.let("passing",null),h=e.name("_valid");t.setParams({passing:a}),e.block((function(){o.forEach(((r,n)=>{let o;(0,Yu.alwaysValidSchema)(i,r)?e.var(h,!0):o=t.subschema({keyword:"oneOf",schemaProp:n,compositeRule:!0},h),n>0&&e.if(Zu._`${h} && ${s}`).assign(s,!1).assign(a,Zu._`[${a}, ${n}]`).else(),e.if(h,(()=>{e.assign(s,!0),e.assign(a,n),o&&t.mergeEvaluated(o,Zu.Name)}))}))})),t.result(s,(()=>t.reset()),(()=>t.error(!0)))}},Lc=Object.defineProperty({default:Uc},"__esModule",{value:!0});var zc={keyword:"allOf",schemaType:"array",code(t){const{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");const i=e.name("valid");r.forEach(((e,r)=>{if((0,Yu.alwaysValidSchema)(n,e))return;const o=t.subschema({keyword:"allOf",schemaProp:r},i);t.ok(i),t.mergeEvaluated(o)}))}},qc=Object.defineProperty({default:zc},"__esModule",{value:!0});const Vc={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:t})=>Zu.str`must match "${t.ifClause}" schema`,params:({params:t})=>Zu._`{failingKeyword: ${t.ifClause}}`},code(t){const{gen:e,parentSchema:r,it:n}=t;void 0===r.then&&void 0===r.else&&(0,Yu.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const i=Gc(n,"then"),o=Gc(n,"else");if(!i&&!o)return;const s=e.let("valid",!0),a=e.name("_valid");if(function(){const e=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(e)}(),t.reset(),i&&o){const r=e.let("ifClause");t.setParams({ifClause:r}),e.if(a,h("then",r),h("else",r))}else i?e.if(a,h("then")):e.if((0,Zu.not)(a),h("else"));function h(r,n){return()=>{const i=t.subschema({keyword:r},a);e.assign(s,a),t.mergeValidEvaluated(i,s),n?e.assign(n,Zu._`${r}`):t.setParams({ifClause:r})}}t.pass(s,(()=>t.error(!0)))}};function Gc(t,e){const r=t.schema[e];return void 0!==r&&!(0,Yu.alwaysValidSchema)(t,r)}var Hc=Vc,Kc=Object.defineProperty({default:Hc},"__esModule",{value:!0});const Qc={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){void 0===e.if&&(0,Yu.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};var Jc=Qc,Zc=Object.defineProperty({default:Jc},"__esModule",{value:!0});var Yc=function(t=!1){const e=[Fc.default,Dc.default,Lc.default,qc.default,Kc.default,Zc.default,kc.default,Sc.default,_c.default,Rc.default,$c.default];return t?e.push(gc.default,wc.default):e.push(dc.default,mc.default),e.push(Ec.default),e},Wc=Object.defineProperty({default:Yc},"__esModule",{value:!0});const Xc={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>Zu.str`must match format "${t}"`,params:({schemaCode:t})=>Zu._`{format: ${t}}`},code(t,e){const{gen:r,data:n,$data:i,schema:o,schemaCode:s,it:a}=t,{opts:h,errSchemaPath:u,schemaEnv:l,self:c}=a;h.validateFormats&&(i?function(){const i=r.scopeValue("formats",{ref:c.formats,code:h.code.formats}),o=r.const("fDef",Zu._`${i}[${s}]`),a=r.let("fType"),u=r.let("format");r.if(Zu._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>r.assign(a,Zu._`${o}.type || "string"`).assign(u,Zu._`${o}.validate`)),(()=>r.assign(a,Zu._`"string"`).assign(u,o))),t.fail$data((0,Zu.or)(!1===h.strictSchema?Zu.nil:Zu._`${s} && !${u}`,function(){const t=l.$async?Zu._`(${o}.async ? await ${u}(${n}) : ${u}(${n}))`:Zu._`${u}(${n})`,r=Zu._`(typeof ${u} == "function" ? ${t} : ${u}.test(${n}))`;return Zu._`${u} && ${u} !== true && ${a} === ${e} && !${r}`}()))}():function(){const i=c.formats[o];if(!i)return void function(){if(!1===h.strictSchema)return void c.logger.warn(t());throw new Error(t());function t(){return`unknown format "${o}" ignored in schema at path "${u}"`}}();if(!0===i)return;const[s,a,f]=function(t){const e=t instanceof RegExp?(0,Zu.regexpCode)(t):h.code.formats?Zu._`${h.code.formats}${(0,Zu.getProperty)(o)}`:void 0,n=r.scopeValue("formats",{key:o,ref:t,code:e});if("object"==typeof t&&!(t instanceof RegExp))return[t.type||"string",t.validate,Zu._`${n}.validate`];return["string",t,n]}(i);s===e&&t.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!l.$async)throw new Error("async format in sync schema");return Zu._`await ${f}(${n})`}return"function"==typeof a?Zu._`${f}(${n})`:Zu._`${f}.test(${n})`}())}())}};var tf=Xc;var ef=[Object.defineProperty({default:tf},"__esModule",{value:!0}).default],rf=Object.defineProperty({default:ef},"__esModule",{value:!0}),nf=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}));var of=[Pl.default,fc.default,(0,Wc.default)(),rf.default,nf.metadataVocabulary,nf.contentVocabulary],sf=Object.defineProperty({default:of},"__esModule",{value:!0}),af=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(e.DiscrError||(e.DiscrError={}))}));const hf={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:t,tagName:e}})=>t===af.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>Zu._`{error: ${t}, tag: ${r}, tagValue: ${e}}`},code(t){const{gen:e,data:r,schema:n,parentSchema:i,it:o}=t,{oneOf:s}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const a=n.propertyName;if("string"!=typeof a)throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");const h=e.let("valid",!1),u=e.const("tag",Zu._`${r}${(0,Zu.getProperty)(a)}`);function l(r){const n=e.name("valid"),i=t.subschema({keyword:"oneOf",schemaProp:r},n);return t.mergeEvaluated(i,Zu.Name),n}e.if(Zu._`typeof ${u} == "string"`,(()=>function(){const r=function(){var t;const e={},r=h(i);let n=!0;for(let e=0;e<s.length;e++){let i=s[e];(null==i?void 0:i.$ref)&&!(0,Yu.schemaHasRulesButRef)(i,o.self.RULES)&&(i=wl.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,null==i?void 0:i.$ref),i instanceof wl.SchemaEnv&&(i=i.schema));const l=null===(t=null==i?void 0:i.properties)||void 0===t?void 0:t[a];if("object"!=typeof l)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);n=n&&(r||h(i)),u(l,e)}if(!n)throw new Error(`discriminator: "${a}" must be required`);return e;function h({required:t}){return Array.isArray(t)&&t.includes(a)}function u(t,e){if(t.const)l(t.const,e);else{if(!t.enum)throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`);for(const r of t.enum)l(r,e)}}function l(t,r){if("string"!=typeof t||t in e)throw new Error(`discriminator: "${a}" values must be unique strings`);e[t]=r}}();e.if(!1);for(const t in r)e.elseIf(Zu._`${u} === ${t}`),e.assign(h,l(r[t]));e.else(),t.error(!1,{discrError:af.DiscrError.Mapping,tag:u,tagName:a}),e.endIf()}()),(()=>t.error(!1,{discrError:af.DiscrError.Tag,tag:u,tagName:a}))),t.ok(h)}};var uf=hf,lf=Object.defineProperty({default:uf},"__esModule",{value:!0}),cf={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0},ff=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;const r=["/properties"],n="http://json-schema.org/draft-07/schema";class i extends Ml.default{_addVocabularies(){super._addVocabularies(),sf.default.forEach((t=>this.addVocabulary(t))),this.opts.discriminator&&this.addKeyword(lf.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const t=this.opts.$data?this.$dataMetaSchema(cf,r):cf;this.addMetaSchema(t,n,!1),this.refs["http://json-schema.org/schema"]=n}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(n)?n:void 0)}}t.exports=e=i,Object.defineProperty(e,"__esModule",{value:!0}),e.default=i,Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return fl.KeywordCxt}}),Object.defineProperty(e,"_",{enumerable:!0,get:function(){return Zu._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return Zu.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return Zu.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return Zu.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return Zu.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return Zu.CodeGen}})})),df=n(ff),mf=o((function(t,e){function r(t,e){return{validate:t,compare:e}}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0,e.fullFormats={date:r(o,s),time:r(h,u),"date-time":r((function(t){const e=t.split(l);return 2===e.length&&o(e[0])&&h(e[1],!0)}),c),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(t){return f.test(t)&&d.test(t)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(t){if(g.test(t))return!1;try{return new RegExp(t),!0}catch(t){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(t){return m.lastIndex=0,m.test(t)},int32:{type:"number",validate:function(t){return Number.isInteger(t)&&t<=2147483647&&t>=-2147483648}},int64:{type:"number",validate:function(t){return Number.isInteger(t)}},float:{type:"number",validate:p},double:{type:"number",validate:p},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:r(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,s),time:r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"date-time":r(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,c),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(t){const e=n.exec(t);if(!e)return!1;const r=+e[1],o=+e[2],s=+e[3];return o>=1&&o<=12&&s>=1&&s<=(2===o&&function(t){return t%4==0&&(t%100!=0||t%400==0)}(r)?29:i[o])}function s(t,e){if(t&&e)return t>e?1:t<e?-1:0}const a=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function h(t,e){const r=a.exec(t);if(!r)return!1;const n=+r[1],i=+r[2],o=+r[3],s=r[5];return(n<=23&&i<=59&&o<=59||23===n&&59===i&&60===o)&&(!e||""!==s)}function u(t,e){if(!t||!e)return;const r=a.exec(t),n=a.exec(e);return r&&n?(t=r[1]+r[2]+r[3]+(r[4]||""))>(e=n[1]+n[2]+n[3]+(n[4]||""))?1:t<e?-1:0:void 0}const l=/t|\s/i;function c(t,e){if(!t||!e)return;const[r,n]=t.split(l),[i,o]=e.split(l),a=s(r,i);return void 0!==a?a||u(n,o):void 0}const f=/\/|:/,d=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;const m=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function p(){return!0}const g=/[^\\]\\Z/})),pf=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const r=Zu.operators,n={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},i={message:({keyword:t,schemaCode:e})=>Zu.str`should be ${n[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>Zu._`{comparison: ${n[t].okStr}, limit: ${e}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:i,code(t){const{gen:e,data:r,schemaCode:i,keyword:o,it:s}=t,{opts:a,self:h}=s;if(!a.validateFormats)return;const u=new ff.KeywordCxt(s,h.RULES.all.format.definition,"format");function l(t){return Zu._`${t}.compare(${r}, ${i}) ${n[o].fail} 0`}u.$data?function(){const r=e.scopeValue("formats",{ref:h.formats,code:a.code.formats}),n=e.const("fmt",Zu._`${r}[${u.schemaCode}]`);t.fail$data(Zu.or(Zu._`typeof ${n} != "object"`,Zu._`${n} instanceof RegExp`,Zu._`typeof ${n}.compare != "function"`,l(n)))}():function(){const r=u.schema,n=h.formats[r];if(!n||!0===n)return;if("object"!=typeof n||n instanceof RegExp||"function"!=typeof n.compare)throw new Error(`"${o}": format "${r}" does not define "compare" function`);const i=e.scopeValue("formats",{key:r,ref:n,code:a.code.formats?Zu._`${a.code.formats}${Zu.getProperty(r)}`:void 0});t.fail$data(l(i))}()},dependencies:["format"]};e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)})),gf=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r=new Zu.Name("fullFormats"),n=new Zu.Name("fastFormats"),i=(t,e={keywords:!0})=>{if(Array.isArray(e))return o(t,e,mf.fullFormats,r),t;const[i,s]="fast"===e.mode?[mf.fastFormats,n]:[mf.fullFormats,r];return o(t,e.formats||mf.formatNames,i,s),e.keywords&&pf.default(t),t};function o(t,e,r,n){var i,o;null!==(i=(o=t.opts.code).formats)&&void 0!==i||(o.formats=Zu._`require("ajv-formats/dist/formats").${n}`);for(const n of e)t.addFormat(n,r[n])}i.get=(t,e="full")=>{const r=("fast"===e?mf.fastFormats:mf.fullFormats)[t];if(!r)throw new Error(`Unknown format "${t}"`);return r},t.exports=e=i,Object.defineProperty(e,"__esModule",{value:!0}),e.default=i})),yf=n(gf),vf=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r="errorMessage",n=new ff.Name("emUsed"),i={required:"missingProperty",dependencies:"property",dependentRequired:"property"},o=/\$\{[^}]+\}/,s=/\$\{([^}]+)\}/g,a=/^""\s*\+\s*|\s*\+\s*""$/g;function h(t){return{keyword:r,schemaType:["string","object"],post:!0,code(e){const{gen:h,data:u,schema:l,schemaValue:c,it:f}=e;if(!1===f.createErrors)return;const d=l,m=Zu.strConcat(Xu.default.instancePath,f.errorPath);function p(t,e){return Zu.and(ff._`${t}.keyword !== ${r}`,ff._`!${t}.${n}`,ff._`${t}.instancePath === ${m}`,ff._`${t}.keyword in ${e}`,ff._`${t}.schemaPath.indexOf(${f.errSchemaPath}) === 0`,ff._`/^\\/[^\\/]*$/.test(${t}.schemaPath.slice(${f.errSchemaPath.length}))`)}function g(t,e){const r=[];for(const n in t){const t=e[n];o.test(t)&&r.push([n,v(t)])}return h.object(...r)}function y(t){return o.test(t)?new Qu._Code(Qu.safeStringify(t).replace(s,((t,e)=>`" + JSON.stringify(${fl.getData(e,f)}) + "`)).replace(a,"")):ff.stringify(t)}function v(t){return ff._`function(){return ${y(t)}}`}h.if(ff._`${Xu.default.errors} > 0`,(()=>{if("object"==typeof d){const[o,s]=function(t){let e,r;for(const n in t){if("properties"===n||"items"===n)continue;const i=t[n];if("object"==typeof i){e||(e={});const t=e[n]={};for(const e in i)t[e]=[]}else r||(r={}),r[n]=[]}return[e,r]}(d);s&&function(r){const i=h.const("emErrors",ff.stringify(r)),o=h.const("templates",g(r,l));h.forOf("err",Xu.default.vErrors,(t=>h.if(p(t,i),(()=>h.code(ff._`${i}[${t}.keyword].push(${t})`).assign(ff._`${t}.${n}`,!0)))));const{singleError:s}=t;if(s){const t=h.let("message",ff._`""`),r=h.let("paramsErrors",ff._`[]`);a((e=>{h.if(t,(()=>h.code(ff._`${t} += ${"string"==typeof s?s:";"}`))),h.code(ff._`${t} += ${u(e)}`),h.assign(r,ff._`${r}.concat(${i}[${e}])`)})),tl.reportError(e,{message:t,params:ff._`{errors: ${r}}`})}else a((t=>tl.reportError(e,{message:u(t),params:ff._`{errors: ${i}[${t}]}`})));function a(t){h.forIn("key",i,(e=>h.if(ff._`${i}[${e}].length`,(()=>t(e)))))}function u(t){return ff._`${t} in ${o} ? ${o}[${t}]() : ${c}[${t}]`}}(s),o&&function(t){const r=h.const("emErrors",ff.stringify(t)),o=[];for(const e in t)o.push([e,g(t[e],l[e])]);const s=h.const("templates",h.object(...o)),a=h.scopeValue("obj",{ref:i,code:ff.stringify(i)}),u=h.let("emPropParams"),f=h.let("emParamsErrors");h.forOf("err",Xu.default.vErrors,(t=>h.if(p(t,r),(()=>{h.assign(u,ff._`${a}[${t}.keyword]`),h.assign(f,ff._`${r}[${t}.keyword][${t}.params[${u}]]`),h.if(f,(()=>h.code(ff._`${f}.push(${t})`).assign(ff._`${t}.${n}`,!0)))})))),h.forIn("key",r,(t=>h.forIn("keyProp",ff._`${r}[${t}]`,(n=>{h.assign(f,ff._`${r}[${t}][${n}]`),h.if(ff._`${f}.length`,(()=>{const r=h.const("tmpl",ff._`${s}[${t}] && ${s}[${t}][${n}]`);tl.reportError(e,{message:ff._`${r} ? ${r}() : ${c}[${t}][${n}]`,params:ff._`{errors: ${f}}`})}))}))))}(o),function(t){const{props:i,items:o}=t;if(!i&&!o)return;const s=ff._`typeof ${u} == "object"`,a=ff._`Array.isArray(${u})`,f=h.let("emErrors");let d,p;const y=h.let("templates");i&&o?(d=h.let("emChildKwd"),h.if(s),h.if(a,(()=>{v(o,l.items),h.assign(d,ff.str`items`)}),(()=>{v(i,l.properties),h.assign(d,ff.str`properties`)})),p=ff._`[${d}]`):o?(h.if(a),v(o,l.items),p=ff._`.items`):i&&(h.if(Zu.and(s,Zu.not(a))),v(i,l.properties),p=ff._`.properties`);function v(t,e){h.assign(f,ff.stringify(t)),h.assign(y,g(t,e))}h.forOf("err",Xu.default.vErrors,(t=>function(t,e,i){h.if(Zu.and(ff._`${t}.keyword !== ${r}`,ff._`!${t}.${n}`,ff._`${t}.instancePath.indexOf(${m}) === 0`),(()=>{const r=h.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:ff._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),n=h.const("emMatches",ff._`${r}.exec(${t}.instancePath.slice(${m}.length))`),o=h.const("emChild",ff._`${n} && ${n}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);h.if(ff._`${o} !== undefined && ${o} in ${e}`,(()=>i(o)))}))}(t,f,(e=>h.code(ff._`${f}[${e}].push(${t})`).assign(ff._`${t}.${n}`,!0))))),h.forIn("key",f,(t=>h.if(ff._`${f}[${t}].length`,(()=>{tl.reportError(e,{message:ff._`${t} in ${y} ? ${y}[${t}]() : ${c}${p}[${t}]`,params:ff._`{errors: ${f}[${t}]}`}),h.assign(ff._`${Xu.default.vErrors}[${Xu.default.errors}-1].instancePath`,ff._`${m} + "/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`)})))),h.endIf()}(function({properties:t,items:e}){const r={};if(t){r.props={};for(const e in t)r.props[e]=[]}if(e){r.items={};for(let t=0;t<e.length;t++)r.items[t]=[]}return r}(d))}const o="string"==typeof d?d:d._;o&&function(t){const i=h.const("emErrs",ff._`[]`);h.forOf("err",Xu.default.vErrors,(t=>h.if(function(t){return Zu.and(ff._`${t}.keyword !== ${r}`,ff._`!${t}.${n}`,Zu.or(ff._`${t}.instancePath === ${m}`,Zu.and(ff._`${t}.instancePath.indexOf(${m}) === 0`,ff._`${t}.instancePath[${m}.length] === "/"`)),ff._`${t}.schemaPath.indexOf(${f.errSchemaPath}) === 0`,ff._`${t}.schemaPath[${f.errSchemaPath}.length] === "/"`)}(t),(()=>h.code(ff._`${i}.push(${t})`).assign(ff._`${t}.${n}`,!0))))),h.if(ff._`${i}.length`,(()=>tl.reportError(e,{message:y(t),params:ff._`{errors: ${i}}`})))}(o),t.keepErrors||function(){const t=h.const("emErrs",ff._`[]`);h.forOf("err",Xu.default.vErrors,(e=>h.if(ff._`!${e}.${n}`,(()=>h.code(ff._`${t}.push(${e})`))))),h.assign(Xu.default.vErrors,t).assign(Xu.default.errors,ff._`${t}.length`)}()}))},metaSchema:{anyOf:[{type:"string"},{type:"object",properties:{properties:{$ref:"#/$defs/stringMap"},items:{$ref:"#/$defs/stringList"},required:{$ref:"#/$defs/stringOrMap"},dependencies:{$ref:"#/$defs/stringOrMap"}},additionalProperties:{type:"string"}}],$defs:{stringMap:{type:"object",additionalProperties:{type:"string"}},stringOrMap:{anyOf:[{type:"string"},{$ref:"#/$defs/stringMap"}]},stringList:{type:"array",items:{type:"string"}}}}}}const u=(t,e={})=>{if(!t.opts.allErrors)throw new Error("ajv-errors: Ajv option allErrors must be true");if(t.opts.jsPropertySyntax)throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");return t.addKeyword(h(e))};e.default=u,t.exports=u,t.exports.default=u})),wf=n(vf),bf="__lodash_hash_undefined__",Ef="[object Function]",_f="[object GeneratorFunction]",Af=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mf=/^\w*$/,kf=/^\./,xf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Nf=/\\(\\)?/g,Sf=/^\[object .+?Constructor\]$/,Pf=/^(?:0|[1-9]\d*)$/,If="object"==typeof r&&r&&r.Object===Object&&r,Rf="object"==typeof self&&self&&self.Object===Object&&self,Cf=If||Rf||Function("return this")();var Tf,Of=Array.prototype,$f=Function.prototype,Bf=Object.prototype,Ff=Cf["__core-js_shared__"],jf=(Tf=/[^.]+$/.exec(Ff&&Ff.keys&&Ff.keys.IE_PROTO||""))?"Symbol(src)_1."+Tf:"",Df=$f.toString,Uf=Bf.hasOwnProperty,Lf=Bf.toString,zf=RegExp("^"+Df.call(Uf).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qf=Cf.Symbol,Vf=Of.splice,Gf=nd(Cf,"Map"),Hf=nd(Object,"create"),Kf=qf?qf.prototype:void 0,Qf=Kf?Kf.toString:void 0;function Jf(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Zf(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Yf(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Wf(t,e,r){var n=t[e];Uf.call(t,e)&&hd(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function Xf(t,e){for(var r=t.length;r--;)if(hd(t[r][0],e))return r;return-1}function td(t){if(!ld(t)||(e=t,jf&&jf in e))return!1;var e,r=function(t){var e=ld(t)?Lf.call(t):"";return e==Ef||e==_f}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?zf:Sf;return r.test(function(t){if(null!=t){try{return Df.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function ed(t,e,r,n){if(!ld(t))return t;e=function(t,e){if(ud(t))return!1;var r=typeof t;if("number"==r||"symbol"==r||"boolean"==r||null==t||cd(t))return!0;return Mf.test(t)||!Af.test(t)||null!=e&&t in Object(e)}(e,t)?[e]:function(t){return ud(t)?t:od(t)}(e);for(var i=-1,o=e.length,s=o-1,a=t;null!=a&&++i<o;){var h=sd(e[i]),u=r;if(i!=s){var l=a[h];void 0===(u=n?n(l,h,a):void 0)&&(u=ld(l)?l:id(e[i+1])?[]:{})}Wf(a,h,u),a=a[h]}return t}function rd(t,e){var r=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?r["string"==typeof e?"string":"hash"]:r.map}function nd(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return td(r)?r:void 0}function id(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||Pf.test(t))&&t>-1&&t%1==0&&t<e}Jf.prototype.clear=function(){this.__data__=Hf?Hf(null):{}},Jf.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Jf.prototype.get=function(t){var e=this.__data__;if(Hf){var r=e[t];return r===bf?void 0:r}return Uf.call(e,t)?e[t]:void 0},Jf.prototype.has=function(t){var e=this.__data__;return Hf?void 0!==e[t]:Uf.call(e,t)},Jf.prototype.set=function(t,e){return this.__data__[t]=Hf&&void 0===e?bf:e,this},Zf.prototype.clear=function(){this.__data__=[]},Zf.prototype.delete=function(t){var e=this.__data__,r=Xf(e,t);return!(r<0)&&(r==e.length-1?e.pop():Vf.call(e,r,1),!0)},Zf.prototype.get=function(t){var e=this.__data__,r=Xf(e,t);return r<0?void 0:e[r][1]},Zf.prototype.has=function(t){return Xf(this.__data__,t)>-1},Zf.prototype.set=function(t,e){var r=this.__data__,n=Xf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Yf.prototype.clear=function(){this.__data__={hash:new Jf,map:new(Gf||Zf),string:new Jf}},Yf.prototype.delete=function(t){return rd(this,t).delete(t)},Yf.prototype.get=function(t){return rd(this,t).get(t)},Yf.prototype.has=function(t){return rd(this,t).has(t)},Yf.prototype.set=function(t,e){return rd(this,t).set(t,e),this};var od=ad((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(cd(t))return Qf?Qf.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return kf.test(t)&&r.push(""),t.replace(xf,(function(t,e,n,i){r.push(n?i.replace(Nf,"$1"):e||t)})),r}));function sd(t){if("string"==typeof t||cd(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ad(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(ad.Cache||Yf),r}function hd(t,e){return t===e||t!=t&&e!=e}ad.Cache=Yf;var ud=Array.isArray;function ld(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function cd(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==Lf.call(t)}var fd=function(t,e,r){return null==t?t:ed(t,e,r)};let dd={},md=0;const pd=new y("networks/5.6.4");function gd(t){const e=function(e,r){null==r&&(r={});const n=[];if(e.InfuraProvider&&"-"!==r.infura)try{n.push(new e.InfuraProvider(t,r.infura))}catch(t){}if(e.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new e.EtherscanProvider(t,r.etherscan))}catch(t){}if(e.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new e.AlchemyProvider(t,r.alchemy))}catch(t){}if(e.PocketProvider&&"-"!==r.pocket){const i=["goerli","ropsten","rinkeby"];try{const o=new e.PocketProvider(t,r.pocket);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(t){}}if(e.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new e.CloudflareProvider(t))}catch(t){}if(e.AnkrProvider&&"-"!==r.ankr)try{const i=["ropsten"],o=new e.AnkrProvider(t,r.ankr);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(t){}if(0===n.length)return null;if(e.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===t&&(i=2),new e.FallbackProvider(n,i)}return n[0]};return e.renetwork=function(t){return gd(t)},e}function yd(t,e){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null};return r.renetwork=function(e){return yd(t,e)},r}const vd={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:gd("homestead")},wd={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:gd("ropsten")},bd={chainId:63,name:"classicMordor",_defaultProvider:yd("https://www.ethercluster.com/mordor","classicMordor")},Ed={unspecified:{chainId:0,name:"unspecified"},homestead:vd,mainnet:vd,morden:{chainId:2,name:"morden"},ropsten:wd,testnet:wd,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:gd("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:gd("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:gd("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},classic:{chainId:61,name:"classic",_defaultProvider:yd("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:bd,classicTestnet:bd,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:yd("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:gd("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:gd("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function _d(t){t=atob(t);const e=[];for(let r=0;r<t.length;r++)e.push(t.charCodeAt(r));return M(e)}function Ad(t){t=M(t);let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}class Md{constructor(t){gr(this,"alphabet",t),gr(this,"base",t.length),gr(this,"_alphabetMap",{}),gr(this,"_leader",t.charAt(0));for(let e=0;e<t.length;e++)this._alphabetMap[t.charAt(e)]=e}encode(t){let e=M(t);if(0===e.length)return"";let r=[0];for(let t=0;t<e.length;++t){let n=e[t];for(let t=0;t<r.length;++t)n+=r[t]<<8,r[t]=n%this.base,n=n/this.base|0;for(;n>0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let t=0;0===e[t]&&t<e.length-1;++t)n+=this._leader;for(let t=r.length-1;t>=0;--t)n+=this.alphabet[r[t]];return n}decode(t){if("string"!=typeof t)throw new TypeError("Expected String");let e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(let r=0;r<t.length;r++){let n=this._alphabetMap[t[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");let i=n;for(let t=0;t<e.length;++t)i+=e[t]*this.base,e[t]=255&i,i>>=8;for(;i>0;)e.push(255&i),i>>=8}for(let r=0;t[r]===this._leader&&r<t.length-1;++r)e.push(0);return M(new Uint8Array(e.reverse()))}}new Md("abcdefghijklmnopqrstuvwxyz234567");const kd=new Md("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function xd(t){return we(_n(t))}const Nd="hash/5.6.1",Sd=new y(Nd),Pd=new Uint8Array(32);Pd.fill(0);const Id=new RegExp("^((.*)\\.)?([^.]+)$");function Rd(t){"string"!=typeof t&&Sd.throwArgumentError("invalid ENS name; not a string","name",t);let e=t,r=Pd;for(;e.length;){const n=e.match(Id);null!=n&&""!==n[2]||Sd.throwArgumentError("invalid ENS address; missing component","name",t);r=we(k([r,we(_n(Bn(n[3])))])),e=n[2]||""}return P(r)}var Cd=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{h(n.next(t))}catch(t){o(t)}}function a(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}h((n=n.apply(t,e||[])).next())}))};const Td=new y(Nd),Od=new Uint8Array(32);Od.fill(0);const $d=qt.from(-1),Bd=qt.from(0),Fd=qt.from(1),jd=qt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const Dd=O(Fd.toHexString(),32),Ud=O(Bd.toHexString(),32),Ld={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},zd=["name","version","chainId","verifyingContract","salt"];function qd(t){return function(e){return"string"!=typeof e&&Td.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const Vd={name:qd("name"),version:qd("version"),chainId:function(t){try{return qt.from(t).toString()}catch(t){}return Td.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Ce(t).toLowerCase()}catch(t){}return Td.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=M(t);if(32!==e.length)throw new Error("bad length");return P(e)}catch(t){}return Td.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Gd(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=""===e[1],n=parseInt(e[2]||"256");(n%8!=0||n>256||e[2]&&e[2]!==String(n))&&Td.throwArgumentError("invalid numeric width","type",t);const i=jd.mask(r?n-1:n),o=r?i.add(Fd).mul($d):Bd;return function(e){const r=qt.from(e);return(r.lt(o)||r.gt(i))&&Td.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),O(r.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(0===r||r>32||e[1]!==String(r))&&Td.throwArgumentError("invalid bytes width","type",t),function(e){return M(e).length!==r&&Td.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=M(t),r=e.length%32;return r?C([e,Od.slice(r)]):P(e)}(e)}}}switch(t){case"address":return function(t){return O(Ce(t),32)};case"bool":return function(t){return t?Dd:Ud};case"bytes":return function(t){return we(t)};case"string":return function(t){return xd(t)}}return null}function Hd(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class Kd{constructor(t){gr(this,"types",Object.freeze(Ar(t))),gr(this,"_encoderCache",{}),gr(this,"_types",{});const e={},r={},n={};Object.keys(t).forEach((t=>{e[t]={},r[t]=[],n[t]={}}));for(const n in t){const i={};t[n].forEach((o=>{i[o.name]&&Td.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",t),i[o.name]=!0;const s=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&Td.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);Gd(s)||(r[s]||Td.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),r[s].push(n),e[n][s]=!0)}))}const i=Object.keys(r).filter((t=>0===r[t].length));0===i.length?Td.throwArgumentError("missing primary type","types",t):i.length>1&&Td.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),gr(this,"primaryType",i[0]),function i(o,s){s[o]&&Td.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),s[o]=!0,Object.keys(e[o]).forEach((t=>{r[t]&&(i(t,s),Object.keys(s).forEach((e=>{n[e][t]=!0})))})),delete s[o]}(this.primaryType,{});for(const e in n){const r=Object.keys(n[e]);r.sort(),this._types[e]=Hd(e,t[e])+r.map((e=>Hd(e,t[e]))).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const e=Gd(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],r=this.getEncoder(t),n=parseInt(e[3]);return e=>{n>=0&&e.length!==n&&Td.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(r);return this._types[t]&&(i=i.map(we)),we(C(i))}}const r=this.types[t];if(r){const e=xd(this._types[t]);return t=>{const n=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return this._types[r]?we(n):n}));return n.unshift(e),C(n)}}return Td.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||Td.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return we(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,r){if(Gd(t))return r(t,e);const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const t=n[1],i=parseInt(n[3]);return i>=0&&e.length!==i&&Td.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,r)))}const i=this.types[t];return i?i.reduce(((t,{name:n,type:i})=>(t[n]=this._visit(i,e[n],r),t)),{}):Td.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new Kd(t)}static getPrimaryType(t){return Kd.from(t).primaryType}static hashStruct(t,e,r){return Kd.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=Ld[r];n||Td.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>zd.indexOf(t.name)-zd.indexOf(e.name))),Kd.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return C(["0x1901",Kd.hashDomain(t),Kd.from(e).hash(r)])}static hash(t,e,r){return we(Kd.encode(t,e,r))}static resolveNames(t,e,r,n){return Cd(this,void 0,void 0,(function*(){t=wr(t);const i={};t.verifyingContract&&!N(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const o=Kd.from(e);o.visit(r,((t,e)=>("address"!==t||N(e,20)||(i[e]="0x"),e)));for(const t in i)i[t]=yield n(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),r=o.visit(r,((t,e)=>"address"===t&&i[e]?i[e]:e)),{domain:t,value:r}}))}static getPayload(t,e,r){Kd.hashDomain(t);const n={},i=[];zd.forEach((e=>{const r=t[e];null!=r&&(n[e]=Vd[e](r),i.push({name:e,type:Ld[e]}))}));const o=Kd.from(e),s=wr(e);return s.EIP712Domain?Td.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):s.EIP712Domain=i,o.encode(r),{types:s,domain:n,primaryType:o.primaryType,message:o.visit(r,((t,e)=>{if(t.match(/^bytes(\d*)/))return P(M(e));if(t.match(/^u?int/))return qt.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&Td.throwArgumentError("invalid string","value",e),e}return Td.throwArgumentError("unsupported type","type",t)}))}}}new y("sha2/5.6.1");function Qd(t){return"0x"+Ho.sha256().update(M(t)).digest("hex")}var Jd=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{h(n.next(t))}catch(t){o(t)}}function a(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}h((n=n.apply(t,e||[])).next())}))};function Zd(t,e){return Jd(this,void 0,void 0,(function*(){null==e&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};!0!==e.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client");const n=yield fetch(t,r),i=yield n.arrayBuffer(),o={};return n.headers.forEach?n.headers.forEach(((t,e)=>{o[e.toLowerCase()]=t})):n.headers.keys().forEach((t=>{o[t.toLowerCase()]=n.headers.get(t)})),{headers:o,statusCode:n.status,statusMessage:n.statusText,body:M(new Uint8Array(i))}}))}var Yd=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{h(n.next(t))}catch(t){o(t)}}function a(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}h((n=n.apply(t,e||[])).next())}))};const Wd=new y("web/5.6.1");function Xd(t){return new Promise((e=>{setTimeout(e,t)}))}function tm(t,e){if(null==t)return null;if("string"==typeof t)return t;if(E(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return Mn(t)}catch(t){}return P(t)}return t}function em(t,e,r){let n=null;if(null!=e){n=_n(e);const r="string"==typeof t?{url:t}:wr(t);if(r.headers){0!==Object.keys(r.headers).filter((t=>"content-type"===t.toLowerCase())).length||(r.headers=wr(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};t=r}return function(t,e,r){const n="object"==typeof t&&null!=t.throttleLimit?t.throttleLimit:12;Wd.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const i="object"==typeof t?t.throttleCallback:null,o="object"==typeof t&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;Wd.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const s="object"==typeof t&&!!t.errorPassThrough,a={};let h=null;const u={method:"GET"};let l=!1,c=12e4;if("string"==typeof t)h=t;else if("object"==typeof t){if(null!=t&&null!=t.url||Wd.throwArgumentError("missing URL","connection.url",t),h=t.url,"number"==typeof t.timeout&&t.timeout>0&&(c=t.timeout),t.headers)for(const e in t.headers)a[e.toLowerCase()]={key:e,value:String(t.headers[e])},["if-none-match","if-modified-since"].indexOf(e.toLowerCase())>=0&&(l=!0);if(u.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==h.substring(0,6)&&!0!==t.allowInsecureAuthentication&&Wd.throwError("basic authentication requires a secure https url",y.errors.INVALID_ARGUMENT,{argument:"url",url:h,user:t.user,password:"[REDACTED]"});const e=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+Ad(_n(e))}}null!=t.skipFetchSetup&&(u.skipFetchSetup=!!t.skipFetchSetup)}const f=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i"),d=h?h.match(f):null;if(d)try{const t={statusCode:200,statusMessage:"OK",headers:{"content-type":d[1]},body:_d(d[2])};let e=t.body;return r&&(e=r(t.body,t)),Promise.resolve(e)}catch(t){Wd.throwError("processing response error",y.errors.SERVER_ERROR,{body:tm(d[1],d[2]),error:t,requestBody:null,requestMethod:"GET",url:h})}e&&(u.method="POST",u.body=e,null==a["content-type"]&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==a["content-length"]&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const m={};Object.keys(a).forEach((t=>{const e=a[t];m[e.key]=e.value})),u.headers=m;const p=function(){let t=null;return{promise:new Promise((function(e,r){c&&(t=setTimeout((()=>{null!=t&&(t=null,r(Wd.makeError("timeout",y.errors.TIMEOUT,{requestBody:tm(u.body,m["content-type"]),requestMethod:u.method,timeout:c,url:h})))}),c))})),cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),g=function(){return Yd(this,void 0,void 0,(function*(){for(let t=0;t<n;t++){let e=null;try{if(e=yield Zd(h,u),t<n)if(301===e.statusCode||302===e.statusCode){const t=e.headers.location||"";if("GET"===u.method&&t.match(/^https:/)){h=e.headers.location;continue}}else if(429===e.statusCode){let r=!0;if(i&&(r=yield i(t,h)),r){let r=0;const n=e.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):o*parseInt(String(Math.random()*Math.pow(2,t))),yield Xd(r);continue}}}catch(t){e=t.response,null==e&&(p.cancel(),Wd.throwError("missing response",y.errors.SERVER_ERROR,{requestBody:tm(u.body,m["content-type"]),requestMethod:u.method,serverError:t,url:h}))}let a=e.body;if(l&&304===e.statusCode?a=null:!s&&(e.statusCode<200||e.statusCode>=300)&&(p.cancel(),Wd.throwError("bad response",y.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:tm(a,e.headers?e.headers["content-type"]:null),requestBody:tm(u.body,m["content-type"]),requestMethod:u.method,url:h})),r)try{const t=yield r(a,e);return p.cancel(),t}catch(r){if(r.throttleRetry&&t<n){let e=!0;if(i&&(e=yield i(t,h)),e){const e=o*parseInt(String(Math.random()*Math.pow(2,t)));yield Xd(e);continue}}p.cancel(),Wd.throwError("processing response error",y.errors.SERVER_ERROR,{body:tm(a,e.headers?e.headers["content-type"]:null),error:r,requestBody:tm(u.body,m["content-type"]),requestMethod:u.method,url:h})}return p.cancel(),a}return Wd.throwError("failed response",y.errors.SERVER_ERROR,{requestBody:tm(u.body,m["content-type"]),requestMethod:u.method,url:h})}))}();return Promise.race([p.promise,g])}(t,n,((t,e)=>{let n=null;if(null!=t)try{n=JSON.parse(Mn(t))}catch(e){Wd.throwError("invalid JSON",y.errors.SERVER_ERROR,{body:t,error:e})}return r&&(n=r(n,e)),n}))}function rm(t,e){return e||(e={}),null==(e=wr(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(r,n){let i=null,o=!1;const s=()=>!o&&(o=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout((()=>{s()&&n(new Error("timeout"))}),e.timeout));const a=e.retryLimit;let h=0;!function i(){return t().then((function(t){if(void 0!==t)s()&&r(t);else if(e.oncePoll)e.oncePoll.once("poll",i);else if(e.onceBlock)e.onceBlock.once("block",i);else if(!o){if(h++,h>a)return void(s()&&n(new Error("retry limit reached")));let t=e.interval*parseInt(String(Math.random()*Math.pow(2,h)));t<e.floor&&(t=e.floor),t>e.ceiling&&(t=e.ceiling),setTimeout(i,t)}return null}),(function(t){s()&&n(t)}))}()}))}for(var nm="qpzry9x8gf2tvdw0s3jn54khce6mua7l",im={},om=0;om<nm.length;om++){var sm=nm.charAt(om);if(void 0!==im[sm])throw new TypeError(sm+" is ambiguous");im[sm]=om}function am(t){var e=t>>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function hm(t){for(var e=1,r=0;r<t.length;++r){var n=t.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+t+")";e=am(e)^n>>5}for(e=am(e),r=0;r<t.length;++r){var i=t.charCodeAt(r);e=am(e)^31&i}return e}function um(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;var i=(t=r).lastIndexOf("1");if(-1===i)return"No separator character for "+t;if(0===i)return"Missing prefix for "+t;var o=t.slice(0,i),s=t.slice(i+1);if(s.length<6)return"Data too short";var a=hm(o);if("string"==typeof a)return a;for(var h=[],u=0;u<s.length;++u){var l=s.charAt(u),c=im[l];if(void 0===c)return"Unknown character "+l;a=am(a)^c,u+6>=s.length||h.push(c)}return 1!==a?"Invalid checksum for "+t:{prefix:o,words:h}}function lm(t,e,r,n){for(var i=0,o=0,s=(1<<r)-1,a=[],h=0;h<t.length;++h)for(i=i<<e|t[h],o+=e;o>=r;)o-=r,a.push(i>>o&s);if(n)o>0&&a.push(i<<r-o&s);else{if(o>=e)return"Excess padding";if(i<<r-o&s)return"Non-zero padding"}return a}var cm={decodeUnsafe:function(){var t=um.apply(null,arguments);if("object"==typeof t)return t},decode:function(t){var e=um.apply(null,arguments);if("object"==typeof e)return e;throw new Error(e)},encode:function(t,e,r){if(r=r||90,t.length+7+e.length>r)throw new TypeError("Exceeds length limit");var n=hm(t=t.toLowerCase());if("string"==typeof n)throw new Error(n);for(var i=t+"1",o=0;o<e.length;++o){var s=e[o];if(s>>5!=0)throw new Error("Non 5-bit word");n=am(n)^s,i+=nm.charAt(s)}for(o=0;o<6;++o)n=am(n);for(n^=1,o=0;o<6;++o){i+=nm.charAt(n>>5*(5-o)&31)}return i},toWordsUnsafe:function(t){var e=lm(t,8,5,!0);if(Array.isArray(e))return e},toWords:function(t){var e=lm(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)},fromWordsUnsafe:function(t){var e=lm(t,5,8,!1);if(Array.isArray(e))return e},fromWords:function(t){var e=lm(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}};const fm="providers/5.6.8",dm=new y(fm);class mm{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const t={},e=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),s=this.hex.bind(this),a=this.number.bind(this),h=this.type.bind(this);return t.transaction={hash:o,type:h,accessList:mm.allowNull(this.accessList.bind(this),null),blockHash:mm.allowNull(o,null),blockNumber:mm.allowNull(a,null),transactionIndex:mm.allowNull(a,null),confirmations:mm.allowNull(a,null),from:e,gasPrice:mm.allowNull(r),maxPriorityFeePerGas:mm.allowNull(r),maxFeePerGas:mm.allowNull(r),gasLimit:r,to:mm.allowNull(e,null),value:r,nonce:a,data:i,r:mm.allowNull(this.uint256),s:mm.allowNull(this.uint256),v:mm.allowNull(a),creates:mm.allowNull(e,null),raw:mm.allowNull(i)},t.transactionRequest={from:mm.allowNull(e),nonce:mm.allowNull(a),gasLimit:mm.allowNull(r),gasPrice:mm.allowNull(r),maxPriorityFeePerGas:mm.allowNull(r),maxFeePerGas:mm.allowNull(r),to:mm.allowNull(e),value:mm.allowNull(r),data:mm.allowNull((t=>this.data(t,!0))),type:mm.allowNull(a),accessList:mm.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:o,address:e,topics:mm.arrayOf(o),data:i,logIndex:a,blockHash:o},t.receipt={to:mm.allowNull(this.address,null),from:mm.allowNull(this.address,null),contractAddress:mm.allowNull(e,null),transactionIndex:a,root:mm.allowNull(s),gasUsed:r,logsBloom:mm.allowNull(i),blockHash:o,transactionHash:o,logs:mm.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:mm.allowNull(a,null),cumulativeGasUsed:r,effectiveGasPrice:mm.allowNull(r),status:mm.allowNull(a),type:h},t.block={hash:mm.allowNull(o),parentHash:o,number:a,timestamp:a,nonce:mm.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:mm.allowNull(e),extraData:i,transactions:mm.allowNull(mm.arrayOf(o)),baseFeePerGas:mm.allowNull(r)},t.blockWithTransactions=wr(t.block),t.blockWithTransactions.transactions=mm.allowNull(mm.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:mm.allowNull(n,void 0),toBlock:mm.allowNull(n,void 0),blockHash:mm.allowNull(o,void 0),address:mm.allowNull(e,void 0),topics:mm.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:mm.allowNull(a),blockHash:mm.allowNull(o),transactionIndex:a,removed:mm.allowNull(this.boolean.bind(this)),address:e,data:mm.allowFalsish(i,"0x"),topics:mm.arrayOf(o),transactionHash:o,logIndex:a},t}accessList(t){return Ls(t||[])}number(t){return"0x"===t?0:qt.from(t).toNumber()}type(t){return"0x"===t||null==t?0:qt.from(t).toNumber()}bigNumber(t){return qt.from(t)}boolean(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===(t=t.toLowerCase()))return!0;if("false"===t)return!1}throw new Error("invalid boolean - "+t)}hex(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),N(t))?t.toLowerCase():dm.throwArgumentError("invalid hash","value",t)}data(t,e){const r=this.hex(t,e);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+t);return r}address(t){return Ce(t)}callAddress(t){if(!N(t,32))return null;const e=Ce(R(t,12));return"0x0000000000000000000000000000000000000000"===e?null:e}contractAddress(t){return Oe(t)}blockTag(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t||N(t))return T(t);throw new Error("invalid blockTag")}hash(t,e){const r=this.hex(t,e);return 32!==I(r)?dm.throwArgumentError("invalid hash","value",t):r}difficulty(t){if(null==t)return null;const e=qt.from(t);try{return e.toNumber()}catch(t){}return null}uint256(t){if(!N(t))throw new Error("invalid uint256");return O(t,32)}_block(t,e){null!=t.author&&null==t.miner&&(t.miner=t.author);const r=null!=t._difficulty?t._difficulty:t.difficulty,n=mm.check(e,t);return n._difficulty=null==r?null:qt.from(r),n}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return mm.check(this.formats.transactionRequest,t)}transactionResponse(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&qt.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),1!==t.type&&2!==t.type||null!=t.accessList||(t.accessList=[]);const e=mm.check(this.formats.transaction,t);if(null!=t.chainId){let r=t.chainId;N(r)&&(r=qt.from(r).toNumber()),e.chainId=r}else{let r=t.networkId;null==r&&null==e.v&&(r=t.chainId),N(r)&&(r=qt.from(r).toNumber()),"number"!=typeof r&&null!=e.v&&(r=(e.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),e.chainId=r}return e.blockHash&&"x"===e.blockHash.replace(/0/g,"")&&(e.blockHash=null),e}transaction(t){return Hs(t)}receiptLog(t){return mm.check(this.formats.receiptLog,t)}receipt(t){const e=mm.check(this.formats.receipt,t);if(null!=e.root)if(e.root.length<=4){const t=qt.from(e.root).toNumber();0===t||1===t?(null!=e.status&&e.status!==t&&dm.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=t,delete e.root):dm.throwArgumentError("invalid alt-root-status","value.root",e.root)}else 66!==e.root.length&&dm.throwArgumentError("invalid root hash","value.root",e.root);return null!=e.status&&(e.byzantium=!0),e}topics(t){return Array.isArray(t)?t.map((t=>this.topics(t))):null!=t?this.hash(t,!0):null}filter(t){return mm.check(this.formats.filter,t)}filterLog(t){return mm.check(this.formats.filterLog,t)}static check(t,e){const r={};for(const n in t)try{const i=t[n](e[n]);void 0!==i&&(r[n]=i)}catch(t){throw t.checkKey=n,t.checkValue=e[n],t}return r}static allowNull(t,e){return function(r){return null==r?e:t(r)}}static allowFalsish(t,e){return function(r){return r?t(r):e}}static arrayOf(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");const r=[];return e.forEach((function(e){r.push(t(e))})),r}}}var pm=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{h(n.next(t))}catch(t){o(t)}}function a(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}h((n=n.apply(t,e||[])).next())}))};const gm=new y(fm);function ym(t){return null==t?"null":(32!==I(t)&&gm.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function vm(t){for(t=t.slice();t.length>0&&null==t[t.length-1];)t.pop();return t.map((t=>{if(Array.isArray(t)){const e={};t.forEach((t=>{e[ym(t)]=!0}));const r=Object.keys(e);return r.sort(),r.join("|")}return ym(t)})).join("&")}function wm(t){if("string"==typeof t){if(32===I(t=t.toLowerCase()))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter:*:"+vm(t);if(ti.isForkEvent(t))throw gm.warn("not implemented"),new Error("not implemented");if(t&&"object"==typeof t)return"filter:"+(t.address||"*")+":"+vm(t.topics||[])}throw new Error("invalid event - "+t)}function bm(){return(new Date).getTime()}function Em(t){return new Promise((e=>{setTimeout(e,t)}))}const _m=["block","network","pending","poll"];class Am{constructor(t,e,r){gr(this,"tag",t),gr(this,"listener",e),gr(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const t=this.tag.split(":");return"tx"!==t[0]?null:t[1]}get filter(){const t=this.tag.split(":");if("filter"!==t[0])return null;const e=t[1],r=""===(n=t[2])?[]:n.split(/&/g).map((t=>{if(""===t)return[];const e=t.split("|").map((t=>"null"===t?null:t));return 1===e.length?e[0]:e}));var n;const i={};return r.length>0&&(i.topics=r),e&&"*"!==e&&(i.address=e),i}pollable(){return this.tag.indexOf(":")>=0||_m.indexOf(this.tag)>=0}}const Mm={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function km(t){return O(qt.from(t).toHexString(),32)}function xm(t){return kd.encode(k([t,R(Qd(Qd(t)),0,4)]))}const Nm=new RegExp("^(ipfs)://(.*)$","i"),Sm=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Nm,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Pm(t,e){try{return Mn(Im(t,e))}catch(t){}return null}function Im(t,e){if("0x"===t)return null;const r=qt.from(R(t,e,e+32)).toNumber(),n=qt.from(R(t,r,r+32)).toNumber();return R(t,r+32,r+32+n)}function Rm(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):gm.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function Cm(t){const e=M(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function Tm(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function Om(t){const e=[];let r=0;for(let n=0;n<t.length;n++)e.push(null),r+=32;for(let n=0;n<t.length;n++){const i=M(t[n]);e[n]=Cm(r),e.push(Cm(i.length)),e.push(Tm(i)),r+=32+32*Math.ceil(i.length/32)}return C(e)}class $m{constructor(t,e,r,n){gr(this,"provider",t),gr(this,"name",r),gr(this,"address",t.formatter.address(e)),gr(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((t=>qt.from(t).eq(1))).catch((t=>{if(t.code===y.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t}))),this._supportsEip2544}_fetch(t,e){return pm(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:C([t,Rd(this.name),e||"0x"])};let n=!1;var i;(yield this.supportsWildcard())&&(n=!0,r.data=C(["0x9061b923",Om([(i=this.name,P(k(i.split(".").map((t=>{const e=_n("_"+Bn(t));return e[0]=e.length-1,e}))))+"00"),r.data])]));try{let t=yield this.provider.call(r);return M(t).length%32==4&&gm.throwError("resolver threw error",y.errors.CALL_EXCEPTION,{transaction:r,data:t}),n&&(t=Im(t,0)),t}catch(t){if(t.code===y.errors.CALL_EXCEPTION)return null;throw t}}))}_fetchBytes(t,e){return pm(this,void 0,void 0,(function*(){const r=yield this._fetch(t,e);return null!=r?Im(r,0):null}))}_getAddress(t,e){const r=Mm[String(t)];if(null==r&&gm.throwError(`unsupported coin type: ${t}`,y.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),"eth"===r.ilk)return this.provider.formatter.address(e);const n=M(e);if(null!=r.p2pkh){const t=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return xm(k([[r.p2pkh],"0x"+t[2]]))}}if(null!=r.p2sh){const t=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return xm(k([[r.p2sh],"0x"+t[2]]))}}if(null!=r.prefix){const t=n[1];let e=n[0];if(0===e?20!==t&&32!==t&&(e=-1):e=-1,e>=0&&n.length===2+t&&t>=1&&t<=75){const t=cm.toWords(n.slice(2));return t.unshift(e),cm.encode(r.prefix,t)}}return null}getAddress(t){return pm(this,void 0,void 0,(function*(){if(null==t&&(t=60),60===t)try{const t=yield this._fetch("0x3b3b57de");return"0x"===t||"0x0000000000000000000000000000000000000000000000000000000000000000"===t?null:this.provider.formatter.callAddress(t)}catch(t){if(t.code===y.errors.CALL_EXCEPTION)return null;throw t}const e=yield this._fetchBytes("0xf1cb7e06",km(t));if(null==e||"0x"===e)return null;const r=this._getAddress(t,e);return null==r&&gm.throwError("invalid or unsupported coin data",y.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:e}),r}))}getAvatar(){return pm(this,void 0,void 0,(function*(){const t=[{type:"name",content:this.name}];try{const e=yield this.getText("avatar");if(null==e)return null;for(let r=0;r<Sm.length;r++){const n=e.match(Sm[r]);if(null==n)continue;const i=n[1].toLowerCase();switch(i){case"https":return t.push({type:"url",content:e}),{linkage:t,url:e};case"data":return t.push({type:"data",content:e}),{linkage:t,url:e};case"ipfs":return t.push({type:"ipfs",content:e}),{linkage:t,url:Rm(e)};case"erc721":case"erc1155":{const r="erc721"===i?"0xc87b56dd":"0x0e89341c";t.push({type:i,content:e});const o=this._resolvedAddress||(yield this.getAddress()),s=(n[2]||"").split("/");if(2!==s.length)return null;const a=yield this.provider.formatter.address(s[0]),h=O(qt.from(s[1]).toHexString(),32);if("erc721"===i){const e=this.provider.formatter.callAddress(yield this.provider.call({to:a,data:C(["0x6352211e",h])}));if(o!==e)return null;t.push({type:"owner",content:e})}else if("erc1155"===i){const e=qt.from(yield this.provider.call({to:a,data:C(["0x00fdd58e",O(o,32),h])}));if(e.isZero())return null;t.push({type:"balance",content:e.toString()})}const u={to:this.provider.formatter.address(s[0]),data:C([r,h])};let l=Pm(yield this.provider.call(u),0);if(null==l)return null;t.push({type:"metadata-url-base",content:l}),"erc1155"===i&&(l=l.replace("{id}",h.substring(2)),t.push({type:"metadata-url-expanded",content:l})),l.match(/^ipfs:/i)&&(l=Rm(l)),t.push({type:"metadata-url",content:l});const c=yield em(l);if(!c)return null;t.push({type:"metadata",content:JSON.stringify(c)});let f=c.image;if("string"!=typeof f)return null;if(f.match(/^(https:\/\/|data:)/i));else{if(null==f.match(Nm))return null;t.push({type:"url-ipfs",content:f}),f=Rm(f)}return t.push({type:"url",content:f}),{linkage:t,url:f}}}}}catch(t){}return null}))}getContentHash(){return pm(this,void 0,void 0,(function*(){const t=yield this._fetchBytes("0xbc1c58d1");if(null==t||"0x"===t)return null;const e=t.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(e){const t=parseInt(e[3],16);if(e[4].length===2*t)return"ipfs://"+kd.encode("0x"+e[1])}const r=t.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const t=parseInt(r[3],16);if(r[4].length===2*t)return"ipns://"+kd.encode("0x"+r[1])}const n=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&64===n[1].length)return"bzz://"+n[1];const i=t.match(/^0x90b2c605([0-9a-f]*)$/);if(i&&68===i[1].length){const t={"=":"","+":"-","/":"_"};return"sia://"+Ad("0x"+i[1]).replace(/[=+\/]/g,(e=>t[e]))}return gm.throwError("invalid or unsupported content hash data",y.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})}))}getText(t){return pm(this,void 0,void 0,(function*(){let e=_n(t);e=k([km(64),km(e.length),e]),e.length%32!=0&&(e=k([e,O("0x",32-t.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",P(e));return null==r||"0x"===r?null:Mn(r)}))}}let Bm=null,Fm=1;class jm extends ei{constructor(t){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),gr(this,"anyNetwork","any"===t),this.anyNetwork&&(t=this.detectNetwork()),t instanceof Promise)this._networkPromise=t,t.catch((t=>{})),this._ready().catch((t=>{}));else{const e=yr(new.target,"getNetwork")(t);e?(gr(this,"_network",e),this.emit("network",e,null)):gm.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return pm(this,void 0,void 0,(function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(t){}null==t&&(t=yield this.detectNetwork()),t||gm.throwError("no network detected",y.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:gr(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return rm((()=>this._ready().then((t=>t),(t=>{if(t.code!==y.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))))}static getFormatter(){return null==Bm&&(Bm=new mm),Bm}static getNetwork(t){return function(t){if(null==t)return null;if("number"==typeof t){for(const e in Ed){const r=Ed[e];if(r.chainId===t)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){const e=Ed[t];return null==e?null:{name:e.name,chainId:e.chainId,ensAddress:e.ensAddress,_defaultProvider:e._defaultProvider||null}}const e=Ed[t.name];if(!e)return"number"!=typeof t.chainId&&pd.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==e.chainId&&pd.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;var n;return null==r&&e._defaultProvider&&(r=(n=e._defaultProvider)&&"function"==typeof n.renetwork?e._defaultProvider.renetwork(t):e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}(null==t?"homestead":t)}ccipReadFetch(t,e,r){return pm(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=t.to.toLowerCase(),i=e.toLowerCase(),o=[];for(let t=0;t<r.length;t++){const e=r[t],s=e.replace("{sender}",n).replace("{data}",i),a=e.indexOf("{data}")>=0?null:JSON.stringify({data:i,sender:n}),h=yield em({url:s,errorPassThrough:!0},a,((t,e)=>(t.status=e.statusCode,t)));if(h.data)return h.data;const u=h.message||"unknown error";if(h.status>=400&&h.status<500)return gm.throwError(`response not found during CCIP fetch: ${u}`,y.errors.SERVER_ERROR,{url:e,errorMessage:u});o.push(u)}return gm.throwError(`error encountered during CCIP fetch: ${o.map((t=>JSON.stringify(t))).join(", ")}`,y.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(t){return pm(this,void 0,void 0,(function*(){if(yield this._ready(),t>0)for(;this._internalBlockNumber;){const e=this._internalBlockNumber;try{const r=yield e;if(bm()-r.respTime<=t)return r.blockNumber;break}catch(t){if(this._internalBlockNumber===e)break}}const e=bm(),r=vr({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((t=>null),(t=>t))}).then((({blockNumber:t,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const i=bm();return(t=qt.from(t).toNumber())<this._maxInternalBlockNumber&&(t=this._maxInternalBlockNumber),this._maxInternalBlockNumber=t,this._setFastBlockNumber(t),{blockNumber:t,reqTime:e,respTime:i}}));return this._internalBlockNumber=r,r.catch((t=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return pm(this,void 0,void 0,(function*(){const t=Fm++,e=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(t){return void this.emit("error",t)}if(this._setFastBlockNumber(r),this.emit("poll",t,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)gm.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",gm.makeError("network block skew detected",y.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let t=this._emitted.block+1;t<=r;t++)this.emit("block",t);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((t=>{if("block"===t)return;const e=this._emitted[t];"pending"!==e&&r-e>12&&delete this._emitted[t]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((t=>{switch(t.type){case"tx":{const r=t.hash;let n=this.getTransactionReceipt(r).then((t=>t&&null!=t.blockNumber?(this._emitted["t:"+r]=t.blockNumber,this.emit(r,t),null):null)).catch((t=>{this.emit("error",t)}));e.push(n);break}case"filter":if(!t._inflight){t._inflight=!0;const n=t.filter;n.fromBlock=t._lastBlockNumber+1,n.toBlock=r,n.toBlock-this._maxFilterBlockRange>n.fromBlock&&(n.fromBlock=n.toBlock-this._maxFilterBlockRange);const i=this.getLogs(n).then((e=>{t._inflight=!1,0!==e.length&&e.forEach((e=>{e.blockNumber>t._lastBlockNumber&&(t._lastBlockNumber=e.blockNumber),this._emitted["b:"+e.blockHash]=e.blockNumber,this._emitted["t:"+e.transactionHash]=e.blockNumber,this.emit(n,e)}))})).catch((e=>{this.emit("error",e),t._inflight=!1}));e.push(i)}}})),this._lastBlockNumber=r,Promise.all(e).then((()=>{this.emit("didPoll",t)})).catch((t=>{this.emit("error",t)}))}else this.emit("didPoll",t)}))}resetEventsBlock(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return pm(this,void 0,void 0,(function*(){return gm.throwError("provider does not support network detection",y.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return pm(this,void 0,void 0,(function*(){const t=yield this._ready(),e=yield this.detectNetwork();if(t.chainId!==e.chainId){if(this.anyNetwork)return this._network=e,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",e,t),yield Em(0),this._network;const r=gm.makeError("underlying network changed",y.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:e});throw this.emit("error",r),r}return t}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((t=>{this._setFastBlockNumber(t)}),(t=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(t){t&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(t){if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const t=bm();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((t=>((null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(t){null!=this._fastBlockNumber&&t<this._fastBlockNumber||(this._fastQueryDate=bm(),(null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,r){return pm(this,void 0,void 0,(function*(){return this._waitForTransaction(t,null==e?1:e,r||0,null)}))}_waitForTransaction(t,e,r,n){return pm(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(t);return(i?i.confirmations:0)>=e?i:new Promise(((i,o)=>{const s=[];let a=!1;const h=function(){return!!a||(a=!0,s.forEach((t=>{t()})),!1)},u=t=>{t.confirmations<e||h()||i(t)};if(this.on(t,u),s.push((()=>{this.removeListener(t,u)})),n){let r=n.startBlock,i=null;const u=s=>pm(this,void 0,void 0,(function*(){a||(yield Em(1e3),this.getTransactionCount(n.from).then((l=>pm(this,void 0,void 0,(function*(){if(!a){if(l<=n.nonce)r=s;else{{const e=yield this.getTransaction(t);if(e&&null!=e.blockNumber)return}for(null==i&&(i=r-3,i<n.startBlock&&(i=n.startBlock));i<=s;){if(a)return;const r=yield this.getBlockWithTransactions(i);for(let i=0;i<r.transactions.length;i++){const s=r.transactions[i];if(s.hash===t)return;if(s.from===n.from&&s.nonce===n.nonce){if(a)return;const r=yield this.waitForTransaction(s.hash,e);if(h())return;let i="replaced";return s.data===n.data&&s.to===n.to&&s.value.eq(n.value)?i="repriced":"0x"===s.data&&s.from===s.to&&s.value.isZero()&&(i="cancelled"),void o(gm.makeError("transaction was replaced",y.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:this._wrapTransaction(s),hash:t,receipt:r}))}}i++}}a||this.once("block",u)}}))),(t=>{a||this.once("block",u)})))}));if(a)return;this.once("block",u),s.push((()=>{this.removeListener("block",u)}))}if("number"==typeof r&&r>0){const t=setTimeout((()=>{h()||o(gm.makeError("timeout exceeded",y.errors.TIMEOUT,{timeout:r}))}),r);t.unref&&t.unref(),s.push((()=>{clearTimeout(t)}))}}))}))}getBlockNumber(){return pm(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return pm(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield this.perform("getGasPrice",{});try{return qt.from(t)}catch(e){return gm.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}}))}getBalance(t,e){return pm(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield vr({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getBalance",r);try{return qt.from(n)}catch(t){return gm.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:t})}}))}getTransactionCount(t,e){return pm(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield vr({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getTransactionCount",r);try{return qt.from(n).toNumber()}catch(t){return gm.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:t})}}))}getCode(t,e){return pm(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield vr({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getCode",r);try{return P(n)}catch(t){return gm.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:t})}}))}getStorageAt(t,e,r){return pm(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield vr({address:this._getAddress(t),blockTag:this._getBlockTag(r),position:Promise.resolve(e).then((t=>T(t)))}),i=yield this.perform("getStorageAt",n);try{return P(i)}catch(t){return gm.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:t})}}))}_wrapTransaction(t,e,r){if(null!=e&&32!==I(e))throw new Error("invalid response - sendTransaction");const n=t;return null!=e&&t.hash!==e&&gm.throwError("Transaction hash mismatch from Provider.sendTransaction.",y.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),n.wait=(e,n)=>pm(this,void 0,void 0,(function*(){let i;null==e&&(e=1),null==n&&(n=0),0!==e&&null!=r&&(i={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:r});const o=yield this._waitForTransaction(t.hash,e,n,i);return null==o&&0===e?null:(this._emitted["t:"+t.hash]=o.blockNumber,0===o.status&&gm.throwError("transaction failed",y.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:o}),o)})),n}sendTransaction(t){return pm(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Promise.resolve(t).then((t=>P(t))),r=this.formatter.transaction(t);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const t=yield this.perform("sendTransaction",{signedTransaction:e});return this._wrapTransaction(r,t,n)}catch(t){throw t.transaction=r,t.transactionHash=r.hash,t}}))}_getTransactionRequest(t){return pm(this,void 0,void 0,(function*(){const e=yield t,r={};return["from","to"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?this._getAddress(t):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?qt.from(t):null)))})),["type"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>null!=t?t:null)))})),e.accessList&&(r.accessList=this.formatter.accessList(e.accessList)),["data"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?P(t):null)))})),this.formatter.transactionRequest(yield vr(r))}))}_getFilter(t){return pm(this,void 0,void 0,(function*(){t=yield t;const e={};return null!=t.address&&(e.address=this._getAddress(t.address)),["blockHash","topics"].forEach((r=>{null!=t[r]&&(e[r]=t[r])})),["fromBlock","toBlock"].forEach((r=>{null!=t[r]&&(e[r]=this._getBlockTag(t[r]))})),this.formatter.filter(yield vr(e))}))}_call(t,e,r){return pm(this,void 0,void 0,(function*(){r>=10&&gm.throwError("CCIP read exceeded maximum redirections",y.errors.SERVER_ERROR,{redirects:r,transaction:t});const n=t.to,i=yield this.perform("call",{transaction:t,blockTag:e});if(r>=0&&"latest"===e&&null!=n&&"0x556f1830"===i.substring(0,10)&&I(i)%32==4)try{const o=R(i,4),s=R(o,0,32);qt.from(s).eq(n)||gm.throwError("CCIP Read sender did not match",y.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const a=[],h=qt.from(R(o,32,64)).toNumber(),u=qt.from(R(o,h,h+32)).toNumber(),l=R(o,h+32);for(let e=0;e<u;e++){const r=Pm(l,32*e);null==r&&gm.throwError("CCIP Read contained corrupt URL string",y.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i}),a.push(r)}const c=Im(o,64);qt.from(R(o,100,128)).isZero()||gm.throwError("CCIP Read callback selector included junk",y.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const f=R(o,96,100),d=Im(o,128),m=yield this.ccipReadFetch(t,c,a);null==m&&gm.throwError("CCIP Read disabled or provided no URLs",y.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const p={to:n,data:C([f,Om([m,d])])};return this._call(p,e,r+1)}catch(t){if(t.code===y.errors.SERVER_ERROR)throw t}try{return P(i)}catch(r){return gm.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"call",params:{transaction:t,blockTag:e},result:i,error:r})}}))}call(t,e){return pm(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield vr({transaction:this._getTransactionRequest(t),blockTag:this._getBlockTag(e),ccipReadEnabled:Promise.resolve(t.ccipReadEnabled)});return this._call(r.transaction,r.blockTag,r.ccipReadEnabled?0:-1)}))}estimateGas(t){return pm(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield vr({transaction:this._getTransactionRequest(t)}),r=yield this.perform("estimateGas",e);try{return qt.from(r)}catch(t){return gm.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"estimateGas",params:e,result:r,error:t})}}))}_getAddress(t){return pm(this,void 0,void 0,(function*(){"string"!=typeof(t=yield t)&&gm.throwArgumentError("invalid address or ENS name","name",t);const e=yield this.resolveName(t);return null==e&&gm.throwError("ENS name not configured",y.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(t)})`}),e}))}_getBlock(t,e){return pm(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;let r=-128;const n={includeTransactions:!!e};if(N(t,32))n.blockHash=t;else try{n.blockTag=yield this._getBlockTag(t),N(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(e){gm.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",t)}return rm((()=>pm(this,void 0,void 0,(function*(){const t=yield this.perform("getBlock",n);if(null==t)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(e){let e=null;for(let r=0;r<t.transactions.length;r++){const n=t.transactions[r];if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){null==e&&(e=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let t=e-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}}const r=this.formatter.blockWithTransactions(t);return r.transactions=r.transactions.map((t=>this._wrapTransaction(t))),r}return this.formatter.block(t)}))),{oncePoll:this})}))}getBlock(t){return this._getBlock(t,!1)}getBlockWithTransactions(t){return this._getBlock(t,!0)}getTransaction(t){return pm(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return rm((()=>pm(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",e);if(null==r)return null==this._emitted["t:"+t]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(t){return pm(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return rm((()=>pm(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",e);if(null==r)return null==this._emitted["t:"+t]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}return n}))),{oncePoll:this})}))}getLogs(t){return pm(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield vr({filter:this._getFilter(t)}),r=yield this.perform("getLogs",e);return r.forEach((t=>{null==t.removed&&(t.removed=!1)})),mm.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return pm(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(t){return pm(this,void 0,void 0,(function*(){if("number"==typeof(t=yield t)&&t<0){t%1&&gm.throwArgumentError("invalid BlockTag","blockTag",t);let e=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return e+=t,e<0&&(e=0),this.formatter.blockTag(e)}return this.formatter.blockTag(t)}))}getResolver(t){return pm(this,void 0,void 0,(function*(){let e=t;for(;;){if(""===e||"."===e)return null;if("eth"!==t&&"eth"===e)return null;const r=yield this._getResolver(e,"getResolver");if(null!=r){const n=new $m(this,r,t);return e===t||(yield n.supportsWildcard())?n:null}e=e.split(".").slice(1).join(".")}}))}_getResolver(t,e){return pm(this,void 0,void 0,(function*(){null==e&&(e="ENS");const r=yield this.getNetwork();r.ensAddress||gm.throwError("network does not support ENS",y.errors.UNSUPPORTED_OPERATION,{operation:e,network:r.name});try{const e=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+Rd(t).substring(2)});return this.formatter.callAddress(e)}catch(t){}return null}))}resolveName(t){return pm(this,void 0,void 0,(function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(e){if(N(t))throw e}"string"!=typeof t&&gm.throwArgumentError("invalid ENS name","name",t);const e=yield this.getResolver(t);return e?yield e.getAddress():null}))}lookupAddress(t){return pm(this,void 0,void 0,(function*(){t=yield t;const e=(t=this.formatter.address(t)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(e,"lookupAddress");if(null==r)return null;const n=Pm(yield this.call({to:r,data:"0x691f3431"+Rd(e).substring(2)}),0);return(yield this.resolveName(n))!=t?null:n}))}getAvatar(t){return pm(this,void 0,void 0,(function*(){let e=null;if(N(t)){const r=this.formatter.address(t).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;e=new $m(this,n,r);try{const t=yield e.getAvatar();if(t)return t.url}catch(t){if(t.code!==y.errors.CALL_EXCEPTION)throw t}try{const t=Pm(yield this.call({to:n,data:"0x691f3431"+Rd(r).substring(2)}),0);e=yield this.getResolver(t)}catch(t){if(t.code!==y.errors.CALL_EXCEPTION)throw t;return null}}else if(e=yield this.getResolver(t),!e)return null;const r=yield e.getAvatar();return null==r?null:r.url}))}perform(t,e){return gm.throwError(t+" not implemented",y.errors.NOT_IMPLEMENTED,{operation:t})}_startEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_stopEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_addEventListener(t,e,r){const n=new Am(wm(t),e,r);return this._events.push(n),this._startEvent(n),this}on(t,e){return this._addEventListener(t,e,!1)}once(t,e){return this._addEventListener(t,e,!0)}emit(t,...e){let r=!1,n=[],i=wm(t);return this._events=this._events.filter((t=>t.tag!==i||(setTimeout((()=>{t.listener.apply(this,e)}),0),r=!0,!t.once||(n.push(t),!1)))),n.forEach((t=>{this._stopEvent(t)})),r}listenerCount(t){if(!t)return this._events.length;let e=wm(t);return this._events.filter((t=>t.tag===e)).length}listeners(t){if(null==t)return this._events.map((t=>t.listener));let e=wm(t);return this._events.filter((t=>t.tag===e)).map((t=>t.listener))}off(t,e){if(null==e)return this.removeAllListeners(t);const r=[];let n=!1,i=wm(t);return this._events=this._events.filter((t=>t.tag!==i||t.listener!=e||(!!n||(n=!0,r.push(t),!1)))),r.forEach((t=>{this._stopEvent(t)})),this}removeAllListeners(t){let e=[];if(null==t)e=this._events,this._events=[];else{const r=wm(t);this._events=this._events.filter((t=>t.tag!==r||(e.push(t),!1)))}return e.forEach((t=>{this._stopEvent(t)})),this}}var Dm=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{h(n.next(t))}catch(t){o(t)}}function a(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}h((n=n.apply(t,e||[])).next())}))};const Um=new y(fm),Lm=["call","estimateGas"];function zm(t,e){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")){const r=N(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if("object"==typeof t){for(const r in t){const n=zm(t[r],e);if(n)return n}return null}if("string"==typeof t)try{return zm(JSON.parse(t),e)}catch(t){}return null}function qm(t,e,r){const n=r.transaction||r.signedTransaction;if("call"===t){const t=zm(e,!0);if(t)return t.data;Um.throwError("missing revert data in call exception; Transaction reverted without a reason string",y.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if("estimateGas"===t){let r=zm(e.body,!1);null==r&&(r=zm(e,!1)),r&&Um.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",y.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===y.errors.SERVER_ERROR&&e.error&&"string"==typeof e.error.message?i=e.error.message:"string"==typeof e.body?i=e.body:"string"==typeof e.responseText&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit/i)&&Um.throwError("insufficient funds for intrinsic transaction cost",y.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&Um.throwError("nonce has already been used",y.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Um.throwError("replacement fee too low",y.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&Um.throwError("legacy pre-eip-155 transactions not supported",y.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),Lm.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&Um.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",y.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function Vm(t){return new Promise((function(e){setTimeout(e,t)}))}function Gm(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function Hm(t){return t?t.toLowerCase():t}const Km={};class Qm extends si{constructor(t,e,r){if(super(),t!==Km)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");gr(this,"provider",e),null==r&&(r=0),"string"==typeof r?(gr(this,"_address",this.provider.formatter.address(r)),gr(this,"_index",null)):"number"==typeof r?(gr(this,"_index",r),gr(this,"_address",null)):Um.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(t){return Um.throwError("cannot alter JSON-RPC Signer connection",y.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Jm(Km,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((t=>(t.length<=this._index&&Um.throwError("unknown account #"+this._index,y.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index]))))}sendUncheckedTransaction(t){t=wr(t);const e=this.getAddress().then((t=>(t&&(t=t.toLowerCase()),t)));if(null==t.gasLimit){const r=wr(t);r.from=e,t.gasLimit=this.provider.estimateGas(r)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((t=>Dm(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.provider.resolveName(t);return null==e&&Um.throwArgumentError("provided ENS name resolves to null","tx.to",t),e}))))),vr({tx:vr(t),sender:e}).then((({tx:e,sender:r})=>{null!=e.from?e.from.toLowerCase()!==r&&Um.throwArgumentError("from address mismatch","transaction",t):e.from=r;const n=this.provider.constructor.hexlifyTransaction(e,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((t=>t),(t=>qm("sendTransaction",t,n)))}))}signTransaction(t){return Um.throwError("signing transactions is unsupported",y.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return Dm(this,void 0,void 0,(function*(){const e=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(t);try{return yield rm((()=>Dm(this,void 0,void 0,(function*(){const t=yield this.provider.getTransaction(r);if(null!==t)return this.provider._wrapTransaction(t,r,e)}))),{oncePoll:this.provider})}catch(t){throw t.transactionHash=r,t}}))}signMessage(t){return Dm(this,void 0,void 0,(function*(){const e="string"==typeof t?_n(t):t,r=yield this.getAddress();return yield this.provider.send("personal_sign",[P(e),r.toLowerCase()])}))}_legacySignMessage(t){return Dm(this,void 0,void 0,(function*(){const e="string"==typeof t?_n(t):t,r=yield this.getAddress();return yield this.provider.send("eth_sign",[r.toLowerCase(),P(e)])}))}_signTypedData(t,e,r){return Dm(this,void 0,void 0,(function*(){const n=yield Kd.resolveNames(t,e,r,(t=>this.provider.resolveName(t))),i=yield this.getAddress();return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(Kd.getPayload(n.domain,e,n.value))])}))}unlock(t){return Dm(this,void 0,void 0,(function*(){const e=this.provider,r=yield this.getAddress();return e.send("personal_unlockAccount",[r.toLowerCase(),t,null])}))}}class Jm extends Qm{sendTransaction(t){return this.sendUncheckedTransaction(t).then((t=>({hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:e=>this.provider.waitForTransaction(t,e)})))}}const Zm={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Ym extends jm{constructor(t,e){let r=e;null==r&&(r=new Promise(((t,e)=>{setTimeout((()=>{this.detectNetwork().then((e=>{t(e)}),(t=>{e(t)}))}),0)}))),super(r),t||(t=yr(this.constructor,"defaultUrl")()),gr(this,"connection","string"==typeof t?Object.freeze({url:t}):Object.freeze(wr(t))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Dm(this,void 0,void 0,(function*(){yield Vm(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch(e){try{t=yield this.send("net_version",[])}catch(t){}}if(null!=t){const e=yr(this.constructor,"getNetwork");try{return e(qt.from(t).toNumber())}catch(e){return Um.throwError("could not detect network",y.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e})}}return Um.throwError("could not detect network",y.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(t){return new Qm(Km,this,t)}getUncheckedSigner(t){return this.getSigner(t).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((t=>t.map((t=>this.formatter.address(t)))))}send(t,e){const r={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Ar(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(n&&this._cache[t])return this._cache[t];const i=em(this.connection,JSON.stringify(r),Gm).then((t=>(this.emit("debug",{action:"response",request:r,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",error:t,request:r,provider:this}),t}));return n&&(this._cache[t]=i,setTimeout((()=>{this._cache[t]=null}),0)),i}prepareRequest(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Hm(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Hm(e.address),e.blockTag]];case"getCode":return["eth_getCode",[Hm(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Hm(e.address),O(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":return e.blockTag?["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]]:e.blockHash?["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":return["eth_call",[yr(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[yr(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=Hm(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return Dm(this,void 0,void 0,(function*(){if("call"===t||"estimateGas"===t){const t=e.transaction;if(t&&null!=t.type&&qt.from(t.type).isZero()&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((e=wr(e)).transaction=wr(t),delete e.transaction.type)}}const r=this.prepareRequest(t,e);null==r&&Um.throwError(t+" not implemented",y.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(r[0],r[1])}catch(r){return qm(t,r,e)}}))}_startEvent(t){"pending"===t.tag&&this._startPending(),super._startEvent(t)}_startPending(){if(null!=this._pendingFilter)return;const t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then((function(r){return function n(){t.send("eth_getFilterChanges",[r]).then((function(r){if(t._pendingFilter!=e)return null;let n=Promise.resolve();return r.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",n=n.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),n.then((function(){return Vm(1e3)}))})).then((function(){if(t._pendingFilter==e)return setTimeout((function(){n()}),0),null;t.send("eth_uninstallFilter",[r])})).catch((t=>{}))}(),r})).catch((t=>{}))}_stopEvent(t){"pending"===t.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(t)}static hexlifyTransaction(t,e){const r=wr(Zm);if(e)for(const t in e)e[t]&&(r[t]=!0);!function(t,e){t&&"object"==typeof t||pr.throwArgumentError("invalid object","object",t),Object.keys(t).forEach((r=>{e[r]||pr.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)}))}(t,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(e){if(null==t[e])return;const r=T(qt.from(t[e]));"gasLimit"===e&&(e="gas"),n[e]=r})),["from","to","data"].forEach((function(e){null!=t[e]&&(n[e]=P(t[e]))})),t.accessList&&(n.accessList=Ls(t.accessList)),n}}var Wm=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{h(n.next(t))}catch(t){o(t)}}function a(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}h((n=n.apply(t,e||[])).next())}))};const Xm=new y(fm);class tp extends Ym{detectNetwork(){const t=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return Wm(this,void 0,void 0,(function*(){let e=this.network;return null==e&&(e=yield t.detectNetwork.call(this),e||Xm.throwError("no network detected",y.errors.UNKNOWN_ERROR,{}),null==this._network&&(gr(this,"_network",e),this.emit("network",e,null))),e}))}}const ep={};function rp(t,{broviderUrl:e="https://rpc.snapshot.org"}={}){const r=`${e}/${t}`;return ep[t]||(ep[t]=new tp({url:r,timeout:25e3,allowGzip:!0},Number(t))),ep[t]}function np(t){return we(_n(t))}var ip=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{h(n.next(t))}catch(t){o(t)}}function a(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}h((n=n.apply(t,e||[])).next())}))};const op=new y("hash/5.6.1"),sp=new Uint8Array(32);sp.fill(0);const ap=qt.from(-1),hp=qt.from(0),up=qt.from(1),lp=qt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const cp=O(up.toHexString(),32),fp=O(hp.toHexString(),32),dp={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},mp=["name","version","chainId","verifyingContract","salt"];function pp(t){return function(e){return"string"!=typeof e&&op.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const gp={name:pp("name"),version:pp("version"),chainId:function(t){try{return qt.from(t).toString()}catch(t){}return op.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Ce(t).toLowerCase()}catch(t){}return op.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=M(t);if(32!==e.length)throw new Error("bad length");return P(e)}catch(t){}return op.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function yp(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=""===e[1],n=parseInt(e[2]||"256");(n%8!=0||n>256||e[2]&&e[2]!==String(n))&&op.throwArgumentError("invalid numeric width","type",t);const i=lp.mask(r?n-1:n),o=r?i.add(up).mul(ap):hp;return function(e){const r=qt.from(e);return(r.lt(o)||r.gt(i))&&op.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),O(r.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(0===r||r>32||e[1]!==String(r))&&op.throwArgumentError("invalid bytes width","type",t),function(e){return M(e).length!==r&&op.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=M(t),r=e.length%32;return r?C([e,sp.slice(r)]):P(e)}(e)}}}switch(t){case"address":return function(t){return O(Ce(t),32)};case"bool":return function(t){return t?cp:fp};case"bytes":return function(t){return we(t)};case"string":return function(t){return np(t)}}return null}function vp(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class wp{constructor(t){gr(this,"types",Object.freeze(Ar(t))),gr(this,"_encoderCache",{}),gr(this,"_types",{});const e={},r={},n={};Object.keys(t).forEach((t=>{e[t]={},r[t]=[],n[t]={}}));for(const n in t){const i={};t[n].forEach((o=>{i[o.name]&&op.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",t),i[o.name]=!0;const s=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&op.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);yp(s)||(r[s]||op.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),r[s].push(n),e[n][s]=!0)}))}const i=Object.keys(r).filter((t=>0===r[t].length));0===i.length?op.throwArgumentError("missing primary type","types",t):i.length>1&&op.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),gr(this,"primaryType",i[0]),function i(o,s){s[o]&&op.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),s[o]=!0,Object.keys(e[o]).forEach((t=>{r[t]&&(i(t,s),Object.keys(s).forEach((e=>{n[e][t]=!0})))})),delete s[o]}(this.primaryType,{});for(const e in n){const r=Object.keys(n[e]);r.sort(),this._types[e]=vp(e,t[e])+r.map((e=>vp(e,t[e]))).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const e=yp(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],r=this.getEncoder(t),n=parseInt(e[3]);return e=>{n>=0&&e.length!==n&&op.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(r);return this._types[t]&&(i=i.map(we)),we(C(i))}}const r=this.types[t];if(r){const e=np(this._types[t]);return t=>{const n=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return this._types[r]?we(n):n}));return n.unshift(e),C(n)}}return op.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||op.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return we(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,r){if(yp(t))return r(t,e);const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const t=n[1],i=parseInt(n[3]);return i>=0&&e.length!==i&&op.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,r)))}const i=this.types[t];return i?i.reduce(((t,{name:n,type:i})=>(t[n]=this._visit(i,e[n],r),t)),{}):op.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new wp(t)}static getPrimaryType(t){return wp.from(t).primaryType}static hashStruct(t,e,r){return wp.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=dp[r];n||op.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>mp.indexOf(t.name)-mp.indexOf(e.name))),wp.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return C(["0x1901",wp.hashDomain(t),wp.from(e).hash(r)])}static hash(t,e,r){return we(wp.encode(t,e,r))}static resolveNames(t,e,r,n){return ip(this,void 0,void 0,(function*(){t=wr(t);const i={};t.verifyingContract&&!N(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const o=wp.from(e);o.visit(r,((t,e)=>("address"!==t||N(e,20)||(i[e]="0x"),e)));for(const t in i)i[t]=yield n(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),r=o.visit(r,((t,e)=>"address"===t&&i[e]?i[e]:e)),{domain:t,value:r}}))}static getPayload(t,e,r){wp.hashDomain(t);const n={},i=[];mp.forEach((e=>{const r=t[e];null!=r&&(n[e]=gp[e](r),i.push({name:e,type:dp[e]}))}));const o=wp.from(e),s=wr(e);return s.EIP712Domain?op.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):s.EIP712Domain=i,o.encode(r),{types:s,domain:n,primaryType:o.primaryType,message:o.visit(r,((t,e)=>{if(t.match(/^bytes(\d*)/))return P(M(e));if(t.match(/^u?int/))return qt.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&op.throwArgumentError("invalid string","value",e),e}return op.throwArgumentError("unsupported type","type",t)}))}}}window&&window.__awaiter;new y("wallet/5.6.2");function bp(t,e,r,n){return js(wp.hash(t,e,r),n)}function Ep(t,r,n,i){return e(this,void 0,void 0,(function*(){let e;try{e=yield rg(i,["function isValidSignature(bytes32 _hash, bytes memory _signature) public view returns (bytes4 magicValue)"],[t,"isValidSignature",[M(n),r]])}catch(t){if(t.message.startsWith("missing revert data in call exception"))return!1;throw t}return e.toLowerCase()==="0x1626ba7e".toLowerCase()}))}function _p(t,r,n,i){return e(this,void 0,void 0,(function*(){return(yield rg(i,["function isValidSignature(bytes _hash, bytes memory _signature) public view returns (bytes4 magicValue)"],[t,"isValidSignature",[M(n),r]])).toLowerCase()==="0x20c13b0b".toLowerCase()}))}function Ap(t,r,n){return e(this,arguments,void 0,(function*(t,e,r,n="1",i={}){const o=rp(n,i);return!!(yield Ep(t,e,r,o))||(yield _p(t,e,r,o))}))}function Mp(t){const{domain:e,types:r,message:n}=t;return Lu.hash(e,r,n)}var kp=["snapshot.4everland.link","ipfs.io","ipfs.fleek.co","gateway.pinata.cloud","dweb.link","ipfs.infura.io"],xp={1:{key:"1",name:"Ethereum",chainId:1,network:"homestead",multicall:"0xeefba1e63905ef1d7acba5a8513c70307c1ce441",ensResolvers:["0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63","0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41"],ensNameWrapper:"0xD4416b13d2b3a9aBae7AcD5D6C2BbDBE25686401",ensSubgraph:"https://subgrapher.snapshot.org/subgraph/arbitrum/5XqPmWe6gjyrJtFn9cLy237i4cWw2j9HcUJEXsP5qGtH",rpc:["https://rpc.ankr.com/eth",{url:"https://api-geth-archive.ankr.com",user:"balancer_user",password:"balancerAnkr20201015"},"https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/eth/mainnet/archive","https://apis.ankr.com/e62bc219f9c9462b8749defe472d2dc5/6106d4a3ec1d1bcc87ec72158f8fd089/eth/archive/main","https://eth-archival.gateway.pokt.network/v1/5f76124fb90218002e9ce985","https://eth-mainnet.alchemyapi.io/v2/4bdDVB5QAaorY2UE-GBUbM2yQB3QJqzv"],light:["https://cloudflare-eth.com"],ws:["wss://eth-mainnet.ws.alchemyapi.io/v2/4bdDVB5QAaorY2UE-GBUbM2yQB3QJqzv"],explorer:{url:"https://etherscan.io",apiUrl:"https://api.etherscan.io"},start:7929876,logo:"ipfs://bafkreid7ndxh6y2ljw2jhbisodiyrhcy2udvnwqgon5wgells3kh4si5z4"},8:{key:"8",name:"Ubiq",chainId:8,network:"Ubiq",multicall:"0x6668750957e4083725926B71C41bDF1434C73262",rpc:["https://rpc.octano.dev"],ws:["wss://ws.octano.dev"],explorer:{url:"https://ubiqscan.io"},start:1,logo:"ipfs://Qmec3HLoN4QhwZAhw4XTi2aN8Wwmcko5hHN22sHARzb9tw"},10:{key:"10",name:"Optimism",chainId:10,network:"Optimism mainnet",multicall:"0x35A6Cdb2C9AD4a45112df4a04147EB07dFA01aB7",rpc:["https://opt-mainnet.g.alchemy.com/v2/JzmIL4Q3jBj7it2duxLFeuCa9Wobmm7D"],explorer:{url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io"},start:657806,logo:"ipfs://QmfF4kwhGL8QosUXvgq2KWCmavhKBvwD6kbhs7L4p5ZAWb"},19:{key:"19",name:"Songbird Canary-Network",shortName:"Songbird",chainId:19,network:"songbird",multicall:"0x17032Ea9c3a13Ed337665145364c0d2aD1108c91",rpc:["https://songbird-api.flare.network/ext/C/rpc"],explorer:{url:"https://songbird-explorer.flare.network"},start:21807126,logo:"ipfs://QmXyvnrZY8FUxSULfnKKA99sAEkjAHtvhRx5WeHixgaEdu"},24:{key:"24",name:"KardiaChain Mainnet",shortName:"KAI",chainId:24,network:"mainnet",multicall:"0xd9c92F2287B7802A37eC9BEce96Aa65fb5f31E1b",rpc:["https://kai-internal.kardiachain.io"],explorer:{url:"https://explorer.kardiachain.io"},start:8260245,logo:"ipfs://bafkreig73yfyqzbxydv6e3dbj5nks3f57px2iez7tywayey4rilfhhrr34"},25:{key:"25",name:"Cronos",shortName:"Cronos",chainId:25,network:"mainnet",multicall:"0x6F522a3982e8F9A50A2EDc9E46ed1A3aE2B3FD3a",rpc:["https://evm-cronos.crypto.org"],explorer:{url:"https://cronos.crypto.org/explorer"},start:4067,logo:"ipfs://QmfSJbtirJoa3Pt7o5Fdm85wbyw9V1hpzqLr5PQbdnfsAj"},30:{key:"30",name:"RSK",chainId:30,network:"rsk mainnet",multicall:"0x4eeebb5580769ba6d26bfd07be636300076d1831",rpc:["https://public-node.rsk.co"],explorer:{url:"https://explorer.rsk.co"},start:2516442,logo:"ipfs://QmXTwpE1SqoNZmyY4c3fYWy6qUgQELsyWKbgJo2Pg6K6V9"},46:{key:"46",name:"Darwinia Network",shortName:"Darwinia",chainId:46,network:"mainnet",multicall:"0x67f9ae42EaA9a8aBf065D60ec6Ab3C1A11370607",rpc:["https://rpc.darwinia.network"],explorer:{url:"https://darwinia.subscan.io"},start:141853,logo:"ipfs://bafkreicf55maidhx46pyu3mwsshlr43xbewr6tkckkonh4nesbkp7krwkm"},56:{key:"56",name:"Binance Smart Chain",shortName:"BSC",chainId:56,network:"mainnet",multicall:"0x1ee38d535d541c55c9dae27b12edf090c608e6fb",rpc:["https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/bsc/mainnet/archive","https://rpc.ankr.com/bsc","https://bsc.getblock.io/mainnet/?api_key=91f8195f-bf46-488f-846a-73d6853790e7","https://bsc-private-dataseed1.nariox.org","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed1.binance.org"],explorer:{url:"https://bscscan.com"},start:461230,logo:"ipfs://QmWQaQ4Tv28DwA4DRKjSDJFWY9mZboGvuu77J8nh7kucxv"},61:{key:"61",name:"Ethereum Classic",shortName:"Ethereum Classic",chainId:61,network:"mainnet",multicall:"0x51be3a92C56ae7E207C5b5Fd87F7798Ce82C1AC2",rpc:["https://www.ethercluster.com/etc"],explorer:{url:"https://blockscout.com/etc/mainnet"},start:13307544,logo:"ipfs://QmVegc28DvA7LjKUFysab81c9BSuN4wQVDQkRXyAtuEBis"},66:{key:"66",name:"OKExChain",shortName:"OEC Mainnet",chainId:66,network:"oec mainnet",multicall:"0x6EB187d8197Ac265c945b69f3c3064A6f3831866",rpc:["https://exchainrpc.okex.org"],ws:["wss://exchainws.okex.org:8443"],explorer:{url:"https://www.oklink.com/okexchain"},start:5076543,logo:"ipfs://Qmd7dKnNwHRZ4HRCbCXUbkNV7gP28fGqPdjbHtjRtT9sQF"},75:{key:"75",name:"Decimal",shortName:"mainnet",chainId:75,network:"mainnet",multicall:"0x949d1A0757803C51F2EfFFEb5472C861A898B8E8",rpc:[],explorer:{url:"https://explorer.decimalchain.com"},start:16031065,logo:"ipfs://bafkreihkdhbce5rkogl63xegaarlirjrvbfarxbtbf5mqme3s5grvbjyxm"},81:{key:"81",name:"Shibuya Network",shortName:"Shibuya",chainId:81,network:"testnet",testnet:!0,multicall:"0x3E90A35839ff0Aa32992d33d861f24dC95BBf74d",rpc:["https://rpc.shibuya.astar.network:8545"],explorer:{url:"https://blockscout.com/shibuya"},start:856303,logo:"ipfs://QmZLQVsUqHBDXutu6ywTvcYXDZG2xBstMfHkfJSzUNpZsc"},82:{key:"82",name:"Meter",shortName:"Meter",chainId:82,network:"mainnet",multicall:"0x579De77CAEd0614e3b158cb738fcD5131B9719Ae",rpc:["https://rpc.meter.io"],explorer:{url:"https://scan.meter.io"},start:4992871,logo:"ipfs://QmSZvT9w9eUDvV1YVaq3BKKEbubtNVqu1Rin44FuN4wz11"},97:{key:"97",name:"Binance Smart Chain Testnet",shortName:"BSC Testnet",chainId:97,network:"testnet",testnet:!0,multicall:"0x8b54247c6BAe96A6ccAFa468ebae96c4D7445e46",rpc:["https://data-seed-prebsc-1-s1.binance.org:8545","https://speedy-nodes-nyc.moralis.io/f2963e29bec0de5787da3164/bsc/testnet/archive"],explorer:{url:"https://testnet.bscscan.com"},start:3599656,logo:"ipfs://QmWQaQ4Tv28DwA4DRKjSDJFWY9mZboGvuu77J8nh7kucxv"},100:{key:"100",name:"Gnosis Chain",shortName:"xDAI",chainId:100,network:"mainnet",multicall:"0xb5b692a88bdfc81ca69dcb1d924f59f0413a602a",rpc:["https://gno.getblock.io/mainnet/6c1d1e6e-75d9-452f-a863-a694bff93d5c/","https://xdai-archive.blockscout.com","https://poa-xdai.gateway.pokt.network/v1/5f76124fb90218002e9ce985","https://rpc.gnosischain.com"],light:["https://rpc.gnosischain.com"],ws:["wss://rpc.xdaichain.com/wss"],explorer:{url:"https://gnosis.blockscout.com"},start:4108192,logo:"ipfs://QmZeiy8Ax4133wzxUQM9ky8z5XFVf6YLFjJMmTWbWVniZR"},108:{key:"108",name:"Thundercore",chainId:108,network:"mainnet",multicall:"0x3017086deef56679e267f67f66c4415109b7a97f",rpc:["https://mainnet-rpc.thundercore.com/archived/SNAPSHOTEuR82a75fLYA"],explorer:{url:"https://viewblock.io/thundercore"},start:94425385,logo:"ipfs://bafkreifc5z5vtvqx2luzgateyvoocwpd2ifv2hwufxdnyl2a767wa6icli"},122:{key:"122",name:"Fuse",shortName:"Fuse",chainId:122,network:"mainnet",multicall:"0x7a59441fb06666F6d2D766393d876945D06a169c",rpc:["https://explorer-node.fuse.io/","https://oefusefull1.liquify.info/"],explorer:{url:"https://explorer.fuse.io"},start:11923459,logo:"ipfs://QmXjWb64nako7voaVEifgdjAbDbswpTY8bghsiHpv8yWtb"},137:{key:"137",name:"Polygon PoS",shortName:"Polygon",chainId:137,network:"mainnet",multicall:"0xCBca837161be50EfA5925bB9Cc77406468e76751",rpc:["https://rpc.ankr.com/polygon","https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/polygon/mainnet/archive","https://speedy-nodes-nyc.moralis.io/f2963e29bec0de5787da3164/polygon/mainnet/archive","https://rpc-mainnet.maticvigil.com/v1/1cfd7598e5ba6dcf0b4db58e8be484badc6ea08e"],ws:["wss://ws-mainnet.matic.network"],explorer:{url:"https://polygonscan.com",apiUrl:"https://api.polygonscan.com"},start:9834491,logo:"ipfs://bafkreihgr7zy7vi5kqddybfaezwuhvssg57qluwmyan4qq7l57nr7w7wey"},144:{key:"144",name:"PHI Network",shortName:"PHI",chainId:144,network:"mainnet",multicall:"0xc2f41B404a6757863AAeF49ff93039421acCd630",rpc:["https://connect.phi.network"],explorer:{url:"https://phiscan.com"},start:360030,logo:"ipfs://bafkreid6pm3mic7izp3a6zlfwhhe7etd276bjfsq2xash6a4s2vmcdf65a"},148:{key:"148",name:"ShimmerEVM",shortName:"ShimmerEVM",chainId:148,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://explorer.evm.shimmer.network/"},start:1290,logo:"ipfs://bafkreib4xhbgbhrwkmizp4d4nz3wzbpyhdm6wpz2v2pbkk7jxsgg3hdt74"},169:{key:"169",name:"Manta Pacific",shortName:"Manta",chainId:169,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://www.oklink.com/manta"},start:332890,logo:"ipfs://bafkreibbrwgwdcfh755dqh4ndta6tja77qbaa36bfv4pstub6prhhore7a"},204:{key:"204",name:"opBNB",shortName:"mainnet",chainId:204,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"http://opbnbscan.com/"},start:512881,logo:"ipfs://bafkreibll4la7wqerzs7zwxjne2j7ayynbg2wlenemssoahxxj5rbt6c64"},246:{key:"246",name:"Energy Web Chain",shortName:"EWC",chainId:246,network:"mainnet",multicall:"0x0767F26d0D568aB61A98b279C0b28a4164A6f05e",rpc:["https://voting-rpc.carbonswap.exchange"],explorer:{url:"https://explorer.energyweb.org"},start:12086501,logo:"ipfs://Qmai7AGHgs8NpeGeXgbMZz7pS2i4kw44qubCJYGrZW2f3a"},250:{key:"250",name:"Fantom Opera",shortName:"fantom",chainId:250,network:"Mainnet",multicall:"0x7f6A10218264a22B4309F3896745687E712962a0",rpc:["https://rpc.ankr.com/fantom","https://rpc.ftm.tools","https://rpcapi.fantom.network"],explorer:{url:"https://ftmscan.com"},start:2497732,logo:"ipfs://QmVEgNeQDKnXygeGxfY9FywZpNGQu98ktZtRJ9bToYF6g7"},269:{key:"269",name:"High Performance Blockchain",shortName:"HPB",chainId:269,network:"mainnet",multicall:"0x67D0f263aef2F6167FA77353695D75b582Ff4Bca",rpc:["https://hpbnode.com"],ws:["wss://ws.hpbnode.com"],explorer:{url:"https://hscan.org"},start:13960096,logo:"ipfs://QmU7f1MyRz8rLELFfypnWZQjGbDGYgZtC9rjw47jYMYrnu"},300:{key:"300",name:"zkSync Sepolia Testnet",shortName:"testnet",chainId:300,network:"testnet",multicall:"0xF9cda624FBC7e059355ce98a31693d299FACd963",rpc:[],explorer:{url:"https://sepolia.explorer.zksync.dev/"},start:2292,logo:"ipfs://bafkreih6y7ri7h667cwxe5miisxghfheiidtbw2747y75stoxt3gp3a2yy",testnet:!0},314:{key:"314",name:"Filecoin",shortName:"mainnet",chainId:314,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://filfox.io"},start:3328594,logo:"ipfs://bafybeibyvjfmk6aqlfdrczvth55jkmnoadtrch7ht3rdmvqmy2bfxynecm"},321:{key:"321",name:"KCC",shortName:"KCC",chainId:321,network:"mainnet",multicall:"0xa64D6AFb48225BDA3259246cfb418c0b91de6D7a",rpc:["https://rpc-mainnet.kcc.network"],ws:["wss://rpc-ws-mainnet.kcc.network"],explorer:{url:"https://explorer.kcc.io"},start:1487453,logo:"ipfs://QmRdzYGhFRG8QLzMJahHrw3vETE2YZ9sywQbEkenSjKEvb"},324:{key:"324",name:"zkSync Era",shortName:"zkSync-era",chainId:324,network:"zkSync Era Mainnet",multicall:"0xF9cda624FBC7e059355ce98a31693d299FACd963",rpc:["https://mainnet.era.zksync.io"],explorer:{url:"https://explorer.zksync.io/"},start:3908235,logo:"ipfs://bafkreih6y7ri7h667cwxe5miisxghfheiidtbw2747y75stoxt3gp3a2yy"},336:{key:"336",name:"Shiden Network",shortName:"Shiden",chainId:336,network:"mainnet",multicall:"0x3E90A35839ff0Aa32992d33d861f24dC95BBf74d",rpc:["https://rpc.shiden.astar.network:8545","https://shiden.api.onfinality.io/public"],explorer:{url:"https://blockscout.com/shiden"},start:1170016,logo:"ipfs://QmcqGQE4Sk73zXc3e91TUFFefKBVeaNgbxV141XkSNE4xj"},369:{key:"369",name:"Pulsechain",shortName:"Pulsechain",chainId:369,network:"mainnet",multicall:"0xdbdd0FD8B16F0092f306392b699D7fbddaA9011B",rpc:["https://rpc.pulsechain.com"],explorer:{url:"https://scan.pulsechain.com/"},start:17657774,logo:"ipfs://QmWUsiEWdejtHZ9B9981TYXn7Ds8C7fkB1S4h5rP3kCCZR"},416:{key:"416",name:"SX Network",shortName:"SX",chainId:416,network:"mainnet",multicall:"0x834a005DDCF990Ba1a79f259e840e58F2D14F49a",rpc:["https://rpc.sx.technology"],ws:["wss://rpc.sx.technology/ws"],explorer:{url:"https://explorer.sx.technology"},start:2680605,logo:"ipfs://QmSXLXqyr2H6Ja5XrmznXbWTEvF2gFaL8RXNXgyLmDHjAF"},592:{key:"592",name:"Astar Network",shortName:"Astar",chainId:592,network:"mainnet",multicall:"0x3E90A35839ff0Aa32992d33d861f24dC95BBf74d",rpc:["https://astar.api.onfinality.io/public","https://rpc.astar.network:8545"],explorer:{url:"https://blockscout.com/astar"},start:366482,logo:"ipfs://QmZLQVsUqHBDXutu6ywTvcYXDZG2xBstMfHkfJSzUNpZsc"},813:{key:"813",name:"Qitmeer",shortName:"MEER",chainId:813,network:"mainnet",multicall:"0x55034b2cF530ae3A8fC1e2e4523F58496796610F",rpc:["https://evm-dataseed1.meerscan.io","https://evm-dataseed.meerscan.com","https://evm-dataseed2.meerscan.io","https://evm-dataseed3.meerscan.io"],explorer:{url:"https://evm.meerscan.io"},start:43317,logo:"ipfs://QmXvum7SNVaAqAc2jNzR1NpNZN1GGvNaKWydg8a1GEDQ7y"},841:{key:"841",name:"Taraxa",shortName:"841",chainId:841,network:"mainnet",multicall:"0xFCe7a3121B42664AaD145712e1c2Bf2e38f60AA1",rpc:["https://rpc.mainnet.taraxa.io"],ws:["wss://ws.mainnet.taraxa.io"],explorer:{url:"https://mainnet.explorer.taraxa.io"},start:1515906,logo:"ipfs://Qmcc6ZCAGESMzZzoj5LsTVcCo2E35x3Ydk71uPJyov6Mwx"},888:{key:"888",name:"Wanchain",chainId:888,network:"mainnet",multicall:"0xba5934ab3056fca1fa458d30fbb3810c3eb5145f",rpc:["https://gwan-ssl.wandevs.org:56891"],ws:["wss://api.wanchain.org:8443/ws/v3/ddd16770c68f30350a21114802d5418eafe039b722de52b488e7eee1ee2cd73f"],explorer:{url:"https://www.wanscan.org"},start:11302663,logo:"ipfs://QmewFFN44rkxESFsHG8edaLt1znr62hjvZhGynfXqruzX3"},1001:{key:"1001",name:"Klaytn Baobab Testnet",shortName:"Boabab",chainId:1001,network:"testnet",testnet:!0,multicall:"0x40643B8Aeaaca0b87Ea1A1E596e64a0e14B1d244",rpc:["https://archive-en.baobab.klaytn.net"],ws:["wss://archive-en.baobab.klaytn.net/ws"],explorer:{url:"https://baobab.scope.klaytn.com"},start:87232478,logo:"ipfs://QmYACyZcidcFtMo4Uf9H6ZKUxTP2TQPjGzNjcUjqYa64dt"},1072:{key:"1072",name:"Shimmer EVM Testnet",shortName:"ShimmerEVM",chainId:1072,network:"testnet",testnet:!0,multicall:"0x751d21047C116413895c259f3f305e38C10B7cF6",rpc:["https://archive.evm.testnet.shimmer.network/v1/chains/rms1pr75wa5xuepg2hew44vnr28wz5h6n6x99zptk2g68sp2wuu2karywgrztx3/evm"],explorer:{url:"https://explorer.evm.testnet.shimmer.network/"},start:10614,logo:"ipfs://bafkreihtwfwrue7klzedwx4rqlk6agklz4lbbk7owsyw6xzn6c2m4t5tgy"},1088:{key:"1088",name:"Metis",shortName:"metis",chainId:1088,network:"mainnet",multicall:"0xc39aBB6c4451089dE48Cffb013c39d3110530e5C",rpc:["https://andromeda.metis.io/?owner=1088"],explorer:{url:"https://andromeda-explorer.metis.io"},start:451,logo:"ipfs://bafkreiaqr4atnjpdnk3c4vu4377ai7bzqpgaefefbl5j5imfsvr4puimtu"},1101:{key:"1101",name:"Polygon zkEVM",shortName:"mainnet",chainId:1101,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://zkevm.polygonscan.com"},start:57746,logo:"ipfs://bafkreibfiyvhqnme2vbxxfcku7qkxgjpkg6ywdkplxh4oxlkqsbznyorfm"},1116:{key:"1116",name:"Core Chain",shortName:"Core",chainId:1116,network:"mainnet",multicall:"0x024f0041b76B598c2A0a75004F8447FaF67BD004",rpc:["https://rpcar.coredao.org/"],explorer:{url:"https://scan.coredao.org"},start:853908,logo:"ipfs://bafkreigjv5yb7uhlrryzib7j2f73nnwqan2tmfnwjdu26vkk365fyesoiu"},1284:{key:"1284",name:"Moonbeam",shortName:"GLMR",chainId:1284,network:"mainnet",multicall:"0x83e3b61886770de2F64AAcaD2724ED4f08F7f36B",rpc:["https://rpc.api.moonbeam.network"],explorer:{url:"https://moonscan.io/"},start:171135,logo:"ipfs://QmWKTEK2pj5sBBbHnMHQbWgw6euVdBrk2Ligpi2chrWASk"},1285:{key:"1285",name:"Moonriver (Kusama)",shortName:"Moonriver",chainId:1285,network:"mainnet",multicall:"0x537004440ffFE1D4AE9F009031Fc2b0385FCA9F1",rpc:["https://rpc.api.moonriver.moonbeam.network"],explorer:{url:"https://blockscout.moonriver.moonbeam.network"},start:413539,logo:"ipfs://QmXtgPesL87Ejhq2Y7yxsaPYpf4RcnoTYPJWPcv6iiYhoi"},1287:{key:"1287",name:"Moonbase Alpha TestNet",shortName:"Moonbase",chainId:1287,network:"testnet",testnet:!0,multicall:"0xf09FD6B6FF3f41614b9d6be2166A0D07045A3A97",rpc:["https://rpc.testnet.moonbeam.network"],explorer:{url:"https://moonbase-blockscout.testnet.moonbeam.network"},start:859041,logo:"ipfs://QmeGbNTU2Jqwg8qLTMGW8n8HSi2VdgCncAaeGzLx6gYnD7"},1328:{key:"1328",name:"Sei atlantic testnet",shortName:"testnet",chainId:1328,network:"testnet",multicall:"0xc454132B017b55b427f45078E335549A7124f5f7",rpc:[],explorer:{url:"https://seitrace.com"},start:96978658,logo:"ipfs://bafkreiammyt7uztbztqbcqv4bydnczsh2fqmnjf6jxj4xnskzzl6sjrigq",testnet:!0},1329:{key:"1329",name:"Sei",shortName:"mainnet",chainId:1329,network:"mainnet",multicall:"0xe033Bed7cae4114Af84Be1e9F1CA7DEa07Dfe1Cf",rpc:[],explorer:{url:"https://seitrace.com/"},start:79164574,logo:"ipfs://bafkreiammyt7uztbztqbcqv4bydnczsh2fqmnjf6jxj4xnskzzl6sjrigq"},1559:{key:"1559",name:"Tenet",shortName:"tenet",chainId:1559,network:"mainnet",multicall:"0xcCB3F00bE353950E4C08501ac8Af48765EAAa738",rpc:[],explorer:{url:"https://tenetscan.io"},start:944415,logo:"ipfs://Qmc1gqjWTzNo4pyFSGtQuCu7kRSZZBUVybtTjHn2nNEEPA"},1663:{key:"1663",name:"Horizen Gobi Testnet",shortName:"Gobi",chainId:1663,network:"testnet",testnet:!0,multicall:"0xC743e4910Bdd4e5aBacCA38F74cdA270281C5eef",rpc:["https://gobi-testnet.horizenlabs.io/ethv1"],explorer:{url:"https://gobi-explorer.horizen.io"},start:1,logo:"ipfs://QmUYQdsnkUoiDiQ3WaWrtH7fsc5yQDC7kZJCHmC2qWPTPt"},2e3:{key:"2000",name:"Doge Chain",shortName:"dogechain",chainId:2e3,network:"mainnet",multicall:"0x6f9D3f3932B417bd4957585D236Cbc32b32C0BDc",rpc:["https://rpc.dogechain.dog"],explorer:{url:"https://explorer.dogechain.dog"},start:877115,logo:"ipfs://bafkreigovfh3pinsdih777issfgaflwu2yjzroljs2642gbvwikcd3nm4i"},2109:{key:"2109",name:"Exosama Network",shortName:"EXN",chainId:2109,network:"mainnet",multicall:"0x2feFC828e2fEfdE0C9f7740919c6A9139F886067",rpc:["https://rpc.exosama.com"],explorer:{url:"https://explorer.exosama.com"},start:94085,logo:"ipfs://QmaQxfwpXYTomUd24PMx5tKjosupXcm99z1jL1XLq9LWBS"},2152:{key:"2152",name:"Findora",shortName:"Findora",chainId:2152,network:"mainnet",multicall:"0xCF7D1e21CBe9bdEF235aef06C5d8051B3d4DF0f5",rpc:["https://archive.prod.findora.org:8545/"],explorer:{url:"https://evm.findorascan.io"},start:4219343,logo:"ipfs://QmXkneyRB6HbHTHRLCZpZqSsawiyJY7b2kZ2V8ydvKYAgv"},2221:{key:"2221",name:"Kava Testnet",shortName:"testnet",chainId:2221,network:"testnet",multicall:"0xc7193EFE367DF0C9349a1149F4E95A2A35604262",rpc:[],explorer:{url:"https://testnet.kavascan.com"},start:6193104,logo:"ipfs://bafkreibpfubharx32fjqkqbfdhygwdjb2khxdg6meaasrcxsgvowos26f4",testnet:!0},2222:{key:"2222",name:"Kava",shortName:"mainnet",chainId:2222,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://kavascan.com/"},start:3661165,logo:"ipfs://bafkreibpfubharx32fjqkqbfdhygwdjb2khxdg6meaasrcxsgvowos26f4"},2400:{key:"2400",name:"TCG Verse",shortName:"TCGV",chainId:2400,network:"mainnet",multicall:"0xceC65DEE0b5012F1b7321b2647681F997c7204FC",rpc:["https://rpc.tcgverse.xyz"],explorer:{url:"https://explorer.tcgverse.xyz"},start:57500,logo:"ipfs://bafkreidg4wpewve5mdxrofneqblydkrjl3oevtgpdf3fk3z3vjqam6ocoe"},4200:{key:"4200",name:"Merlin",shortName:"merlin",chainId:4200,network:"mainnet",multicall:"0x830E7E548F4D80947a40A7Cf3a2a53166a0C3980",rpc:[],explorer:{url:"https://scan.merlinchain.io"},start:589494,logo:"ipfs://bafkreicew2qv3m756m7xs2nrjezinghps7rlessrqjqetvox74w4hov2xe"},4337:{key:"4337",name:"Beam",shortName:"Beam",chainId:4337,network:"mainnet",multicall:"0x4956F15eFdc3dC16645e90Cc356eAFA65fFC65Ec",rpc:[],explorer:{url:"https://subnets.avax.network/beam/"},start:1,logo:"ipfs://QmaKRLxXPdeTsLx7MFLS3CJbhpSbResgoeL4fCgHB1mTsF"},4689:{key:"4689",name:"IoTeX",shortName:"IoTeX",chainId:4689,network:"mainnet",multicall:"0x9c8B105c94282CDB0F3ecF27e3cfA96A35c07be6",rpc:["https://babel-api.mainnet.iotex.io"],explorer:{url:"https://iotexscan.io"},start:11533283,logo:"ipfs://QmNkr1UPcBYbvLp7d7Pk4eF3YCsHpaNkfusKZNtykL2EQC"},5e3:{key:"5000",name:"Mantle",chainId:5e3,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:["https://rpc.mantle.xyz"],explorer:{url:"https://explorer.mantle.xyz"},start:304717,logo:"ipfs://bafkreidkucwfn4mzo2gtydrt2wogk3je5xpugom67vhi4h4comaxxjzoz4"},5555:{key:"5555",name:"Chain Verse",shortName:"ChainVerse",chainId:5555,network:"ChainVerse",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:["https://rpc.chainverse.info"],explorer:{url:"https://explorer.chainverse.info"},start:6334180,logo:"ipfs://QmQyJt28h4wN3QHPXUQJQYQqGiFUD77han3zibZPzHbitk"},6102:{key:"6102",name:"Cascadia Testnet",shortName:"Cascadia",chainId:6102,network:"testnet",multicall:"0x728989819bAD588F193563008E0a03E8cD6a3e4a",rpc:["https://testnet.cascadia.foundation"],explorer:{url:"https://explorer.cascadia.foundation"},testnet:!0,start:370457,logo:"ipfs://QmWkhZYhReYyaa5pQXj32hEGxoRcBqarFMcfQScELmjYQj"},7332:{key:"7332",name:"Horizen EON",shortName:"EON",chainId:7332,network:"mainnet",multicall:"0xC743e4910Bdd4e5aBacCA38F74cdA270281C5eef",rpc:[],explorer:{url:"https://eon-explorer.horizenlabs.io"},start:85108,logo:"ipfs://QmUYQdsnkUoiDiQ3WaWrtH7fsc5yQDC7kZJCHmC2qWPTPt"},7341:{key:"7341",name:"Shyft",shortName:"Shyft",chainId:7341,network:"mainnet",multicall:"0xceb10e9133D771cA93c8002Be527A465E85381a2",rpc:["https://rpc.shyft.network"],explorer:{url:"https://bx.shyft.network"},start:3673983,logo:"ipfs://bafkreifwxnnfk6koabzmxgcxcwlrwt6b5gijdain2gyqee77q4ajfb7fu4"},7560:{key:"7560",name:"Cyber",shortName:"mainnet",chainId:7560,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://cyberscan.co"},start:1731707,logo:"ipfs://bafkreifm2bbehoqpz4454o7gixnxfi6cgvqlxigqr3f6ipj7l2omtgfgnm"},8217:{key:"8217",name:"Klaytn Cypress",shortName:"Cypress",chainId:8217,network:"mainnet",multicall:"0x5f5f0d1b9ff8b3dcace308e39b13b203354906e9",rpc:["https://archive-en.cypress.klaytn.net"],ws:["wss://archive-en.cypress.klaytn.net/ws"],explorer:{url:"https://scope.klaytn.com"},start:91582357,logo:"ipfs://QmYACyZcidcFtMo4Uf9H6ZKUxTP2TQPjGzNjcUjqYa64dt"},8453:{key:"8453",name:"Base",shortName:"mainnet",chainId:8453,network:"mainnet",multicall:"0xca11bde05977b3631167028862be2a173976ca11",rpc:[],explorer:{url:"https://basescan.org/"},start:5022,logo:"ipfs://QmaxRoHpxZd8PqccAynherrMznMufG6sdmHZLihkECXmZv"},9001:{key:"9001",name:"Evmos Network",shortName:"Evmos",chainId:9001,network:"mainnet",multicall:"0x37763d16f8dBf6F185368E0f256350cAb7E24b26",rpc:["https://eth.bd.evmos.org:8545"],ws:["wss://eth.bd.evmos.org:8546"],explorer:{url:"https://escan.live"},start:13959539,logo:"ipfs://bafkreif4obrdoiretpozdd56seziywc6clha7wwkbldng3ovry2bpzly34"},1e4:{key:"10000",name:"smartBCH",shortName:"BCH",chainId:1e4,network:"mainnet",multicall:"0x1b38EBAd553f218e2962Cb1C0539Abb5d6A37774",rpc:["https://smartbch.greyh.at/"],explorer:{url:"https://smartbch-explorer.web.app"},start:268248,logo:"ipfs://QmWG1p7om4hZ4Yi4uQvDpxg4si7qVYhtppGbcDGrhVFvMd"},10243:{key:"10243",name:"Arthera Testnet",shortName:"Arthera_",chainId:10243,network:"testnet",testnet:!0,multicall:"0x27c7FC597aD2E81C4c1cA1769972f79DaF042Da7",rpc:["https://rpc-test.arthera.net"],explorer:{url:"https://explorer-test.arthera.net"},start:10523,logo:"ipfs://QmYQp3e52KjkT4bYdAvB6ACEEpXs2D8DozsDitaADRY2Ak"},13337:{key:"13337",name:"Beam Testnet",shortName:"testnet",chainId:13337,network:"testnet",multicall:"0x9BF49b704EE2A095b95c1f2D4EB9010510c41C9E",rpc:[],explorer:{url:"https://subnets-test.avax.network/beam/"},start:3,logo:"ipfs://QmaKRLxXPdeTsLx7MFLS3CJbhpSbResgoeL4fCgHB1mTsF",testnet:!0},13371:{key:"13371",name:"Immutable zkEVM",shortName:"mainnet",chainId:13371,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://explorer.immutable.com"},start:3680945,logo:"ipfs://bafkreiepnhfv3hgexddjpyaeemxo3byhtxxit6t4zsponyczee6ddjqxwi"},13473:{key:"13473",name:"Immutable zkEVM Testnet",shortName:"testnet",chainId:13473,network:"testnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://explorer.testnet.immutable.com"},start:5307209,logo:"ipfs://bafkreiepnhfv3hgexddjpyaeemxo3byhtxxit6t4zsponyczee6ddjqxwi",testnet:!0},16718:{key:"16718",name:"AirDAO",chainId:16718,network:"mainnet",multicall:"0x25e81aC81A8B03389D78CB45faB78353aB528574",rpc:["https://network-archive.ambrosus.io"],ws:["wss://network-archive.ambrosus.io/ws"],explorer:{url:"https://airdao.io/explorer"},start:22922566,logo:"ipfs://QmSxXjvWng3Diz4YwXDV2VqSPgMyzLYBNfkjJcr7rzkxom"},29548:{key:"29548",name:"MCH Verse",shortName:"mainnet",chainId:29548,network:"mainnet",multicall:"0x1d39652386488CE1fE4254E105F5A42a04d43dB2",rpc:[],explorer:{url:"https://explorer.oasys.mycryptoheroes.net"},start:27458402,logo:"ipfs://QmZZnwR1y6cU1sare2TQmwqkNDLXQxD4GdPrmHLmUoPtbU"},42161:{key:"42161",name:"Arbitrum One",chainId:42161,network:"Arbitrum mainnet",multicall:"0x7A7443F8c577d537f1d8cD4a629d40a3148Dd7ee",rpc:["https://rpc.ankr.com/arbitrum","https://speedy-nodes-nyc.moralis.io/9e03baabdc27be2a35bdec4a/arbitrum/mainnet","https://arb-mainnet.g.alchemy.com/v2/JDvtNGwnHhTltIwfnxQocKwKkCTKA1DL"],explorer:{url:"https://arbiscan.io"},start:256508,logo:"ipfs://QmWZ5SMRfvcK8tycsDqojQaSiKedgtVkS7CkZdxPgeCVsZ"},42170:{key:"42170",name:"Arbitrum Nova",chainId:42170,network:"Arbitrum Nova",multicall:"0x4E74EBd9CABff51cE9a43EFe059bA8c5A28E4A14",rpc:["https://nova.arbitrum.io/rpc","https://arbitrum-nova.public.blastapi.io"],explorer:{url:"https://nova.arbiscan.io/"},start:6006607,logo:"ipfs://bafkreie5xsqt3mrrwu7v32qpmmctibhzhgxf4emfzzddsdhdlfsa7fmplu"},42220:{key:"42220",name:"Celo",shortName:"Celo",chainId:42220,network:"mainnet",multicall:"0xb8d0d2C1391eeB350d2Cd39EfABBaaEC297368D9",rpc:["https://celo.snapshot.org","https://forno.celo.org","https://celo-mainnet--rpc.datahub.figment.io/apikey/e892a66dc36e4d2d98a5d6406d609796/"],explorer:{url:"https://explorer.celo.org"},start:6599803,logo:"ipfs://QmS2tVJ7rdJRe1NHXAi2L86yCbUwVVrmB2mHQeNdJxvQti"},43113:{key:"43113",name:"Avalanche FUJI Testnet",chainId:43113,network:"testnet",testnet:!0,multicall:"0x984476ea55e32e785A9D8FF14329f99D74E3d2A2",rpc:["https://api.avax-test.network/ext/bc/C/rpc"],explorer:{url:"https://testnet.snowtrace.io"},start:10528153,logo:"ipfs://QmeS75uS7XLR8o8uUzhLRVYPX9vMFf4DXgKxQeCzyy7vM2"},43114:{key:"43114",name:"Avalanche",chainId:43114,network:"mainnet",multicall:"0x7E9985aE4C8248fdB07607648406a48C76e9e7eD",rpc:["https://nd-784-543-849.p2pify.com/aa7b29fc5fed65b34f0ee6b8de33f8c0/ext/bc/C/rpc","https://rpc.ankr.com/avalanche","https://api.avax.network/ext/bc/C/rpc"],explorer:{url:"https://snowtrace.io"},start:536483,logo:"ipfs://QmeS75uS7XLR8o8uUzhLRVYPX9vMFf4DXgKxQeCzyy7vM2"},47805:{key:"47805",name:"REI Mainnet",chainId:47805,network:"mainnet",multicall:"0x9eE9904815B80C39C1a27294E69a8626EAa7952d",rpc:["https://rpc.rei.network"],explorer:{url:"https://scan.rei.network/"},start:1715902,logo:"ipfs://QmTogMDLmDgJjDjUKDHDuc2KVTVDbXf8bXJLFiVe8PRxgo"},53935:{key:"53935",name:"DFK Chain",chainId:53935,network:"mainnet",multicall:"0x5b24224dC16508DAD755756639E420817DD4c99E",rpc:["https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"],explorer:{url:"https://subnets.avax.network/defi-kingdoms/"},start:62,logo:"ipfs://QmZNkpVgPbuVbDcsi6arwH1om3456FGnwfDqYQJWUfHDEx"},59141:{key:"59141",name:"Linea Sepolia",shortName:"testnet",chainId:59141,network:"testnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://sepolia.lineascan.build/"},start:227427,logo:"ipfs://bafkreihtyzolub3sejuwc32hpdpjnt7ksowaguni2yuho3kyihhcqrtqce",testnet:!0},59144:{key:"59144",name:"Linea",shortName:"linea",chainId:59144,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://lineascan.build/"},start:42,logo:"ipfs://bafkreihtyzolub3sejuwc32hpdpjnt7ksowaguni2yuho3kyihhcqrtqce"},80001:{key:"80001",name:"Polygon Mumbai",chainId:80001,network:"testnet",testnet:!0,multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:["https://speedy-nodes-nyc.moralis.io/9e03baabdc27be2a35bdec4a/polygon/mumbai/archive","https://rpc-mumbai.matic.today"],ws:["wss://ws-mumbai.matic.today"],explorer:{url:"https://mumbai.polygonscan.com",apiUrl:"https://api-mumbai.polygonscan.com"},start:12011090,logo:"ipfs://bafkreihgr7zy7vi5kqddybfaezwuhvssg57qluwmyan4qq7l57nr7w7wey"},81457:{key:"81457",name:"Blast",shortName:"mainnet",chainId:81457,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://blastscan.io"},start:88189,logo:"ipfs://bafkreibfmkjg22cozxppzcoxswj45clvh2rqhxzax57cmmgudbtkf4dkce"},84532:{key:"84532",name:"Base Sepolia",shortName:"testnet",chainId:84532,network:"testnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://base-sepolia.blockscout.com/"},start:1059647,logo:"ipfs://QmaxRoHpxZd8PqccAynherrMznMufG6sdmHZLihkECXmZv",testnet:!0},686868:{key:"686868",name:"Merlin Testnet",shortName:"merlin",chainId:686868,network:"testnet",multicall:"0x758BC6321b7c68F4986d62a4D46E83A2DCb58c80",rpc:[],explorer:{url:"https://testnet-scan.merlinchain.io"},start:3562021,logo:"ipfs://bafkreicew2qv3m756m7xs2nrjezinghps7rlessrqjqetvox74w4hov2xe",testnet:!0},713715:{key:"713715",name:"Sei EVM Devnet",shortName:"devnet",chainId:713715,network:"testnet",multicall:"0xEe8d287B844959ADe40d718Dc23077ba920e2f07",rpc:[],explorer:{url:"https://seitrace.com"},start:1463669,logo:"ipfs://bafkreiammyt7uztbztqbcqv4bydnczsh2fqmnjf6jxj4xnskzzl6sjrigq",testnet:!0},810180:{key:"810180",name:"zkLink Nova",shortName:"zlink",chainId:810180,network:"mainnet",multicall:"0x825267E0fA5CAe92F98540828a54198dcB3Eaeb5",rpc:[],explorer:{url:"https://explorer.zklink.io"},start:146055,logo:"ipfs://bafkreic6c3iems5235qapyhyrygha7akqrsfact2nok3y2uhljpzxrdu74"},810181:{key:"810181",name:"zkLink Nova Sepolia",shortName:"testnet",chainId:810181,network:"testnet",multicall:"0x97148F8fDdd9A1620f72EC1Bb2932916623d9da5",rpc:[],explorer:{url:"https://sepolia.explorer.zklink.io/"},start:43723,logo:"ipfs://bafkreic6c3iems5235qapyhyrygha7akqrsfact2nok3y2uhljpzxrdu74",testnet:!0},11155111:{key:"11155111",name:"Sepolia testnet",shortName:"Sepolia",chainId:11155111,network:"sepolia",testnet:!0,multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:["https://sepolia.infura.io/v3/d26b4fd748814fe994b05899fd89e667"],ensResolvers:["0x8FADE66B79cC9f707aB26799354482EB93a5B7dD"],ensNameWrapper:"0x0635513f179D50A207757E05759CbD106d7dFcE8",ensSubgraph:"https://api.studio.thegraph.com/proxy/49574/enssepolia/version/latest",explorer:{url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io"},start:751532,logo:"ipfs://bafkreid7ndxh6y2ljw2jhbisodiyrhcy2udvnwqgon5wgells3kh4si5z4"},11155420:{key:"11155420",name:"OP Sepolia",shortName:"testnet",chainId:11155420,network:"testnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://sepolia-optimism.etherscan.io"},start:1620204,logo:"ipfs://QmfF4kwhGL8QosUXvgq2KWCmavhKBvwD6kbhs7L4p5ZAWb",testnet:!0},111557560:{key:"111557560",name:"Cyber Testnet",shortName:"testnet",chainId:111557560,network:"testnet",multicall:"0xffc391F0018269d4758AEA1a144772E8FB99545E",rpc:[],explorer:{url:"https://testnet.cyberscan.co/"},start:304545,logo:"ipfs://bafkreifm2bbehoqpz4454o7gixnxfi6cgvqlxigqr3f6ipj7l2omtgfgnm",testnet:!0},168587773:{key:"168587773",name:"Blast Sepolia",shortName:"testnet",chainId:168587773,network:"testnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://sepolia.blastexplorer.io"},start:756690,logo:"ipfs://bafkreibfmkjg22cozxppzcoxswj45clvh2rqhxzax57cmmgudbtkf4dkce",testnet:!0},245022926:{key:"245022926",name:"Neon Devnet",shortName:"devnet",chainId:245022926,network:"testnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://devnet.neonscan.org/"},start:205206112,logo:"ipfs://QmecRPQGa4bU7tybg1sUQY48Md9rWnmhrT6WW5ueqvhg6P",testnet:!0},1313161554:{key:"1313161554",name:"Aurora",shortName:"Aurora",chainId:1313161554,network:"mainnet",multicall:"0x32b50c286DEFd2932a0247b8bb940b78c063F16c",rpc:["https://mainnet.aurora.dev"],explorer:{url:"https://explorer.mainnet.aurora.dev"},start:57190533,logo:"ipfs://QmeRhsR1UPRTQCizdhmgr2XxphXebVKU5di97uCV2UMFpa"},16666e5:{key:"1666600000",name:"Harmony",shortName:"HarmonyMainnet",chainId:16666e5,network:"mainnet",multicall:"0x9c31392D2e0229dC4Aa250F043d46B9E82074BF8",rpc:["https://a.api.s0.t.hmny.io"],ws:["wss://ws.s0.t.hmny.io"],explorer:{url:"https://explorer.harmony.one"},start:10911984,logo:"ipfs://QmNnGPr1CNvj12SSGzKARtUHv9FyEfE5nES73U4vBWQSJL"},16667e5:{key:"1666700000",name:"Harmony Testnet",shortName:"HarmonyTestnet",chainId:16667e5,network:"testnet",testnet:!0,multicall:"0x9923589503Fd205feE3d367DDFF2378f0F7dD2d4",rpc:["https://api.s0.b.hmny.io"],ws:["wss://ws.s0.b.hmny.io"],explorer:{url:"https://explorer.pops.one"},start:7521509,logo:"ipfs://QmNnGPr1CNvj12SSGzKARtUHv9FyEfE5nES73U4vBWQSJL"}};class Np{constructor(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}static isValidChoice(t,e){return"number"==typeof t&&void 0!==(null==e?void 0:e[t-1])}getValidVotes(){return this.votes.filter((t=>Np.isValidChoice(t.choice,this.proposal.choices)))}getScores(){return this.proposal.choices.map(((t,e)=>{const r=this.getValidVotes().filter((t=>t.choice===e+1));return r.reduce(((t,e)=>t+e.balance),0)}))}getScoresByStrategy(){return this.proposal.choices.map(((t,e)=>{const r=this.strategies.map(((t,r)=>{const n=this.getValidVotes().filter((t=>t.choice===e+1));return n.reduce(((t,e)=>t+e.scores[r]),0)}));return r}))}getScoresTotal(){return this.votes.reduce(((t,e)=>t+e.balance),0)}getChoiceString(){return this.proposal.choices[this.selected-1]}}class Sp{constructor(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}static isValidChoice(t,e){return Array.isArray(t)&&t.every((t=>void 0!==(null==e?void 0:e[t-1])))&&t.length===new Set(t).size}getValidVotes(){return this.votes.filter((t=>Sp.isValidChoice(t.choice,this.proposal.choices)))}getScores(){return this.proposal.choices.map(((t,e)=>this.getValidVotes().filter((t=>t.choice.includes(e+1))).reduce(((t,e)=>t+e.balance),0)))}getScoresByStrategy(){return this.proposal.choices.map(((t,e)=>this.strategies.map(((t,r)=>this.getValidVotes().filter((t=>t.choice.includes(e+1))).reduce(((t,e)=>t+e.scores[r]),0)))))}getScoresTotal(){return this.votes.reduce(((t,e)=>t+e.balance),0)}getChoiceString(){return this.selected?this.proposal.choices.filter(((t,e)=>this.selected.includes(e+1))).join(", "):""}}function Pp(t,e){const r=t/e.reduce(((t,e)=>t+e),0);return isNaN(r)?0:r}function Ip(t,e){return Math.sqrt(t*e)}function Rp(t){return t*t}function Cp(t,e){return t.map((t=>e*t))}class Tp{constructor(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}static isValidChoice(t,e){return"object"==typeof t&&!Array.isArray(t)&&null!==t&&Object.keys(t).every((t=>void 0!==(null==e?void 0:e[Number(t)-1])))&&Object.keys(t).length>0&&Object.values(t).every((t=>"number"==typeof t&&t>=0))&&Object.values(t).some((t=>"number"==typeof t&&t>0))}getValidVotes(){return this.votes.filter((t=>Tp.isValidChoice(t.choice,this.proposal.choices)))}getScores(){const t=this.getValidVotes(),e=this.getValidVotes().reduce(((t,e)=>t+e.balance),0),r=this.proposal.choices.map(((e,r)=>{const n=t.map((t=>Ip(Pp(t.choice[r+1],Object.values(t.choice)),t.balance))).reduce(((t,e)=>t+e),0);return Rp(n)}));return Cp(r.map(((t,e)=>Pp(r[e],r))),e)}getScoresByStrategy(){const t=this.getValidVotes(),e=this.getValidVotes().reduce(((t,e)=>t+e.balance),0),r=this.proposal.choices.map(((e,r)=>this.strategies.map(((e,n)=>t.map((t=>Ip(Pp(t.choice[r+1],Object.values(t.choice)),t.scores[n]))).reduce(((t,e)=>t+e),0))))).map((t=>t.map((t=>[Rp(t)]))));return r.map(((t,n)=>Cp(this.strategies.map(((t,e)=>Pp(r[n][e][0],r.flat(2)))),e)))}getScoresTotal(){return this.votes.reduce(((t,e)=>t+e.balance),0)}getChoiceString(){return this.proposal.choices.map(((t,e)=>{if(this.selected[e+1]){const r=Pp(this.selected[e+1],Object.values(this.selected));return`${Math.round(1e3*r)/10}% for ${t}`}})).filter((t=>null!=t)).join(", ")}}function Op(t,e){const r=[...new Set(t.map((t=>t[0])).flat())],n=Object.entries(t.reduce(((t,[e],r,n)=>{const i=n[r][1];t[e[0]][0]+=i;const o=n[r][2];return o.length>1?t[e[0]][1]=o.map(((r,n)=>r+t[e[0]][1][n]||r)):t[e[0]][1]=[t[e[0]][1].concat(o).reduce(((t,e)=>t+e),0)],t}),Object.assign({},...r.map((t=>({[t]:[0,[]]})))))),i=n.map((t=>[t[0],t[1][0]])),[o,s]=i.reduce((([t,e],[r,n])=>n>e?[r,n]:[t,e]),["?",-1/0]),[a,h]=i.reduce((([t,e],[r,n])=>n<e?[r,n]:[t,e]),["?",1/0]),u=n.sort(((t,e)=>e[1][0]-t[1][0])),l=t.map((t=>t[1])).reduce(((t,e)=>t+e),0);return e.push({round:e.length+1,sortedByHighest:u}),s>l/2||u.length<3?e:Op(t.map((t=>[t[0].filter((t=>t!=a)),t[1],t[2]])).filter((t=>t[0].length>0)),e)}function $p(t){const e=Op(t.map((t=>[t.choice,t.balance,t.scores])),[]);return e[e.length-1].sortedByHighest}class Bp{constructor(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}static isValidChoice(t,e){return Array.isArray(t)&&t.every((t=>void 0!==(null==e?void 0:e[t-1])))&&t.length===new Set(t).size&&t.length>0&&t.length===e.length}getValidVotes(){return this.votes.filter((t=>Bp.isValidChoice(t.choice,this.proposal.choices)))}getScores(){return function(t,e){const r=$p(t);return e.choices.map(((t,e)=>r.filter((t=>Number(t[0])===e+1)).reduce(((t,e)=>t+e[1][0]),0)))}(this.getValidVotes(),this.proposal)}getScoresByStrategy(){const t=$p(this.getValidVotes());return this.proposal.choices.map(((e,r)=>this.strategies.map(((e,n)=>t.filter((t=>Number(t[0])===r+1)).reduce(((t,e)=>t+e[1][1][n]),0)))))}getScoresTotal(){return this.votes.reduce(((t,e)=>t+e.balance),0)}getChoiceString(){return this.selected.map((t=>{if(this.proposal.choices[t-1])return this.proposal.choices[t-1]})).map(((t,e)=>`(${ug(e+1)}) ${t}`)).join(", ")}}function Fp(t,e,r){const n=r.reduce(((t,e)=>t+e),0),i=e[t]/n*100;return isNaN(i)?0:i}function jp(t,e,r){return Fp(t+1,e,Object.values(e))/100*r}class Dp{constructor(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}static isValidChoice(t,e){return"object"==typeof t&&!Array.isArray(t)&&null!==t&&Object.keys(t).every((t=>void 0!==(null==e?void 0:e[Number(t)-1])))&&Object.keys(t).length>0&&Object.values(t).every((t=>"number"==typeof t&&t>=0))&&Object.values(t).some((t=>"number"==typeof t&&t>0))}getValidVotes(){return this.votes.filter((t=>Dp.isValidChoice(t.choice,this.proposal.choices)))}getScores(){const t=this.proposal.choices.map(((t,e)=>this.getValidVotes().map((t=>jp(e,t.choice,t.balance))).reduce(((t,e)=>t+e),0))),e=this.getValidVotes().reduce(((t,e)=>t+e.balance),0);return t.map(((e,r)=>Fp(r,t,t))).map((t=>e/100*t))}getScoresByStrategy(){const t=this.proposal.choices.map(((t,e)=>this.strategies.map(((t,r)=>this.getValidVotes().map((t=>jp(e,t.choice,t.scores[r]))).reduce(((t,e)=>t+e),0))))).map((t=>t.map((t=>[t])))),e=this.getValidVotes().reduce(((t,e)=>t+e.balance),0);return t.map(((r,n)=>this.strategies.map(((e,r)=>Fp(0,t[n][r],t.flat(2)))).map((t=>[e/100*t])).flat()))}getScoresTotal(){return this.votes.reduce(((t,e)=>t+e.balance),0)}getChoiceString(){return this.proposal.choices.map(((t,e)=>{if(this.selected[e+1])return`${Math.round(10*Fp(e+1,this.selected,Object.values(this.selected)))/10}% for ${t}`})).filter((t=>null!=t)).join(", ")}}var Up={"single-choice":Np,approval:Sp,quadratic:Tp,"ranked-choice":Bp,weighted:Dp,basic:Np};const Lp={1:"https://subgrapher.snapshot.org/delegation/1",10:"https://subgrapher.snapshot.org/delegation/10",56:"https://subgrapher.snapshot.org/delegation/56",100:"https://subgrapher.snapshot.org/delegation/100",137:"https://subgrapher.snapshot.org/delegation/137",250:"https://subgrapher.snapshot.org/delegation/250",42161:"https://subgrapher.snapshot.org/delegation/42161",11155111:"https://subgrapher.snapshot.org/delegation/11155111"},zp=1e3;function qp(t){return t.length===zp&&t[0].timestamp===t[t.length-1].timestamp}function Vp(t,e){const r=function(t){return`${t.delegator}-${t.delegate}-${t.space}`}(e);t.has(r)||t.set(r,e)}function Gp(t){const e=["",t];return t.includes(".eth")&&e.push(t.replace(".eth","")),e}function Hp(t){return e(this,arguments,void 0,(function*({url:t,spaces:e,pivot:r,snapshot:n}){const i={delegations:{__args:{where:{space_in:e,timestamp_gte:r},first:zp,skip:0,orderBy:"timestamp",orderDirection:"asc"},delegator:!0,space:!0,delegate:!0,timestamp:!0}};return"latest"!==n&&(i.delegations.__args.block={number:n}),(yield ig(t,i)).delegations||[]}))}const Kp="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",Qp=["function text(bytes32 node, string calldata key) external view returns (string memory)","function resolver(bytes32 node) view returns (address)"],Jp={Accept:"application/json","Content-Type":"application/json"},Zp="https://score.snapshot.org";function Yp(t=Zp,e={path:""}){const r=new URL(t);e.path&&(r.pathname=e.path);const n=r.searchParams.get("apiKey");let i=Object.assign({},Jp);return n&&(r.searchParams.delete("apiKey"),i=Object.assign(Object.assign({},Jp),{"X-API-KEY":n})),{url:r.toString(),headers:i}}function Wp(t){return e(this,void 0,void 0,(function*(){let e=yield t.text();try{e=JSON.parse(e)}catch(r){return Promise.reject({code:t.status||500,message:"Failed to parse response from score API",data:e})}return e.error?Promise.reject(e.error):e}))}const Xp=new df({allErrors:!0,allowUnionTypes:!0,$data:!0,passContext:!0});yf(Xp),wf(Xp),Xp.addFormat("address",{validate:t=>{try{return Te(t)}catch(t){return!1}}}),Xp.addFormat("evmOrStarknetAddress",{validate:t=>{try{return Te(t)||/^0x[0-9a-fA-F]{62,64}$/.test(t)}catch(t){return!1}}}),Xp.addFormat("long",{validate:()=>!0}),Xp.addFormat("ethValue",{validate:t=>{if(!t.match(/^([0-9]|[1-9][0-9]+)(\.[0-9]+)?$/))return!1;try{return function(t,e){if("string"!=typeof t&&Ya.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=Wa.indexOf(e);-1!==t&&(e=3*t)}Ha(t,null!=e?e:18)}(t,18),!0}catch(t){return!1}}});const tg=Object.keys(xp),eg=Object.keys(xp).filter((t=>!xp[t].testnet));function rg(t,r,n,i){return e(this,void 0,void 0,(function*(){const e=new sa(n[0],r,t);try{const t=n[2]||[];return yield e[n[1]](...t,i||{})}catch(t){return Promise.reject(t)}}))}function ng(t,r,n,i,o){return e(this,void 0,void 0,(function*(){const e=(null==o?void 0:o.multicallAddress)||xp[t].multicall,s=new sa(e,["function aggregate(tuple(address target, bytes callData)[] calls) view returns (uint256 blockNumber, bytes[] returnData)"],r),a=new Yn(n);try{const t=(null==o?void 0:o.limit)||500;(null==o?void 0:o.limit)&&delete o.limit;const e=Math.ceil(i.length/t),r=[];Array.from(Array(e)).forEach(((e,n)=>{const h=i.slice(t*n,t*(n+1));r.push(s.aggregate(h.map((t=>[t[0].toLowerCase(),a.encodeFunctionData(t[1],t[2])])),o||{}))}));let n=yield Promise.all(r);return n=n.reduce(((t,[,e])=>t.concat(e)),[]),n.map(((t,e)=>a.decodeFunctionResult(i[e][1],t)))}catch(t){return Promise.reject(t)}}))}function ig(t,r){return e(this,arguments,void 0,(function*(t,e,r={}){const n=yield a(t,{method:"POST",headers:Object.assign({Accept:"application/json","Content-Type":"application/json"},null==r?void 0:r.headers),body:JSON.stringify({query:Ku.jsonToGraphQLQuery({query:e})})});let i=yield n.text();try{i=JSON.parse(i)}catch(e){throw new Error(`Errors found in subgraphRequest: URL: ${t}, Status: ${n.status}, Response: ${i.substring(0,400)}`)}if(i.errors)throw new Error(`Errors found in subgraphRequest: URL: ${t}, Status: ${n.status}, Response: ${JSON.stringify(i.errors).substring(0,400)}`);const{data:o}=i;return o||{}}))}function og(t,e=kp[0]){const r=`https://${e}`;if(!t)return null;if(!(t.startsWith("ipfs://")||t.startsWith("ipns://")||t.startsWith("https://")||t.startsWith("http://")))return`${r}/ipfs/${t}`;const n=t.split("://")[0];return"ipfs"===n?t.replace("ipfs://",`${r}/ipfs/`):"ipns"===n?t.replace("ipns://",`${r}/ipns/`):t}function sg(r,n){return e(this,arguments,void 0,(function*(e,r,n="1",i={}){var o,s;const{ensResolvers:a=(null===(o=xp[n])||void 0===o?void 0:o.ensResolvers)||xp[1].ensResolvers,broviderUrl:h}=i,u=t(i,["ensResolvers","broviderUrl"]),l=du(fu(e)),c=rp(n,{broviderUrl:h}),f=[[Kp,"resolver",[l]],...a.map((t=>[t,"text",[l,r]]))],[[d],...m]=yield ng(n,c,Qp,f,u),p=a.indexOf(d);return-1!==p?null===(s=m[p])||void 0===s?void 0:s[0]:null}))}function ag(t){return e(this,arguments,void 0,(function*(t,e="1",r={}){try{return yield sg(t,"snapshot",e,r)}catch(t){return console.log(t),null}}))}function hg(t){return e(this,arguments,void 0,(function*(t,e="1",r={}){const n=rp(e,r),i=new sa(Kp,["function owner(bytes32) view returns (address)"],n),o=r.ensNameWrapper||xp[e].ensNameWrapper,s=du(fu(t));let a=yield i.owner(s);if(a===o){const t=new sa(o,["function ownerOf(uint256) view returns (address)"],n);a=yield t.ownerOf(s)}return a}))}function ug(t){const e=["th","st","nd","rd"],r=t%100;return t+(e[(r-20)%10]||e[r]||e[0])}function lg(t){return!!xp[t]}function cg(t){return Te(t)&&"0x0000000000000000000000000000000000000000"!==t}function fg(t,e){return"latest"===t||"number"==typeof t&&t>=xp[e].start}function dg(t){return Promise.reject(new Error(t))}Xp.addKeyword({keyword:"snapshotNetwork",validate:function(t,e){return"mainnet"===(this.snapshotEnv||"default")?eg.includes(e):tg.includes(e)},error:{message:"network not allowed"}}),Xp.addKeyword({keyword:"maxLengthWithSpaceType",validate:function t(e,r){const n=this.spaceType||"default",i=r.length<=e[n];return i||(t.errors=[{keyword:"maxLengthWithSpaceType",message:`must NOT have more than ${e[n]} characters`,params:{limit:e[n]}}]),i},errors:!0}),Xp.addKeyword({keyword:"maxItemsWithSpaceType",validate:function t(e,r){const n=this.spaceType||"default",i=r.length<=e[n];return i||(t.errors=[{keyword:"maxItemsWithSpaceType",message:`must NOT have more than ${e[n]} items`,params:{limit:e[n]}}]),i},errors:!0}),Xp.addFormat("customUrl",{type:"string",validate:t=>!t.length||(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("ipfs://")||t.startsWith("ipns://")||t.startsWith("snapshot://"))});var mg={call:rg,multicall:ng,subgraphRequest:ig,ipfsGet:function(t,r){return e(this,arguments,void 0,(function*(t,e,r="ipfs"){return a(`https://${t}/${r}/${e}`).then((t=>t.json()))}))},getUrl:og,getJSON:function(t){return e(this,arguments,void 0,(function*(t,e={}){const r=og(t,e.gateways);return a(r).then((t=>t.json()))}))},sendTransaction:function(t,r,n,i,o){return e(this,arguments,void 0,(function*(t,e,r,n,i,o={}){const s=t.getSigner(),a=new sa(e,r,t).connect(s);return yield a[n](...i,o)}))},getScores:function(t,r,n,i){return e(this,arguments,void 0,(function*(t,e,r,n,i="latest",o=Zp,s={}){if(!Array.isArray(n))return dg("addresses should be an array of addresses");if(0===n.length)return dg("addresses can not be empty");const h=n.find((t=>!cg(t)));if(h)return dg(`Invalid address: ${h}`);if(!lg(r))return dg(`Invalid network: ${r}`);const u=e.find((t=>t.network&&!lg(t.network)));if(u)return dg(`Invalid network (${u.network}) in strategy ${u.name}`);if(!fg(i,r))return dg(`Snapshot (${i}) must be 'latest' or greater than network start block (${xp[r].start})`);new URL(o).pathname="/api/scores";const{url:l,headers:c}=Yp(o,{path:"/api/scores"});try{const o={space:t,network:r,snapshot:i,strategies:e,addresses:n},h=yield a(l,{method:"POST",headers:c,body:JSON.stringify({params:o})}),u=yield Wp(h);return"all"===s.returnValue?u.result:u.result[s.returnValue||"scores"]}catch(t){return t.errno?Promise.reject({code:t.errno,message:t.toString(),data:""}):Promise.reject(t)}}))},getVp:function(t,r,n,i,o,s,h){return e(this,void 0,void 0,(function*(){const{url:e,headers:u}=Yp(null==h?void 0:h.url);if(!cg(t))return dg(`Invalid voter address: ${t}`);if(!lg(r))return dg(`Invalid network: ${r}`);const l=n.find((t=>t.network&&!lg(t.network)));if(l)return dg(`Invalid network (${l.network}) in strategy ${l.name}`);if(!fg(i,r))return dg(`Snapshot (${i}) must be 'latest' or greater than network start block (${xp[r].start})`);const c={method:"POST",headers:u,body:JSON.stringify({jsonrpc:"2.0",method:"get_vp",params:{address:t,network:r,strategies:n,snapshot:i,space:o,delegation:s}})};try{const t=yield a(e,c);return(yield Wp(t)).result}catch(t){return t.errno?Promise.reject({code:t.errno,message:t.toString(),data:""}):Promise.reject(t)}}))},validateSchema:function(t,e,r={snapshotEnv:"default",spaceType:"default"}){const n=Xp.compile(t),i=n.call(r,e);return i||n.errors},getEnsTextRecord:sg,getSpaceUri:ag,getEnsOwner:hg,getSpaceController:function(t){return e(this,arguments,void 0,(function*(t,e="1",r={}){const n=yield ag(t,e,r);if(n){let t=Te(n);if(t)return n;const e=n.split("/"),r=e.includes("testnet")?5:4,i=e[r];if(t=Te(i),t)return i}return yield hg(t,e,r)}))},getDelegatesBySpace:function(t,r){return e(this,arguments,void 0,(function*(t,e,r="latest",n={}){const i=n.subgraphUrl||Lp[t];if(!i)return Promise.reject(`Delegation subgraph not available for network ${t}`);let o=0;const s=new Map,a=Gp(e);for(;;){const t=yield Hp({url:i,spaces:a,pivot:o,snapshot:r});if(qp(t))throw new Error("Unable to paginate delegation");if(t.forEach((t=>{Vp(s,t),o=t.timestamp})),t.length<zp)break}return[...s.values()]}))},clone:function(t){return JSON.parse(JSON.stringify(t))},sleep:function(t){return e(this,void 0,void 0,(function*(){return new Promise((e=>{setTimeout(e,t)}))}))},getNumberWithOrdinal:ug,voting:Up,getProvider:rp,signMessage:function(t,r,n){return e(this,void 0,void 0,(function*(){return r=P(new Buffer(r,"utf8")),yield t.send("personal_sign",[r,n])}))},getBlockNumber:function(t){return e(this,void 0,void 0,(function*(){try{const e=yield t.getBlockNumber();return parseInt(e)}catch(t){return Promise.reject()}}))},Multicaller:class{constructor(t,e,r,n){this.options={},this.calls=[],this.paths=[],this.network=t,this.provider=e,this.abi=r,this.options=n||{}}call(t,e,r,n){return this.calls.push([e,r,n]),this.paths.push(t),this}execute(t){return e(this,void 0,void 0,(function*(){const e=t||{};return(yield ng(this.network,this.provider,this.abi,this.calls,this.options)).forEach(((t,r)=>fd(e,this.paths[r],t.length>1?t:t[0]))),this.calls=[],this.paths=[],e}))}},getSnapshots:function(t,r,n,i){return e(this,arguments,void 0,(function*(t,e,r,n,i={}){const o={};if(n.forEach((t=>o[t]="latest")),"latest"===e)return o;const s=`${t}-${e}-${n.join("-")}`,a=dd[s],h=Date.now();if(a&&md>h)return a;md<h&&(dd={},md=h+36e5-h%36e5),o[t]=e;const u=Object.keys(o).filter((e=>t!==e));if(0===u.length)return o;const l={blocks:{__args:{where:{ts:(yield r.getBlock(e)).timestamp,network_in:u}},network:!0,number:!0}},c=i.blockFinderUrl||"https://blockfinder.snapshot.org";return(yield ig(c,l)).blocks.forEach((t=>o[t.network]=t.number)),dd[s]=o,o}))},getHash:Mp,verify:function(t,r,n){return e(this,arguments,void 0,(function*(t,e,r,n="1",i={}){const{domain:o,types:s,message:a}=r,h=Mp(r);try{if(t===bp(o,s,a,e))return!0}catch(t){}return yield Ap(t,e,h,n,i)}))},validate:function(t,r,n,i,o,s,h){return e(this,void 0,void 0,(function*(){if(!cg(r))return dg(`Invalid author: ${r}`);if(!lg(i))return dg(`Invalid network: ${i}`);if(!fg(o,i))return dg(`Snapshot (${o}) must be 'latest' or greater than network start block (${xp[i].start})`);h||(h={});const{url:e,headers:u}=Yp(h.url),l={method:"POST",headers:u,body:JSON.stringify({jsonrpc:"2.0",method:"validate",params:{validation:t,author:r,space:n,network:i,snapshot:o,params:s}})};try{const t=yield a(e,l);return(yield Wp(t)).result}catch(t){return t.errno?Promise.reject({code:t.errno,message:t.toString(),data:""}):Promise.reject(t)}}))},SNAPSHOT_SUBGRAPH_URL:Lp};return{Client:or,Client712:or,schemas:dr,utils:mg}}));
21
+ deps: ${r}}`};const r={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(t){const[e,r]=function({schema:t}){const e={},r={};for(const n in t){if("__proto__"===n)continue;(Array.isArray(t[n])?e:r)[n]=t[n]}return[e,r]}(t);n(t,e),i(t,r)}};function n(t,e=t.schema){const{gen:r,data:n,it:i}=t;if(0===Object.keys(e).length)return;const o=r.let("missing");for(const s in e){const a=e[s];if(0===a.length)continue;const h=(0,sl.propertyInData)(r,n,s,i.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(h,(()=>{for(const e of a)(0,sl.checkReportMissingProp)(t,e)})):(r.if(Zu._`${h} && (${(0,sl.checkMissingProp)(t,a,o)})`),(0,sl.reportMissingProp)(t,o),r.else())}}function i(t,e=t.schema){const{gen:r,data:n,keyword:i,it:o}=t,s=r.name("valid");for(const a in e)(0,Yu.alwaysValidSchema)(o,e[a])||(r.if((0,sl.propertyInData)(r,n,a,o.opts.ownProperties),(()=>{const e=t.subschema({keyword:i,schemaProp:a},s);t.mergeValidEvaluated(e,s)}),(()=>r.var(s,!0))),t.ok(s))}e.validatePropertyDeps=n,e.validateSchemaDeps=i,e.default=r}));const Ac={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:t})=>Zu._`{propertyName: ${t.propertyName}}`},code(t){const{gen:e,schema:r,data:n,it:i}=t;if((0,Yu.alwaysValidSchema)(i,r))return;const o=e.name("valid");e.forIn("key",n,(r=>{t.setParams({propertyName:r}),t.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},o),e.if((0,Zu.not)(o),(()=>{t.error(!0),i.allErrors||e.break()}))})),t.ok(o)}};var Mc=Ac,kc=Object.defineProperty({default:Mc},"__esModule",{value:!0});const xc={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:t})=>Zu._`{additionalProperty: ${t.additionalProperty}}`},code(t){const{gen:e,schema:r,parentSchema:n,data:i,errsCount:o,it:s}=t;if(!o)throw new Error("ajv implementation error");const{allErrors:a,opts:h}=s;if(s.props=!0,"all"!==h.removeAdditional&&(0,Yu.alwaysValidSchema)(s,r))return;const u=(0,sl.allSchemaProperties)(n.properties),l=(0,sl.allSchemaProperties)(n.patternProperties);function c(t){e.code(Zu._`delete ${i}[${t}]`)}function f(n){if("all"===h.removeAdditional||h.removeAdditional&&!1===r)c(n);else{if(!1===r)return t.setParams({additionalProperty:n}),t.error(),void(a||e.break());if("object"==typeof r&&!(0,Yu.alwaysValidSchema)(s,r)){const r=e.name("valid");"failing"===h.removeAdditional?(d(n,r,!1),e.if((0,Zu.not)(r),(()=>{t.reset(),c(n)}))):(d(n,r),a||e.if((0,Zu.not)(r),(()=>e.break())))}}}function d(e,r,n){const i={keyword:"additionalProperties",dataProp:e,dataPropType:Yu.Type.Str};!1===n&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(i,r)}e.forIn("key",i,(r=>{u.length||l.length?e.if(function(r){let i;if(u.length>8){const t=(0,Yu.schemaRefOrVal)(s,n.properties,"properties");i=(0,sl.isOwnProperty)(e,t,r)}else i=u.length?(0,Zu.or)(...u.map((t=>Zu._`${r} === ${t}`))):Zu.nil;return l.length&&(i=(0,Zu.or)(i,...l.map((e=>Zu._`${(0,sl.usePattern)(t,e)}.test(${r})`)))),(0,Zu.not)(i)}(r),(()=>f(r))):f(r)})),t.ok(Zu._`${o} === ${Xu.default.errors}`)}};var Nc=xc,Sc=Object.defineProperty({default:Nc},"__esModule",{value:!0});const Pc={keyword:"properties",type:"object",schemaType:"object",code(t){const{gen:e,schema:r,parentSchema:n,data:i,it:o}=t;"all"===o.opts.removeAdditional&&void 0===n.additionalProperties&&Sc.default.code(new fl.KeywordCxt(o,Sc.default,"additionalProperties"));const s=(0,sl.allSchemaProperties)(r);for(const t of s)o.definedProperties.add(t);o.opts.unevaluated&&s.length&&!0!==o.props&&(o.props=Yu.mergeEvaluated.props(e,(0,Yu.toHash)(s),o.props));const a=s.filter((t=>!(0,Yu.alwaysValidSchema)(o,r[t])));if(0===a.length)return;const h=e.name("valid");for(const r of a)u(r)?l(r):(e.if((0,sl.propertyInData)(e,i,r,o.opts.ownProperties)),l(r),o.allErrors||e.else().var(h,!0),e.endIf()),t.it.definedProperties.add(r),t.ok(h);function u(t){return o.opts.useDefaults&&!o.compositeRule&&void 0!==r[t].default}function l(e){t.subschema({keyword:"properties",schemaProp:e,dataProp:e},h)}}};var Ic=Pc,Rc=Object.defineProperty({default:Ic},"__esModule",{value:!0});const Cc=Yu,Tc={keyword:"patternProperties",type:"object",schemaType:"object",code(t){const{gen:e,schema:r,data:n,parentSchema:i,it:o}=t,{opts:s}=o,a=(0,sl.allSchemaProperties)(r),h=a.filter((t=>(0,Yu.alwaysValidSchema)(o,r[t])));if(0===a.length||h.length===a.length&&(!o.opts.unevaluated||!0===o.props))return;const u=s.strictSchema&&!s.allowMatchingProperties&&i.properties,l=e.name("valid");!0===o.props||o.props instanceof Zu.Name||(o.props=(0,Cc.evaluatedPropsToName)(e,o.props));const{props:c}=o;function f(t){for(const e in u)new RegExp(t).test(e)&&(0,Yu.checkStrictMode)(o,`property ${e} matches pattern ${t} (use allowMatchingProperties)`)}function d(r){e.forIn("key",n,(n=>{e.if(Zu._`${(0,sl.usePattern)(t,r)}.test(${n})`,(()=>{const i=h.includes(r);i||t.subschema({keyword:"patternProperties",schemaProp:r,dataProp:n,dataPropType:Cc.Type.Str},l),o.opts.unevaluated&&!0!==c?e.assign(Zu._`${c}[${n}]`,!0):i||o.allErrors||e.if((0,Zu.not)(l),(()=>e.break()))}))}))}!function(){for(const t of a)u&&f(t),o.allErrors?d(t):(e.var(l,!0),d(t),e.if(l))}()}};var Oc=Tc,$c=Object.defineProperty({default:Oc},"__esModule",{value:!0});var Bc={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){const{gen:e,schema:r,it:n}=t;if((0,Yu.alwaysValidSchema)(n,r))return void t.fail();const i=e.name("valid");t.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),t.failResult(i,(()=>t.reset()),(()=>t.error()))},error:{message:"must NOT be valid"}},Fc=Object.defineProperty({default:Bc},"__esModule",{value:!0});var jc={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:sl.validateUnion,error:{message:"must match a schema in anyOf"}},Dc=Object.defineProperty({default:jc},"__esModule",{value:!0});var Uc={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:t})=>Zu._`{passingSchemas: ${t.passing}}`},code(t){const{gen:e,schema:r,parentSchema:n,it:i}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");if(i.opts.discriminator&&n.discriminator)return;const o=r,s=e.let("valid",!1),a=e.let("passing",null),h=e.name("_valid");t.setParams({passing:a}),e.block((function(){o.forEach(((r,n)=>{let o;(0,Yu.alwaysValidSchema)(i,r)?e.var(h,!0):o=t.subschema({keyword:"oneOf",schemaProp:n,compositeRule:!0},h),n>0&&e.if(Zu._`${h} && ${s}`).assign(s,!1).assign(a,Zu._`[${a}, ${n}]`).else(),e.if(h,(()=>{e.assign(s,!0),e.assign(a,n),o&&t.mergeEvaluated(o,Zu.Name)}))}))})),t.result(s,(()=>t.reset()),(()=>t.error(!0)))}},Lc=Object.defineProperty({default:Uc},"__esModule",{value:!0});var zc={keyword:"allOf",schemaType:"array",code(t){const{gen:e,schema:r,it:n}=t;if(!Array.isArray(r))throw new Error("ajv implementation error");const i=e.name("valid");r.forEach(((e,r)=>{if((0,Yu.alwaysValidSchema)(n,e))return;const o=t.subschema({keyword:"allOf",schemaProp:r},i);t.ok(i),t.mergeEvaluated(o)}))}},qc=Object.defineProperty({default:zc},"__esModule",{value:!0});const Vc={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:t})=>Zu.str`must match "${t.ifClause}" schema`,params:({params:t})=>Zu._`{failingKeyword: ${t.ifClause}}`},code(t){const{gen:e,parentSchema:r,it:n}=t;void 0===r.then&&void 0===r.else&&(0,Yu.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const i=Gc(n,"then"),o=Gc(n,"else");if(!i&&!o)return;const s=e.let("valid",!0),a=e.name("_valid");if(function(){const e=t.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},a);t.mergeEvaluated(e)}(),t.reset(),i&&o){const r=e.let("ifClause");t.setParams({ifClause:r}),e.if(a,h("then",r),h("else",r))}else i?e.if(a,h("then")):e.if((0,Zu.not)(a),h("else"));function h(r,n){return()=>{const i=t.subschema({keyword:r},a);e.assign(s,a),t.mergeValidEvaluated(i,s),n?e.assign(n,Zu._`${r}`):t.setParams({ifClause:r})}}t.pass(s,(()=>t.error(!0)))}};function Gc(t,e){const r=t.schema[e];return void 0!==r&&!(0,Yu.alwaysValidSchema)(t,r)}var Hc=Vc,Kc=Object.defineProperty({default:Hc},"__esModule",{value:!0});const Qc={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){void 0===e.if&&(0,Yu.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};var Jc=Qc,Zc=Object.defineProperty({default:Jc},"__esModule",{value:!0});var Yc=function(t=!1){const e=[Fc.default,Dc.default,Lc.default,qc.default,Kc.default,Zc.default,kc.default,Sc.default,_c.default,Rc.default,$c.default];return t?e.push(gc.default,wc.default):e.push(dc.default,mc.default),e.push(Ec.default),e},Wc=Object.defineProperty({default:Yc},"__esModule",{value:!0});const Xc={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>Zu.str`must match format "${t}"`,params:({schemaCode:t})=>Zu._`{format: ${t}}`},code(t,e){const{gen:r,data:n,$data:i,schema:o,schemaCode:s,it:a}=t,{opts:h,errSchemaPath:u,schemaEnv:l,self:c}=a;h.validateFormats&&(i?function(){const i=r.scopeValue("formats",{ref:c.formats,code:h.code.formats}),o=r.const("fDef",Zu._`${i}[${s}]`),a=r.let("fType"),u=r.let("format");r.if(Zu._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>r.assign(a,Zu._`${o}.type || "string"`).assign(u,Zu._`${o}.validate`)),(()=>r.assign(a,Zu._`"string"`).assign(u,o))),t.fail$data((0,Zu.or)(!1===h.strictSchema?Zu.nil:Zu._`${s} && !${u}`,function(){const t=l.$async?Zu._`(${o}.async ? await ${u}(${n}) : ${u}(${n}))`:Zu._`${u}(${n})`,r=Zu._`(typeof ${u} == "function" ? ${t} : ${u}.test(${n}))`;return Zu._`${u} && ${u} !== true && ${a} === ${e} && !${r}`}()))}():function(){const i=c.formats[o];if(!i)return void function(){if(!1===h.strictSchema)return void c.logger.warn(t());throw new Error(t());function t(){return`unknown format "${o}" ignored in schema at path "${u}"`}}();if(!0===i)return;const[s,a,f]=function(t){const e=t instanceof RegExp?(0,Zu.regexpCode)(t):h.code.formats?Zu._`${h.code.formats}${(0,Zu.getProperty)(o)}`:void 0,n=r.scopeValue("formats",{key:o,ref:t,code:e});if("object"==typeof t&&!(t instanceof RegExp))return[t.type||"string",t.validate,Zu._`${n}.validate`];return["string",t,n]}(i);s===e&&t.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!l.$async)throw new Error("async format in sync schema");return Zu._`await ${f}(${n})`}return"function"==typeof a?Zu._`${f}(${n})`:Zu._`${f}.test(${n})`}())}())}};var tf=Xc;var ef=[Object.defineProperty({default:tf},"__esModule",{value:!0}).default],rf=Object.defineProperty({default:ef},"__esModule",{value:!0}),nf=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}));var of=[Pl.default,fc.default,(0,Wc.default)(),rf.default,nf.metadataVocabulary,nf.contentVocabulary],sf=Object.defineProperty({default:of},"__esModule",{value:!0}),af=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0,function(t){t.Tag="tag",t.Mapping="mapping"}(e.DiscrError||(e.DiscrError={}))}));const hf={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:t,tagName:e}})=>t===af.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>Zu._`{error: ${t}, tag: ${r}, tagValue: ${e}}`},code(t){const{gen:e,data:r,schema:n,parentSchema:i,it:o}=t,{oneOf:s}=i;if(!o.opts.discriminator)throw new Error("discriminator: requires discriminator option");const a=n.propertyName;if("string"!=typeof a)throw new Error("discriminator: requires propertyName");if(n.mapping)throw new Error("discriminator: mapping is not supported");if(!s)throw new Error("discriminator: requires oneOf keyword");const h=e.let("valid",!1),u=e.const("tag",Zu._`${r}${(0,Zu.getProperty)(a)}`);function l(r){const n=e.name("valid"),i=t.subschema({keyword:"oneOf",schemaProp:r},n);return t.mergeEvaluated(i,Zu.Name),n}e.if(Zu._`typeof ${u} == "string"`,(()=>function(){const r=function(){var t;const e={},r=h(i);let n=!0;for(let e=0;e<s.length;e++){let i=s[e];(null==i?void 0:i.$ref)&&!(0,Yu.schemaHasRulesButRef)(i,o.self.RULES)&&(i=wl.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,null==i?void 0:i.$ref),i instanceof wl.SchemaEnv&&(i=i.schema));const l=null===(t=null==i?void 0:i.properties)||void 0===t?void 0:t[a];if("object"!=typeof l)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${a}"`);n=n&&(r||h(i)),u(l,e)}if(!n)throw new Error(`discriminator: "${a}" must be required`);return e;function h({required:t}){return Array.isArray(t)&&t.includes(a)}function u(t,e){if(t.const)l(t.const,e);else{if(!t.enum)throw new Error(`discriminator: "properties/${a}" must have "const" or "enum"`);for(const r of t.enum)l(r,e)}}function l(t,r){if("string"!=typeof t||t in e)throw new Error(`discriminator: "${a}" values must be unique strings`);e[t]=r}}();e.if(!1);for(const t in r)e.elseIf(Zu._`${u} === ${t}`),e.assign(h,l(r[t]));e.else(),t.error(!1,{discrError:af.DiscrError.Mapping,tag:u,tagName:a}),e.endIf()}()),(()=>t.error(!1,{discrError:af.DiscrError.Tag,tag:u,tagName:a}))),t.ok(h)}};var uf=hf,lf=Object.defineProperty({default:uf},"__esModule",{value:!0}),cf={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0},ff=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;const r=["/properties"],n="http://json-schema.org/draft-07/schema";class i extends Ml.default{_addVocabularies(){super._addVocabularies(),sf.default.forEach((t=>this.addVocabulary(t))),this.opts.discriminator&&this.addKeyword(lf.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const t=this.opts.$data?this.$dataMetaSchema(cf,r):cf;this.addMetaSchema(t,n,!1),this.refs["http://json-schema.org/schema"]=n}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(n)?n:void 0)}}t.exports=e=i,Object.defineProperty(e,"__esModule",{value:!0}),e.default=i,Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return fl.KeywordCxt}}),Object.defineProperty(e,"_",{enumerable:!0,get:function(){return Zu._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return Zu.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return Zu.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return Zu.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return Zu.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return Zu.CodeGen}})})),df=n(ff),mf=o((function(t,e){function r(t,e){return{validate:t,compare:e}}Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0,e.fullFormats={date:r(o,s),time:r(h,u),"date-time":r((function(t){const e=t.split(l);return 2===e.length&&o(e[0])&&h(e[1],!0)}),c),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:function(t){return f.test(t)&&d.test(t)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:function(t){if(g.test(t))return!1;try{return new RegExp(t),!0}catch(t){return!1}},uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:function(t){return m.lastIndex=0,m.test(t)},int32:{type:"number",validate:function(t){return Number.isInteger(t)&&t<=2147483647&&t>=-2147483648}},int64:{type:"number",validate:function(t){return Number.isInteger(t)}},float:{type:"number",validate:p},double:{type:"number",validate:p},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:r(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,s),time:r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"date-time":r(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,c),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);const n=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function o(t){const e=n.exec(t);if(!e)return!1;const r=+e[1],o=+e[2],s=+e[3];return o>=1&&o<=12&&s>=1&&s<=(2===o&&function(t){return t%4==0&&(t%100!=0||t%400==0)}(r)?29:i[o])}function s(t,e){if(t&&e)return t>e?1:t<e?-1:0}const a=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function h(t,e){const r=a.exec(t);if(!r)return!1;const n=+r[1],i=+r[2],o=+r[3],s=r[5];return(n<=23&&i<=59&&o<=59||23===n&&59===i&&60===o)&&(!e||""!==s)}function u(t,e){if(!t||!e)return;const r=a.exec(t),n=a.exec(e);return r&&n?(t=r[1]+r[2]+r[3]+(r[4]||""))>(e=n[1]+n[2]+n[3]+(n[4]||""))?1:t<e?-1:0:void 0}const l=/t|\s/i;function c(t,e){if(!t||!e)return;const[r,n]=t.split(l),[i,o]=e.split(l),a=s(r,i);return void 0!==a?a||u(n,o):void 0}const f=/\/|:/,d=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;const m=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function p(){return!0}const g=/[^\\]\\Z/})),pf=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const r=Zu.operators,n={formatMaximum:{okStr:"<=",ok:r.LTE,fail:r.GT},formatMinimum:{okStr:">=",ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},i={message:({keyword:t,schemaCode:e})=>Zu.str`should be ${n[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>Zu._`{comparison: ${n[t].okStr}, limit: ${e}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:i,code(t){const{gen:e,data:r,schemaCode:i,keyword:o,it:s}=t,{opts:a,self:h}=s;if(!a.validateFormats)return;const u=new ff.KeywordCxt(s,h.RULES.all.format.definition,"format");function l(t){return Zu._`${t}.compare(${r}, ${i}) ${n[o].fail} 0`}u.$data?function(){const r=e.scopeValue("formats",{ref:h.formats,code:a.code.formats}),n=e.const("fmt",Zu._`${r}[${u.schemaCode}]`);t.fail$data(Zu.or(Zu._`typeof ${n} != "object"`,Zu._`${n} instanceof RegExp`,Zu._`typeof ${n}.compare != "function"`,l(n)))}():function(){const r=u.schema,n=h.formats[r];if(!n||!0===n)return;if("object"!=typeof n||n instanceof RegExp||"function"!=typeof n.compare)throw new Error(`"${o}": format "${r}" does not define "compare" function`);const i=e.scopeValue("formats",{key:r,ref:n,code:a.code.formats?Zu._`${a.code.formats}${Zu.getProperty(r)}`:void 0});t.fail$data(l(i))}()},dependencies:["format"]};e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)})),gf=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r=new Zu.Name("fullFormats"),n=new Zu.Name("fastFormats"),i=(t,e={keywords:!0})=>{if(Array.isArray(e))return o(t,e,mf.fullFormats,r),t;const[i,s]="fast"===e.mode?[mf.fastFormats,n]:[mf.fullFormats,r];return o(t,e.formats||mf.formatNames,i,s),e.keywords&&pf.default(t),t};function o(t,e,r,n){var i,o;null!==(i=(o=t.opts.code).formats)&&void 0!==i||(o.formats=Zu._`require("ajv-formats/dist/formats").${n}`);for(const n of e)t.addFormat(n,r[n])}i.get=(t,e="full")=>{const r=("fast"===e?mf.fastFormats:mf.fullFormats)[t];if(!r)throw new Error(`Unknown format "${t}"`);return r},t.exports=e=i,Object.defineProperty(e,"__esModule",{value:!0}),e.default=i})),yf=n(gf),vf=o((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r="errorMessage",n=new ff.Name("emUsed"),i={required:"missingProperty",dependencies:"property",dependentRequired:"property"},o=/\$\{[^}]+\}/,s=/\$\{([^}]+)\}/g,a=/^""\s*\+\s*|\s*\+\s*""$/g;function h(t){return{keyword:r,schemaType:["string","object"],post:!0,code(e){const{gen:h,data:u,schema:l,schemaValue:c,it:f}=e;if(!1===f.createErrors)return;const d=l,m=Zu.strConcat(Xu.default.instancePath,f.errorPath);function p(t,e){return Zu.and(ff._`${t}.keyword !== ${r}`,ff._`!${t}.${n}`,ff._`${t}.instancePath === ${m}`,ff._`${t}.keyword in ${e}`,ff._`${t}.schemaPath.indexOf(${f.errSchemaPath}) === 0`,ff._`/^\\/[^\\/]*$/.test(${t}.schemaPath.slice(${f.errSchemaPath.length}))`)}function g(t,e){const r=[];for(const n in t){const t=e[n];o.test(t)&&r.push([n,v(t)])}return h.object(...r)}function y(t){return o.test(t)?new Qu._Code(Qu.safeStringify(t).replace(s,((t,e)=>`" + JSON.stringify(${fl.getData(e,f)}) + "`)).replace(a,"")):ff.stringify(t)}function v(t){return ff._`function(){return ${y(t)}}`}h.if(ff._`${Xu.default.errors} > 0`,(()=>{if("object"==typeof d){const[o,s]=function(t){let e,r;for(const n in t){if("properties"===n||"items"===n)continue;const i=t[n];if("object"==typeof i){e||(e={});const t=e[n]={};for(const e in i)t[e]=[]}else r||(r={}),r[n]=[]}return[e,r]}(d);s&&function(r){const i=h.const("emErrors",ff.stringify(r)),o=h.const("templates",g(r,l));h.forOf("err",Xu.default.vErrors,(t=>h.if(p(t,i),(()=>h.code(ff._`${i}[${t}.keyword].push(${t})`).assign(ff._`${t}.${n}`,!0)))));const{singleError:s}=t;if(s){const t=h.let("message",ff._`""`),r=h.let("paramsErrors",ff._`[]`);a((e=>{h.if(t,(()=>h.code(ff._`${t} += ${"string"==typeof s?s:";"}`))),h.code(ff._`${t} += ${u(e)}`),h.assign(r,ff._`${r}.concat(${i}[${e}])`)})),tl.reportError(e,{message:t,params:ff._`{errors: ${r}}`})}else a((t=>tl.reportError(e,{message:u(t),params:ff._`{errors: ${i}[${t}]}`})));function a(t){h.forIn("key",i,(e=>h.if(ff._`${i}[${e}].length`,(()=>t(e)))))}function u(t){return ff._`${t} in ${o} ? ${o}[${t}]() : ${c}[${t}]`}}(s),o&&function(t){const r=h.const("emErrors",ff.stringify(t)),o=[];for(const e in t)o.push([e,g(t[e],l[e])]);const s=h.const("templates",h.object(...o)),a=h.scopeValue("obj",{ref:i,code:ff.stringify(i)}),u=h.let("emPropParams"),f=h.let("emParamsErrors");h.forOf("err",Xu.default.vErrors,(t=>h.if(p(t,r),(()=>{h.assign(u,ff._`${a}[${t}.keyword]`),h.assign(f,ff._`${r}[${t}.keyword][${t}.params[${u}]]`),h.if(f,(()=>h.code(ff._`${f}.push(${t})`).assign(ff._`${t}.${n}`,!0)))})))),h.forIn("key",r,(t=>h.forIn("keyProp",ff._`${r}[${t}]`,(n=>{h.assign(f,ff._`${r}[${t}][${n}]`),h.if(ff._`${f}.length`,(()=>{const r=h.const("tmpl",ff._`${s}[${t}] && ${s}[${t}][${n}]`);tl.reportError(e,{message:ff._`${r} ? ${r}() : ${c}[${t}][${n}]`,params:ff._`{errors: ${f}}`})}))}))))}(o),function(t){const{props:i,items:o}=t;if(!i&&!o)return;const s=ff._`typeof ${u} == "object"`,a=ff._`Array.isArray(${u})`,f=h.let("emErrors");let d,p;const y=h.let("templates");i&&o?(d=h.let("emChildKwd"),h.if(s),h.if(a,(()=>{v(o,l.items),h.assign(d,ff.str`items`)}),(()=>{v(i,l.properties),h.assign(d,ff.str`properties`)})),p=ff._`[${d}]`):o?(h.if(a),v(o,l.items),p=ff._`.items`):i&&(h.if(Zu.and(s,Zu.not(a))),v(i,l.properties),p=ff._`.properties`);function v(t,e){h.assign(f,ff.stringify(t)),h.assign(y,g(t,e))}h.forOf("err",Xu.default.vErrors,(t=>function(t,e,i){h.if(Zu.and(ff._`${t}.keyword !== ${r}`,ff._`!${t}.${n}`,ff._`${t}.instancePath.indexOf(${m}) === 0`),(()=>{const r=h.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:ff._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),n=h.const("emMatches",ff._`${r}.exec(${t}.instancePath.slice(${m}.length))`),o=h.const("emChild",ff._`${n} && ${n}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);h.if(ff._`${o} !== undefined && ${o} in ${e}`,(()=>i(o)))}))}(t,f,(e=>h.code(ff._`${f}[${e}].push(${t})`).assign(ff._`${t}.${n}`,!0))))),h.forIn("key",f,(t=>h.if(ff._`${f}[${t}].length`,(()=>{tl.reportError(e,{message:ff._`${t} in ${y} ? ${y}[${t}]() : ${c}${p}[${t}]`,params:ff._`{errors: ${f}[${t}]}`}),h.assign(ff._`${Xu.default.vErrors}[${Xu.default.errors}-1].instancePath`,ff._`${m} + "/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`)})))),h.endIf()}(function({properties:t,items:e}){const r={};if(t){r.props={};for(const e in t)r.props[e]=[]}if(e){r.items={};for(let t=0;t<e.length;t++)r.items[t]=[]}return r}(d))}const o="string"==typeof d?d:d._;o&&function(t){const i=h.const("emErrs",ff._`[]`);h.forOf("err",Xu.default.vErrors,(t=>h.if(function(t){return Zu.and(ff._`${t}.keyword !== ${r}`,ff._`!${t}.${n}`,Zu.or(ff._`${t}.instancePath === ${m}`,Zu.and(ff._`${t}.instancePath.indexOf(${m}) === 0`,ff._`${t}.instancePath[${m}.length] === "/"`)),ff._`${t}.schemaPath.indexOf(${f.errSchemaPath}) === 0`,ff._`${t}.schemaPath[${f.errSchemaPath}.length] === "/"`)}(t),(()=>h.code(ff._`${i}.push(${t})`).assign(ff._`${t}.${n}`,!0))))),h.if(ff._`${i}.length`,(()=>tl.reportError(e,{message:y(t),params:ff._`{errors: ${i}}`})))}(o),t.keepErrors||function(){const t=h.const("emErrs",ff._`[]`);h.forOf("err",Xu.default.vErrors,(e=>h.if(ff._`!${e}.${n}`,(()=>h.code(ff._`${t}.push(${e})`))))),h.assign(Xu.default.vErrors,t).assign(Xu.default.errors,ff._`${t}.length`)}()}))},metaSchema:{anyOf:[{type:"string"},{type:"object",properties:{properties:{$ref:"#/$defs/stringMap"},items:{$ref:"#/$defs/stringList"},required:{$ref:"#/$defs/stringOrMap"},dependencies:{$ref:"#/$defs/stringOrMap"}},additionalProperties:{type:"string"}}],$defs:{stringMap:{type:"object",additionalProperties:{type:"string"}},stringOrMap:{anyOf:[{type:"string"},{$ref:"#/$defs/stringMap"}]},stringList:{type:"array",items:{type:"string"}}}}}}const u=(t,e={})=>{if(!t.opts.allErrors)throw new Error("ajv-errors: Ajv option allErrors must be true");if(t.opts.jsPropertySyntax)throw new Error("ajv-errors: ajv option jsPropertySyntax is not supported");return t.addKeyword(h(e))};e.default=u,t.exports=u,t.exports.default=u})),wf=n(vf),bf="__lodash_hash_undefined__",Ef="[object Function]",_f="[object GeneratorFunction]",Af=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mf=/^\w*$/,kf=/^\./,xf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Nf=/\\(\\)?/g,Sf=/^\[object .+?Constructor\]$/,Pf=/^(?:0|[1-9]\d*)$/,If="object"==typeof r&&r&&r.Object===Object&&r,Rf="object"==typeof self&&self&&self.Object===Object&&self,Cf=If||Rf||Function("return this")();var Tf,Of=Array.prototype,$f=Function.prototype,Bf=Object.prototype,Ff=Cf["__core-js_shared__"],jf=(Tf=/[^.]+$/.exec(Ff&&Ff.keys&&Ff.keys.IE_PROTO||""))?"Symbol(src)_1."+Tf:"",Df=$f.toString,Uf=Bf.hasOwnProperty,Lf=Bf.toString,zf=RegExp("^"+Df.call(Uf).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qf=Cf.Symbol,Vf=Of.splice,Gf=nd(Cf,"Map"),Hf=nd(Object,"create"),Kf=qf?qf.prototype:void 0,Qf=Kf?Kf.toString:void 0;function Jf(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Zf(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Yf(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Wf(t,e,r){var n=t[e];Uf.call(t,e)&&hd(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function Xf(t,e){for(var r=t.length;r--;)if(hd(t[r][0],e))return r;return-1}function td(t){if(!ld(t)||(e=t,jf&&jf in e))return!1;var e,r=function(t){var e=ld(t)?Lf.call(t):"";return e==Ef||e==_f}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?zf:Sf;return r.test(function(t){if(null!=t){try{return Df.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function ed(t,e,r,n){if(!ld(t))return t;e=function(t,e){if(ud(t))return!1;var r=typeof t;if("number"==r||"symbol"==r||"boolean"==r||null==t||cd(t))return!0;return Mf.test(t)||!Af.test(t)||null!=e&&t in Object(e)}(e,t)?[e]:function(t){return ud(t)?t:od(t)}(e);for(var i=-1,o=e.length,s=o-1,a=t;null!=a&&++i<o;){var h=sd(e[i]),u=r;if(i!=s){var l=a[h];void 0===(u=n?n(l,h,a):void 0)&&(u=ld(l)?l:id(e[i+1])?[]:{})}Wf(a,h,u),a=a[h]}return t}function rd(t,e){var r=t.__data__;return function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}(e)?r["string"==typeof e?"string":"hash"]:r.map}function nd(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return td(r)?r:void 0}function id(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||Pf.test(t))&&t>-1&&t%1==0&&t<e}Jf.prototype.clear=function(){this.__data__=Hf?Hf(null):{}},Jf.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Jf.prototype.get=function(t){var e=this.__data__;if(Hf){var r=e[t];return r===bf?void 0:r}return Uf.call(e,t)?e[t]:void 0},Jf.prototype.has=function(t){var e=this.__data__;return Hf?void 0!==e[t]:Uf.call(e,t)},Jf.prototype.set=function(t,e){return this.__data__[t]=Hf&&void 0===e?bf:e,this},Zf.prototype.clear=function(){this.__data__=[]},Zf.prototype.delete=function(t){var e=this.__data__,r=Xf(e,t);return!(r<0)&&(r==e.length-1?e.pop():Vf.call(e,r,1),!0)},Zf.prototype.get=function(t){var e=this.__data__,r=Xf(e,t);return r<0?void 0:e[r][1]},Zf.prototype.has=function(t){return Xf(this.__data__,t)>-1},Zf.prototype.set=function(t,e){var r=this.__data__,n=Xf(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},Yf.prototype.clear=function(){this.__data__={hash:new Jf,map:new(Gf||Zf),string:new Jf}},Yf.prototype.delete=function(t){return rd(this,t).delete(t)},Yf.prototype.get=function(t){return rd(this,t).get(t)},Yf.prototype.has=function(t){return rd(this,t).has(t)},Yf.prototype.set=function(t,e){return rd(this,t).set(t,e),this};var od=ad((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(cd(t))return Qf?Qf.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return kf.test(t)&&r.push(""),t.replace(xf,(function(t,e,n,i){r.push(n?i.replace(Nf,"$1"):e||t)})),r}));function sd(t){if("string"==typeof t||cd(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ad(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s),s};return r.cache=new(ad.Cache||Yf),r}function hd(t,e){return t===e||t!=t&&e!=e}ad.Cache=Yf;var ud=Array.isArray;function ld(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function cd(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==Lf.call(t)}var fd=function(t,e,r){return null==t?t:ed(t,e,r)};let dd={},md=0;const pd=new y("networks/5.6.4");function gd(t){const e=function(e,r){null==r&&(r={});const n=[];if(e.InfuraProvider&&"-"!==r.infura)try{n.push(new e.InfuraProvider(t,r.infura))}catch(t){}if(e.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new e.EtherscanProvider(t,r.etherscan))}catch(t){}if(e.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new e.AlchemyProvider(t,r.alchemy))}catch(t){}if(e.PocketProvider&&"-"!==r.pocket){const i=["goerli","ropsten","rinkeby"];try{const o=new e.PocketProvider(t,r.pocket);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(t){}}if(e.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new e.CloudflareProvider(t))}catch(t){}if(e.AnkrProvider&&"-"!==r.ankr)try{const i=["ropsten"],o=new e.AnkrProvider(t,r.ankr);o.network&&-1===i.indexOf(o.network.name)&&n.push(o)}catch(t){}if(0===n.length)return null;if(e.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===t&&(i=2),new e.FallbackProvider(n,i)}return n[0]};return e.renetwork=function(t){return gd(t)},e}function yd(t,e){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null};return r.renetwork=function(e){return yd(t,e)},r}const vd={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:gd("homestead")},wd={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:gd("ropsten")},bd={chainId:63,name:"classicMordor",_defaultProvider:yd("https://www.ethercluster.com/mordor","classicMordor")},Ed={unspecified:{chainId:0,name:"unspecified"},homestead:vd,mainnet:vd,morden:{chainId:2,name:"morden"},ropsten:wd,testnet:wd,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:gd("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:gd("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:gd("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},classic:{chainId:61,name:"classic",_defaultProvider:yd("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:bd,classicTestnet:bd,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:yd("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:gd("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:gd("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function _d(t){t=atob(t);const e=[];for(let r=0;r<t.length;r++)e.push(t.charCodeAt(r));return M(e)}function Ad(t){t=M(t);let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}class Md{constructor(t){gr(this,"alphabet",t),gr(this,"base",t.length),gr(this,"_alphabetMap",{}),gr(this,"_leader",t.charAt(0));for(let e=0;e<t.length;e++)this._alphabetMap[t.charAt(e)]=e}encode(t){let e=M(t);if(0===e.length)return"";let r=[0];for(let t=0;t<e.length;++t){let n=e[t];for(let t=0;t<r.length;++t)n+=r[t]<<8,r[t]=n%this.base,n=n/this.base|0;for(;n>0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let t=0;0===e[t]&&t<e.length-1;++t)n+=this._leader;for(let t=r.length-1;t>=0;--t)n+=this.alphabet[r[t]];return n}decode(t){if("string"!=typeof t)throw new TypeError("Expected String");let e=[];if(0===t.length)return new Uint8Array(e);e.push(0);for(let r=0;r<t.length;r++){let n=this._alphabetMap[t[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");let i=n;for(let t=0;t<e.length;++t)i+=e[t]*this.base,e[t]=255&i,i>>=8;for(;i>0;)e.push(255&i),i>>=8}for(let r=0;t[r]===this._leader&&r<t.length-1;++r)e.push(0);return M(new Uint8Array(e.reverse()))}}new Md("abcdefghijklmnopqrstuvwxyz234567");const kd=new Md("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function xd(t){return we(_n(t))}const Nd="hash/5.6.1",Sd=new y(Nd),Pd=new Uint8Array(32);Pd.fill(0);const Id=new RegExp("^((.*)\\.)?([^.]+)$");function Rd(t){"string"!=typeof t&&Sd.throwArgumentError("invalid ENS name; not a string","name",t);let e=t,r=Pd;for(;e.length;){const n=e.match(Id);null!=n&&""!==n[2]||Sd.throwArgumentError("invalid ENS address; missing component","name",t);r=we(k([r,we(_n(Bn(n[3])))])),e=n[2]||""}return P(r)}var Cd=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{h(n.next(t))}catch(t){o(t)}}function a(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}h((n=n.apply(t,e||[])).next())}))};const Td=new y(Nd),Od=new Uint8Array(32);Od.fill(0);const $d=qt.from(-1),Bd=qt.from(0),Fd=qt.from(1),jd=qt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const Dd=O(Fd.toHexString(),32),Ud=O(Bd.toHexString(),32),Ld={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},zd=["name","version","chainId","verifyingContract","salt"];function qd(t){return function(e){return"string"!=typeof e&&Td.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const Vd={name:qd("name"),version:qd("version"),chainId:function(t){try{return qt.from(t).toString()}catch(t){}return Td.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Ce(t).toLowerCase()}catch(t){}return Td.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=M(t);if(32!==e.length)throw new Error("bad length");return P(e)}catch(t){}return Td.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Gd(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=""===e[1],n=parseInt(e[2]||"256");(n%8!=0||n>256||e[2]&&e[2]!==String(n))&&Td.throwArgumentError("invalid numeric width","type",t);const i=jd.mask(r?n-1:n),o=r?i.add(Fd).mul($d):Bd;return function(e){const r=qt.from(e);return(r.lt(o)||r.gt(i))&&Td.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),O(r.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(0===r||r>32||e[1]!==String(r))&&Td.throwArgumentError("invalid bytes width","type",t),function(e){return M(e).length!==r&&Td.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=M(t),r=e.length%32;return r?C([e,Od.slice(r)]):P(e)}(e)}}}switch(t){case"address":return function(t){return O(Ce(t),32)};case"bool":return function(t){return t?Dd:Ud};case"bytes":return function(t){return we(t)};case"string":return function(t){return xd(t)}}return null}function Hd(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class Kd{constructor(t){gr(this,"types",Object.freeze(Ar(t))),gr(this,"_encoderCache",{}),gr(this,"_types",{});const e={},r={},n={};Object.keys(t).forEach((t=>{e[t]={},r[t]=[],n[t]={}}));for(const n in t){const i={};t[n].forEach((o=>{i[o.name]&&Td.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",t),i[o.name]=!0;const s=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&Td.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);Gd(s)||(r[s]||Td.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),r[s].push(n),e[n][s]=!0)}))}const i=Object.keys(r).filter((t=>0===r[t].length));0===i.length?Td.throwArgumentError("missing primary type","types",t):i.length>1&&Td.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),gr(this,"primaryType",i[0]),function i(o,s){s[o]&&Td.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),s[o]=!0,Object.keys(e[o]).forEach((t=>{r[t]&&(i(t,s),Object.keys(s).forEach((e=>{n[e][t]=!0})))})),delete s[o]}(this.primaryType,{});for(const e in n){const r=Object.keys(n[e]);r.sort(),this._types[e]=Hd(e,t[e])+r.map((e=>Hd(e,t[e]))).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const e=Gd(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],r=this.getEncoder(t),n=parseInt(e[3]);return e=>{n>=0&&e.length!==n&&Td.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(r);return this._types[t]&&(i=i.map(we)),we(C(i))}}const r=this.types[t];if(r){const e=xd(this._types[t]);return t=>{const n=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return this._types[r]?we(n):n}));return n.unshift(e),C(n)}}return Td.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||Td.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return we(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,r){if(Gd(t))return r(t,e);const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const t=n[1],i=parseInt(n[3]);return i>=0&&e.length!==i&&Td.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,r)))}const i=this.types[t];return i?i.reduce(((t,{name:n,type:i})=>(t[n]=this._visit(i,e[n],r),t)),{}):Td.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new Kd(t)}static getPrimaryType(t){return Kd.from(t).primaryType}static hashStruct(t,e,r){return Kd.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=Ld[r];n||Td.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>zd.indexOf(t.name)-zd.indexOf(e.name))),Kd.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return C(["0x1901",Kd.hashDomain(t),Kd.from(e).hash(r)])}static hash(t,e,r){return we(Kd.encode(t,e,r))}static resolveNames(t,e,r,n){return Cd(this,void 0,void 0,(function*(){t=wr(t);const i={};t.verifyingContract&&!N(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const o=Kd.from(e);o.visit(r,((t,e)=>("address"!==t||N(e,20)||(i[e]="0x"),e)));for(const t in i)i[t]=yield n(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),r=o.visit(r,((t,e)=>"address"===t&&i[e]?i[e]:e)),{domain:t,value:r}}))}static getPayload(t,e,r){Kd.hashDomain(t);const n={},i=[];zd.forEach((e=>{const r=t[e];null!=r&&(n[e]=Vd[e](r),i.push({name:e,type:Ld[e]}))}));const o=Kd.from(e),s=wr(e);return s.EIP712Domain?Td.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):s.EIP712Domain=i,o.encode(r),{types:s,domain:n,primaryType:o.primaryType,message:o.visit(r,((t,e)=>{if(t.match(/^bytes(\d*)/))return P(M(e));if(t.match(/^u?int/))return qt.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&Td.throwArgumentError("invalid string","value",e),e}return Td.throwArgumentError("unsupported type","type",t)}))}}}new y("sha2/5.6.1");function Qd(t){return"0x"+Ho.sha256().update(M(t)).digest("hex")}var Jd=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{h(n.next(t))}catch(t){o(t)}}function a(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}h((n=n.apply(t,e||[])).next())}))};function Zd(t,e){return Jd(this,void 0,void 0,(function*(){null==e&&(e={});const r={method:e.method||"GET",headers:e.headers||{},body:e.body||void 0};!0!==e.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client");const n=yield fetch(t,r),i=yield n.arrayBuffer(),o={};return n.headers.forEach?n.headers.forEach(((t,e)=>{o[e.toLowerCase()]=t})):n.headers.keys().forEach((t=>{o[t.toLowerCase()]=n.headers.get(t)})),{headers:o,statusCode:n.status,statusMessage:n.statusText,body:M(new Uint8Array(i))}}))}var Yd=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{h(n.next(t))}catch(t){o(t)}}function a(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}h((n=n.apply(t,e||[])).next())}))};const Wd=new y("web/5.6.1");function Xd(t){return new Promise((e=>{setTimeout(e,t)}))}function tm(t,e){if(null==t)return null;if("string"==typeof t)return t;if(E(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return Mn(t)}catch(t){}return P(t)}return t}function em(t,e,r){let n=null;if(null!=e){n=_n(e);const r="string"==typeof t?{url:t}:wr(t);if(r.headers){0!==Object.keys(r.headers).filter((t=>"content-type"===t.toLowerCase())).length||(r.headers=wr(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};t=r}return function(t,e,r){const n="object"==typeof t&&null!=t.throttleLimit?t.throttleLimit:12;Wd.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const i="object"==typeof t?t.throttleCallback:null,o="object"==typeof t&&"number"==typeof t.throttleSlotInterval?t.throttleSlotInterval:100;Wd.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const s="object"==typeof t&&!!t.errorPassThrough,a={};let h=null;const u={method:"GET"};let l=!1,c=12e4;if("string"==typeof t)h=t;else if("object"==typeof t){if(null!=t&&null!=t.url||Wd.throwArgumentError("missing URL","connection.url",t),h=t.url,"number"==typeof t.timeout&&t.timeout>0&&(c=t.timeout),t.headers)for(const e in t.headers)a[e.toLowerCase()]={key:e,value:String(t.headers[e])},["if-none-match","if-modified-since"].indexOf(e.toLowerCase())>=0&&(l=!0);if(u.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==h.substring(0,6)&&!0!==t.allowInsecureAuthentication&&Wd.throwError("basic authentication requires a secure https url",y.errors.INVALID_ARGUMENT,{argument:"url",url:h,user:t.user,password:"[REDACTED]"});const e=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+Ad(_n(e))}}null!=t.skipFetchSetup&&(u.skipFetchSetup=!!t.skipFetchSetup)}const f=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i"),d=h?h.match(f):null;if(d)try{const t={statusCode:200,statusMessage:"OK",headers:{"content-type":d[1]},body:_d(d[2])};let e=t.body;return r&&(e=r(t.body,t)),Promise.resolve(e)}catch(t){Wd.throwError("processing response error",y.errors.SERVER_ERROR,{body:tm(d[1],d[2]),error:t,requestBody:null,requestMethod:"GET",url:h})}e&&(u.method="POST",u.body=e,null==a["content-type"]&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==a["content-length"]&&(a["content-length"]={key:"Content-Length",value:String(e.length)}));const m={};Object.keys(a).forEach((t=>{const e=a[t];m[e.key]=e.value})),u.headers=m;const p=function(){let t=null;return{promise:new Promise((function(e,r){c&&(t=setTimeout((()=>{null!=t&&(t=null,r(Wd.makeError("timeout",y.errors.TIMEOUT,{requestBody:tm(u.body,m["content-type"]),requestMethod:u.method,timeout:c,url:h})))}),c))})),cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),g=function(){return Yd(this,void 0,void 0,(function*(){for(let t=0;t<n;t++){let e=null;try{if(e=yield Zd(h,u),t<n)if(301===e.statusCode||302===e.statusCode){const t=e.headers.location||"";if("GET"===u.method&&t.match(/^https:/)){h=e.headers.location;continue}}else if(429===e.statusCode){let r=!0;if(i&&(r=yield i(t,h)),r){let r=0;const n=e.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):o*parseInt(String(Math.random()*Math.pow(2,t))),yield Xd(r);continue}}}catch(t){e=t.response,null==e&&(p.cancel(),Wd.throwError("missing response",y.errors.SERVER_ERROR,{requestBody:tm(u.body,m["content-type"]),requestMethod:u.method,serverError:t,url:h}))}let a=e.body;if(l&&304===e.statusCode?a=null:!s&&(e.statusCode<200||e.statusCode>=300)&&(p.cancel(),Wd.throwError("bad response",y.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:tm(a,e.headers?e.headers["content-type"]:null),requestBody:tm(u.body,m["content-type"]),requestMethod:u.method,url:h})),r)try{const t=yield r(a,e);return p.cancel(),t}catch(r){if(r.throttleRetry&&t<n){let e=!0;if(i&&(e=yield i(t,h)),e){const e=o*parseInt(String(Math.random()*Math.pow(2,t)));yield Xd(e);continue}}p.cancel(),Wd.throwError("processing response error",y.errors.SERVER_ERROR,{body:tm(a,e.headers?e.headers["content-type"]:null),error:r,requestBody:tm(u.body,m["content-type"]),requestMethod:u.method,url:h})}return p.cancel(),a}return Wd.throwError("failed response",y.errors.SERVER_ERROR,{requestBody:tm(u.body,m["content-type"]),requestMethod:u.method,url:h})}))}();return Promise.race([p.promise,g])}(t,n,((t,e)=>{let n=null;if(null!=t)try{n=JSON.parse(Mn(t))}catch(e){Wd.throwError("invalid JSON",y.errors.SERVER_ERROR,{body:t,error:e})}return r&&(n=r(n,e)),n}))}function rm(t,e){return e||(e={}),null==(e=wr(e)).floor&&(e.floor=0),null==e.ceiling&&(e.ceiling=1e4),null==e.interval&&(e.interval=250),new Promise((function(r,n){let i=null,o=!1;const s=()=>!o&&(o=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout((()=>{s()&&n(new Error("timeout"))}),e.timeout));const a=e.retryLimit;let h=0;!function i(){return t().then((function(t){if(void 0!==t)s()&&r(t);else if(e.oncePoll)e.oncePoll.once("poll",i);else if(e.onceBlock)e.onceBlock.once("block",i);else if(!o){if(h++,h>a)return void(s()&&n(new Error("retry limit reached")));let t=e.interval*parseInt(String(Math.random()*Math.pow(2,h)));t<e.floor&&(t=e.floor),t>e.ceiling&&(t=e.ceiling),setTimeout(i,t)}return null}),(function(t){s()&&n(t)}))}()}))}for(var nm="qpzry9x8gf2tvdw0s3jn54khce6mua7l",im={},om=0;om<nm.length;om++){var sm=nm.charAt(om);if(void 0!==im[sm])throw new TypeError(sm+" is ambiguous");im[sm]=om}function am(t){var e=t>>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function hm(t){for(var e=1,r=0;r<t.length;++r){var n=t.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+t+")";e=am(e)^n>>5}for(e=am(e),r=0;r<t.length;++r){var i=t.charCodeAt(r);e=am(e)^31&i}return e}function um(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;var i=(t=r).lastIndexOf("1");if(-1===i)return"No separator character for "+t;if(0===i)return"Missing prefix for "+t;var o=t.slice(0,i),s=t.slice(i+1);if(s.length<6)return"Data too short";var a=hm(o);if("string"==typeof a)return a;for(var h=[],u=0;u<s.length;++u){var l=s.charAt(u),c=im[l];if(void 0===c)return"Unknown character "+l;a=am(a)^c,u+6>=s.length||h.push(c)}return 1!==a?"Invalid checksum for "+t:{prefix:o,words:h}}function lm(t,e,r,n){for(var i=0,o=0,s=(1<<r)-1,a=[],h=0;h<t.length;++h)for(i=i<<e|t[h],o+=e;o>=r;)o-=r,a.push(i>>o&s);if(n)o>0&&a.push(i<<r-o&s);else{if(o>=e)return"Excess padding";if(i<<r-o&s)return"Non-zero padding"}return a}var cm={decodeUnsafe:function(){var t=um.apply(null,arguments);if("object"==typeof t)return t},decode:function(t){var e=um.apply(null,arguments);if("object"==typeof e)return e;throw new Error(e)},encode:function(t,e,r){if(r=r||90,t.length+7+e.length>r)throw new TypeError("Exceeds length limit");var n=hm(t=t.toLowerCase());if("string"==typeof n)throw new Error(n);for(var i=t+"1",o=0;o<e.length;++o){var s=e[o];if(s>>5!=0)throw new Error("Non 5-bit word");n=am(n)^s,i+=nm.charAt(s)}for(o=0;o<6;++o)n=am(n);for(n^=1,o=0;o<6;++o){i+=nm.charAt(n>>5*(5-o)&31)}return i},toWordsUnsafe:function(t){var e=lm(t,8,5,!0);if(Array.isArray(e))return e},toWords:function(t){var e=lm(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)},fromWordsUnsafe:function(t){var e=lm(t,5,8,!1);if(Array.isArray(e))return e},fromWords:function(t){var e=lm(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}};const fm="providers/5.6.8",dm=new y(fm);class mm{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const t={},e=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),s=this.hex.bind(this),a=this.number.bind(this),h=this.type.bind(this);return t.transaction={hash:o,type:h,accessList:mm.allowNull(this.accessList.bind(this),null),blockHash:mm.allowNull(o,null),blockNumber:mm.allowNull(a,null),transactionIndex:mm.allowNull(a,null),confirmations:mm.allowNull(a,null),from:e,gasPrice:mm.allowNull(r),maxPriorityFeePerGas:mm.allowNull(r),maxFeePerGas:mm.allowNull(r),gasLimit:r,to:mm.allowNull(e,null),value:r,nonce:a,data:i,r:mm.allowNull(this.uint256),s:mm.allowNull(this.uint256),v:mm.allowNull(a),creates:mm.allowNull(e,null),raw:mm.allowNull(i)},t.transactionRequest={from:mm.allowNull(e),nonce:mm.allowNull(a),gasLimit:mm.allowNull(r),gasPrice:mm.allowNull(r),maxPriorityFeePerGas:mm.allowNull(r),maxFeePerGas:mm.allowNull(r),to:mm.allowNull(e),value:mm.allowNull(r),data:mm.allowNull((t=>this.data(t,!0))),type:mm.allowNull(a),accessList:mm.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:o,address:e,topics:mm.arrayOf(o),data:i,logIndex:a,blockHash:o},t.receipt={to:mm.allowNull(this.address,null),from:mm.allowNull(this.address,null),contractAddress:mm.allowNull(e,null),transactionIndex:a,root:mm.allowNull(s),gasUsed:r,logsBloom:mm.allowNull(i),blockHash:o,transactionHash:o,logs:mm.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:mm.allowNull(a,null),cumulativeGasUsed:r,effectiveGasPrice:mm.allowNull(r),status:mm.allowNull(a),type:h},t.block={hash:mm.allowNull(o),parentHash:o,number:a,timestamp:a,nonce:mm.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:mm.allowNull(e),extraData:i,transactions:mm.allowNull(mm.arrayOf(o)),baseFeePerGas:mm.allowNull(r)},t.blockWithTransactions=wr(t.block),t.blockWithTransactions.transactions=mm.allowNull(mm.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:mm.allowNull(n,void 0),toBlock:mm.allowNull(n,void 0),blockHash:mm.allowNull(o,void 0),address:mm.allowNull(e,void 0),topics:mm.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:mm.allowNull(a),blockHash:mm.allowNull(o),transactionIndex:a,removed:mm.allowNull(this.boolean.bind(this)),address:e,data:mm.allowFalsish(i,"0x"),topics:mm.arrayOf(o),transactionHash:o,logIndex:a},t}accessList(t){return Ls(t||[])}number(t){return"0x"===t?0:qt.from(t).toNumber()}type(t){return"0x"===t||null==t?0:qt.from(t).toNumber()}bigNumber(t){return qt.from(t)}boolean(t){if("boolean"==typeof t)return t;if("string"==typeof t){if("true"===(t=t.toLowerCase()))return!0;if("false"===t)return!1}throw new Error("invalid boolean - "+t)}hex(t,e){return"string"==typeof t&&(e||"0x"===t.substring(0,2)||(t="0x"+t),N(t))?t.toLowerCase():dm.throwArgumentError("invalid hash","value",t)}data(t,e){const r=this.hex(t,e);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+t);return r}address(t){return Ce(t)}callAddress(t){if(!N(t,32))return null;const e=Ce(R(t,12));return"0x0000000000000000000000000000000000000000"===e?null:e}contractAddress(t){return Oe(t)}blockTag(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t||N(t))return T(t);throw new Error("invalid blockTag")}hash(t,e){const r=this.hex(t,e);return 32!==I(r)?dm.throwArgumentError("invalid hash","value",t):r}difficulty(t){if(null==t)return null;const e=qt.from(t);try{return e.toNumber()}catch(t){}return null}uint256(t){if(!N(t))throw new Error("invalid uint256");return O(t,32)}_block(t,e){null!=t.author&&null==t.miner&&(t.miner=t.author);const r=null!=t._difficulty?t._difficulty:t.difficulty,n=mm.check(e,t);return n._difficulty=null==r?null:qt.from(r),n}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return mm.check(this.formats.transactionRequest,t)}transactionResponse(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&qt.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),1!==t.type&&2!==t.type||null!=t.accessList||(t.accessList=[]);const e=mm.check(this.formats.transaction,t);if(null!=t.chainId){let r=t.chainId;N(r)&&(r=qt.from(r).toNumber()),e.chainId=r}else{let r=t.networkId;null==r&&null==e.v&&(r=t.chainId),N(r)&&(r=qt.from(r).toNumber()),"number"!=typeof r&&null!=e.v&&(r=(e.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),e.chainId=r}return e.blockHash&&"x"===e.blockHash.replace(/0/g,"")&&(e.blockHash=null),e}transaction(t){return Hs(t)}receiptLog(t){return mm.check(this.formats.receiptLog,t)}receipt(t){const e=mm.check(this.formats.receipt,t);if(null!=e.root)if(e.root.length<=4){const t=qt.from(e.root).toNumber();0===t||1===t?(null!=e.status&&e.status!==t&&dm.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=t,delete e.root):dm.throwArgumentError("invalid alt-root-status","value.root",e.root)}else 66!==e.root.length&&dm.throwArgumentError("invalid root hash","value.root",e.root);return null!=e.status&&(e.byzantium=!0),e}topics(t){return Array.isArray(t)?t.map((t=>this.topics(t))):null!=t?this.hash(t,!0):null}filter(t){return mm.check(this.formats.filter,t)}filterLog(t){return mm.check(this.formats.filterLog,t)}static check(t,e){const r={};for(const n in t)try{const i=t[n](e[n]);void 0!==i&&(r[n]=i)}catch(t){throw t.checkKey=n,t.checkValue=e[n],t}return r}static allowNull(t,e){return function(r){return null==r?e:t(r)}}static allowFalsish(t,e){return function(r){return r?t(r):e}}static arrayOf(t){return function(e){if(!Array.isArray(e))throw new Error("not an array");const r=[];return e.forEach((function(e){r.push(t(e))})),r}}}var pm=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{h(n.next(t))}catch(t){o(t)}}function a(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}h((n=n.apply(t,e||[])).next())}))};const gm=new y(fm);function ym(t){return null==t?"null":(32!==I(t)&&gm.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function vm(t){for(t=t.slice();t.length>0&&null==t[t.length-1];)t.pop();return t.map((t=>{if(Array.isArray(t)){const e={};t.forEach((t=>{e[ym(t)]=!0}));const r=Object.keys(e);return r.sort(),r.join("|")}return ym(t)})).join("&")}function wm(t){if("string"==typeof t){if(32===I(t=t.toLowerCase()))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter:*:"+vm(t);if(ti.isForkEvent(t))throw gm.warn("not implemented"),new Error("not implemented");if(t&&"object"==typeof t)return"filter:"+(t.address||"*")+":"+vm(t.topics||[])}throw new Error("invalid event - "+t)}function bm(){return(new Date).getTime()}function Em(t){return new Promise((e=>{setTimeout(e,t)}))}const _m=["block","network","pending","poll"];class Am{constructor(t,e,r){gr(this,"tag",t),gr(this,"listener",e),gr(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const t=this.tag.split(":");return"tx"!==t[0]?null:t[1]}get filter(){const t=this.tag.split(":");if("filter"!==t[0])return null;const e=t[1],r=""===(n=t[2])?[]:n.split(/&/g).map((t=>{if(""===t)return[];const e=t.split("|").map((t=>"null"===t?null:t));return 1===e.length?e[0]:e}));var n;const i={};return r.length>0&&(i.topics=r),e&&"*"!==e&&(i.address=e),i}pollable(){return this.tag.indexOf(":")>=0||_m.indexOf(this.tag)>=0}}const Mm={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function km(t){return O(qt.from(t).toHexString(),32)}function xm(t){return kd.encode(k([t,R(Qd(Qd(t)),0,4)]))}const Nm=new RegExp("^(ipfs)://(.*)$","i"),Sm=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Nm,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Pm(t,e){try{return Mn(Im(t,e))}catch(t){}return null}function Im(t,e){if("0x"===t)return null;const r=qt.from(R(t,e,e+32)).toNumber(),n=qt.from(R(t,r,r+32)).toNumber();return R(t,r+32,r+32+n)}function Rm(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):gm.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function Cm(t){const e=M(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function Tm(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function Om(t){const e=[];let r=0;for(let n=0;n<t.length;n++)e.push(null),r+=32;for(let n=0;n<t.length;n++){const i=M(t[n]);e[n]=Cm(r),e.push(Cm(i.length)),e.push(Tm(i)),r+=32+32*Math.ceil(i.length/32)}return C(e)}class $m{constructor(t,e,r,n){gr(this,"provider",t),gr(this,"name",r),gr(this,"address",t.formatter.address(e)),gr(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((t=>qt.from(t).eq(1))).catch((t=>{if(t.code===y.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t}))),this._supportsEip2544}_fetch(t,e){return pm(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:C([t,Rd(this.name),e||"0x"])};let n=!1;var i;(yield this.supportsWildcard())&&(n=!0,r.data=C(["0x9061b923",Om([(i=this.name,P(k(i.split(".").map((t=>{const e=_n("_"+Bn(t));return e[0]=e.length-1,e}))))+"00"),r.data])]));try{let t=yield this.provider.call(r);return M(t).length%32==4&&gm.throwError("resolver threw error",y.errors.CALL_EXCEPTION,{transaction:r,data:t}),n&&(t=Im(t,0)),t}catch(t){if(t.code===y.errors.CALL_EXCEPTION)return null;throw t}}))}_fetchBytes(t,e){return pm(this,void 0,void 0,(function*(){const r=yield this._fetch(t,e);return null!=r?Im(r,0):null}))}_getAddress(t,e){const r=Mm[String(t)];if(null==r&&gm.throwError(`unsupported coin type: ${t}`,y.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),"eth"===r.ilk)return this.provider.formatter.address(e);const n=M(e);if(null!=r.p2pkh){const t=e.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return xm(k([[r.p2pkh],"0x"+t[2]]))}}if(null!=r.p2sh){const t=e.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(t){const e=parseInt(t[1],16);if(t[2].length===2*e&&e>=1&&e<=75)return xm(k([[r.p2sh],"0x"+t[2]]))}}if(null!=r.prefix){const t=n[1];let e=n[0];if(0===e?20!==t&&32!==t&&(e=-1):e=-1,e>=0&&n.length===2+t&&t>=1&&t<=75){const t=cm.toWords(n.slice(2));return t.unshift(e),cm.encode(r.prefix,t)}}return null}getAddress(t){return pm(this,void 0,void 0,(function*(){if(null==t&&(t=60),60===t)try{const t=yield this._fetch("0x3b3b57de");return"0x"===t||"0x0000000000000000000000000000000000000000000000000000000000000000"===t?null:this.provider.formatter.callAddress(t)}catch(t){if(t.code===y.errors.CALL_EXCEPTION)return null;throw t}const e=yield this._fetchBytes("0xf1cb7e06",km(t));if(null==e||"0x"===e)return null;const r=this._getAddress(t,e);return null==r&&gm.throwError("invalid or unsupported coin data",y.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:e}),r}))}getAvatar(){return pm(this,void 0,void 0,(function*(){const t=[{type:"name",content:this.name}];try{const e=yield this.getText("avatar");if(null==e)return null;for(let r=0;r<Sm.length;r++){const n=e.match(Sm[r]);if(null==n)continue;const i=n[1].toLowerCase();switch(i){case"https":return t.push({type:"url",content:e}),{linkage:t,url:e};case"data":return t.push({type:"data",content:e}),{linkage:t,url:e};case"ipfs":return t.push({type:"ipfs",content:e}),{linkage:t,url:Rm(e)};case"erc721":case"erc1155":{const r="erc721"===i?"0xc87b56dd":"0x0e89341c";t.push({type:i,content:e});const o=this._resolvedAddress||(yield this.getAddress()),s=(n[2]||"").split("/");if(2!==s.length)return null;const a=yield this.provider.formatter.address(s[0]),h=O(qt.from(s[1]).toHexString(),32);if("erc721"===i){const e=this.provider.formatter.callAddress(yield this.provider.call({to:a,data:C(["0x6352211e",h])}));if(o!==e)return null;t.push({type:"owner",content:e})}else if("erc1155"===i){const e=qt.from(yield this.provider.call({to:a,data:C(["0x00fdd58e",O(o,32),h])}));if(e.isZero())return null;t.push({type:"balance",content:e.toString()})}const u={to:this.provider.formatter.address(s[0]),data:C([r,h])};let l=Pm(yield this.provider.call(u),0);if(null==l)return null;t.push({type:"metadata-url-base",content:l}),"erc1155"===i&&(l=l.replace("{id}",h.substring(2)),t.push({type:"metadata-url-expanded",content:l})),l.match(/^ipfs:/i)&&(l=Rm(l)),t.push({type:"metadata-url",content:l});const c=yield em(l);if(!c)return null;t.push({type:"metadata",content:JSON.stringify(c)});let f=c.image;if("string"!=typeof f)return null;if(f.match(/^(https:\/\/|data:)/i));else{if(null==f.match(Nm))return null;t.push({type:"url-ipfs",content:f}),f=Rm(f)}return t.push({type:"url",content:f}),{linkage:t,url:f}}}}}catch(t){}return null}))}getContentHash(){return pm(this,void 0,void 0,(function*(){const t=yield this._fetchBytes("0xbc1c58d1");if(null==t||"0x"===t)return null;const e=t.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(e){const t=parseInt(e[3],16);if(e[4].length===2*t)return"ipfs://"+kd.encode("0x"+e[1])}const r=t.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const t=parseInt(r[3],16);if(r[4].length===2*t)return"ipns://"+kd.encode("0x"+r[1])}const n=t.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&64===n[1].length)return"bzz://"+n[1];const i=t.match(/^0x90b2c605([0-9a-f]*)$/);if(i&&68===i[1].length){const t={"=":"","+":"-","/":"_"};return"sia://"+Ad("0x"+i[1]).replace(/[=+\/]/g,(e=>t[e]))}return gm.throwError("invalid or unsupported content hash data",y.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})}))}getText(t){return pm(this,void 0,void 0,(function*(){let e=_n(t);e=k([km(64),km(e.length),e]),e.length%32!=0&&(e=k([e,O("0x",32-t.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",P(e));return null==r||"0x"===r?null:Mn(r)}))}}let Bm=null,Fm=1;class jm extends ei{constructor(t){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),gr(this,"anyNetwork","any"===t),this.anyNetwork&&(t=this.detectNetwork()),t instanceof Promise)this._networkPromise=t,t.catch((t=>{})),this._ready().catch((t=>{}));else{const e=yr(new.target,"getNetwork")(t);e?(gr(this,"_network",e),this.emit("network",e,null)):gm.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return pm(this,void 0,void 0,(function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(t){}null==t&&(t=yield this.detectNetwork()),t||gm.throwError("no network detected",y.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:gr(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return rm((()=>this._ready().then((t=>t),(t=>{if(t.code!==y.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))))}static getFormatter(){return null==Bm&&(Bm=new mm),Bm}static getNetwork(t){return function(t){if(null==t)return null;if("number"==typeof t){for(const e in Ed){const r=Ed[e];if(r.chainId===t)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:t,name:"unknown"}}if("string"==typeof t){const e=Ed[t];return null==e?null:{name:e.name,chainId:e.chainId,ensAddress:e.ensAddress,_defaultProvider:e._defaultProvider||null}}const e=Ed[t.name];if(!e)return"number"!=typeof t.chainId&&pd.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==e.chainId&&pd.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;var n;return null==r&&e._defaultProvider&&(r=(n=e._defaultProvider)&&"function"==typeof n.renetwork?e._defaultProvider.renetwork(t):e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}(null==t?"homestead":t)}ccipReadFetch(t,e,r){return pm(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=t.to.toLowerCase(),i=e.toLowerCase(),o=[];for(let t=0;t<r.length;t++){const e=r[t],s=e.replace("{sender}",n).replace("{data}",i),a=e.indexOf("{data}")>=0?null:JSON.stringify({data:i,sender:n}),h=yield em({url:s,errorPassThrough:!0},a,((t,e)=>(t.status=e.statusCode,t)));if(h.data)return h.data;const u=h.message||"unknown error";if(h.status>=400&&h.status<500)return gm.throwError(`response not found during CCIP fetch: ${u}`,y.errors.SERVER_ERROR,{url:e,errorMessage:u});o.push(u)}return gm.throwError(`error encountered during CCIP fetch: ${o.map((t=>JSON.stringify(t))).join(", ")}`,y.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(t){return pm(this,void 0,void 0,(function*(){if(yield this._ready(),t>0)for(;this._internalBlockNumber;){const e=this._internalBlockNumber;try{const r=yield e;if(bm()-r.respTime<=t)return r.blockNumber;break}catch(t){if(this._internalBlockNumber===e)break}}const e=bm(),r=vr({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((t=>null),(t=>t))}).then((({blockNumber:t,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const i=bm();return(t=qt.from(t).toNumber())<this._maxInternalBlockNumber&&(t=this._maxInternalBlockNumber),this._maxInternalBlockNumber=t,this._setFastBlockNumber(t),{blockNumber:t,reqTime:e,respTime:i}}));return this._internalBlockNumber=r,r.catch((t=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return pm(this,void 0,void 0,(function*(){const t=Fm++,e=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(t){return void this.emit("error",t)}if(this._setFastBlockNumber(r),this.emit("poll",t,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)gm.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",gm.makeError("network block skew detected",y.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let t=this._emitted.block+1;t<=r;t++)this.emit("block",t);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((t=>{if("block"===t)return;const e=this._emitted[t];"pending"!==e&&r-e>12&&delete this._emitted[t]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((t=>{switch(t.type){case"tx":{const r=t.hash;let n=this.getTransactionReceipt(r).then((t=>t&&null!=t.blockNumber?(this._emitted["t:"+r]=t.blockNumber,this.emit(r,t),null):null)).catch((t=>{this.emit("error",t)}));e.push(n);break}case"filter":if(!t._inflight){t._inflight=!0;const n=t.filter;n.fromBlock=t._lastBlockNumber+1,n.toBlock=r,n.toBlock-this._maxFilterBlockRange>n.fromBlock&&(n.fromBlock=n.toBlock-this._maxFilterBlockRange);const i=this.getLogs(n).then((e=>{t._inflight=!1,0!==e.length&&e.forEach((e=>{e.blockNumber>t._lastBlockNumber&&(t._lastBlockNumber=e.blockNumber),this._emitted["b:"+e.blockHash]=e.blockNumber,this._emitted["t:"+e.transactionHash]=e.blockNumber,this.emit(n,e)}))})).catch((e=>{this.emit("error",e),t._inflight=!1}));e.push(i)}}})),this._lastBlockNumber=r,Promise.all(e).then((()=>{this.emit("didPoll",t)})).catch((t=>{this.emit("error",t)}))}else this.emit("didPoll",t)}))}resetEventsBlock(t){this._lastBlockNumber=t-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return pm(this,void 0,void 0,(function*(){return gm.throwError("provider does not support network detection",y.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return pm(this,void 0,void 0,(function*(){const t=yield this._ready(),e=yield this.detectNetwork();if(t.chainId!==e.chainId){if(this.anyNetwork)return this._network=e,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",e,t),yield Em(0),this._network;const r=gm.makeError("underlying network changed",y.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:e});throw this.emit("error",r),r}return t}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((t=>{this._setFastBlockNumber(t)}),(t=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(t){t&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!t&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(t){if("number"!=typeof t||t<=0||parseInt(String(t))!=t)throw new Error("invalid polling interval");this._pollingInterval=t,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const t=bm();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((t=>((null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(t){null!=this._fastBlockNumber&&t<this._fastBlockNumber||(this._fastQueryDate=bm(),(null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,r){return pm(this,void 0,void 0,(function*(){return this._waitForTransaction(t,null==e?1:e,r||0,null)}))}_waitForTransaction(t,e,r,n){return pm(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(t);return(i?i.confirmations:0)>=e?i:new Promise(((i,o)=>{const s=[];let a=!1;const h=function(){return!!a||(a=!0,s.forEach((t=>{t()})),!1)},u=t=>{t.confirmations<e||h()||i(t)};if(this.on(t,u),s.push((()=>{this.removeListener(t,u)})),n){let r=n.startBlock,i=null;const u=s=>pm(this,void 0,void 0,(function*(){a||(yield Em(1e3),this.getTransactionCount(n.from).then((l=>pm(this,void 0,void 0,(function*(){if(!a){if(l<=n.nonce)r=s;else{{const e=yield this.getTransaction(t);if(e&&null!=e.blockNumber)return}for(null==i&&(i=r-3,i<n.startBlock&&(i=n.startBlock));i<=s;){if(a)return;const r=yield this.getBlockWithTransactions(i);for(let i=0;i<r.transactions.length;i++){const s=r.transactions[i];if(s.hash===t)return;if(s.from===n.from&&s.nonce===n.nonce){if(a)return;const r=yield this.waitForTransaction(s.hash,e);if(h())return;let i="replaced";return s.data===n.data&&s.to===n.to&&s.value.eq(n.value)?i="repriced":"0x"===s.data&&s.from===s.to&&s.value.isZero()&&(i="cancelled"),void o(gm.makeError("transaction was replaced",y.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:this._wrapTransaction(s),hash:t,receipt:r}))}}i++}}a||this.once("block",u)}}))),(t=>{a||this.once("block",u)})))}));if(a)return;this.once("block",u),s.push((()=>{this.removeListener("block",u)}))}if("number"==typeof r&&r>0){const t=setTimeout((()=>{h()||o(gm.makeError("timeout exceeded",y.errors.TIMEOUT,{timeout:r}))}),r);t.unref&&t.unref(),s.push((()=>{clearTimeout(t)}))}}))}))}getBlockNumber(){return pm(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return pm(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield this.perform("getGasPrice",{});try{return qt.from(t)}catch(e){return gm.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}}))}getBalance(t,e){return pm(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield vr({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getBalance",r);try{return qt.from(n)}catch(t){return gm.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:t})}}))}getTransactionCount(t,e){return pm(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield vr({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getTransactionCount",r);try{return qt.from(n).toNumber()}catch(t){return gm.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:t})}}))}getCode(t,e){return pm(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield vr({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getCode",r);try{return P(n)}catch(t){return gm.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:t})}}))}getStorageAt(t,e,r){return pm(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield vr({address:this._getAddress(t),blockTag:this._getBlockTag(r),position:Promise.resolve(e).then((t=>T(t)))}),i=yield this.perform("getStorageAt",n);try{return P(i)}catch(t){return gm.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:t})}}))}_wrapTransaction(t,e,r){if(null!=e&&32!==I(e))throw new Error("invalid response - sendTransaction");const n=t;return null!=e&&t.hash!==e&&gm.throwError("Transaction hash mismatch from Provider.sendTransaction.",y.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),n.wait=(e,n)=>pm(this,void 0,void 0,(function*(){let i;null==e&&(e=1),null==n&&(n=0),0!==e&&null!=r&&(i={data:t.data,from:t.from,nonce:t.nonce,to:t.to,value:t.value,startBlock:r});const o=yield this._waitForTransaction(t.hash,e,n,i);return null==o&&0===e?null:(this._emitted["t:"+t.hash]=o.blockNumber,0===o.status&&gm.throwError("transaction failed",y.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:o}),o)})),n}sendTransaction(t){return pm(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Promise.resolve(t).then((t=>P(t))),r=this.formatter.transaction(t);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const t=yield this.perform("sendTransaction",{signedTransaction:e});return this._wrapTransaction(r,t,n)}catch(t){throw t.transaction=r,t.transactionHash=r.hash,t}}))}_getTransactionRequest(t){return pm(this,void 0,void 0,(function*(){const e=yield t,r={};return["from","to"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?this._getAddress(t):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?qt.from(t):null)))})),["type"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>null!=t?t:null)))})),e.accessList&&(r.accessList=this.formatter.accessList(e.accessList)),["data"].forEach((t=>{null!=e[t]&&(r[t]=Promise.resolve(e[t]).then((t=>t?P(t):null)))})),this.formatter.transactionRequest(yield vr(r))}))}_getFilter(t){return pm(this,void 0,void 0,(function*(){t=yield t;const e={};return null!=t.address&&(e.address=this._getAddress(t.address)),["blockHash","topics"].forEach((r=>{null!=t[r]&&(e[r]=t[r])})),["fromBlock","toBlock"].forEach((r=>{null!=t[r]&&(e[r]=this._getBlockTag(t[r]))})),this.formatter.filter(yield vr(e))}))}_call(t,e,r){return pm(this,void 0,void 0,(function*(){r>=10&&gm.throwError("CCIP read exceeded maximum redirections",y.errors.SERVER_ERROR,{redirects:r,transaction:t});const n=t.to,i=yield this.perform("call",{transaction:t,blockTag:e});if(r>=0&&"latest"===e&&null!=n&&"0x556f1830"===i.substring(0,10)&&I(i)%32==4)try{const o=R(i,4),s=R(o,0,32);qt.from(s).eq(n)||gm.throwError("CCIP Read sender did not match",y.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const a=[],h=qt.from(R(o,32,64)).toNumber(),u=qt.from(R(o,h,h+32)).toNumber(),l=R(o,h+32);for(let e=0;e<u;e++){const r=Pm(l,32*e);null==r&&gm.throwError("CCIP Read contained corrupt URL string",y.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i}),a.push(r)}const c=Im(o,64);qt.from(R(o,100,128)).isZero()||gm.throwError("CCIP Read callback selector included junk",y.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const f=R(o,96,100),d=Im(o,128),m=yield this.ccipReadFetch(t,c,a);null==m&&gm.throwError("CCIP Read disabled or provided no URLs",y.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const p={to:n,data:C([f,Om([m,d])])};return this._call(p,e,r+1)}catch(t){if(t.code===y.errors.SERVER_ERROR)throw t}try{return P(i)}catch(r){return gm.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"call",params:{transaction:t,blockTag:e},result:i,error:r})}}))}call(t,e){return pm(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield vr({transaction:this._getTransactionRequest(t),blockTag:this._getBlockTag(e),ccipReadEnabled:Promise.resolve(t.ccipReadEnabled)});return this._call(r.transaction,r.blockTag,r.ccipReadEnabled?0:-1)}))}estimateGas(t){return pm(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield vr({transaction:this._getTransactionRequest(t)}),r=yield this.perform("estimateGas",e);try{return qt.from(r)}catch(t){return gm.throwError("bad result from backend",y.errors.SERVER_ERROR,{method:"estimateGas",params:e,result:r,error:t})}}))}_getAddress(t){return pm(this,void 0,void 0,(function*(){"string"!=typeof(t=yield t)&&gm.throwArgumentError("invalid address or ENS name","name",t);const e=yield this.resolveName(t);return null==e&&gm.throwError("ENS name not configured",y.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(t)})`}),e}))}_getBlock(t,e){return pm(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;let r=-128;const n={includeTransactions:!!e};if(N(t,32))n.blockHash=t;else try{n.blockTag=yield this._getBlockTag(t),N(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(e){gm.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",t)}return rm((()=>pm(this,void 0,void 0,(function*(){const t=yield this.perform("getBlock",n);if(null==t)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(e){let e=null;for(let r=0;r<t.transactions.length;r++){const n=t.transactions[r];if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){null==e&&(e=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let t=e-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}}const r=this.formatter.blockWithTransactions(t);return r.transactions=r.transactions.map((t=>this._wrapTransaction(t))),r}return this.formatter.block(t)}))),{oncePoll:this})}))}getBlock(t){return this._getBlock(t,!1)}getBlockWithTransactions(t){return this._getBlock(t,!0)}getTransaction(t){return pm(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return rm((()=>pm(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",e);if(null==r)return null==this._emitted["t:"+t]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(t){return pm(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return rm((()=>pm(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",e);if(null==r)return null==this._emitted["t:"+t]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let t=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;t<=0&&(t=1),n.confirmations=t}return n}))),{oncePoll:this})}))}getLogs(t){return pm(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield vr({filter:this._getFilter(t)}),r=yield this.perform("getLogs",e);return r.forEach((t=>{null==t.removed&&(t.removed=!1)})),mm.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return pm(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(t){return pm(this,void 0,void 0,(function*(){if("number"==typeof(t=yield t)&&t<0){t%1&&gm.throwArgumentError("invalid BlockTag","blockTag",t);let e=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return e+=t,e<0&&(e=0),this.formatter.blockTag(e)}return this.formatter.blockTag(t)}))}getResolver(t){return pm(this,void 0,void 0,(function*(){let e=t;for(;;){if(""===e||"."===e)return null;if("eth"!==t&&"eth"===e)return null;const r=yield this._getResolver(e,"getResolver");if(null!=r){const n=new $m(this,r,t);return e===t||(yield n.supportsWildcard())?n:null}e=e.split(".").slice(1).join(".")}}))}_getResolver(t,e){return pm(this,void 0,void 0,(function*(){null==e&&(e="ENS");const r=yield this.getNetwork();r.ensAddress||gm.throwError("network does not support ENS",y.errors.UNSUPPORTED_OPERATION,{operation:e,network:r.name});try{const e=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+Rd(t).substring(2)});return this.formatter.callAddress(e)}catch(t){}return null}))}resolveName(t){return pm(this,void 0,void 0,(function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(e){if(N(t))throw e}"string"!=typeof t&&gm.throwArgumentError("invalid ENS name","name",t);const e=yield this.getResolver(t);return e?yield e.getAddress():null}))}lookupAddress(t){return pm(this,void 0,void 0,(function*(){t=yield t;const e=(t=this.formatter.address(t)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(e,"lookupAddress");if(null==r)return null;const n=Pm(yield this.call({to:r,data:"0x691f3431"+Rd(e).substring(2)}),0);return(yield this.resolveName(n))!=t?null:n}))}getAvatar(t){return pm(this,void 0,void 0,(function*(){let e=null;if(N(t)){const r=this.formatter.address(t).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;e=new $m(this,n,r);try{const t=yield e.getAvatar();if(t)return t.url}catch(t){if(t.code!==y.errors.CALL_EXCEPTION)throw t}try{const t=Pm(yield this.call({to:n,data:"0x691f3431"+Rd(r).substring(2)}),0);e=yield this.getResolver(t)}catch(t){if(t.code!==y.errors.CALL_EXCEPTION)throw t;return null}}else if(e=yield this.getResolver(t),!e)return null;const r=yield e.getAvatar();return null==r?null:r.url}))}perform(t,e){return gm.throwError(t+" not implemented",y.errors.NOT_IMPLEMENTED,{operation:t})}_startEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_stopEvent(t){this.polling=this._events.filter((t=>t.pollable())).length>0}_addEventListener(t,e,r){const n=new Am(wm(t),e,r);return this._events.push(n),this._startEvent(n),this}on(t,e){return this._addEventListener(t,e,!1)}once(t,e){return this._addEventListener(t,e,!0)}emit(t,...e){let r=!1,n=[],i=wm(t);return this._events=this._events.filter((t=>t.tag!==i||(setTimeout((()=>{t.listener.apply(this,e)}),0),r=!0,!t.once||(n.push(t),!1)))),n.forEach((t=>{this._stopEvent(t)})),r}listenerCount(t){if(!t)return this._events.length;let e=wm(t);return this._events.filter((t=>t.tag===e)).length}listeners(t){if(null==t)return this._events.map((t=>t.listener));let e=wm(t);return this._events.filter((t=>t.tag===e)).map((t=>t.listener))}off(t,e){if(null==e)return this.removeAllListeners(t);const r=[];let n=!1,i=wm(t);return this._events=this._events.filter((t=>t.tag!==i||t.listener!=e||(!!n||(n=!0,r.push(t),!1)))),r.forEach((t=>{this._stopEvent(t)})),this}removeAllListeners(t){let e=[];if(null==t)e=this._events,this._events=[];else{const r=wm(t);this._events=this._events.filter((t=>t.tag!==r||(e.push(t),!1)))}return e.forEach((t=>{this._stopEvent(t)})),this}}var Dm=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{h(n.next(t))}catch(t){o(t)}}function a(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}h((n=n.apply(t,e||[])).next())}))};const Um=new y(fm),Lm=["call","estimateGas"];function zm(t,e){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")){const r=N(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if("object"==typeof t){for(const r in t){const n=zm(t[r],e);if(n)return n}return null}if("string"==typeof t)try{return zm(JSON.parse(t),e)}catch(t){}return null}function qm(t,e,r){const n=r.transaction||r.signedTransaction;if("call"===t){const t=zm(e,!0);if(t)return t.data;Um.throwError("missing revert data in call exception; Transaction reverted without a reason string",y.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if("estimateGas"===t){let r=zm(e.body,!1);null==r&&(r=zm(e,!1)),r&&Um.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",y.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===y.errors.SERVER_ERROR&&e.error&&"string"==typeof e.error.message?i=e.error.message:"string"==typeof e.body?i=e.body:"string"==typeof e.responseText&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit/i)&&Um.throwError("insufficient funds for intrinsic transaction cost",y.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&Um.throwError("nonce has already been used",y.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Um.throwError("replacement fee too low",y.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&Um.throwError("legacy pre-eip-155 transactions not supported",y.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),Lm.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&Um.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",y.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function Vm(t){return new Promise((function(e){setTimeout(e,t)}))}function Gm(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function Hm(t){return t?t.toLowerCase():t}const Km={};class Qm extends si{constructor(t,e,r){if(super(),t!==Km)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");gr(this,"provider",e),null==r&&(r=0),"string"==typeof r?(gr(this,"_address",this.provider.formatter.address(r)),gr(this,"_index",null)):"number"==typeof r?(gr(this,"_index",r),gr(this,"_address",null)):Um.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(t){return Um.throwError("cannot alter JSON-RPC Signer connection",y.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Jm(Km,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((t=>(t.length<=this._index&&Um.throwError("unknown account #"+this._index,y.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index]))))}sendUncheckedTransaction(t){t=wr(t);const e=this.getAddress().then((t=>(t&&(t=t.toLowerCase()),t)));if(null==t.gasLimit){const r=wr(t);r.from=e,t.gasLimit=this.provider.estimateGas(r)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((t=>Dm(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.provider.resolveName(t);return null==e&&Um.throwArgumentError("provided ENS name resolves to null","tx.to",t),e}))))),vr({tx:vr(t),sender:e}).then((({tx:e,sender:r})=>{null!=e.from?e.from.toLowerCase()!==r&&Um.throwArgumentError("from address mismatch","transaction",t):e.from=r;const n=this.provider.constructor.hexlifyTransaction(e,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((t=>t),(t=>qm("sendTransaction",t,n)))}))}signTransaction(t){return Um.throwError("signing transactions is unsupported",y.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return Dm(this,void 0,void 0,(function*(){const e=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(t);try{return yield rm((()=>Dm(this,void 0,void 0,(function*(){const t=yield this.provider.getTransaction(r);if(null!==t)return this.provider._wrapTransaction(t,r,e)}))),{oncePoll:this.provider})}catch(t){throw t.transactionHash=r,t}}))}signMessage(t){return Dm(this,void 0,void 0,(function*(){const e="string"==typeof t?_n(t):t,r=yield this.getAddress();return yield this.provider.send("personal_sign",[P(e),r.toLowerCase()])}))}_legacySignMessage(t){return Dm(this,void 0,void 0,(function*(){const e="string"==typeof t?_n(t):t,r=yield this.getAddress();return yield this.provider.send("eth_sign",[r.toLowerCase(),P(e)])}))}_signTypedData(t,e,r){return Dm(this,void 0,void 0,(function*(){const n=yield Kd.resolveNames(t,e,r,(t=>this.provider.resolveName(t))),i=yield this.getAddress();return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(Kd.getPayload(n.domain,e,n.value))])}))}unlock(t){return Dm(this,void 0,void 0,(function*(){const e=this.provider,r=yield this.getAddress();return e.send("personal_unlockAccount",[r.toLowerCase(),t,null])}))}}class Jm extends Qm{sendTransaction(t){return this.sendUncheckedTransaction(t).then((t=>({hash:t,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:e=>this.provider.waitForTransaction(t,e)})))}}const Zm={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Ym extends jm{constructor(t,e){let r=e;null==r&&(r=new Promise(((t,e)=>{setTimeout((()=>{this.detectNetwork().then((e=>{t(e)}),(t=>{e(t)}))}),0)}))),super(r),t||(t=yr(this.constructor,"defaultUrl")()),gr(this,"connection","string"==typeof t?Object.freeze({url:t}):Object.freeze(wr(t))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Dm(this,void 0,void 0,(function*(){yield Vm(0);let t=null;try{t=yield this.send("eth_chainId",[])}catch(e){try{t=yield this.send("net_version",[])}catch(t){}}if(null!=t){const e=yr(this.constructor,"getNetwork");try{return e(qt.from(t).toNumber())}catch(e){return Um.throwError("could not detect network",y.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e})}}return Um.throwError("could not detect network",y.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(t){return new Qm(Km,this,t)}getUncheckedSigner(t){return this.getSigner(t).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((t=>t.map((t=>this.formatter.address(t)))))}send(t,e){const r={method:t,params:e,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Ar(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(n&&this._cache[t])return this._cache[t];const i=em(this.connection,JSON.stringify(r),Gm).then((t=>(this.emit("debug",{action:"response",request:r,response:t,provider:this}),t)),(t=>{throw this.emit("debug",{action:"response",error:t,request:r,provider:this}),t}));return n&&(this._cache[t]=i,setTimeout((()=>{this._cache[t]=null}),0)),i}prepareRequest(t,e){switch(t){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Hm(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Hm(e.address),e.blockTag]];case"getCode":return["eth_getCode",[Hm(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Hm(e.address),O(e.position,32),e.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[e.signedTransaction]];case"getBlock":return e.blockTag?["eth_getBlockByNumber",[e.blockTag,!!e.includeTransactions]]:e.blockHash?["eth_getBlockByHash",[e.blockHash,!!e.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[e.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[e.transactionHash]];case"call":return["eth_call",[yr(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[yr(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=Hm(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return Dm(this,void 0,void 0,(function*(){if("call"===t||"estimateGas"===t){const t=e.transaction;if(t&&null!=t.type&&qt.from(t.type).isZero()&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((e=wr(e)).transaction=wr(t),delete e.transaction.type)}}const r=this.prepareRequest(t,e);null==r&&Um.throwError(t+" not implemented",y.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(r[0],r[1])}catch(r){return qm(t,r,e)}}))}_startEvent(t){"pending"===t.tag&&this._startPending(),super._startEvent(t)}_startPending(){if(null!=this._pendingFilter)return;const t=this,e=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=e,e.then((function(r){return function n(){t.send("eth_getFilterChanges",[r]).then((function(r){if(t._pendingFilter!=e)return null;let n=Promise.resolve();return r.forEach((function(e){t._emitted["t:"+e.toLowerCase()]="pending",n=n.then((function(){return t.getTransaction(e).then((function(e){return t.emit("pending",e),null}))}))})),n.then((function(){return Vm(1e3)}))})).then((function(){if(t._pendingFilter==e)return setTimeout((function(){n()}),0),null;t.send("eth_uninstallFilter",[r])})).catch((t=>{}))}(),r})).catch((t=>{}))}_stopEvent(t){"pending"===t.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(t)}static hexlifyTransaction(t,e){const r=wr(Zm);if(e)for(const t in e)e[t]&&(r[t]=!0);!function(t,e){t&&"object"==typeof t||pr.throwArgumentError("invalid object","object",t),Object.keys(t).forEach((r=>{e[r]||pr.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)}))}(t,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(e){if(null==t[e])return;const r=T(qt.from(t[e]));"gasLimit"===e&&(e="gas"),n[e]=r})),["from","to","data"].forEach((function(e){null!=t[e]&&(n[e]=P(t[e]))})),t.accessList&&(n.accessList=Ls(t.accessList)),n}}var Wm=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{h(n.next(t))}catch(t){o(t)}}function a(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}h((n=n.apply(t,e||[])).next())}))};const Xm=new y(fm);class tp extends Ym{detectNetwork(){const t=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return Wm(this,void 0,void 0,(function*(){let e=this.network;return null==e&&(e=yield t.detectNetwork.call(this),e||Xm.throwError("no network detected",y.errors.UNKNOWN_ERROR,{}),null==this._network&&(gr(this,"_network",e),this.emit("network",e,null))),e}))}}const ep={};function rp(t,{broviderUrl:e="https://rpc.snapshot.org"}={}){const r=`${e}/${t}`;return ep[t]||(ep[t]=new tp({url:r,timeout:25e3,allowGzip:!0},Number(t))),ep[t]}function np(t){return we(_n(t))}var ip=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{h(n.next(t))}catch(t){o(t)}}function a(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}h((n=n.apply(t,e||[])).next())}))};const op=new y("hash/5.6.1"),sp=new Uint8Array(32);sp.fill(0);const ap=qt.from(-1),hp=qt.from(0),up=qt.from(1),lp=qt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const cp=O(up.toHexString(),32),fp=O(hp.toHexString(),32),dp={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},mp=["name","version","chainId","verifyingContract","salt"];function pp(t){return function(e){return"string"!=typeof e&&op.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const gp={name:pp("name"),version:pp("version"),chainId:function(t){try{return qt.from(t).toString()}catch(t){}return op.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Ce(t).toLowerCase()}catch(t){}return op.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=M(t);if(32!==e.length)throw new Error("bad length");return P(e)}catch(t){}return op.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function yp(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=""===e[1],n=parseInt(e[2]||"256");(n%8!=0||n>256||e[2]&&e[2]!==String(n))&&op.throwArgumentError("invalid numeric width","type",t);const i=lp.mask(r?n-1:n),o=r?i.add(up).mul(ap):hp;return function(e){const r=qt.from(e);return(r.lt(o)||r.gt(i))&&op.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),O(r.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(0===r||r>32||e[1]!==String(r))&&op.throwArgumentError("invalid bytes width","type",t),function(e){return M(e).length!==r&&op.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=M(t),r=e.length%32;return r?C([e,sp.slice(r)]):P(e)}(e)}}}switch(t){case"address":return function(t){return O(Ce(t),32)};case"bool":return function(t){return t?cp:fp};case"bytes":return function(t){return we(t)};case"string":return function(t){return np(t)}}return null}function vp(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class wp{constructor(t){gr(this,"types",Object.freeze(Ar(t))),gr(this,"_encoderCache",{}),gr(this,"_types",{});const e={},r={},n={};Object.keys(t).forEach((t=>{e[t]={},r[t]=[],n[t]={}}));for(const n in t){const i={};t[n].forEach((o=>{i[o.name]&&op.throwArgumentError(`duplicate variable name ${JSON.stringify(o.name)} in ${JSON.stringify(n)}`,"types",t),i[o.name]=!0;const s=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&op.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);yp(s)||(r[s]||op.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",t),r[s].push(n),e[n][s]=!0)}))}const i=Object.keys(r).filter((t=>0===r[t].length));0===i.length?op.throwArgumentError("missing primary type","types",t):i.length>1&&op.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),gr(this,"primaryType",i[0]),function i(o,s){s[o]&&op.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",t),s[o]=!0,Object.keys(e[o]).forEach((t=>{r[t]&&(i(t,s),Object.keys(s).forEach((e=>{n[e][t]=!0})))})),delete s[o]}(this.primaryType,{});for(const e in n){const r=Object.keys(n[e]);r.sort(),this._types[e]=vp(e,t[e])+r.map((e=>vp(e,t[e]))).join("")}}getEncoder(t){let e=this._encoderCache[t];return e||(e=this._encoderCache[t]=this._getEncoder(t)),e}_getEncoder(t){{const e=yp(t);if(e)return e}const e=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(e){const t=e[1],r=this.getEncoder(t),n=parseInt(e[3]);return e=>{n>=0&&e.length!==n&&op.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(r);return this._types[t]&&(i=i.map(we)),we(C(i))}}const r=this.types[t];if(r){const e=np(this._types[t]);return t=>{const n=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return this._types[r]?we(n):n}));return n.unshift(e),C(n)}}return op.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||op.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return we(this.encodeData(t,e))}encode(t){return this.encodeData(this.primaryType,t)}hash(t){return this.hashStruct(this.primaryType,t)}_visit(t,e,r){if(yp(t))return r(t,e);const n=t.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const t=n[1],i=parseInt(n[3]);return i>=0&&e.length!==i&&op.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e),e.map((e=>this._visit(t,e,r)))}const i=this.types[t];return i?i.reduce(((t,{name:n,type:i})=>(t[n]=this._visit(i,e[n],r),t)),{}):op.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new wp(t)}static getPrimaryType(t){return wp.from(t).primaryType}static hashStruct(t,e,r){return wp.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=dp[r];n||op.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>mp.indexOf(t.name)-mp.indexOf(e.name))),wp.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return C(["0x1901",wp.hashDomain(t),wp.from(e).hash(r)])}static hash(t,e,r){return we(wp.encode(t,e,r))}static resolveNames(t,e,r,n){return ip(this,void 0,void 0,(function*(){t=wr(t);const i={};t.verifyingContract&&!N(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const o=wp.from(e);o.visit(r,((t,e)=>("address"!==t||N(e,20)||(i[e]="0x"),e)));for(const t in i)i[t]=yield n(t);return t.verifyingContract&&i[t.verifyingContract]&&(t.verifyingContract=i[t.verifyingContract]),r=o.visit(r,((t,e)=>"address"===t&&i[e]?i[e]:e)),{domain:t,value:r}}))}static getPayload(t,e,r){wp.hashDomain(t);const n={},i=[];mp.forEach((e=>{const r=t[e];null!=r&&(n[e]=gp[e](r),i.push({name:e,type:dp[e]}))}));const o=wp.from(e),s=wr(e);return s.EIP712Domain?op.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",e):s.EIP712Domain=i,o.encode(r),{types:s,domain:n,primaryType:o.primaryType,message:o.visit(r,((t,e)=>{if(t.match(/^bytes(\d*)/))return P(M(e));if(t.match(/^u?int/))return qt.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&op.throwArgumentError("invalid string","value",e),e}return op.throwArgumentError("unsupported type","type",t)}))}}}window&&window.__awaiter;new y("wallet/5.6.2");function bp(t,e,r,n){return js(wp.hash(t,e,r),n)}function Ep(t,r,n,i){return e(this,void 0,void 0,(function*(){let e;try{e=yield rg(i,["function isValidSignature(bytes32 _hash, bytes memory _signature) public view returns (bytes4 magicValue)"],[t,"isValidSignature",[M(n),r]])}catch(t){if(t.message.startsWith("missing revert data in call exception"))return!1;throw t}return e.toLowerCase()==="0x1626ba7e".toLowerCase()}))}function _p(t,r,n,i){return e(this,void 0,void 0,(function*(){return(yield rg(i,["function isValidSignature(bytes _hash, bytes memory _signature) public view returns (bytes4 magicValue)"],[t,"isValidSignature",[M(n),r]])).toLowerCase()==="0x20c13b0b".toLowerCase()}))}function Ap(t,r,n){return e(this,arguments,void 0,(function*(t,e,r,n="1",i={}){const o=rp(n,i);return!!(yield Ep(t,e,r,o))||(yield _p(t,e,r,o))}))}function Mp(t){const{domain:e,types:r,message:n}=t;return Lu.hash(e,r,n)}var kp=["snapshot.4everland.link","ipfs.io","ipfs.fleek.co","gateway.pinata.cloud","dweb.link","ipfs.infura.io"],xp={1:{key:"1",name:"Ethereum",chainId:1,network:"homestead",multicall:"0xeefba1e63905ef1d7acba5a8513c70307c1ce441",ensResolvers:["0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63","0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41"],ensNameWrapper:"0xD4416b13d2b3a9aBae7AcD5D6C2BbDBE25686401",ensSubgraph:"https://subgrapher.snapshot.org/subgraph/arbitrum/5XqPmWe6gjyrJtFn9cLy237i4cWw2j9HcUJEXsP5qGtH",rpc:["https://rpc.ankr.com/eth",{url:"https://api-geth-archive.ankr.com",user:"balancer_user",password:"balancerAnkr20201015"},"https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/eth/mainnet/archive","https://apis.ankr.com/e62bc219f9c9462b8749defe472d2dc5/6106d4a3ec1d1bcc87ec72158f8fd089/eth/archive/main","https://eth-archival.gateway.pokt.network/v1/5f76124fb90218002e9ce985","https://eth-mainnet.alchemyapi.io/v2/4bdDVB5QAaorY2UE-GBUbM2yQB3QJqzv"],light:["https://cloudflare-eth.com"],ws:["wss://eth-mainnet.ws.alchemyapi.io/v2/4bdDVB5QAaorY2UE-GBUbM2yQB3QJqzv"],explorer:{url:"https://etherscan.io",apiUrl:"https://api.etherscan.io"},start:7929876,logo:"ipfs://bafkreid7ndxh6y2ljw2jhbisodiyrhcy2udvnwqgon5wgells3kh4si5z4"},8:{key:"8",name:"Ubiq",chainId:8,network:"Ubiq",multicall:"0x6668750957e4083725926B71C41bDF1434C73262",rpc:["https://rpc.octano.dev"],ws:["wss://ws.octano.dev"],explorer:{url:"https://ubiqscan.io"},start:1,logo:"ipfs://Qmec3HLoN4QhwZAhw4XTi2aN8Wwmcko5hHN22sHARzb9tw"},10:{key:"10",name:"Optimism",chainId:10,network:"Optimism mainnet",multicall:"0x35A6Cdb2C9AD4a45112df4a04147EB07dFA01aB7",rpc:["https://opt-mainnet.g.alchemy.com/v2/JzmIL4Q3jBj7it2duxLFeuCa9Wobmm7D"],explorer:{url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io"},start:657806,logo:"ipfs://QmfF4kwhGL8QosUXvgq2KWCmavhKBvwD6kbhs7L4p5ZAWb"},19:{key:"19",name:"Songbird Canary-Network",shortName:"Songbird",chainId:19,network:"songbird",multicall:"0x17032Ea9c3a13Ed337665145364c0d2aD1108c91",rpc:["https://songbird-api.flare.network/ext/C/rpc"],explorer:{url:"https://songbird-explorer.flare.network"},start:21807126,logo:"ipfs://QmXyvnrZY8FUxSULfnKKA99sAEkjAHtvhRx5WeHixgaEdu"},24:{key:"24",name:"KardiaChain Mainnet",shortName:"KAI",chainId:24,network:"mainnet",multicall:"0xd9c92F2287B7802A37eC9BEce96Aa65fb5f31E1b",rpc:["https://kai-internal.kardiachain.io"],explorer:{url:"https://explorer.kardiachain.io"},start:8260245,logo:"ipfs://bafkreig73yfyqzbxydv6e3dbj5nks3f57px2iez7tywayey4rilfhhrr34"},25:{key:"25",name:"Cronos",shortName:"Cronos",chainId:25,network:"mainnet",multicall:"0x6F522a3982e8F9A50A2EDc9E46ed1A3aE2B3FD3a",rpc:["https://evm-cronos.crypto.org"],explorer:{url:"https://cronos.crypto.org/explorer"},start:4067,logo:"ipfs://QmfSJbtirJoa3Pt7o5Fdm85wbyw9V1hpzqLr5PQbdnfsAj"},30:{key:"30",name:"RSK",chainId:30,network:"rsk mainnet",multicall:"0x4eeebb5580769ba6d26bfd07be636300076d1831",rpc:["https://public-node.rsk.co"],explorer:{url:"https://explorer.rsk.co"},start:2516442,logo:"ipfs://QmXTwpE1SqoNZmyY4c3fYWy6qUgQELsyWKbgJo2Pg6K6V9"},46:{key:"46",name:"Darwinia Network",shortName:"Darwinia",chainId:46,network:"mainnet",multicall:"0x67f9ae42EaA9a8aBf065D60ec6Ab3C1A11370607",rpc:["https://rpc.darwinia.network"],explorer:{url:"https://darwinia.subscan.io"},start:141853,logo:"ipfs://bafkreicf55maidhx46pyu3mwsshlr43xbewr6tkckkonh4nesbkp7krwkm"},56:{key:"56",name:"BNB Smart Chain",shortName:"BSC",chainId:56,network:"mainnet",multicall:"0x1ee38d535d541c55c9dae27b12edf090c608e6fb",rpc:["https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/bsc/mainnet/archive","https://rpc.ankr.com/bsc","https://bsc.getblock.io/mainnet/?api_key=91f8195f-bf46-488f-846a-73d6853790e7","https://bsc-private-dataseed1.nariox.org","https://bsc-dataseed1.ninicoin.io","https://bsc-dataseed1.binance.org"],explorer:{url:"https://bscscan.com"},start:461230,logo:"ipfs://QmWQaQ4Tv28DwA4DRKjSDJFWY9mZboGvuu77J8nh7kucxv"},61:{key:"61",name:"Ethereum Classic",shortName:"Ethereum Classic",chainId:61,network:"mainnet",multicall:"0x51be3a92C56ae7E207C5b5Fd87F7798Ce82C1AC2",rpc:["https://www.ethercluster.com/etc"],explorer:{url:"https://blockscout.com/etc/mainnet"},start:13307544,logo:"ipfs://QmVegc28DvA7LjKUFysab81c9BSuN4wQVDQkRXyAtuEBis"},66:{key:"66",name:"OKExChain",shortName:"OEC Mainnet",chainId:66,network:"oec mainnet",multicall:"0x6EB187d8197Ac265c945b69f3c3064A6f3831866",rpc:["https://exchainrpc.okex.org"],ws:["wss://exchainws.okex.org:8443"],explorer:{url:"https://www.oklink.com/okexchain"},start:5076543,logo:"ipfs://Qmd7dKnNwHRZ4HRCbCXUbkNV7gP28fGqPdjbHtjRtT9sQF"},75:{key:"75",name:"Decimal",shortName:"mainnet",chainId:75,network:"mainnet",multicall:"0x949d1A0757803C51F2EfFFEb5472C861A898B8E8",rpc:[],explorer:{url:"https://explorer.decimalchain.com"},start:16031065,logo:"ipfs://bafkreihkdhbce5rkogl63xegaarlirjrvbfarxbtbf5mqme3s5grvbjyxm"},81:{key:"81",name:"Shibuya Network",shortName:"Shibuya",chainId:81,network:"testnet",testnet:!0,multicall:"0x3E90A35839ff0Aa32992d33d861f24dC95BBf74d",rpc:["https://rpc.shibuya.astar.network:8545"],explorer:{url:"https://blockscout.com/shibuya"},start:856303,logo:"ipfs://QmZLQVsUqHBDXutu6ywTvcYXDZG2xBstMfHkfJSzUNpZsc"},82:{key:"82",name:"Meter",shortName:"Meter",chainId:82,network:"mainnet",multicall:"0x579De77CAEd0614e3b158cb738fcD5131B9719Ae",rpc:["https://rpc.meter.io"],explorer:{url:"https://scan.meter.io"},start:4992871,logo:"ipfs://QmSZvT9w9eUDvV1YVaq3BKKEbubtNVqu1Rin44FuN4wz11"},97:{key:"97",name:"BNB Smart Chain Testnet",shortName:"BSC Testnet",chainId:97,network:"testnet",testnet:!0,multicall:"0x8b54247c6BAe96A6ccAFa468ebae96c4D7445e46",rpc:["https://data-seed-prebsc-1-s1.binance.org:8545","https://speedy-nodes-nyc.moralis.io/f2963e29bec0de5787da3164/bsc/testnet/archive"],explorer:{url:"https://testnet.bscscan.com"},start:3599656,logo:"ipfs://QmWQaQ4Tv28DwA4DRKjSDJFWY9mZboGvuu77J8nh7kucxv"},100:{key:"100",name:"Gnosis Chain",shortName:"xDAI",chainId:100,network:"mainnet",multicall:"0xb5b692a88bdfc81ca69dcb1d924f59f0413a602a",rpc:["https://gno.getblock.io/mainnet/6c1d1e6e-75d9-452f-a863-a694bff93d5c/","https://xdai-archive.blockscout.com","https://poa-xdai.gateway.pokt.network/v1/5f76124fb90218002e9ce985","https://rpc.gnosischain.com"],light:["https://rpc.gnosischain.com"],ws:["wss://rpc.xdaichain.com/wss"],explorer:{url:"https://gnosis.blockscout.com"},start:4108192,logo:"ipfs://QmZeiy8Ax4133wzxUQM9ky8z5XFVf6YLFjJMmTWbWVniZR"},108:{key:"108",name:"Thundercore",chainId:108,network:"mainnet",multicall:"0x3017086deef56679e267f67f66c4415109b7a97f",rpc:["https://mainnet-rpc.thundercore.com/archived/SNAPSHOTEuR82a75fLYA"],explorer:{url:"https://viewblock.io/thundercore"},start:94425385,logo:"ipfs://bafkreifc5z5vtvqx2luzgateyvoocwpd2ifv2hwufxdnyl2a767wa6icli"},122:{key:"122",name:"Fuse",shortName:"Fuse",chainId:122,network:"mainnet",multicall:"0x7a59441fb06666F6d2D766393d876945D06a169c",rpc:["https://explorer-node.fuse.io/","https://oefusefull1.liquify.info/"],explorer:{url:"https://explorer.fuse.io"},start:11923459,logo:"ipfs://QmXjWb64nako7voaVEifgdjAbDbswpTY8bghsiHpv8yWtb"},137:{key:"137",name:"Polygon PoS",shortName:"Polygon",chainId:137,network:"mainnet",multicall:"0xCBca837161be50EfA5925bB9Cc77406468e76751",rpc:["https://rpc.ankr.com/polygon","https://speedy-nodes-nyc.moralis.io/b9aed21e7bb7bdeb35972c9a/polygon/mainnet/archive","https://speedy-nodes-nyc.moralis.io/f2963e29bec0de5787da3164/polygon/mainnet/archive","https://rpc-mainnet.maticvigil.com/v1/1cfd7598e5ba6dcf0b4db58e8be484badc6ea08e"],ws:["wss://ws-mainnet.matic.network"],explorer:{url:"https://polygonscan.com",apiUrl:"https://api.polygonscan.com"},start:9834491,logo:"ipfs://bafkreihgr7zy7vi5kqddybfaezwuhvssg57qluwmyan4qq7l57nr7w7wey"},144:{key:"144",name:"PHI Network",shortName:"PHI",chainId:144,network:"mainnet",multicall:"0xc2f41B404a6757863AAeF49ff93039421acCd630",rpc:["https://connect.phi.network"],explorer:{url:"https://phiscan.com"},start:360030,logo:"ipfs://bafkreid6pm3mic7izp3a6zlfwhhe7etd276bjfsq2xash6a4s2vmcdf65a"},148:{key:"148",name:"ShimmerEVM",shortName:"ShimmerEVM",chainId:148,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://explorer.evm.shimmer.network/"},start:1290,logo:"ipfs://bafkreib4xhbgbhrwkmizp4d4nz3wzbpyhdm6wpz2v2pbkk7jxsgg3hdt74"},169:{key:"169",name:"Manta Pacific",shortName:"Manta",chainId:169,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://www.oklink.com/manta"},start:332890,logo:"ipfs://bafkreibbrwgwdcfh755dqh4ndta6tja77qbaa36bfv4pstub6prhhore7a"},204:{key:"204",name:"opBNB",shortName:"mainnet",chainId:204,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"http://opbnbscan.com/"},start:512881,logo:"ipfs://bafkreibll4la7wqerzs7zwxjne2j7ayynbg2wlenemssoahxxj5rbt6c64"},246:{key:"246",name:"Energy Web Chain",shortName:"EWC",chainId:246,network:"mainnet",multicall:"0x0767F26d0D568aB61A98b279C0b28a4164A6f05e",rpc:["https://voting-rpc.carbonswap.exchange"],explorer:{url:"https://explorer.energyweb.org"},start:12086501,logo:"ipfs://Qmai7AGHgs8NpeGeXgbMZz7pS2i4kw44qubCJYGrZW2f3a"},250:{key:"250",name:"Fantom Opera",shortName:"fantom",chainId:250,network:"Mainnet",multicall:"0x7f6A10218264a22B4309F3896745687E712962a0",rpc:["https://rpc.ankr.com/fantom","https://rpc.ftm.tools","https://rpcapi.fantom.network"],explorer:{url:"https://ftmscan.com"},start:2497732,logo:"ipfs://QmVEgNeQDKnXygeGxfY9FywZpNGQu98ktZtRJ9bToYF6g7"},269:{key:"269",name:"High Performance Blockchain",shortName:"HPB",chainId:269,network:"mainnet",multicall:"0x67D0f263aef2F6167FA77353695D75b582Ff4Bca",rpc:["https://hpbnode.com"],ws:["wss://ws.hpbnode.com"],explorer:{url:"https://hscan.org"},start:13960096,logo:"ipfs://QmU7f1MyRz8rLELFfypnWZQjGbDGYgZtC9rjw47jYMYrnu"},300:{key:"300",name:"zkSync Sepolia Testnet",shortName:"testnet",chainId:300,network:"testnet",multicall:"0xF9cda624FBC7e059355ce98a31693d299FACd963",rpc:[],explorer:{url:"https://sepolia.explorer.zksync.dev/"},start:2292,logo:"ipfs://bafkreih6y7ri7h667cwxe5miisxghfheiidtbw2747y75stoxt3gp3a2yy",testnet:!0},314:{key:"314",name:"Filecoin",shortName:"mainnet",chainId:314,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://filfox.io"},start:3328594,logo:"ipfs://bafybeibyvjfmk6aqlfdrczvth55jkmnoadtrch7ht3rdmvqmy2bfxynecm"},321:{key:"321",name:"KCC",shortName:"KCC",chainId:321,network:"mainnet",multicall:"0xa64D6AFb48225BDA3259246cfb418c0b91de6D7a",rpc:["https://rpc-mainnet.kcc.network"],ws:["wss://rpc-ws-mainnet.kcc.network"],explorer:{url:"https://explorer.kcc.io"},start:1487453,logo:"ipfs://QmRdzYGhFRG8QLzMJahHrw3vETE2YZ9sywQbEkenSjKEvb"},324:{key:"324",name:"zkSync Era",shortName:"zkSync-era",chainId:324,network:"zkSync Era Mainnet",multicall:"0xF9cda624FBC7e059355ce98a31693d299FACd963",rpc:["https://mainnet.era.zksync.io"],explorer:{url:"https://explorer.zksync.io/"},start:3908235,logo:"ipfs://bafkreih6y7ri7h667cwxe5miisxghfheiidtbw2747y75stoxt3gp3a2yy"},336:{key:"336",name:"Shiden Network",shortName:"Shiden",chainId:336,network:"mainnet",multicall:"0x3E90A35839ff0Aa32992d33d861f24dC95BBf74d",rpc:["https://rpc.shiden.astar.network:8545","https://shiden.api.onfinality.io/public"],explorer:{url:"https://blockscout.com/shiden"},start:1170016,logo:"ipfs://QmcqGQE4Sk73zXc3e91TUFFefKBVeaNgbxV141XkSNE4xj"},369:{key:"369",name:"Pulsechain",shortName:"Pulsechain",chainId:369,network:"mainnet",multicall:"0xdbdd0FD8B16F0092f306392b699D7fbddaA9011B",rpc:["https://rpc.pulsechain.com"],explorer:{url:"https://scan.pulsechain.com/"},start:17657774,logo:"ipfs://QmWUsiEWdejtHZ9B9981TYXn7Ds8C7fkB1S4h5rP3kCCZR"},416:{key:"416",name:"SX Network",shortName:"SX",chainId:416,network:"mainnet",multicall:"0x834a005DDCF990Ba1a79f259e840e58F2D14F49a",rpc:["https://rpc.sx.technology"],ws:["wss://rpc.sx.technology/ws"],explorer:{url:"https://explorer.sx.technology"},start:2680605,logo:"ipfs://QmSXLXqyr2H6Ja5XrmznXbWTEvF2gFaL8RXNXgyLmDHjAF"},592:{key:"592",name:"Astar Network",shortName:"Astar",chainId:592,network:"mainnet",multicall:"0x3E90A35839ff0Aa32992d33d861f24dC95BBf74d",rpc:["https://astar.api.onfinality.io/public","https://rpc.astar.network:8545"],explorer:{url:"https://blockscout.com/astar"},start:366482,logo:"ipfs://QmZLQVsUqHBDXutu6ywTvcYXDZG2xBstMfHkfJSzUNpZsc"},813:{key:"813",name:"Qitmeer",shortName:"MEER",chainId:813,network:"mainnet",multicall:"0x55034b2cF530ae3A8fC1e2e4523F58496796610F",rpc:["https://evm-dataseed1.meerscan.io","https://evm-dataseed.meerscan.com","https://evm-dataseed2.meerscan.io","https://evm-dataseed3.meerscan.io"],explorer:{url:"https://evm.meerscan.io"},start:43317,logo:"ipfs://QmXvum7SNVaAqAc2jNzR1NpNZN1GGvNaKWydg8a1GEDQ7y"},841:{key:"841",name:"Taraxa",shortName:"841",chainId:841,network:"mainnet",multicall:"0xFCe7a3121B42664AaD145712e1c2Bf2e38f60AA1",rpc:["https://rpc.mainnet.taraxa.io"],ws:["wss://ws.mainnet.taraxa.io"],explorer:{url:"https://mainnet.explorer.taraxa.io"},start:1515906,logo:"ipfs://Qmcc6ZCAGESMzZzoj5LsTVcCo2E35x3Ydk71uPJyov6Mwx"},888:{key:"888",name:"Wanchain",chainId:888,network:"mainnet",multicall:"0xba5934ab3056fca1fa458d30fbb3810c3eb5145f",rpc:["https://gwan-ssl.wandevs.org:56891"],ws:["wss://api.wanchain.org:8443/ws/v3/ddd16770c68f30350a21114802d5418eafe039b722de52b488e7eee1ee2cd73f"],explorer:{url:"https://www.wanscan.org"},start:11302663,logo:"ipfs://QmewFFN44rkxESFsHG8edaLt1znr62hjvZhGynfXqruzX3"},1001:{key:"1001",name:"Klaytn Baobab Testnet",shortName:"Boabab",chainId:1001,network:"testnet",testnet:!0,multicall:"0x40643B8Aeaaca0b87Ea1A1E596e64a0e14B1d244",rpc:["https://archive-en.baobab.klaytn.net"],ws:["wss://archive-en.baobab.klaytn.net/ws"],explorer:{url:"https://baobab.scope.klaytn.com"},start:87232478,logo:"ipfs://QmYACyZcidcFtMo4Uf9H6ZKUxTP2TQPjGzNjcUjqYa64dt"},1072:{key:"1072",name:"Shimmer EVM Testnet",shortName:"ShimmerEVM",chainId:1072,network:"testnet",testnet:!0,multicall:"0x751d21047C116413895c259f3f305e38C10B7cF6",rpc:["https://archive.evm.testnet.shimmer.network/v1/chains/rms1pr75wa5xuepg2hew44vnr28wz5h6n6x99zptk2g68sp2wuu2karywgrztx3/evm"],explorer:{url:"https://explorer.evm.testnet.shimmer.network/"},start:10614,logo:"ipfs://bafkreihtwfwrue7klzedwx4rqlk6agklz4lbbk7owsyw6xzn6c2m4t5tgy"},1088:{key:"1088",name:"Metis",shortName:"metis",chainId:1088,network:"mainnet",multicall:"0xc39aBB6c4451089dE48Cffb013c39d3110530e5C",rpc:["https://andromeda.metis.io/?owner=1088"],explorer:{url:"https://andromeda-explorer.metis.io"},start:451,logo:"ipfs://bafkreiaqr4atnjpdnk3c4vu4377ai7bzqpgaefefbl5j5imfsvr4puimtu"},1101:{key:"1101",name:"Polygon zkEVM",shortName:"mainnet",chainId:1101,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://zkevm.polygonscan.com"},start:57746,logo:"ipfs://bafkreibfiyvhqnme2vbxxfcku7qkxgjpkg6ywdkplxh4oxlkqsbznyorfm"},1116:{key:"1116",name:"Core Chain",shortName:"Core",chainId:1116,network:"mainnet",multicall:"0x024f0041b76B598c2A0a75004F8447FaF67BD004",rpc:["https://rpcar.coredao.org/"],explorer:{url:"https://scan.coredao.org"},start:853908,logo:"ipfs://bafkreigjv5yb7uhlrryzib7j2f73nnwqan2tmfnwjdu26vkk365fyesoiu"},1284:{key:"1284",name:"Moonbeam",shortName:"GLMR",chainId:1284,network:"mainnet",multicall:"0x83e3b61886770de2F64AAcaD2724ED4f08F7f36B",rpc:["https://rpc.api.moonbeam.network"],explorer:{url:"https://moonscan.io/"},start:171135,logo:"ipfs://QmWKTEK2pj5sBBbHnMHQbWgw6euVdBrk2Ligpi2chrWASk"},1285:{key:"1285",name:"Moonriver (Kusama)",shortName:"Moonriver",chainId:1285,network:"mainnet",multicall:"0x537004440ffFE1D4AE9F009031Fc2b0385FCA9F1",rpc:["https://rpc.api.moonriver.moonbeam.network"],explorer:{url:"https://blockscout.moonriver.moonbeam.network"},start:413539,logo:"ipfs://QmXtgPesL87Ejhq2Y7yxsaPYpf4RcnoTYPJWPcv6iiYhoi"},1287:{key:"1287",name:"Moonbase Alpha TestNet",shortName:"Moonbase",chainId:1287,network:"testnet",testnet:!0,multicall:"0xf09FD6B6FF3f41614b9d6be2166A0D07045A3A97",rpc:["https://rpc.testnet.moonbeam.network"],explorer:{url:"https://moonbase-blockscout.testnet.moonbeam.network"},start:859041,logo:"ipfs://QmeGbNTU2Jqwg8qLTMGW8n8HSi2VdgCncAaeGzLx6gYnD7"},1328:{key:"1328",name:"Sei atlantic testnet",shortName:"testnet",chainId:1328,network:"testnet",multicall:"0xc454132B017b55b427f45078E335549A7124f5f7",rpc:[],explorer:{url:"https://seitrace.com"},start:96978658,logo:"ipfs://bafkreiammyt7uztbztqbcqv4bydnczsh2fqmnjf6jxj4xnskzzl6sjrigq",testnet:!0},1329:{key:"1329",name:"Sei",shortName:"mainnet",chainId:1329,network:"mainnet",multicall:"0xe033Bed7cae4114Af84Be1e9F1CA7DEa07Dfe1Cf",rpc:[],explorer:{url:"https://seitrace.com/"},start:79164574,logo:"ipfs://bafkreiammyt7uztbztqbcqv4bydnczsh2fqmnjf6jxj4xnskzzl6sjrigq"},1559:{key:"1559",name:"Tenet",shortName:"tenet",chainId:1559,network:"mainnet",multicall:"0xcCB3F00bE353950E4C08501ac8Af48765EAAa738",rpc:[],explorer:{url:"https://tenetscan.io"},start:944415,logo:"ipfs://Qmc1gqjWTzNo4pyFSGtQuCu7kRSZZBUVybtTjHn2nNEEPA"},1663:{key:"1663",name:"Horizen Gobi Testnet",shortName:"Gobi",chainId:1663,network:"testnet",testnet:!0,multicall:"0xC743e4910Bdd4e5aBacCA38F74cdA270281C5eef",rpc:["https://gobi-testnet.horizenlabs.io/ethv1"],explorer:{url:"https://gobi-explorer.horizen.io"},start:1,logo:"ipfs://QmUYQdsnkUoiDiQ3WaWrtH7fsc5yQDC7kZJCHmC2qWPTPt"},2e3:{key:"2000",name:"Doge Chain",shortName:"dogechain",chainId:2e3,network:"mainnet",multicall:"0x6f9D3f3932B417bd4957585D236Cbc32b32C0BDc",rpc:["https://rpc.dogechain.dog"],explorer:{url:"https://explorer.dogechain.dog"},start:877115,logo:"ipfs://bafkreigovfh3pinsdih777issfgaflwu2yjzroljs2642gbvwikcd3nm4i"},2109:{key:"2109",name:"Exosama Network",shortName:"EXN",chainId:2109,network:"mainnet",multicall:"0x2feFC828e2fEfdE0C9f7740919c6A9139F886067",rpc:["https://rpc.exosama.com"],explorer:{url:"https://explorer.exosama.com"},start:94085,logo:"ipfs://QmaQxfwpXYTomUd24PMx5tKjosupXcm99z1jL1XLq9LWBS"},2152:{key:"2152",name:"Findora",shortName:"Findora",chainId:2152,network:"mainnet",multicall:"0xCF7D1e21CBe9bdEF235aef06C5d8051B3d4DF0f5",rpc:["https://archive.prod.findora.org:8545/"],explorer:{url:"https://evm.findorascan.io"},start:4219343,logo:"ipfs://QmXkneyRB6HbHTHRLCZpZqSsawiyJY7b2kZ2V8ydvKYAgv"},2221:{key:"2221",name:"Kava Testnet",shortName:"testnet",chainId:2221,network:"testnet",multicall:"0xc7193EFE367DF0C9349a1149F4E95A2A35604262",rpc:[],explorer:{url:"https://testnet.kavascan.com"},start:6193104,logo:"ipfs://bafkreibpfubharx32fjqkqbfdhygwdjb2khxdg6meaasrcxsgvowos26f4",testnet:!0},2222:{key:"2222",name:"Kava",shortName:"mainnet",chainId:2222,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://kavascan.com/"},start:3661165,logo:"ipfs://bafkreibpfubharx32fjqkqbfdhygwdjb2khxdg6meaasrcxsgvowos26f4"},2400:{key:"2400",name:"TCG Verse",shortName:"TCGV",chainId:2400,network:"mainnet",multicall:"0xceC65DEE0b5012F1b7321b2647681F997c7204FC",rpc:["https://rpc.tcgverse.xyz"],explorer:{url:"https://explorer.tcgverse.xyz"},start:57500,logo:"ipfs://bafkreidg4wpewve5mdxrofneqblydkrjl3oevtgpdf3fk3z3vjqam6ocoe"},4200:{key:"4200",name:"Merlin",shortName:"merlin",chainId:4200,network:"mainnet",multicall:"0x830E7E548F4D80947a40A7Cf3a2a53166a0C3980",rpc:[],explorer:{url:"https://scan.merlinchain.io"},start:589494,logo:"ipfs://bafkreicew2qv3m756m7xs2nrjezinghps7rlessrqjqetvox74w4hov2xe"},4337:{key:"4337",name:"Beam",shortName:"Beam",chainId:4337,network:"mainnet",multicall:"0x4956F15eFdc3dC16645e90Cc356eAFA65fFC65Ec",rpc:[],explorer:{url:"https://subnets.avax.network/beam/"},start:1,logo:"ipfs://QmaKRLxXPdeTsLx7MFLS3CJbhpSbResgoeL4fCgHB1mTsF"},4689:{key:"4689",name:"IoTeX",shortName:"IoTeX",chainId:4689,network:"mainnet",multicall:"0x9c8B105c94282CDB0F3ecF27e3cfA96A35c07be6",rpc:["https://babel-api.mainnet.iotex.io"],explorer:{url:"https://iotexscan.io"},start:11533283,logo:"ipfs://QmNkr1UPcBYbvLp7d7Pk4eF3YCsHpaNkfusKZNtykL2EQC"},5e3:{key:"5000",name:"Mantle",chainId:5e3,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:["https://rpc.mantle.xyz"],explorer:{url:"https://explorer.mantle.xyz"},start:304717,logo:"ipfs://bafkreidkucwfn4mzo2gtydrt2wogk3je5xpugom67vhi4h4comaxxjzoz4"},5555:{key:"5555",name:"Chain Verse",shortName:"ChainVerse",chainId:5555,network:"ChainVerse",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:["https://rpc.chainverse.info"],explorer:{url:"https://explorer.chainverse.info"},start:6334180,logo:"ipfs://QmQyJt28h4wN3QHPXUQJQYQqGiFUD77han3zibZPzHbitk"},6102:{key:"6102",name:"Cascadia Testnet",shortName:"Cascadia",chainId:6102,network:"testnet",multicall:"0x728989819bAD588F193563008E0a03E8cD6a3e4a",rpc:["https://testnet.cascadia.foundation"],explorer:{url:"https://explorer.cascadia.foundation"},testnet:!0,start:370457,logo:"ipfs://QmWkhZYhReYyaa5pQXj32hEGxoRcBqarFMcfQScELmjYQj"},7332:{key:"7332",name:"Horizen EON",shortName:"EON",chainId:7332,network:"mainnet",multicall:"0xC743e4910Bdd4e5aBacCA38F74cdA270281C5eef",rpc:[],explorer:{url:"https://eon-explorer.horizenlabs.io"},start:85108,logo:"ipfs://QmUYQdsnkUoiDiQ3WaWrtH7fsc5yQDC7kZJCHmC2qWPTPt"},7341:{key:"7341",name:"Shyft",shortName:"Shyft",chainId:7341,network:"mainnet",multicall:"0xceb10e9133D771cA93c8002Be527A465E85381a2",rpc:["https://rpc.shyft.network"],explorer:{url:"https://bx.shyft.network"},start:3673983,logo:"ipfs://bafkreifwxnnfk6koabzmxgcxcwlrwt6b5gijdain2gyqee77q4ajfb7fu4"},7560:{key:"7560",name:"Cyber",shortName:"mainnet",chainId:7560,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://cyberscan.co"},start:1731707,logo:"ipfs://bafkreifm2bbehoqpz4454o7gixnxfi6cgvqlxigqr3f6ipj7l2omtgfgnm"},8217:{key:"8217",name:"Klaytn Cypress",shortName:"Cypress",chainId:8217,network:"mainnet",multicall:"0x5f5f0d1b9ff8b3dcace308e39b13b203354906e9",rpc:["https://archive-en.cypress.klaytn.net"],ws:["wss://archive-en.cypress.klaytn.net/ws"],explorer:{url:"https://scope.klaytn.com"},start:91582357,logo:"ipfs://QmYACyZcidcFtMo4Uf9H6ZKUxTP2TQPjGzNjcUjqYa64dt"},8453:{key:"8453",name:"Base",shortName:"mainnet",chainId:8453,network:"mainnet",multicall:"0xca11bde05977b3631167028862be2a173976ca11",rpc:[],explorer:{url:"https://basescan.org/"},start:5022,logo:"ipfs://QmaxRoHpxZd8PqccAynherrMznMufG6sdmHZLihkECXmZv"},9001:{key:"9001",name:"Evmos Network",shortName:"Evmos",chainId:9001,network:"mainnet",multicall:"0x37763d16f8dBf6F185368E0f256350cAb7E24b26",rpc:["https://eth.bd.evmos.org:8545"],ws:["wss://eth.bd.evmos.org:8546"],explorer:{url:"https://escan.live"},start:13959539,logo:"ipfs://bafkreif4obrdoiretpozdd56seziywc6clha7wwkbldng3ovry2bpzly34"},1e4:{key:"10000",name:"smartBCH",shortName:"BCH",chainId:1e4,network:"mainnet",multicall:"0x1b38EBAd553f218e2962Cb1C0539Abb5d6A37774",rpc:["https://smartbch.greyh.at/"],explorer:{url:"https://smartbch-explorer.web.app"},start:268248,logo:"ipfs://QmWG1p7om4hZ4Yi4uQvDpxg4si7qVYhtppGbcDGrhVFvMd"},10243:{key:"10243",name:"Arthera Testnet",shortName:"Arthera_",chainId:10243,network:"testnet",testnet:!0,multicall:"0x27c7FC597aD2E81C4c1cA1769972f79DaF042Da7",rpc:["https://rpc-test.arthera.net"],explorer:{url:"https://explorer-test.arthera.net"},start:10523,logo:"ipfs://QmYQp3e52KjkT4bYdAvB6ACEEpXs2D8DozsDitaADRY2Ak"},13337:{key:"13337",name:"Beam Testnet",shortName:"testnet",chainId:13337,network:"testnet",multicall:"0x9BF49b704EE2A095b95c1f2D4EB9010510c41C9E",rpc:[],explorer:{url:"https://subnets-test.avax.network/beam/"},start:3,logo:"ipfs://QmaKRLxXPdeTsLx7MFLS3CJbhpSbResgoeL4fCgHB1mTsF",testnet:!0},13371:{key:"13371",name:"Immutable zkEVM",shortName:"mainnet",chainId:13371,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://explorer.immutable.com"},start:3680945,logo:"ipfs://bafkreiepnhfv3hgexddjpyaeemxo3byhtxxit6t4zsponyczee6ddjqxwi"},13473:{key:"13473",name:"Immutable zkEVM Testnet",shortName:"testnet",chainId:13473,network:"testnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://explorer.testnet.immutable.com"},start:5307209,logo:"ipfs://bafkreiepnhfv3hgexddjpyaeemxo3byhtxxit6t4zsponyczee6ddjqxwi",testnet:!0},16718:{key:"16718",name:"AirDAO",chainId:16718,network:"mainnet",multicall:"0x25e81aC81A8B03389D78CB45faB78353aB528574",rpc:["https://network-archive.ambrosus.io"],ws:["wss://network-archive.ambrosus.io/ws"],explorer:{url:"https://airdao.io/explorer"},start:22922566,logo:"ipfs://QmSxXjvWng3Diz4YwXDV2VqSPgMyzLYBNfkjJcr7rzkxom"},29548:{key:"29548",name:"MCH Verse",shortName:"mainnet",chainId:29548,network:"mainnet",multicall:"0x1d39652386488CE1fE4254E105F5A42a04d43dB2",rpc:[],explorer:{url:"https://explorer.oasys.mycryptoheroes.net"},start:27458402,logo:"ipfs://QmZZnwR1y6cU1sare2TQmwqkNDLXQxD4GdPrmHLmUoPtbU"},42161:{key:"42161",name:"Arbitrum One",chainId:42161,network:"Arbitrum mainnet",multicall:"0x7A7443F8c577d537f1d8cD4a629d40a3148Dd7ee",rpc:["https://rpc.ankr.com/arbitrum","https://speedy-nodes-nyc.moralis.io/9e03baabdc27be2a35bdec4a/arbitrum/mainnet","https://arb-mainnet.g.alchemy.com/v2/JDvtNGwnHhTltIwfnxQocKwKkCTKA1DL"],explorer:{url:"https://arbiscan.io"},start:256508,logo:"ipfs://QmWZ5SMRfvcK8tycsDqojQaSiKedgtVkS7CkZdxPgeCVsZ"},42170:{key:"42170",name:"Arbitrum Nova",chainId:42170,network:"Arbitrum Nova",multicall:"0x4E74EBd9CABff51cE9a43EFe059bA8c5A28E4A14",rpc:["https://nova.arbitrum.io/rpc","https://arbitrum-nova.public.blastapi.io"],explorer:{url:"https://nova.arbiscan.io/"},start:6006607,logo:"ipfs://bafkreie5xsqt3mrrwu7v32qpmmctibhzhgxf4emfzzddsdhdlfsa7fmplu"},42220:{key:"42220",name:"Celo",shortName:"Celo",chainId:42220,network:"mainnet",multicall:"0xb8d0d2C1391eeB350d2Cd39EfABBaaEC297368D9",rpc:["https://celo.snapshot.org","https://forno.celo.org","https://celo-mainnet--rpc.datahub.figment.io/apikey/e892a66dc36e4d2d98a5d6406d609796/"],explorer:{url:"https://explorer.celo.org"},start:6599803,logo:"ipfs://QmS2tVJ7rdJRe1NHXAi2L86yCbUwVVrmB2mHQeNdJxvQti"},43113:{key:"43113",name:"Avalanche FUJI Testnet",chainId:43113,network:"testnet",testnet:!0,multicall:"0x984476ea55e32e785A9D8FF14329f99D74E3d2A2",rpc:["https://api.avax-test.network/ext/bc/C/rpc"],explorer:{url:"https://testnet.snowtrace.io"},start:10528153,logo:"ipfs://QmeS75uS7XLR8o8uUzhLRVYPX9vMFf4DXgKxQeCzyy7vM2"},43114:{key:"43114",name:"Avalanche",chainId:43114,network:"mainnet",multicall:"0x7E9985aE4C8248fdB07607648406a48C76e9e7eD",rpc:["https://nd-784-543-849.p2pify.com/aa7b29fc5fed65b34f0ee6b8de33f8c0/ext/bc/C/rpc","https://rpc.ankr.com/avalanche","https://api.avax.network/ext/bc/C/rpc"],explorer:{url:"https://snowtrace.io"},start:536483,logo:"ipfs://QmeS75uS7XLR8o8uUzhLRVYPX9vMFf4DXgKxQeCzyy7vM2"},47805:{key:"47805",name:"REI Mainnet",chainId:47805,network:"mainnet",multicall:"0x9eE9904815B80C39C1a27294E69a8626EAa7952d",rpc:["https://rpc.rei.network"],explorer:{url:"https://scan.rei.network/"},start:1715902,logo:"ipfs://QmTogMDLmDgJjDjUKDHDuc2KVTVDbXf8bXJLFiVe8PRxgo"},53935:{key:"53935",name:"DFK Chain",chainId:53935,network:"mainnet",multicall:"0x5b24224dC16508DAD755756639E420817DD4c99E",rpc:["https://subnets.avax.network/defi-kingdoms/dfk-chain/rpc"],explorer:{url:"https://subnets.avax.network/defi-kingdoms/"},start:62,logo:"ipfs://QmZNkpVgPbuVbDcsi6arwH1om3456FGnwfDqYQJWUfHDEx"},59141:{key:"59141",name:"Linea Sepolia",shortName:"testnet",chainId:59141,network:"testnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://sepolia.lineascan.build/"},start:227427,logo:"ipfs://bafkreihtyzolub3sejuwc32hpdpjnt7ksowaguni2yuho3kyihhcqrtqce",testnet:!0},59144:{key:"59144",name:"Linea",shortName:"linea",chainId:59144,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://lineascan.build/"},start:42,logo:"ipfs://bafkreihtyzolub3sejuwc32hpdpjnt7ksowaguni2yuho3kyihhcqrtqce"},80001:{key:"80001",name:"Polygon Mumbai",chainId:80001,network:"testnet",testnet:!0,multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:["https://speedy-nodes-nyc.moralis.io/9e03baabdc27be2a35bdec4a/polygon/mumbai/archive","https://rpc-mumbai.matic.today"],ws:["wss://ws-mumbai.matic.today"],explorer:{url:"https://mumbai.polygonscan.com",apiUrl:"https://api-mumbai.polygonscan.com"},start:12011090,logo:"ipfs://bafkreihgr7zy7vi5kqddybfaezwuhvssg57qluwmyan4qq7l57nr7w7wey"},81457:{key:"81457",name:"Blast",shortName:"mainnet",chainId:81457,network:"mainnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://blastscan.io"},start:88189,logo:"ipfs://bafkreibfmkjg22cozxppzcoxswj45clvh2rqhxzax57cmmgudbtkf4dkce"},84532:{key:"84532",name:"Base Sepolia",shortName:"testnet",chainId:84532,network:"testnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://base-sepolia.blockscout.com/"},start:1059647,logo:"ipfs://QmaxRoHpxZd8PqccAynherrMznMufG6sdmHZLihkECXmZv",testnet:!0},686868:{key:"686868",name:"Merlin Testnet",shortName:"merlin",chainId:686868,network:"testnet",multicall:"0x758BC6321b7c68F4986d62a4D46E83A2DCb58c80",rpc:[],explorer:{url:"https://testnet-scan.merlinchain.io"},start:3562021,logo:"ipfs://bafkreicew2qv3m756m7xs2nrjezinghps7rlessrqjqetvox74w4hov2xe",testnet:!0},713715:{key:"713715",name:"Sei EVM Devnet",shortName:"devnet",chainId:713715,network:"testnet",multicall:"0xEe8d287B844959ADe40d718Dc23077ba920e2f07",rpc:[],explorer:{url:"https://seitrace.com"},start:1463669,logo:"ipfs://bafkreiammyt7uztbztqbcqv4bydnczsh2fqmnjf6jxj4xnskzzl6sjrigq",testnet:!0},810180:{key:"810180",name:"zkLink Nova",shortName:"zlink",chainId:810180,network:"mainnet",multicall:"0x825267E0fA5CAe92F98540828a54198dcB3Eaeb5",rpc:[],explorer:{url:"https://explorer.zklink.io"},start:146055,logo:"ipfs://bafkreic6c3iems5235qapyhyrygha7akqrsfact2nok3y2uhljpzxrdu74"},810181:{key:"810181",name:"zkLink Nova Sepolia",shortName:"testnet",chainId:810181,network:"testnet",multicall:"0x97148F8fDdd9A1620f72EC1Bb2932916623d9da5",rpc:[],explorer:{url:"https://sepolia.explorer.zklink.io/"},start:43723,logo:"ipfs://bafkreic6c3iems5235qapyhyrygha7akqrsfact2nok3y2uhljpzxrdu74",testnet:!0},11155111:{key:"11155111",name:"Sepolia testnet",shortName:"Sepolia",chainId:11155111,network:"sepolia",testnet:!0,multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:["https://sepolia.infura.io/v3/d26b4fd748814fe994b05899fd89e667"],ensResolvers:["0x8FADE66B79cC9f707aB26799354482EB93a5B7dD"],ensNameWrapper:"0x0635513f179D50A207757E05759CbD106d7dFcE8",ensSubgraph:"https://api.studio.thegraph.com/proxy/49574/enssepolia/version/latest",explorer:{url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io"},start:751532,logo:"ipfs://bafkreid7ndxh6y2ljw2jhbisodiyrhcy2udvnwqgon5wgells3kh4si5z4"},11155420:{key:"11155420",name:"OP Sepolia",shortName:"testnet",chainId:11155420,network:"testnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://sepolia-optimism.etherscan.io"},start:1620204,logo:"ipfs://QmfF4kwhGL8QosUXvgq2KWCmavhKBvwD6kbhs7L4p5ZAWb",testnet:!0},111557560:{key:"111557560",name:"Cyber Testnet",shortName:"testnet",chainId:111557560,network:"testnet",multicall:"0xffc391F0018269d4758AEA1a144772E8FB99545E",rpc:[],explorer:{url:"https://testnet.cyberscan.co/"},start:304545,logo:"ipfs://bafkreifm2bbehoqpz4454o7gixnxfi6cgvqlxigqr3f6ipj7l2omtgfgnm",testnet:!0},168587773:{key:"168587773",name:"Blast Sepolia",shortName:"testnet",chainId:168587773,network:"testnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://sepolia.blastexplorer.io"},start:756690,logo:"ipfs://bafkreibfmkjg22cozxppzcoxswj45clvh2rqhxzax57cmmgudbtkf4dkce",testnet:!0},245022926:{key:"245022926",name:"Neon Devnet",shortName:"devnet",chainId:245022926,network:"testnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://devnet.neonscan.org/"},start:205206112,logo:"ipfs://QmecRPQGa4bU7tybg1sUQY48Md9rWnmhrT6WW5ueqvhg6P",testnet:!0},1313161554:{key:"1313161554",name:"Aurora",shortName:"Aurora",chainId:1313161554,network:"mainnet",multicall:"0x32b50c286DEFd2932a0247b8bb940b78c063F16c",rpc:["https://mainnet.aurora.dev"],explorer:{url:"https://explorer.mainnet.aurora.dev"},start:57190533,logo:"ipfs://QmeRhsR1UPRTQCizdhmgr2XxphXebVKU5di97uCV2UMFpa"},16666e5:{key:"1666600000",name:"Harmony",shortName:"HarmonyMainnet",chainId:16666e5,network:"mainnet",multicall:"0x9c31392D2e0229dC4Aa250F043d46B9E82074BF8",rpc:["https://a.api.s0.t.hmny.io"],ws:["wss://ws.s0.t.hmny.io"],explorer:{url:"https://explorer.harmony.one"},start:10911984,logo:"ipfs://QmNnGPr1CNvj12SSGzKARtUHv9FyEfE5nES73U4vBWQSJL"},16667e5:{key:"1666700000",name:"Harmony Testnet",shortName:"HarmonyTestnet",chainId:16667e5,network:"testnet",testnet:!0,multicall:"0x9923589503Fd205feE3d367DDFF2378f0F7dD2d4",rpc:["https://api.s0.b.hmny.io"],ws:["wss://ws.s0.b.hmny.io"],explorer:{url:"https://explorer.pops.one"},start:7521509,logo:"ipfs://QmNnGPr1CNvj12SSGzKARtUHv9FyEfE5nES73U4vBWQSJL"}};class Np{constructor(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}static isValidChoice(t,e){return"number"==typeof t&&void 0!==(null==e?void 0:e[t-1])}getValidVotes(){return this.votes.filter((t=>Np.isValidChoice(t.choice,this.proposal.choices)))}getScores(){return this.proposal.choices.map(((t,e)=>{const r=this.getValidVotes().filter((t=>t.choice===e+1));return r.reduce(((t,e)=>t+e.balance),0)}))}getScoresByStrategy(){return this.proposal.choices.map(((t,e)=>{const r=this.strategies.map(((t,r)=>{const n=this.getValidVotes().filter((t=>t.choice===e+1));return n.reduce(((t,e)=>t+e.scores[r]),0)}));return r}))}getScoresTotal(){return this.votes.reduce(((t,e)=>t+e.balance),0)}getChoiceString(){return this.proposal.choices[this.selected-1]}}class Sp{constructor(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}static isValidChoice(t,e){return Array.isArray(t)&&t.every((t=>void 0!==(null==e?void 0:e[t-1])))&&t.length===new Set(t).size}getValidVotes(){return this.votes.filter((t=>Sp.isValidChoice(t.choice,this.proposal.choices)))}getScores(){return this.proposal.choices.map(((t,e)=>this.getValidVotes().filter((t=>t.choice.includes(e+1))).reduce(((t,e)=>t+e.balance),0)))}getScoresByStrategy(){return this.proposal.choices.map(((t,e)=>this.strategies.map(((t,r)=>this.getValidVotes().filter((t=>t.choice.includes(e+1))).reduce(((t,e)=>t+e.scores[r]),0)))))}getScoresTotal(){return this.votes.reduce(((t,e)=>t+e.balance),0)}getChoiceString(){return this.selected?this.proposal.choices.filter(((t,e)=>this.selected.includes(e+1))).join(", "):""}}function Pp(t,e){const r=t/e.reduce(((t,e)=>t+e),0);return isNaN(r)?0:r}function Ip(t,e){return Math.sqrt(t*e)}function Rp(t){return t*t}function Cp(t,e){return t.map((t=>e*t))}class Tp{constructor(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}static isValidChoice(t,e){return"object"==typeof t&&!Array.isArray(t)&&null!==t&&Object.keys(t).every((t=>void 0!==(null==e?void 0:e[Number(t)-1])))&&Object.keys(t).length>0&&Object.values(t).every((t=>"number"==typeof t&&t>=0))&&Object.values(t).some((t=>"number"==typeof t&&t>0))}getValidVotes(){return this.votes.filter((t=>Tp.isValidChoice(t.choice,this.proposal.choices)))}getScores(){const t=this.getValidVotes(),e=this.getValidVotes().reduce(((t,e)=>t+e.balance),0),r=this.proposal.choices.map(((e,r)=>{const n=t.map((t=>Ip(Pp(t.choice[r+1],Object.values(t.choice)),t.balance))).reduce(((t,e)=>t+e),0);return Rp(n)}));return Cp(r.map(((t,e)=>Pp(r[e],r))),e)}getScoresByStrategy(){const t=this.getValidVotes(),e=this.getValidVotes().reduce(((t,e)=>t+e.balance),0),r=this.proposal.choices.map(((e,r)=>this.strategies.map(((e,n)=>t.map((t=>Ip(Pp(t.choice[r+1],Object.values(t.choice)),t.scores[n]))).reduce(((t,e)=>t+e),0))))).map((t=>t.map((t=>[Rp(t)]))));return r.map(((t,n)=>Cp(this.strategies.map(((t,e)=>Pp(r[n][e][0],r.flat(2)))),e)))}getScoresTotal(){return this.votes.reduce(((t,e)=>t+e.balance),0)}getChoiceString(){return this.proposal.choices.map(((t,e)=>{if(this.selected[e+1]){const r=Pp(this.selected[e+1],Object.values(this.selected));return`${Math.round(1e3*r)/10}% for ${t}`}})).filter((t=>null!=t)).join(", ")}}function Op(t,e){const r=[...new Set(t.map((t=>t[0])).flat())],n=Object.entries(t.reduce(((t,[e],r,n)=>{const i=n[r][1];t[e[0]][0]+=i;const o=n[r][2];return o.length>1?t[e[0]][1]=o.map(((r,n)=>r+t[e[0]][1][n]||r)):t[e[0]][1]=[t[e[0]][1].concat(o).reduce(((t,e)=>t+e),0)],t}),Object.assign({},...r.map((t=>({[t]:[0,[]]})))))),i=n.map((t=>[t[0],t[1][0]])),[o,s]=i.reduce((([t,e],[r,n])=>n>e?[r,n]:[t,e]),["?",-1/0]),[a,h]=i.reduce((([t,e],[r,n])=>n<e?[r,n]:[t,e]),["?",1/0]),u=n.sort(((t,e)=>e[1][0]-t[1][0])),l=t.map((t=>t[1])).reduce(((t,e)=>t+e),0);return e.push({round:e.length+1,sortedByHighest:u}),s>l/2||u.length<3?e:Op(t.map((t=>[t[0].filter((t=>t!=a)),t[1],t[2]])).filter((t=>t[0].length>0)),e)}function $p(t){const e=Op(t.map((t=>[t.choice,t.balance,t.scores])),[]);return e[e.length-1].sortedByHighest}class Bp{constructor(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}static isValidChoice(t,e){return Array.isArray(t)&&t.every((t=>void 0!==(null==e?void 0:e[t-1])))&&t.length===new Set(t).size&&t.length>0&&t.length===e.length}getValidVotes(){return this.votes.filter((t=>Bp.isValidChoice(t.choice,this.proposal.choices)))}getScores(){return function(t,e){const r=$p(t);return e.choices.map(((t,e)=>r.filter((t=>Number(t[0])===e+1)).reduce(((t,e)=>t+e[1][0]),0)))}(this.getValidVotes(),this.proposal)}getScoresByStrategy(){const t=$p(this.getValidVotes());return this.proposal.choices.map(((e,r)=>this.strategies.map(((e,n)=>t.filter((t=>Number(t[0])===r+1)).reduce(((t,e)=>t+e[1][1][n]),0)))))}getScoresTotal(){return this.votes.reduce(((t,e)=>t+e.balance),0)}getChoiceString(){return this.selected.map((t=>{if(this.proposal.choices[t-1])return this.proposal.choices[t-1]})).map(((t,e)=>`(${ug(e+1)}) ${t}`)).join(", ")}}function Fp(t,e,r){const n=r.reduce(((t,e)=>t+e),0),i=e[t]/n*100;return isNaN(i)?0:i}function jp(t,e,r){return Fp(t+1,e,Object.values(e))/100*r}class Dp{constructor(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}static isValidChoice(t,e){return"object"==typeof t&&!Array.isArray(t)&&null!==t&&Object.keys(t).every((t=>void 0!==(null==e?void 0:e[Number(t)-1])))&&Object.keys(t).length>0&&Object.values(t).every((t=>"number"==typeof t&&t>=0))&&Object.values(t).some((t=>"number"==typeof t&&t>0))}getValidVotes(){return this.votes.filter((t=>Dp.isValidChoice(t.choice,this.proposal.choices)))}getScores(){const t=this.proposal.choices.map(((t,e)=>this.getValidVotes().map((t=>jp(e,t.choice,t.balance))).reduce(((t,e)=>t+e),0))),e=this.getValidVotes().reduce(((t,e)=>t+e.balance),0);return t.map(((e,r)=>Fp(r,t,t))).map((t=>e/100*t))}getScoresByStrategy(){const t=this.proposal.choices.map(((t,e)=>this.strategies.map(((t,r)=>this.getValidVotes().map((t=>jp(e,t.choice,t.scores[r]))).reduce(((t,e)=>t+e),0))))).map((t=>t.map((t=>[t])))),e=this.getValidVotes().reduce(((t,e)=>t+e.balance),0);return t.map(((r,n)=>this.strategies.map(((e,r)=>Fp(0,t[n][r],t.flat(2)))).map((t=>[e/100*t])).flat()))}getScoresTotal(){return this.votes.reduce(((t,e)=>t+e.balance),0)}getChoiceString(){return this.proposal.choices.map(((t,e)=>{if(this.selected[e+1])return`${Math.round(10*Fp(e+1,this.selected,Object.values(this.selected)))/10}% for ${t}`})).filter((t=>null!=t)).join(", ")}}var Up={"single-choice":Np,approval:Sp,quadratic:Tp,"ranked-choice":Bp,weighted:Dp,basic:Np};const Lp={1:"https://subgrapher.snapshot.org/delegation/1",10:"https://subgrapher.snapshot.org/delegation/10",56:"https://subgrapher.snapshot.org/delegation/56",100:"https://subgrapher.snapshot.org/delegation/100",137:"https://subgrapher.snapshot.org/delegation/137",250:"https://subgrapher.snapshot.org/delegation/250",42161:"https://subgrapher.snapshot.org/delegation/42161",11155111:"https://subgrapher.snapshot.org/delegation/11155111"},zp=1e3;function qp(t){return t.length===zp&&t[0].timestamp===t[t.length-1].timestamp}function Vp(t,e){const r=function(t){return`${t.delegator}-${t.delegate}-${t.space}`}(e);t.has(r)||t.set(r,e)}function Gp(t){const e=["",t];return t.includes(".eth")&&e.push(t.replace(".eth","")),e}function Hp(t){return e(this,arguments,void 0,(function*({url:t,spaces:e,pivot:r,snapshot:n}){const i={delegations:{__args:{where:{space_in:e,timestamp_gte:r},first:zp,skip:0,orderBy:"timestamp",orderDirection:"asc"},delegator:!0,space:!0,delegate:!0,timestamp:!0}};return"latest"!==n&&(i.delegations.__args.block={number:n}),(yield ig(t,i)).delegations||[]}))}const Kp="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",Qp=["function text(bytes32 node, string calldata key) external view returns (string memory)","function resolver(bytes32 node) view returns (address)"],Jp={Accept:"application/json","Content-Type":"application/json"},Zp="https://score.snapshot.org";function Yp(t=Zp,e={path:""}){const r=new URL(t);e.path&&(r.pathname=e.path);const n=r.searchParams.get("apiKey");let i=Object.assign({},Jp);return n&&(r.searchParams.delete("apiKey"),i=Object.assign(Object.assign({},Jp),{"X-API-KEY":n})),{url:r.toString(),headers:i}}function Wp(t){return e(this,void 0,void 0,(function*(){let e=yield t.text();try{e=JSON.parse(e)}catch(r){return Promise.reject({code:t.status||500,message:"Failed to parse response from score API",data:e})}return e.error?Promise.reject(e.error):e}))}const Xp=new df({allErrors:!0,allowUnionTypes:!0,$data:!0,passContext:!0});yf(Xp),wf(Xp),Xp.addFormat("address",{validate:t=>{try{return Te(t)}catch(t){return!1}}}),Xp.addFormat("evmOrStarknetAddress",{validate:t=>{try{return Te(t)||/^0x[0-9a-fA-F]{62,64}$/.test(t)}catch(t){return!1}}}),Xp.addFormat("long",{validate:()=>!0}),Xp.addFormat("ethValue",{validate:t=>{if(!t.match(/^([0-9]|[1-9][0-9]+)(\.[0-9]+)?$/))return!1;try{return function(t,e){if("string"!=typeof t&&Ya.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=Wa.indexOf(e);-1!==t&&(e=3*t)}Ha(t,null!=e?e:18)}(t,18),!0}catch(t){return!1}}});const tg=Object.keys(xp),eg=Object.keys(xp).filter((t=>!xp[t].testnet));function rg(t,r,n,i){return e(this,void 0,void 0,(function*(){const e=new sa(n[0],r,t);try{const t=n[2]||[];return yield e[n[1]](...t,i||{})}catch(t){return Promise.reject(t)}}))}function ng(t,r,n,i,o){return e(this,void 0,void 0,(function*(){const e=(null==o?void 0:o.multicallAddress)||xp[t].multicall,s=new sa(e,["function aggregate(tuple(address target, bytes callData)[] calls) view returns (uint256 blockNumber, bytes[] returnData)"],r),a=new Yn(n);try{const t=(null==o?void 0:o.limit)||500;(null==o?void 0:o.limit)&&delete o.limit;const e=Math.ceil(i.length/t),r=[];Array.from(Array(e)).forEach(((e,n)=>{const h=i.slice(t*n,t*(n+1));r.push(s.aggregate(h.map((t=>[t[0].toLowerCase(),a.encodeFunctionData(t[1],t[2])])),o||{}))}));let n=yield Promise.all(r);return n=n.reduce(((t,[,e])=>t.concat(e)),[]),n.map(((t,e)=>a.decodeFunctionResult(i[e][1],t)))}catch(t){return Promise.reject(t)}}))}function ig(t,r){return e(this,arguments,void 0,(function*(t,e,r={}){const n=yield a(t,{method:"POST",headers:Object.assign({Accept:"application/json","Content-Type":"application/json"},null==r?void 0:r.headers),body:JSON.stringify({query:Ku.jsonToGraphQLQuery({query:e})})});let i=yield n.text();try{i=JSON.parse(i)}catch(e){throw new Error(`Errors found in subgraphRequest: URL: ${t}, Status: ${n.status}, Response: ${i.substring(0,400)}`)}if(i.errors)throw new Error(`Errors found in subgraphRequest: URL: ${t}, Status: ${n.status}, Response: ${JSON.stringify(i.errors).substring(0,400)}`);const{data:o}=i;return o||{}}))}function og(t,e=kp[0]){const r=`https://${e}`;if(!t)return null;if(!(t.startsWith("ipfs://")||t.startsWith("ipns://")||t.startsWith("https://")||t.startsWith("http://")))return`${r}/ipfs/${t}`;const n=t.split("://")[0];return"ipfs"===n?t.replace("ipfs://",`${r}/ipfs/`):"ipns"===n?t.replace("ipns://",`${r}/ipns/`):t}function sg(r,n){return e(this,arguments,void 0,(function*(e,r,n="1",i={}){var o,s;const{ensResolvers:a=(null===(o=xp[n])||void 0===o?void 0:o.ensResolvers)||xp[1].ensResolvers,broviderUrl:h}=i,u=t(i,["ensResolvers","broviderUrl"]),l=du(fu(e)),c=rp(n,{broviderUrl:h}),f=[[Kp,"resolver",[l]],...a.map((t=>[t,"text",[l,r]]))],[[d],...m]=yield ng(n,c,Qp,f,u),p=a.indexOf(d);return-1!==p?null===(s=m[p])||void 0===s?void 0:s[0]:null}))}function ag(t){return e(this,arguments,void 0,(function*(t,e="1",r={}){try{return yield sg(t,"snapshot",e,r)}catch(t){return console.log(t),null}}))}function hg(t){return e(this,arguments,void 0,(function*(t,e="1",r={}){const n=rp(e,r),i=new sa(Kp,["function owner(bytes32) view returns (address)"],n),o=r.ensNameWrapper||xp[e].ensNameWrapper,s=du(fu(t));let a=yield i.owner(s);if(a===o){const t=new sa(o,["function ownerOf(uint256) view returns (address)"],n);a=yield t.ownerOf(s)}return a}))}function ug(t){const e=["th","st","nd","rd"],r=t%100;return t+(e[(r-20)%10]||e[r]||e[0])}function lg(t){return!!xp[t]}function cg(t){return Te(t)&&"0x0000000000000000000000000000000000000000"!==t}function fg(t,e){return"latest"===t||"number"==typeof t&&t>=xp[e].start}function dg(t){return Promise.reject(new Error(t))}Xp.addKeyword({keyword:"snapshotNetwork",validate:function(t,e){return"mainnet"===(this.snapshotEnv||"default")?eg.includes(e):tg.includes(e)},error:{message:"network not allowed"}}),Xp.addKeyword({keyword:"maxLengthWithSpaceType",validate:function t(e,r){const n=this.spaceType||"default",i=r.length<=e[n];return i||(t.errors=[{keyword:"maxLengthWithSpaceType",message:`must NOT have more than ${e[n]} characters`,params:{limit:e[n]}}]),i},errors:!0}),Xp.addKeyword({keyword:"maxItemsWithSpaceType",validate:function t(e,r){const n=this.spaceType||"default",i=r.length<=e[n];return i||(t.errors=[{keyword:"maxItemsWithSpaceType",message:`must NOT have more than ${e[n]} items`,params:{limit:e[n]}}]),i},errors:!0}),Xp.addFormat("customUrl",{type:"string",validate:t=>!t.length||(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("ipfs://")||t.startsWith("ipns://")||t.startsWith("snapshot://"))});var mg={call:rg,multicall:ng,subgraphRequest:ig,ipfsGet:function(t,r){return e(this,arguments,void 0,(function*(t,e,r="ipfs"){return a(`https://${t}/${r}/${e}`).then((t=>t.json()))}))},getUrl:og,getJSON:function(t){return e(this,arguments,void 0,(function*(t,e={}){const r=og(t,e.gateways);return a(r).then((t=>t.json()))}))},sendTransaction:function(t,r,n,i,o){return e(this,arguments,void 0,(function*(t,e,r,n,i,o={}){const s=t.getSigner(),a=new sa(e,r,t).connect(s);return yield a[n](...i,o)}))},getScores:function(t,r,n,i){return e(this,arguments,void 0,(function*(t,e,r,n,i="latest",o=Zp,s={}){if(!Array.isArray(n))return dg("addresses should be an array of addresses");if(0===n.length)return dg("addresses can not be empty");const h=n.find((t=>!cg(t)));if(h)return dg(`Invalid address: ${h}`);if(!lg(r))return dg(`Invalid network: ${r}`);const u=e.find((t=>t.network&&!lg(t.network)));if(u)return dg(`Invalid network (${u.network}) in strategy ${u.name}`);if(!fg(i,r))return dg(`Snapshot (${i}) must be 'latest' or greater than network start block (${xp[r].start})`);new URL(o).pathname="/api/scores";const{url:l,headers:c}=Yp(o,{path:"/api/scores"});try{const o={space:t,network:r,snapshot:i,strategies:e,addresses:n},h=yield a(l,{method:"POST",headers:c,body:JSON.stringify({params:o})}),u=yield Wp(h);return"all"===s.returnValue?u.result:u.result[s.returnValue||"scores"]}catch(t){return t.errno?Promise.reject({code:t.errno,message:t.toString(),data:""}):Promise.reject(t)}}))},getVp:function(t,r,n,i,o,s,h){return e(this,void 0,void 0,(function*(){const{url:e,headers:u}=Yp(null==h?void 0:h.url);if(!cg(t))return dg(`Invalid voter address: ${t}`);if(!lg(r))return dg(`Invalid network: ${r}`);const l=n.find((t=>t.network&&!lg(t.network)));if(l)return dg(`Invalid network (${l.network}) in strategy ${l.name}`);if(!fg(i,r))return dg(`Snapshot (${i}) must be 'latest' or greater than network start block (${xp[r].start})`);const c={method:"POST",headers:u,body:JSON.stringify({jsonrpc:"2.0",method:"get_vp",params:{address:t,network:r,strategies:n,snapshot:i,space:o,delegation:s}})};try{const t=yield a(e,c);return(yield Wp(t)).result}catch(t){return t.errno?Promise.reject({code:t.errno,message:t.toString(),data:""}):Promise.reject(t)}}))},validateSchema:function(t,e,r={snapshotEnv:"default",spaceType:"default"}){const n=Xp.compile(t),i=n.call(r,e);return i||n.errors},getEnsTextRecord:sg,getSpaceUri:ag,getEnsOwner:hg,getSpaceController:function(t){return e(this,arguments,void 0,(function*(t,e="1",r={}){const n=yield ag(t,e,r);if(n){let t=Te(n);if(t)return n;const e=n.split("/"),r=e.includes("testnet")?5:4,i=e[r];if(t=Te(i),t)return i}return yield hg(t,e,r)}))},getDelegatesBySpace:function(t,r){return e(this,arguments,void 0,(function*(t,e,r="latest",n={}){const i=n.subgraphUrl||Lp[t];if(!i)return Promise.reject(`Delegation subgraph not available for network ${t}`);let o=0;const s=new Map,a=Gp(e);for(;;){const t=yield Hp({url:i,spaces:a,pivot:o,snapshot:r});if(qp(t))throw new Error("Unable to paginate delegation");if(t.forEach((t=>{Vp(s,t),o=t.timestamp})),t.length<zp)break}return[...s.values()]}))},clone:function(t){return JSON.parse(JSON.stringify(t))},sleep:function(t){return e(this,void 0,void 0,(function*(){return new Promise((e=>{setTimeout(e,t)}))}))},getNumberWithOrdinal:ug,voting:Up,getProvider:rp,signMessage:function(t,r,n){return e(this,void 0,void 0,(function*(){return r=P(new Buffer(r,"utf8")),yield t.send("personal_sign",[r,n])}))},getBlockNumber:function(t){return e(this,void 0,void 0,(function*(){try{const e=yield t.getBlockNumber();return parseInt(e)}catch(t){return Promise.reject()}}))},Multicaller:class{constructor(t,e,r,n){this.options={},this.calls=[],this.paths=[],this.network=t,this.provider=e,this.abi=r,this.options=n||{}}call(t,e,r,n){return this.calls.push([e,r,n]),this.paths.push(t),this}execute(t){return e(this,void 0,void 0,(function*(){const e=t||{};return(yield ng(this.network,this.provider,this.abi,this.calls,this.options)).forEach(((t,r)=>fd(e,this.paths[r],t.length>1?t:t[0]))),this.calls=[],this.paths=[],e}))}},getSnapshots:function(t,r,n,i){return e(this,arguments,void 0,(function*(t,e,r,n,i={}){const o={};if(n.forEach((t=>o[t]="latest")),"latest"===e)return o;const s=`${t}-${e}-${n.join("-")}`,a=dd[s],h=Date.now();if(a&&md>h)return a;md<h&&(dd={},md=h+36e5-h%36e5),o[t]=e;const u=Object.keys(o).filter((e=>t!==e));if(0===u.length)return o;const l={blocks:{__args:{where:{ts:(yield r.getBlock(e)).timestamp,network_in:u}},network:!0,number:!0}},c=i.blockFinderUrl||"https://blockfinder.snapshot.org";return(yield ig(c,l)).blocks.forEach((t=>o[t.network]=t.number)),dd[s]=o,o}))},getHash:Mp,verify:function(t,r,n){return e(this,arguments,void 0,(function*(t,e,r,n="1",i={}){const{domain:o,types:s,message:a}=r,h=Mp(r);try{if(t===bp(o,s,a,e))return!0}catch(t){}return yield Ap(t,e,h,n,i)}))},validate:function(t,r,n,i,o,s,h){return e(this,void 0,void 0,(function*(){if(!cg(r))return dg(`Invalid author: ${r}`);if(!lg(i))return dg(`Invalid network: ${i}`);if(!fg(o,i))return dg(`Snapshot (${o}) must be 'latest' or greater than network start block (${xp[i].start})`);h||(h={});const{url:e,headers:u}=Yp(h.url),l={method:"POST",headers:u,body:JSON.stringify({jsonrpc:"2.0",method:"validate",params:{validation:t,author:r,space:n,network:i,snapshot:o,params:s}})};try{const t=yield a(e,l);return(yield Wp(t)).result}catch(t){return t.errno?Promise.reject({code:t.errno,message:t.toString(),data:""}):Promise.reject(t)}}))},SNAPSHOT_SUBGRAPH_URL:Lp};return{Client:or,Client712:or,schemas:dr,utils:mg}}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@snapshot-labs/snapshot.js",
3
- "version": "0.11.39",
3
+ "version": "0.11.40",
4
4
  "repository": "snapshot-labs/snapshot.js",
5
5
  "license": "MIT",
6
6
  "main": "dist/snapshot.cjs.js",
package/src/networks.json CHANGED
@@ -151,7 +151,7 @@
151
151
  },
152
152
  "56": {
153
153
  "key": "56",
154
- "name": "Binance Smart Chain",
154
+ "name": "BNB Smart Chain",
155
155
  "shortName": "BSC",
156
156
  "chainId": 56,
157
157
  "network": "mainnet",
@@ -254,7 +254,7 @@
254
254
  },
255
255
  "97": {
256
256
  "key": "97",
257
- "name": "Binance Smart Chain Testnet",
257
+ "name": "BNB Smart Chain Testnet",
258
258
  "shortName": "BSC Testnet",
259
259
  "chainId": 97,
260
260
  "network": "testnet",
@@ -1622,4 +1622,4 @@
1622
1622
  "start": 7521509,
1623
1623
  "logo": "ipfs://QmNnGPr1CNvj12SSGzKARtUHv9FyEfE5nES73U4vBWQSJL"
1624
1624
  }
1625
- }
1625
+ }