@snapshot-labs/snapshot.js 0.11.28 → 0.11.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/snapshot.cjs.js +10 -0
- package/dist/snapshot.esm.js +10 -0
- package/dist/snapshot.min.js +1 -1
- package/package.json +1 -1
- package/src/utils.ts +10 -0
package/dist/snapshot.min.js
CHANGED
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
|| ${h} === "boolean" || ${o} === null`).assign(l,Xh._`[${o}]`)}}n.else(),u(t),n.endIf(),n.if(Xh._`${l} !== undefined`,(()=>{n.assign(o,l),function({gen:t,parentData:e,parentDataProperty:r},n){t.if(Xh._`${e} !== undefined`,(()=>t.assign(Xh._`${e}[${r}]`,n)))}(t,l)}))}(t,e,h):u(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?Xh.operators.EQ:Xh.operators.NEQ;let s;switch(t){case"null":return Xh._`${e} ${o} null`;case"array":s=Xh._`Array.isArray(${e})`;break;case"object":s=Xh._`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":s=a(Xh._`!(${e} % 1) && !isNaN(${e})`);break;case"number":s=a();break;default:return Xh._`typeof ${e} ${o} ${t}`}return i===r.Correct?s:(0,Xh.not)(s);function a(t=Xh.nil){return(0,Xh.and)(Xh._`typeof ${e} == "number"`,t,n?Xh._`isFinite(${e})`:Xh.nil)}}function s(t,e,r,n){if(1===t.length)return o(t[0],e,r,n);let i;const s=(0,tl.toHash)(t);if(s.array&&s.object){const t=Xh._`typeof ${e} != "object"`;i=s.null?t:Xh._`!${e} || ${t}`,delete s.null,delete s.array,delete s.object}else i=Xh.nil;s.number&&delete s.integer;for(const t in s)i=(0,Xh.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?Xh._`{type: ${t}}`:Xh._`{type: ${e}}`};function u(t){const e=function(t){const{gen:e,data:r,schema:n}=t,i=(0,tl.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,nl.reportError)(e,a)}e.reportTypeError=u})),ul=u((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=Xh._`${o}${(0,Xh.getProperty)(e)}`;if(i)return void(0,tl.checkStrictMode)(t,`default is ignored for: ${a}`);let u=Xh._`${a} === undefined`;"empty"===s.useDefaults&&(u=Xh._`${u} || ${a} === null || ${a} === ""`),n.if(u,Xh._`${a} = ${(0,Xh.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)))}})),hl=u((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=tl;function n(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:Xh._`Object.prototype.hasOwnProperty`})}function i(t,e,r){return Xh._`${n(t)}.call(${e}, ${r})`}function o(t,e,r,n){const o=Xh._`${e}${(0,Xh.getProperty)(r)} === undefined`;return n?(0,Xh.or)(o,(0,Xh.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:Xh._`${e}`},!0),t.error()}))},e.checkMissingProp=function({gen:t,data:e,it:{opts:r}},n,i){return(0,Xh.or)(...n.map((n=>(0,Xh.and)(o(t,e,n,r.ownProperties),Xh._`${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=Xh._`${e}${(0,Xh.getProperty)(r)} !== undefined`;return n?Xh._`${o} && ${i(t,e,r)}`:o},e.noPropertyInData=o,e.allSchemaProperties=s,e.schemaProperties=function(t,e){return s(e).filter((r=>!(0,tl.alwaysValidSchema)(t,e[r])))},e.callValidateCode=function({schemaCode:t,data:e,it:{gen:r,topSchemaRef:n,schemaPath:i,errorPath:o},it:s},a,u,h){const l=h?Xh._`${t}, ${e}, ${n}${i}`:e,c=[[rl.default.instancePath,(0,Xh.strConcat)(rl.default.instancePath,o)],[rl.default.parentData,s.parentData],[rl.default.parentDataProperty,s.parentDataProperty],[rl.default.rootData,rl.default.rootData]];s.opts.dynamicRef&&c.push([rl.default.dynamicAnchors,rl.default.dynamicAnchors]);const f=Xh._`${l}, ${r.object(...c)}`;return u!==Xh.nil?Xh._`${a}.call(${u}, ${f})`:Xh._`${a}(${f})`};const a=Xh._`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:Xh._`${"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",Xh._`${r}.length`);e.forRange("i",0,s,(r=>{t.subschema({keyword:n,dataProp:r,dataPropType:tl.Type.Num},o),e.if((0,Xh.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,tl.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,Xh._`${o} || ${s}`);t.mergeValidEvaluated(a,s)||e.if((0,Xh.not)(o))})))),t.result(o,(()=>t.reset()),(()=>t.error(!0)))}})),ll=u((function(t,e){function r(t){const{gen:e,data:r,it:n}=t;e.if(n.parentData,(()=>e.assign(r,Xh._`${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,Xh.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,u=e.macro.call(a.self,o,s,a),h=n(r,i,u);!1!==a.opts.validateSchema&&a.self.validateSchema(u,!0);const l=r.name("valid");t.subschema({schema:u,schemaPath:Xh.nil,errSchemaPath:`${a.errSchemaPath}/${i}`,topSchemaRef:h,compositeRule:!0},l),t.pass(l,(()=>t.error(!0)))},e.funcKeywordCode=function(t,e){var i;const{gen:o,keyword:s,schema:a,parentSchema:u,$data:h,it:l}=t;!function({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}(l,e);const c=!h&&e.compile?e.compile.call(l.self,a,u,l):e.validate,f=n(o,s,c),d=o.let("valid");function p(r=(e.async?Xh._`await `:Xh.nil)){const n=l.opts.passContext?rl.default.this:rl.default.self,i=!("compile"in e&&!h||!1===e.schema);o.assign(d,Xh._`${r}${(0,hl.callValidateCode)(t,f,n,i)}`,e.modifying)}function m(t){var r;o.if((0,Xh.not)(null!==(r=e.valid)&&void 0!==r?r:d),t)}t.block$data(d,(function(){if(!1===e.errors)p(),e.modifying&&r(t),m((()=>t.error()));else{const n=e.async?function(){const t=o.let("ruleErrs",null);return o.try((()=>p(Xh._`await `)),(e=>o.assign(d,!1).if(Xh._`${e} instanceof ${l.ValidationError}`,(()=>o.assign(t,Xh._`${e}.errors`)),(()=>o.throw(e))))),t}():function(){const t=Xh._`${f}.errors`;return o.assign(t,null),p(Xh.nil),t}();e.modifying&&r(t),m((()=>function(t,e){const{gen:r}=t;r.if(Xh._`Array.isArray(${e})`,(()=>{r.assign(rl.default.vErrors,Xh._`${rl.default.vErrors} === null ? ${e} : ${rl.default.vErrors}.concat(${e})`).assign(rl.default.errors,Xh._`${rl.default.vErrors}.length`),(0,nl.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)}}}})),cl=u((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:Xh._`${t.schemaPath}${(0,Xh.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:n[r],schemaPath:Xh._`${t.schemaPath}${(0,Xh.getProperty)(e)}${(0,Xh.getProperty)(r)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,tl.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;u(a.let("data",Xh._`${e.data}${(0,Xh.getProperty)(r)}`,!0)),t.errorPath=Xh.str`${i}${(0,tl.getErrorPath)(r,n,s.jsPropertySyntax)}`,t.parentDataProperty=Xh._`${r}`,t.dataPathArr=[...o,t.parentDataProperty]}if(void 0!==i){u(i instanceof Xh.Name?i:a.let("data",i,!0)),void 0!==s&&(t.propertyName=s)}function u(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}})),fl=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},dl=u((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,u,h,l,c){if(o&&"object"==typeof o&&!Array.isArray(o)){for(var f in n(o,s,a,u,h,l,c),o){var d=o[f];if(Array.isArray(d)){if(f in e.arrayKeywords)for(var p=0;p<d.length;p++)r(t,n,i,d[p],s+"/"+f+"/"+p,a,s,f,o,p)}else if(f in e.propsKeywords){if(d&&"object"==typeof d)for(var m in d)r(t,n,i,d[m],s+"/"+f+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),a,s,f,o,m)}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,u,h,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}})),pl=u((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,tl.eachItem)(t[n],(t=>e+=o(t))),e===1/0))return 1/0}return e}function s(t,e="",r){!1!==r&&(e=h(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 u=/#\/?$/;function h(t){return t?t.replace(u,""):""}e.normalizeId=h,e.resolveUrl=function(t,e,r){return r=h(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=h(t[r]||e),o={"":i},a=s(n,i,!1),u={},c=new Set;return dl(t,{allKeys:!0},((t,e,n,i)=>{if(void 0===i)return;const s=a+e;let p=o[i];function m(e){const r=this.opts.uriResolver.resolve;if(e=h(p?r(p,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!==h(s)&&("#"===e[0]?(f(t,u[e],e),u[e]=t):this.refs[e]=s),e}function g(t){if("string"==typeof t){if(!l.test(t))throw new Error(`invalid anchor "${t}"`);m.call(this,`#${t}`)}}"string"==typeof t[r]&&(p=m.call(this,t[r])),g.call(this,t.$anchor),g.call(this,t.$dynamicAnchor),o[e]=p})),u;function f(t,e,r){if(void 0!==e&&!fl(t,e))throw d(r)}function d(t){return new Error(`reference "${t}" resolves to more than one schema`)}}})),ml=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;const r=al;function n({gen:t,validateName:e,schema:r,schemaEnv:n,opts:o},s){o.code.es5?t.func(e,Xh._`${rl.default.data}, ${rl.default.valCxt}`,n.$async,(()=>{t.code(Xh._`"use strict"; ${i(r,o)}`),function(t,e){t.if(rl.default.valCxt,(()=>{t.var(rl.default.instancePath,Xh._`${rl.default.valCxt}.${rl.default.instancePath}`),t.var(rl.default.parentData,Xh._`${rl.default.valCxt}.${rl.default.parentData}`),t.var(rl.default.parentDataProperty,Xh._`${rl.default.valCxt}.${rl.default.parentDataProperty}`),t.var(rl.default.rootData,Xh._`${rl.default.valCxt}.${rl.default.rootData}`),e.dynamicRef&&t.var(rl.default.dynamicAnchors,Xh._`${rl.default.valCxt}.${rl.default.dynamicAnchors}`)}),(()=>{t.var(rl.default.instancePath,Xh._`""`),t.var(rl.default.parentData,Xh._`undefined`),t.var(rl.default.parentDataProperty,Xh._`undefined`),t.var(rl.default.rootData,rl.default.data),e.dynamicRef&&t.var(rl.default.dynamicAnchors,Xh._`{}`)}))}(t,o),t.code(s)})):t.func(e,Xh._`${rl.default.data}, ${function(t){return Xh._`{${rl.default.instancePath}="", ${rl.default.parentData}, ${rl.default.parentDataProperty}, ${rl.default.rootData}=${rl.default.data}${t.dynamicRef?Xh._`, ${rl.default.dynamicAnchors}={}`:Xh.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)?Xh._`/*# sourceURL=${r} */`:Xh.nil}function o(t,e){a(t)&&(u(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,pl.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",rl.default.errors);h(t,o),n.var(e,Xh._`${o} === ${rl.default.errors}`)}(t,e):(0,il.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 u(t){(0,tl.checkUnknownRules)(t),function(t){const{schema:e,errSchemaPath:r,opts:n,self:i}=t;e.$ref&&n.ignoreKeywordsWithRef&&(0,tl.schemaHasRulesButRef)(e,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(t)}function h(t,e){if(t.opts.jtd)return c(t,[],!1,e);const r=(0,al.getSchemaTypes)(t.schema);c(t,r,!(0,al.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(Xh._`${rl.default.self}.logger.log(${o})`);else if("function"==typeof i.$comment){const r=Xh.str`${n}/$comment`,i=t.scopeValue("root",{ref:e.root});t.code(Xh._`${rl.default.self}.opts.$comment(${o}, ${r}, ${i}.schema)`)}}function c(t,e,n,i){const{gen:o,schema:s,data:a,allErrors:u,opts:h,self:l}=t,{RULES:c}=l;function g(l){(0,sl.shouldUseGroup)(s,l)&&(l.type?(o.if((0,r.checkDataType)(l.type,a,h.strictNumbers)),f(t,l),1===e.length&&e[0]===l.type&&n&&(o.else(),(0,r.reportTypeError)(t)),o.endIf()):f(t,l),u||o.if(Xh._`${rl.default.errors} === ${i||0}`))}!s.$ref||!h.ignoreKeywordsWithRef&&(0,tl.schemaHasRulesButRef)(s,c)?(h.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=>{p(t.dataTypes,e)||m(t,`type "${e}" not allowed by context "${t.dataTypes.join(",")}"`)})),t.dataTypes=t.dataTypes.filter((t=>p(e,t)))})(t,e),t.opts.allowUnionTypes||function(t,e){e.length>1&&(2!==e.length||!e.includes("null"))&&m(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,sl.shouldUseRule)(t.schema,i)){const{type:r}=i.definition;r.length&&!r.some((t=>d(e,t)))&&m(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,ul.assignDefaults)(t,e.type),r.block((()=>{for(const r of e.rules)(0,sl.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 p(t,e){return t.includes(e)||"integer"===e&&t.includes("number")}function m(t,e){e+=` at "${t.schemaEnv.baseId+t.errSchemaPath}" (strictTypes)`,(0,tl.checkStrictMode)(t,e,t.opts.strictTypes)}e.validateFunctionCode=function(t){a(t)&&(u(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,tl.checkStrictMode)(t,"default is ignored in the schema root")}(t),i.let(rl.default.vErrors,null),i.let(rl.default.errors,0),r.unevaluated&&function(t){const{gen:e,validateName:r}=t;t.evaluated=e.const("evaluated",Xh._`${r}.evaluated`),e.if(Xh._`${t.evaluated}.dynamicProps`,(()=>e.assign(Xh._`${t.evaluated}.props`,Xh._`undefined`))),e.if(Xh._`${t.evaluated}.dynamicItems`,(()=>e.assign(Xh._`${t.evaluated}.items`,Xh._`undefined`)))}(t),h(t),function(t){const{gen:e,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=t;r.$async?e.if(Xh._`${rl.default.errors} === 0`,(()=>e.return(rl.default.data)),(()=>e.throw(Xh._`new ${i}(${rl.default.vErrors})`))):(e.assign(Xh._`${n}.errors`,rl.default.vErrors),o.unevaluated&&function({gen:t,evaluated:e,props:r,items:n}){r instanceof Xh.Name&&t.assign(Xh._`${e}.props`,r);n instanceof Xh.Name&&t.assign(Xh._`${e}.items`,n)}(t),e.return(Xh._`${rl.default.errors} === 0`))}(t)}))}(t):n(t,(()=>(0,il.topBoolOrEmptySchema)(t)))};class g{constructor(t,e,r){if((0,ll.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,tl.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,ll.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",rl.default.errors))}result(t,e,r){this.failResult((0,Xh.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,Xh.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(Xh._`${e} !== undefined && (${(0,Xh.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?nl.reportExtraError:nl.reportError)(this,this.def.error,e)}$dataError(){(0,nl.reportError)(this,this.def.$dataError||nl.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,nl.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=Xh.nil){this.gen.block((()=>{this.check$data(t,r),e()}))}check$data(t=Xh.nil,e=Xh.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:i,def:o}=this;r.if((0,Xh.or)(Xh._`${n} === undefined`,e)),t!==Xh.nil&&r.assign(t,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),t!==Xh.nil&&r.assign(t,!1)),r.else()}invalid$data(){const{gen:t,schemaCode:e,schemaType:n,def:i,it:o}=this;return(0,Xh.or)(function(){if(n.length){if(!(e instanceof Xh.Name))throw new Error("ajv implementation error");const t=Array.isArray(n)?n:[n];return Xh._`${(0,r.checkDataTypes)(t,e,o.opts.strictNumbers,r.DataType.Wrong)}`}return Xh.nil}(),function(){if(i.validateSchema){const r=t.scopeValue("validate$data",{ref:i.validateSchema});return Xh._`!${r}(${e})`}return Xh.nil}())}subschema(t,e){const r=(0,cl.getSubschema)(this.it,t);(0,cl.extendSubschemaData)(r,this.it,t),(0,cl.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=tl.mergeEvaluated.props(n,t.props,r.props,e)),!0!==r.items&&void 0!==t.items&&(r.items=tl.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,Xh.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,ll.funcKeywordCode)(i,r):"macro"in r?(0,ll.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,ll.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 rl.default.rootData;if("/"===t[0]){if(!v.test(t))throw new Error(`Invalid JSON-pointer: ${t}`);i=t,o=rl.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(u("property/index",a));return n[e-a]}if(a>e)throw new Error(u("data",a));if(o=r[e-a],!i)return o}let s=o;const a=i.split("/");for(const t of a)t&&(o=Xh._`${o}${(0,Xh.getProperty)((0,tl.unescapeJsonPointer)(t))}`,s=Xh._`${s} && ${o}`);return s;function u(t,r){return`Cannot access ${t} ${r} levels up, current level is ${e}`}}e.getData=b}));class gl extends Error{constructor(t){super("validation failed"),this.errors=t,this.ajv=this.validation=!0}}var yl=gl,vl=Object.defineProperty({default:yl},"__esModule",{value:!0});class wl extends Error{constructor(t,e,r,n){super(n||`can't resolve reference ${r} from id ${e}`),this.missingRef=(0,pl.resolveUrl)(t,e,r),this.missingSchema=(0,pl.normalizeId)((0,pl.getFullPath)(t,this.missingRef))}}var bl=wl,El=Object.defineProperty({default:bl},"__esModule",{value:!0}),_l=u((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,pl.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,pl.getFullPath)(this.opts.uriResolver,t.root.baseId),{es5:n,lines:i}=this.opts.code,{ownProperties:s}=this.opts,a=new Xh.CodeGen(this.scope,{es5:n,lines:i,ownProperties:s});let u;t.$async&&(u=a.scopeValue("Error",{ref:vl.default,code:Xh._`require("ajv/dist/runtime/validation_error").default`}));const h=a.scopeName("validate");t.validateName=h;const l={gen:a,allErrors:this.opts.allErrors,data:rl.default.data,parentData:rl.default.parentData,parentDataProperty:rl.default.parentDataProperty,dataNames:[rl.default.data],dataPathArr:[Xh.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:a.scopeValue("schema",!0===this.opts.code.source?{ref:t.schema,code:(0,Xh.stringify)(t.schema)}:{ref:t.schema}),validateName:h,ValidationError:u,schema:t.schema,schemaEnv:t,rootId:r,baseId:t.baseId||r,schemaPath:Xh.nil,errSchemaPath:t.schemaPath||(this.opts.jtd?"":"#"),errorPath:Xh._`""`,opts:this.opts,self:this};let c;try{this._compilations.add(t),(0,ml.validateFunctionCode)(l),a.optimize(this.opts.code.optimize);const e=a.toString();c=`${a.scopeRefs(rl.default.scope)}return ${e}`,this.opts.code.process&&(c=this.opts.code.process(c,t));const r=new Function(`${rl.default.self}`,`${rl.default.scope}`,c)(this,this.scope.get());if(this.scope.value(h,{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:h,validateCode:e,scopeValues:a._values}),this.opts.unevaluated){const{props:t,items:e}=l;r.evaluated={props:t instanceof Xh.Name?void 0:t,items:e instanceof Xh.Name?void 0:e,dynamicProps:t instanceof Xh.Name,dynamicItems:e instanceof Xh.Name},r.source&&(r.source.evaluated=(0,Xh.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,pl.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,pl._getFullPath)(this.opts.uriResolver,i);let s=(0,pl.getFullPath)(this.opts.uriResolver,t.baseId,void 0);if(Object.keys(t.schema).length>0&&o===s)return h.call(this,i,t);const u=(0,pl.normalizeId)(o),l=this.refs[u]||this.schemas[u];if("string"==typeof l){const e=a.call(this,t,l);if("object"!=typeof(null==e?void 0:e.schema))return;return h.call(this,i,e)}if("object"==typeof(null==l?void 0:l.schema)){if(l.validate||n.call(this,l),u===(0,pl.normalizeId)(e)){const{schema:e}=l,{schemaId:n}=this.opts,i=e[n];return i&&(s=(0,pl.resolveUrl)(this.opts.uriResolver,s,i)),new r({schema:e,schemaId:n,root:t,baseId:s})}return h.call(this,i,l)}}e.SchemaEnv=r,e.compileSchema=n,e.resolveRef=function(t,e,n){var o;n=(0,pl.resolveUrl)(this.opts.uriResolver,e,n);const a=t.refs[n];if(a)return a;let u=s.call(this,t,n);if(void 0===u){const i=null===(o=t.localRefs)||void 0===o?void 0:o[n],{schemaId:s}=this.opts;i&&(u=new r({schema:i,schemaId:s,root:t,baseId:e}))}return void 0!==u?t.refs[n]=i.call(this,u):void 0},e.getCompilingSchema=o,e.resolveSchema=a;const u=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function h(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,tl.unescapeFragment)(r)];if(void 0===t)return;const i="object"==typeof(n=t)&&n[this.opts.schemaId];!u.has(r)&&i&&(e=(0,pl.resolveUrl)(this.opts.uriResolver,e,i))}let s;if("boolean"!=typeof n&&n.$ref&&!(0,tl.schemaHasRulesButRef)(n,this.RULES)){const t=(0,pl.resolveUrl)(this.opts.uriResolver,e,n.$ref);s=a.call(this,i,t)}const{schemaId:h}=this.opts;return s=s||new r({schema:n,schemaId:h,root:i,baseId:e}),s.schema!==s.root.schema?s:void 0}})),Al={$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},Ml=u((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="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",u=e("[\\:\\/\\?\\#\\[\\]\\@]",a),h=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}"),p=r(r(d+"\\:"+d)+"|"+f),m=r(r(d+"\\:")+"{6}"+p),g=r("\\:\\:"+r(d+"\\:")+"{5}"+p),y=r(r(d)+"?\\:\\:"+r(d+"\\:")+"{4}"+p),v=r(r(r(d+"\\:")+"{0,1}"+d)+"?\\:\\:"+r(d+"\\:")+"{3}"+p),w=r(r(r(d+"\\:")+"{0,2}"+d)+"?\\:\\:"+r(d+"\\:")+"{2}"+p),b=r(r(r(d+"\\:")+"{0,3}"+d)+"?\\:\\:"+d+"\\:"+p),E=r(r(r(d+"\\:")+"{0,4}"+d)+"?\\:\\:"+p),_=r(r(r(d+"\\:")+"{0,5}"+d)+"?\\:\\:"+d),A=r(r(r(d+"\\:")+"{0,6}"+d)+"?\\:\\:"),M=r([m,g,y,v,w,b,E,_,A].join("|")),k=r(r(l+"|"+s)+"+"),N=(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(N+"|"+e("[\\/\\?]",h))+"*"),{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,"[\\:\\@\\/\\?]",h),"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,u),"g"),PCT_ENCODED:new RegExp(s,"g"),IPV4ADDRESS:new RegExp("^("+f+")$"),IPV6ADDRESS:new RegExp("^\\[?("+M+")"+r(r("\\%25|\\%(?!"+o+"{2})")+"("+k+")")+"?\\]?$")}}var u=a(!1),h=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,p=1,m=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-p,N=Math.floor,x=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?N(t/y):t>>1,t+=N(t/e);t>k*m>>1;n+=d)t=N(t/k);return N(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 u=s>0?s+1:0;u<r;){for(var h=n,l=1,c=d;;c+=d){u>=r&&S("invalid-input");var g=C(t.charCodeAt(u++));(g>=d||g>N((f-n)/l))&&S("overflow"),n+=g*l;var y=c<=o?p:c>=o+m?m:c-o;if(g<y)break;var E=d-y;l>N(f/E)&&S("overflow"),l*=E}var _=e.length+1;o=O(n-h,_,0==h),N(n/_)>f-i&&S("overflow"),i+=N(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,u=void 0;try{for(var h,l=t[Symbol.iterator]();!(s=(h=l.next()).done);s=!0){var c=h.value;c<128&&e.push(x(c))}}catch(t){a=!0,u=t}finally{try{!s&&l.return&&l.return()}finally{if(a)throw u}}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>N((f-i)/C)&&S("overflow"),i+=(E-n)*C,n=E;var $=!0,B=!1,D=void 0;try{for(var F,j=t[Symbol.iterator]();!($=(F=j.next()).done);$=!0){var U=F.value;if(U<n&&++i>f&&S("overflow"),U==n){for(var L=i,z=d;;z+=d){var q=z<=o?p:z>=o+m?m:z-o;if(L<q)break;var V=L-q,G=d-q;e.push(x(T(q+V%G,0))),L=N(V/G)}e.push(x(T(L,0))),o=O(i,C,y==g),i=0,++y}}}catch(t){B=!0,D=t}finally{try{!$&&j.return&&j.return()}finally{if(B)throw D}}++i,++n}return e.join("")},D=function(t){return I(t,(function(t){return E.test(t)?$(t.slice(4).toLowerCase()):t}))},F=function(t){return I(t,(function(t){return _.test(t)?"xn--"+B(t):t}))},j={version:"2.1.0",ucs2:{decode:R,encode:function(t){return String.fromCodePoint.apply(String,c(t))}},decode:$,encode:B,toASCII:F,toUnicode:D},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),u=a[0],h=a[1],c=h?h.split(":").map(V):[],f=u.split(":").map(V),d=e.IPV4ADDRESS.test(f[f.length-1]),p=d?7:8,m=f.length-p,g=Array(p),y=0;y<p;++y)g[y]=c[y]||f[m+y]||"";d&&(g[p-1]=G(g[p-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?h:u;"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=j.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,u)}o&&o.parse&&o.parse(r,e)}else r.error=r.error||"URI can not be parsed.";return r}function Y(t,e){var r=!1!==e.iri?h:u,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 Z=/^\.\.?\//,W=/^\/\.(\/|$)/,X=/^\/\.\.(\/|$)/,tt=/^\/?(?:.|\n)*?(?=\/|$)/;function et(t){for(var e=[];t.length;)if(t.match(Z))t=t.replace(Z,"");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?h:u,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?j.toUnicode(t.host):j.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=Y(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?h.ESCAPE:u.ESCAPE,L)}function ut(t,e){return t&&t.toString().replace(e&&e.iri?h.PCT_ENCODED:u.PCT_ENCODED,z)}var ht={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:ht.domainHost,parse:ht.parse,serialize:ht.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},pt={},mt="[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(mt,"g"),_t=new RegExp(yt,"g"),At=new RegExp(e("[^]",vt,"[\\.]",'[\\"]',wt),"g"),Mt=new RegExp(e("[^]",mt,bt),"g"),kt=Mt;function Nt(t){var e=z(t);return e.match(Et)?e:t}var xt={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,u=s.length;a<u;++a){var h=s[a].split("=");switch(h[0]){case"to":for(var l=h[1].split(","),c=0,f=l.length;c<f;++c)n.push(l[c]);break;case"subject":r.subject=ut(h[1],e);break;case"body":r.body=ut(h[1],e);break;default:i=!0,o[ut(h[0],e)]=ut(h[1],e)}}i&&(r.headers=o)}r.query=void 0;for(var d=0,p=n.length;d<p;++d){var m=n[d].split("@");if(m[0]=ut(m[0]),e.unicodeSupport)m[1]=ut(m[1],e).toLowerCase();else try{m[1]=j.toASCII(ut(m[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]=m.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 u=String(n[s]),h=u.lastIndexOf("@"),l=u.slice(0,h).replace(_t,Nt).replace(_t,i).replace(At,L),c=u.slice(h+1);try{c=e.iri?j.toUnicode(c):j.toASCII(ut(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 p in f)f[p]!==pt[p]&&d.push(p.replace(_t,Nt).replace(_t,i).replace(Mt,L)+"="+f[p].replace(_t,Nt).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),u=U[a];n.nid=o,n.nss=s,n.path=void 0,u&&(n=u.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[ht.scheme]=ht,U[lt.scheme]=lt,U[ft.scheme]=ft,U[dt.scheme]=dt,U[xt.scheme]=xt,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=ut,Object.defineProperty(t,"__esModule",{value:!0})}(e)}));Ml.code='require("ajv/dist/runtime/uri").default';var kl=Ml,Nl=Object.defineProperty({default:kl},"__esModule",{value:!0}),xl=u((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 ml.KeywordCxt}}),Object.defineProperty(e,"_",{enumerable:!0,get:function(){return Xh._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return Xh.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return Xh.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return Xh.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return Xh.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return Xh.CodeGen}});const r=Xh,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 u(t){var e,r,i,o,s,a,u,h,l,c,f,d,p,m,g,y,v,w,b,E,_,A,M,k,N;const x=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:Nl.default;return{strictSchema:null===(a=null!==(s=t.strictSchema)&&void 0!==s?s:x)||void 0===a||a,strictNumbers:null===(h=null!==(u=t.strictNumbers)&&void 0!==u?u:x)||void 0===h||h,strictTypes:null!==(c=null!==(l=t.strictTypes)&&void 0!==l?l:x)&&void 0!==c?c:"log",strictTuples:null!==(d=null!==(f=t.strictTuples)&&void 0!==f?f:x)&&void 0!==d?d:"log",strictRequired:null!==(m=null!==(p=t.strictRequired)&&void 0!==p?p:x)&&void 0!==m&&m,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===(N=t.int32range)||void 0===N||N,uriResolver:R}}class h{constructor(t={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,t=this.opts={...t,...u(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,ol.getRules)(),l.call(this,s,t,"NOT SUPPORTED"),l.call(this,a,t,"DEPRECATED","warn"),this._metaOpts=m.call(this),t.formats&&d.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),t.keywords&&p.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=Al;"id"===r&&(n={...Al},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 El.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 u.call(this,t);this.refs[t]||await i.call(this,r.$schema),this.refs[t]||this.addSchema(r,t,e)}async function u(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,pl.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 _l.SchemaEnv({schema:{},schemaId:r});if(e=_l.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,pl.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,tl.eachItem)(r,(t=>w.call(this,t))),this;E.call(this,e);const n={...e,type:(0,al.getJSONTypes)(e.type),schemaType:(0,al.getJSONTypes)(e.schemaType)};return(0,tl.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,pl.normalizeId)(o||r);const u=pl.getSchemaRefs.call(this,t,r);return a=new _l.SchemaEnv({schema:t,schemaId:s,meta:e,baseId:r,localRefs:u}),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):_l.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{_l.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,pl.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 p(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 m(){const t={...this.opts};for(const e of i)delete t[e];return t}e.default=h,h.ValidationError=vl.default,h.MissingRefError=El.default;const g={log(){},warn(){},error(){}};const y=/^[a-z_$][a-z0-9_$:-]*$/i;function v(t,e){const{RULES:r}=this;if((0,tl.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,al.getJSONTypes)(e.type),schemaType:(0,al.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 Sl={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}},Pl=Object.defineProperty({default:Sl},"__esModule",{value:!0}),Il=u((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:u,opts:h,self:l}=o,{root:c}=a;if(("#"===r||"#/"===r)&&s===c.baseId)return function(){if(a===c)return i(t,u,a,a.$async);const r=e.scopeValue("root",{ref:c});return i(t,Xh._`${r}.validate`,c,c.$async)}();const f=_l.resolveRef.call(l,c,s,r);if(void 0===f)throw new El.default(o.opts.uriResolver,s,r);return f instanceof _l.SchemaEnv?function(e){const r=n(t,e);i(t,r,e,e.$async)}(f):function(n){const i=e.scopeValue("schema",!0===h.code.source?{ref:n,code:(0,Xh.stringify)(n)}:{ref:n}),o=e.name("valid"),s=t.subschema({schema:n,dataTypes:[],schemaPath:Xh.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}):Xh._`${r.scopeValue("wrapper",{ref:e})}.validate`}function i(t,e,r,n){const{gen:i,it:o}=t,{allErrors:s,schemaEnv:a,opts:u}=o,h=u.passContext?rl.default.this:Xh.nil;function l(t){const e=Xh._`${t}.errors`;i.assign(rl.default.vErrors,Xh._`${rl.default.vErrors} === null ? ${e} : ${rl.default.vErrors}.concat(${e})`),i.assign(rl.default.errors,Xh._`${rl.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=tl.mergeEvaluated.props(i,n.props,o.props));else{const e=i.var("props",Xh._`${t}.evaluated.props`);o.props=tl.mergeEvaluated.props(i,e,o.props,Xh.Name)}if(!0!==o.items)if(n&&!n.dynamicItems)void 0!==n.items&&(o.items=tl.mergeEvaluated.items(i,n.items,o.items));else{const e=i.var("items",Xh._`${t}.evaluated.items`);o.items=tl.mergeEvaluated.items(i,e,o.items,Xh.Name)}}n?function(){if(!a.$async)throw new Error("async schema referenced by sync schema");const r=i.let("valid");i.try((()=>{i.code(Xh._`await ${(0,hl.callValidateCode)(t,e,h)}`),c(e),s||i.assign(r,!0)}),(t=>{i.if(Xh._`!(${t} instanceof ${o.ValidationError})`,(()=>i.throw(t))),l(t),s||i.assign(r,!1)})),t.ok(r)}():t.result((0,hl.callValidateCode)(t,e,h),(()=>c(e)),(()=>l(e)))}e.getValidate=n,e.callRef=i,e.default=r}));var Rl=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",Pl.default,Il.default],Cl=Object.defineProperty({default:Rl},"__esModule",{value:!0});const Tl=Xh.operators,Ol={maximum:{okStr:"<=",ok:Tl.LTE,fail:Tl.GT},minimum:{okStr:">=",ok:Tl.GTE,fail:Tl.LT},exclusiveMaximum:{okStr:"<",ok:Tl.LT,fail:Tl.GTE},exclusiveMinimum:{okStr:">",ok:Tl.GT,fail:Tl.LTE}},$l={message:({keyword:t,schemaCode:e})=>Xh.str`must be ${Ol[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>Xh._`{comparison: ${Ol[t].okStr}, limit: ${e}}`},Bl={keyword:Object.keys(Ol),type:"number",schemaType:"number",$data:!0,error:$l,code(t){const{keyword:e,data:r,schemaCode:n}=t;t.fail$data(Xh._`${r} ${Ol[e].fail} ${n} || isNaN(${r})`)}};var Dl=Bl,Fl=Object.defineProperty({default:Dl},"__esModule",{value:!0});var jl={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:t})=>Xh.str`must be multiple of ${t}`,params:({schemaCode:t})=>Xh._`{multipleOf: ${t}}`},code(t){const{gen:e,data:r,schemaCode:n,it:i}=t,o=i.opts.multipleOfPrecision,s=e.let("res"),a=o?Xh._`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:Xh._`${s} !== parseInt(${s})`;t.fail$data(Xh._`(${n} === 0 || (${s} = ${r}/${n}, ${a}))`)}},Ul=Object.defineProperty({default:jl},"__esModule",{value:!0});function Ll(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 zl=Ll;Ll.code='require("ajv/dist/runtime/ucs2length").default';var ql=Object.defineProperty({default:zl},"__esModule",{value:!0});const Vl={message({keyword:t,schemaCode:e}){const r="maxLength"===t?"more":"fewer";return Xh.str`must NOT have ${r} than ${e} characters`},params:({schemaCode:t})=>Xh._`{limit: ${t}}`},Gl={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:Vl,code(t){const{keyword:e,data:r,schemaCode:n,it:i}=t,o="maxLength"===e?Xh.operators.GT:Xh.operators.LT,s=!1===i.opts.unicode?Xh._`${r}.length`:Xh._`${(0,tl.useFunc)(t.gen,ql.default)}(${r})`;t.fail$data(Xh._`${s} ${o} ${n}`)}};var Hl=Gl,Kl=Object.defineProperty({default:Hl},"__esModule",{value:!0});var Ql={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>Xh.str`must match pattern "${t}"`,params:({schemaCode:t})=>Xh._`{pattern: ${t}}`},code(t){const{data:e,$data:r,schema:n,schemaCode:i,it:o}=t,s=o.opts.unicodeRegExp?"u":"",a=r?Xh._`(new RegExp(${i}, ${s}))`:(0,hl.usePattern)(t,n);t.fail$data(Xh._`!${a}.test(${e})`)}},Jl=Object.defineProperty({default:Ql},"__esModule",{value:!0});const Yl={message({keyword:t,schemaCode:e}){const r="maxProperties"===t?"more":"fewer";return Xh.str`must NOT have ${r} than ${e} properties`},params:({schemaCode:t})=>Xh._`{limit: ${t}}`},Zl={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:Yl,code(t){const{keyword:e,data:r,schemaCode:n}=t,i="maxProperties"===e?Xh.operators.GT:Xh.operators.LT;t.fail$data(Xh._`Object.keys(${r}).length ${i} ${n}`)}};var Wl=Zl,Xl=Object.defineProperty({default:Wl},"__esModule",{value:!0});var tc={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:t}})=>Xh.str`must have required property '${t}'`,params:({params:{missingProperty:t}})=>Xh._`{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 u=r.length>=a.loopRequired;if(s.allErrors?function(){if(u||o)t.block$data(Xh.nil,h);else for(const e of r)(0,hl.checkReportMissingProp)(t,e)}():function(){const s=e.let("missing");if(u||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,hl.propertyInData)(e,i,r,a.ownProperties)),e.if((0,Xh.not)(o),(()=>{t.error(),e.break()}))}),Xh.nil)}(s,r))),t.ok(r)}else e.if((0,hl.checkMissingProp)(t,r,s)),(0,hl.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,tl.checkStrictMode)(s,e,s.opts.strictRequired)}}function h(){e.forOf("prop",n,(r=>{t.setParams({missingProperty:r}),e.if((0,hl.noPropertyInData)(e,i,r,a.ownProperties),(()=>t.error()))}))}}},ec=Object.defineProperty({default:tc},"__esModule",{value:!0});const rc={message({keyword:t,schemaCode:e}){const r="maxItems"===t?"more":"fewer";return Xh.str`must NOT have ${r} than ${e} items`},params:({schemaCode:t})=>Xh._`{limit: ${t}}`},nc={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:rc,code(t){const{keyword:e,data:r,schemaCode:n}=t,i="maxItems"===e?Xh.operators.GT:Xh.operators.LT;t.fail$data(Xh._`${r}.length ${i} ${n}`)}};var ic=nc,oc=Object.defineProperty({default:ic},"__esModule",{value:!0});fl.code='require("ajv/dist/runtime/equal").default';var sc=fl,ac=Object.defineProperty({default:sc},"__esModule",{value:!0});var uc={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:t,j:e}})=>Xh.str`must NOT have duplicate items (items ## ${e} and ${t} are identical)`,params:({params:{i:t,j:e}})=>Xh._`{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 u=e.let("valid"),h=o.items?(0,al.getSchemaTypes)(o.items):[];function l(n,i){const o=e.name("item"),s=(0,al.checkDataTypes)(h,o,a.opts.strictNumbers,al.DataType.Wrong),l=e.const("indices",Xh._`{}`);e.for(Xh._`;${n}--;`,(()=>{e.let(o,Xh._`${r}[${n}]`),e.if(s,Xh._`continue`),h.length>1&&e.if(Xh._`typeof ${o} == "string"`,Xh._`${o} += "_"`),e.if(Xh._`typeof ${l}[${o}] == "number"`,(()=>{e.assign(i,Xh._`${l}[${o}]`),t.error(),e.assign(u,!1).break()})).code(Xh._`${l}[${o}] = ${n}`)}))}function c(n,i){const o=(0,tl.useFunc)(e,ac.default),s=e.name("outer");e.label(s).for(Xh._`;${n}--;`,(()=>e.for(Xh._`${i} = ${n}; ${i}--;`,(()=>e.if(Xh._`${o}(${r}[${n}], ${r}[${i}])`,(()=>{t.error(),e.assign(u,!1).break(s)}))))))}t.block$data(u,(function(){const n=e.let("i",Xh._`${r}.length`),i=e.let("j");t.setParams({i:n,j:i}),e.assign(u,!0),e.if(Xh._`${n} > 1`,(()=>(h.length>0&&!h.some((t=>"object"===t||"array"===t))?l:c)(n,i)))}),Xh._`${s} === false`),t.ok(u)}},hc=Object.defineProperty({default:uc},"__esModule",{value:!0});var lc={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:t})=>Xh._`{allowedValue: ${t}}`},code(t){const{gen:e,data:r,$data:n,schemaCode:i,schema:o}=t;n||o&&"object"==typeof o?t.fail$data(Xh._`!${(0,tl.useFunc)(e,ac.default)}(${r}, ${i})`):t.fail(Xh._`${o} !== ${r}`)}},cc=Object.defineProperty({default:lc},"__esModule",{value:!0});var fc={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:t})=>Xh._`{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 u;const h=()=>null!=u?u:u=(0,tl.useFunc)(e,ac.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(Xh._`${h()}(${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,Xh.or)(...i.map(((e,n)=>function(t,e){const n=i[e];return"object"==typeof n&&null!==n?Xh._`${h()}(${r}, ${t}[${e}])`:Xh._`${r} === ${n}`}(t,n))))}t.pass(l)}},dc=Object.defineProperty({default:fc},"__esModule",{value:!0});var pc=[Fl.default,Ul.default,Kl.default,Jl.default,Xl.default,ec.default,oc.default,hc.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},cc.default,dc.default],mc=Object.defineProperty({default:pc},"__esModule",{value:!0}),gc=u((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}})=>Xh.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>Xh._`{limit: ${t}}`},code(t){const{parentSchema:e,it:r}=t,{items:i}=e;Array.isArray(i)?n(t,i):(0,tl.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",Xh._`${i}.length`);if(!1===n)t.setParams({len:e.length}),t.pass(Xh._`${a} <= ${e.length}`);else if("object"==typeof n&&!(0,tl.alwaysValidSchema)(s,n)){const n=r.var("valid",Xh._`${a} <= ${e.length}`);r.if((0,Xh.not)(n),(()=>function(n){r.forRange("i",e.length,a,(e=>{t.subschema({keyword:o,dataProp:e,dataPropType:tl.Type.Num},n),s.allErrors||r.if((0,Xh.not)(n),(()=>r.break()))}))}(n))),t.ok(n)}}e.validateAdditionalItems=n,e.default=r})),yc=u((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,tl.alwaysValidSchema)(r,e)||t.ok((0,hl.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,u=o===t.minItems&&(o===t.maxItems||!1===t[e]);if(n.strictTuples&&!u){const t=`"${s}" is ${o}-tuple, but minItems or maxItems/${e} are not specified or different at path "${i}"`;(0,tl.checkStrictMode)(a,t,n.strictTuples)}}(i),a.opts.unevaluated&&r.length&&!0!==a.items&&(a.items=tl.mergeEvaluated.items(n,r.length,a.items));const u=n.name("valid"),h=n.const("len",Xh._`${o}.length`);r.forEach(((e,r)=>{(0,tl.alwaysValidSchema)(a,e)||(n.if(Xh._`${h} > ${r}`,(()=>t.subschema({keyword:s,schemaProp:r,dataProp:r},u))),t.ok(u))}))}e.validateTuple=n,e.default=r}));var vc={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:t=>(0,yc.validateTuple)(t,"items")},wc=Object.defineProperty({default:vc},"__esModule",{value:!0});const bc={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:t}})=>Xh.str`must NOT have more than ${t} items`,params:({params:{len:t}})=>Xh._`{limit: ${t}}`},code(t){const{schema:e,parentSchema:r,it:n}=t,{prefixItems:i}=r;n.items=!0,(0,tl.alwaysValidSchema)(n,e)||(i?(0,gc.validateAdditionalItems)(t,i):t.ok((0,hl.validateArray)(t)))}};var Ec=bc,_c=Object.defineProperty({default:Ec},"__esModule",{value:!0});var Ac={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:t,max:e}})=>void 0===e?Xh.str`must contain at least ${t} valid item(s)`:Xh.str`must contain at least ${t} and no more than ${e} valid item(s)`,params:({params:{min:t,max:e}})=>void 0===e?Xh._`{minContains: ${t}}`:Xh._`{minContains: ${t}, maxContains: ${e}}`},code(t){const{gen:e,schema:r,parentSchema:n,data:i,it:o}=t;let s,a;const{minContains:u,maxContains:h}=n;o.opts.next?(s=void 0===u?1:u,a=h):s=1;const l=e.const("len",Xh._`${i}.length`);if(t.setParams({min:s,max:a}),void 0===a&&0===s)return void(0,tl.checkStrictMode)(o,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==a&&s>a)return(0,tl.checkStrictMode)(o,'"minContains" > "maxContains" is always invalid'),void t.fail();if((0,tl.alwaysValidSchema)(o,r)){let e=Xh._`${l} >= ${s}`;return void 0!==a&&(e=Xh._`${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(Xh._`${t}++`),void 0===a?e.if(Xh._`${t} >= ${s}`,(()=>e.assign(c,!0).break())):(e.if(Xh._`${t} > ${a}`,(()=>e.assign(c,!1).break())),1===s?e.assign(c,!0):e.if(Xh._`${t} >= ${s}`,(()=>e.assign(c,!0))))}(r)))))}function d(r,n){e.forRange("i",0,l,(e=>{t.subschema({keyword:"contains",dataProp:e,dataPropType:tl.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(Xh._`${i}.length > 0`,f)):(e.let(c,!1),f()),t.result(c,(()=>t.reset()))}},Mc=Object.defineProperty({default:Ac},"__esModule",{value:!0}),kc=u((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 Xh.str`must have ${n} ${r} when property ${t} is present`},params:({params:{property:t,depsCount:e,deps:r,missingProperty:n}})=>Xh._`{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 u=(0,hl.propertyInData)(r,n,s,i.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(u,(()=>{for(const e of a)(0,hl.checkReportMissingProp)(t,e)})):(r.if(Xh._`${u} && (${(0,hl.checkMissingProp)(t,a,o)})`),(0,hl.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,tl.alwaysValidSchema)(o,e[a])||(r.if((0,hl.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 Nc={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:t})=>Xh._`{propertyName: ${t.propertyName}}`},code(t){const{gen:e,schema:r,data:n,it:i}=t;if((0,tl.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,Xh.not)(o),(()=>{t.error(!0),i.allErrors||e.break()}))})),t.ok(o)}};var xc=Nc,Sc=Object.defineProperty({default:xc},"__esModule",{value:!0});const Pc={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:t})=>Xh._`{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:u}=s;if(s.props=!0,"all"!==u.removeAdditional&&(0,tl.alwaysValidSchema)(s,r))return;const h=(0,hl.allSchemaProperties)(n.properties),l=(0,hl.allSchemaProperties)(n.patternProperties);function c(t){e.code(Xh._`delete ${i}[${t}]`)}function f(n){if("all"===u.removeAdditional||u.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,tl.alwaysValidSchema)(s,r)){const r=e.name("valid");"failing"===u.removeAdditional?(d(n,r,!1),e.if((0,Xh.not)(r),(()=>{t.reset(),c(n)}))):(d(n,r),a||e.if((0,Xh.not)(r),(()=>e.break())))}}}function d(e,r,n){const i={keyword:"additionalProperties",dataProp:e,dataPropType:tl.Type.Str};!1===n&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(i,r)}e.forIn("key",i,(r=>{h.length||l.length?e.if(function(r){let i;if(h.length>8){const t=(0,tl.schemaRefOrVal)(s,n.properties,"properties");i=(0,hl.isOwnProperty)(e,t,r)}else i=h.length?(0,Xh.or)(...h.map((t=>Xh._`${r} === ${t}`))):Xh.nil;return l.length&&(i=(0,Xh.or)(i,...l.map((e=>Xh._`${(0,hl.usePattern)(t,e)}.test(${r})`)))),(0,Xh.not)(i)}(r),(()=>f(r))):f(r)})),t.ok(Xh._`${o} === ${rl.default.errors}`)}};var Ic=Pc,Rc=Object.defineProperty({default:Ic},"__esModule",{value:!0});const Cc={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&&Rc.default.code(new ml.KeywordCxt(o,Rc.default,"additionalProperties"));const s=(0,hl.allSchemaProperties)(r);for(const t of s)o.definedProperties.add(t);o.opts.unevaluated&&s.length&&!0!==o.props&&(o.props=tl.mergeEvaluated.props(e,(0,tl.toHash)(s),o.props));const a=s.filter((t=>!(0,tl.alwaysValidSchema)(o,r[t])));if(0===a.length)return;const u=e.name("valid");for(const r of a)h(r)?l(r):(e.if((0,hl.propertyInData)(e,i,r,o.opts.ownProperties)),l(r),o.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(r),t.ok(u);function h(t){return o.opts.useDefaults&&!o.compositeRule&&void 0!==r[t].default}function l(e){t.subschema({keyword:"properties",schemaProp:e,dataProp:e},u)}}};var Tc=Cc,Oc=Object.defineProperty({default:Tc},"__esModule",{value:!0});const $c=tl,Bc={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,hl.allSchemaProperties)(r),u=a.filter((t=>(0,tl.alwaysValidSchema)(o,r[t])));if(0===a.length||u.length===a.length&&(!o.opts.unevaluated||!0===o.props))return;const h=s.strictSchema&&!s.allowMatchingProperties&&i.properties,l=e.name("valid");!0===o.props||o.props instanceof Xh.Name||(o.props=(0,$c.evaluatedPropsToName)(e,o.props));const{props:c}=o;function f(t){for(const e in h)new RegExp(t).test(e)&&(0,tl.checkStrictMode)(o,`property ${e} matches pattern ${t} (use allowMatchingProperties)`)}function d(r){e.forIn("key",n,(n=>{e.if(Xh._`${(0,hl.usePattern)(t,r)}.test(${n})`,(()=>{const i=u.includes(r);i||t.subschema({keyword:"patternProperties",schemaProp:r,dataProp:n,dataPropType:$c.Type.Str},l),o.opts.unevaluated&&!0!==c?e.assign(Xh._`${c}[${n}]`,!0):i||o.allErrors||e.if((0,Xh.not)(l),(()=>e.break()))}))}))}!function(){for(const t of a)h&&f(t),o.allErrors?d(t):(e.var(l,!0),d(t),e.if(l))}()}};var Dc=Bc,Fc=Object.defineProperty({default:Dc},"__esModule",{value:!0});var jc={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){const{gen:e,schema:r,it:n}=t;if((0,tl.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"}},Uc=Object.defineProperty({default:jc},"__esModule",{value:!0});var Lc={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:hl.validateUnion,error:{message:"must match a schema in anyOf"}},zc=Object.defineProperty({default:Lc},"__esModule",{value:!0});var qc={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:t})=>Xh._`{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),u=e.name("_valid");t.setParams({passing:a}),e.block((function(){o.forEach(((r,n)=>{let o;(0,tl.alwaysValidSchema)(i,r)?e.var(u,!0):o=t.subschema({keyword:"oneOf",schemaProp:n,compositeRule:!0},u),n>0&&e.if(Xh._`${u} && ${s}`).assign(s,!1).assign(a,Xh._`[${a}, ${n}]`).else(),e.if(u,(()=>{e.assign(s,!0),e.assign(a,n),o&&t.mergeEvaluated(o,Xh.Name)}))}))})),t.result(s,(()=>t.reset()),(()=>t.error(!0)))}},Vc=Object.defineProperty({default:qc},"__esModule",{value:!0});var Gc={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,tl.alwaysValidSchema)(n,e))return;const o=t.subschema({keyword:"allOf",schemaProp:r},i);t.ok(i),t.mergeEvaluated(o)}))}},Hc=Object.defineProperty({default:Gc},"__esModule",{value:!0});const Kc={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:t})=>Xh.str`must match "${t.ifClause}" schema`,params:({params:t})=>Xh._`{failingKeyword: ${t.ifClause}}`},code(t){const{gen:e,parentSchema:r,it:n}=t;void 0===r.then&&void 0===r.else&&(0,tl.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const i=Qc(n,"then"),o=Qc(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,u("then",r),u("else",r))}else i?e.if(a,u("then")):e.if((0,Xh.not)(a),u("else"));function u(r,n){return()=>{const i=t.subschema({keyword:r},a);e.assign(s,a),t.mergeValidEvaluated(i,s),n?e.assign(n,Xh._`${r}`):t.setParams({ifClause:r})}}t.pass(s,(()=>t.error(!0)))}};function Qc(t,e){const r=t.schema[e];return void 0!==r&&!(0,tl.alwaysValidSchema)(t,r)}var Jc=Kc,Yc=Object.defineProperty({default:Jc},"__esModule",{value:!0});const Zc={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){void 0===e.if&&(0,tl.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};var Wc=Zc,Xc=Object.defineProperty({default:Wc},"__esModule",{value:!0});var tf=function(t=!1){const e=[Uc.default,zc.default,Vc.default,Hc.default,Yc.default,Xc.default,Sc.default,Rc.default,kc.default,Oc.default,Fc.default];return t?e.push(wc.default,_c.default):e.push(gc.default,yc.default),e.push(Mc.default),e},ef=Object.defineProperty({default:tf},"__esModule",{value:!0});const rf={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>Xh.str`must match format "${t}"`,params:({schemaCode:t})=>Xh._`{format: ${t}}`},code(t,e){const{gen:r,data:n,$data:i,schema:o,schemaCode:s,it:a}=t,{opts:u,errSchemaPath:h,schemaEnv:l,self:c}=a;u.validateFormats&&(i?function(){const i=r.scopeValue("formats",{ref:c.formats,code:u.code.formats}),o=r.const("fDef",Xh._`${i}[${s}]`),a=r.let("fType"),h=r.let("format");r.if(Xh._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>r.assign(a,Xh._`${o}.type || "string"`).assign(h,Xh._`${o}.validate`)),(()=>r.assign(a,Xh._`"string"`).assign(h,o))),t.fail$data((0,Xh.or)(!1===u.strictSchema?Xh.nil:Xh._`${s} && !${h}`,function(){const t=l.$async?Xh._`(${o}.async ? await ${h}(${n}) : ${h}(${n}))`:Xh._`${h}(${n})`,r=Xh._`(typeof ${h} == "function" ? ${t} : ${h}.test(${n}))`;return Xh._`${h} && ${h} !== true && ${a} === ${e} && !${r}`}()))}():function(){const i=c.formats[o];if(!i)return void function(){if(!1===u.strictSchema)return void c.logger.warn(t());throw new Error(t());function t(){return`unknown format "${o}" ignored in schema at path "${h}"`}}();if(!0===i)return;const[s,a,f]=function(t){const e=t instanceof RegExp?(0,Xh.regexpCode)(t):u.code.formats?Xh._`${u.code.formats}${(0,Xh.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,Xh._`${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 Xh._`await ${f}(${n})`}return"function"==typeof a?Xh._`${f}(${n})`:Xh._`${f}.test(${n})`}())}())}};var nf=rf;var of=[Object.defineProperty({default:nf},"__esModule",{value:!0}).default],sf=Object.defineProperty({default:of},"__esModule",{value:!0}),af=u((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 uf=[Cl.default,mc.default,(0,ef.default)(),sf.default,af.metadataVocabulary,af.contentVocabulary],hf=Object.defineProperty({default:uf},"__esModule",{value:!0}),lf=u((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 cf={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:t,tagName:e}})=>t===lf.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>Xh._`{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 u=e.let("valid",!1),h=e.const("tag",Xh._`${r}${(0,Xh.getProperty)(a)}`);function l(r){const n=e.name("valid"),i=t.subschema({keyword:"oneOf",schemaProp:r},n);return t.mergeEvaluated(i,Xh.Name),n}e.if(Xh._`typeof ${h} == "string"`,(()=>function(){const r=function(){var t;const e={},r=u(i);let n=!0;for(let e=0;e<s.length;e++){let i=s[e];(null==i?void 0:i.$ref)&&!(0,tl.schemaHasRulesButRef)(i,o.self.RULES)&&(i=_l.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,null==i?void 0:i.$ref),i instanceof _l.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||u(i)),h(l,e)}if(!n)throw new Error(`discriminator: "${a}" must be required`);return e;function u({required:t}){return Array.isArray(t)&&t.includes(a)}function h(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(Xh._`${h} === ${t}`),e.assign(u,l(r[t]));e.else(),t.error(!1,{discrError:lf.DiscrError.Mapping,tag:h,tagName:a}),e.endIf()}()),(()=>t.error(!1,{discrError:lf.DiscrError.Tag,tag:h,tagName:a}))),t.ok(u)}};var ff=cf,df=Object.defineProperty({default:ff},"__esModule",{value:!0}),pf={$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},mf=u((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 xl.default{_addVocabularies(){super._addVocabularies(),hf.default.forEach((t=>this.addVocabulary(t))),this.opts.discriminator&&this.addKeyword(df.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const t=this.opts.$data?this.$dataMetaSchema(pf,r):pf;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 ml.KeywordCxt}}),Object.defineProperty(e,"_",{enumerable:!0,get:function(){return Xh._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return Xh.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return Xh.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return Xh.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return Xh.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return Xh.CodeGen}})})),gf=s(mf),yf=u((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(u,h),"date-time":r((function(t){const e=t.split(l);return 2===e.length&&o(e[0])&&u(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 p.lastIndex=0,p.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:m},double:{type:"number",validate:m},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,h),"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 u(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 h(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||h(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 p=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function m(){return!0}const g=/[^\\]\\Z/})),vf=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const r=Xh.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})=>Xh.str`should be ${n[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>Xh._`{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:u}=s;if(!a.validateFormats)return;const h=new mf.KeywordCxt(s,u.RULES.all.format.definition,"format");function l(t){return Xh._`${t}.compare(${r}, ${i}) ${n[o].fail} 0`}h.$data?function(){const r=e.scopeValue("formats",{ref:u.formats,code:a.code.formats}),n=e.const("fmt",Xh._`${r}[${h.schemaCode}]`);t.fail$data(Xh.or(Xh._`typeof ${n} != "object"`,Xh._`${n} instanceof RegExp`,Xh._`typeof ${n}.compare != "function"`,l(n)))}():function(){const r=h.schema,n=u.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?Xh._`${a.code.formats}${Xh.getProperty(r)}`:void 0});t.fail$data(l(i))}()},dependencies:["format"]};e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)})),wf=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r=new Xh.Name("fullFormats"),n=new Xh.Name("fastFormats"),i=(t,e={keywords:!0})=>{if(Array.isArray(e))return o(t,e,yf.fullFormats,r),t;const[i,s]="fast"===e.mode?[yf.fastFormats,n]:[yf.fullFormats,r];return o(t,e.formats||yf.formatNames,i,s),e.keywords&&vf.default(t),t};function o(t,e,r,n){var i,o;null!==(i=(o=t.opts.code).formats)&&void 0!==i||(o.formats=Xh._`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?yf.fastFormats:yf.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})),bf=s(wf),Ef=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r="errorMessage",n=new mf.Name("emUsed"),i={required:"missingProperty",dependencies:"property",dependentRequired:"property"},o=/\$\{[^}]+\}/,s=/\$\{([^}]+)\}/g,a=/^""\s*\+\s*|\s*\+\s*""$/g;function u(t){return{keyword:r,schemaType:["string","object"],post:!0,code(e){const{gen:u,data:h,schema:l,schemaValue:c,it:f}=e;if(!1===f.createErrors)return;const d=l,p=Xh.strConcat(rl.default.instancePath,f.errorPath);function m(t,e){return Xh.and(mf._`${t}.keyword !== ${r}`,mf._`!${t}.${n}`,mf._`${t}.instancePath === ${p}`,mf._`${t}.keyword in ${e}`,mf._`${t}.schemaPath.indexOf(${f.errSchemaPath}) === 0`,mf._`/^\\/[^\\/]*$/.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 u.object(...r)}function y(t){return o.test(t)?new Zh._Code(Zh.safeStringify(t).replace(s,((t,e)=>`" + JSON.stringify(${ml.getData(e,f)}) + "`)).replace(a,"")):mf.stringify(t)}function v(t){return mf._`function(){return ${y(t)}}`}u.if(mf._`${rl.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=u.const("emErrors",mf.stringify(r)),o=u.const("templates",g(r,l));u.forOf("err",rl.default.vErrors,(t=>u.if(m(t,i),(()=>u.code(mf._`${i}[${t}.keyword].push(${t})`).assign(mf._`${t}.${n}`,!0)))));const{singleError:s}=t;if(s){const t=u.let("message",mf._`""`),r=u.let("paramsErrors",mf._`[]`);a((e=>{u.if(t,(()=>u.code(mf._`${t} += ${"string"==typeof s?s:";"}`))),u.code(mf._`${t} += ${h(e)}`),u.assign(r,mf._`${r}.concat(${i}[${e}])`)})),nl.reportError(e,{message:t,params:mf._`{errors: ${r}}`})}else a((t=>nl.reportError(e,{message:h(t),params:mf._`{errors: ${i}[${t}]}`})));function a(t){u.forIn("key",i,(e=>u.if(mf._`${i}[${e}].length`,(()=>t(e)))))}function h(t){return mf._`${t} in ${o} ? ${o}[${t}]() : ${c}[${t}]`}}(s),o&&function(t){const r=u.const("emErrors",mf.stringify(t)),o=[];for(const e in t)o.push([e,g(t[e],l[e])]);const s=u.const("templates",u.object(...o)),a=u.scopeValue("obj",{ref:i,code:mf.stringify(i)}),h=u.let("emPropParams"),f=u.let("emParamsErrors");u.forOf("err",rl.default.vErrors,(t=>u.if(m(t,r),(()=>{u.assign(h,mf._`${a}[${t}.keyword]`),u.assign(f,mf._`${r}[${t}.keyword][${t}.params[${h}]]`),u.if(f,(()=>u.code(mf._`${f}.push(${t})`).assign(mf._`${t}.${n}`,!0)))})))),u.forIn("key",r,(t=>u.forIn("keyProp",mf._`${r}[${t}]`,(n=>{u.assign(f,mf._`${r}[${t}][${n}]`),u.if(mf._`${f}.length`,(()=>{const r=u.const("tmpl",mf._`${s}[${t}] && ${s}[${t}][${n}]`);nl.reportError(e,{message:mf._`${r} ? ${r}() : ${c}[${t}][${n}]`,params:mf._`{errors: ${f}}`})}))}))))}(o),function(t){const{props:i,items:o}=t;if(!i&&!o)return;const s=mf._`typeof ${h} == "object"`,a=mf._`Array.isArray(${h})`,f=u.let("emErrors");let d,m;const y=u.let("templates");i&&o?(d=u.let("emChildKwd"),u.if(s),u.if(a,(()=>{v(o,l.items),u.assign(d,mf.str`items`)}),(()=>{v(i,l.properties),u.assign(d,mf.str`properties`)})),m=mf._`[${d}]`):o?(u.if(a),v(o,l.items),m=mf._`.items`):i&&(u.if(Xh.and(s,Xh.not(a))),v(i,l.properties),m=mf._`.properties`);function v(t,e){u.assign(f,mf.stringify(t)),u.assign(y,g(t,e))}u.forOf("err",rl.default.vErrors,(t=>function(t,e,i){u.if(Xh.and(mf._`${t}.keyword !== ${r}`,mf._`!${t}.${n}`,mf._`${t}.instancePath.indexOf(${p}) === 0`),(()=>{const r=u.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:mf._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),n=u.const("emMatches",mf._`${r}.exec(${t}.instancePath.slice(${p}.length))`),o=u.const("emChild",mf._`${n} && ${n}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);u.if(mf._`${o} !== undefined && ${o} in ${e}`,(()=>i(o)))}))}(t,f,(e=>u.code(mf._`${f}[${e}].push(${t})`).assign(mf._`${t}.${n}`,!0))))),u.forIn("key",f,(t=>u.if(mf._`${f}[${t}].length`,(()=>{nl.reportError(e,{message:mf._`${t} in ${y} ? ${y}[${t}]() : ${c}${m}[${t}]`,params:mf._`{errors: ${f}[${t}]}`}),u.assign(mf._`${rl.default.vErrors}[${rl.default.errors}-1].instancePath`,mf._`${p} + "/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`)})))),u.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=u.const("emErrs",mf._`[]`);u.forOf("err",rl.default.vErrors,(t=>u.if(function(t){return Xh.and(mf._`${t}.keyword !== ${r}`,mf._`!${t}.${n}`,Xh.or(mf._`${t}.instancePath === ${p}`,Xh.and(mf._`${t}.instancePath.indexOf(${p}) === 0`,mf._`${t}.instancePath[${p}.length] === "/"`)),mf._`${t}.schemaPath.indexOf(${f.errSchemaPath}) === 0`,mf._`${t}.schemaPath[${f.errSchemaPath}.length] === "/"`)}(t),(()=>u.code(mf._`${i}.push(${t})`).assign(mf._`${t}.${n}`,!0))))),u.if(mf._`${i}.length`,(()=>nl.reportError(e,{message:y(t),params:mf._`{errors: ${i}}`})))}(o),t.keepErrors||function(){const t=u.const("emErrs",mf._`[]`);u.forOf("err",rl.default.vErrors,(e=>u.if(mf._`!${e}.${n}`,(()=>u.code(mf._`${t}.push(${e})`))))),u.assign(rl.default.vErrors,t).assign(rl.default.errors,mf._`${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 h=(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(u(e))};e.default=h,t.exports=h,t.exports.default=h})),_f=s(Ef),Af="__lodash_hash_undefined__",Mf="[object Function]",kf="[object GeneratorFunction]",Nf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xf=/^\w*$/,Sf=/^\./,Pf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,If=/\\(\\)?/g,Rf=/^\[object .+?Constructor\]$/,Cf=/^(?:0|[1-9]\d*)$/,Tf="object"==typeof o&&o&&o.Object===Object&&o,Of="object"==typeof self&&self&&self.Object===Object&&self,$f=Tf||Of||Function("return this")();var Bf,Df=Array.prototype,Ff=Function.prototype,jf=Object.prototype,Uf=$f["__core-js_shared__"],Lf=(Bf=/[^.]+$/.exec(Uf&&Uf.keys&&Uf.keys.IE_PROTO||""))?"Symbol(src)_1."+Bf:"",zf=Ff.toString,qf=jf.hasOwnProperty,Vf=jf.toString,Gf=RegExp("^"+zf.call(qf).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hf=$f.Symbol,Kf=Df.splice,Qf=sd($f,"Map"),Jf=sd(Object,"create"),Yf=Hf?Hf.prototype:void 0,Zf=Yf?Yf.toString:void 0;function Wf(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 Xf(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 td(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 ed(t,e,r){var n=t[e];qf.call(t,e)&&cd(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function rd(t,e){for(var r=t.length;r--;)if(cd(t[r][0],e))return r;return-1}function nd(t){if(!dd(t)||(e=t,Lf&&Lf in e))return!1;var e,r=function(t){var e=dd(t)?Vf.call(t):"";return e==Mf||e==kf}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?Gf:Rf;return r.test(function(t){if(null!=t){try{return zf.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function id(t,e,r,n){if(!dd(t))return t;e=function(t,e){if(fd(t))return!1;var r=typeof t;if("number"==r||"symbol"==r||"boolean"==r||null==t||pd(t))return!0;return xf.test(t)||!Nf.test(t)||null!=e&&t in Object(e)}(e,t)?[e]:function(t){return fd(t)?t:ud(t)}(e);for(var i=-1,o=e.length,s=o-1,a=t;null!=a&&++i<o;){var u=hd(e[i]),h=r;if(i!=s){var l=a[u];void 0===(h=n?n(l,u,a):void 0)&&(h=dd(l)?l:ad(e[i+1])?[]:{})}ed(a,u,h),a=a[u]}return t}function od(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 sd(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return nd(r)?r:void 0}function ad(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||Cf.test(t))&&t>-1&&t%1==0&&t<e}Wf.prototype.clear=function(){this.__data__=Jf?Jf(null):{}},Wf.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Wf.prototype.get=function(t){var e=this.__data__;if(Jf){var r=e[t];return r===Af?void 0:r}return qf.call(e,t)?e[t]:void 0},Wf.prototype.has=function(t){var e=this.__data__;return Jf?void 0!==e[t]:qf.call(e,t)},Wf.prototype.set=function(t,e){return this.__data__[t]=Jf&&void 0===e?Af:e,this},Xf.prototype.clear=function(){this.__data__=[]},Xf.prototype.delete=function(t){var e=this.__data__,r=rd(e,t);return!(r<0)&&(r==e.length-1?e.pop():Kf.call(e,r,1),!0)},Xf.prototype.get=function(t){var e=this.__data__,r=rd(e,t);return r<0?void 0:e[r][1]},Xf.prototype.has=function(t){return rd(this.__data__,t)>-1},Xf.prototype.set=function(t,e){var r=this.__data__,n=rd(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},td.prototype.clear=function(){this.__data__={hash:new Wf,map:new(Qf||Xf),string:new Wf}},td.prototype.delete=function(t){return od(this,t).delete(t)},td.prototype.get=function(t){return od(this,t).get(t)},td.prototype.has=function(t){return od(this,t).has(t)},td.prototype.set=function(t,e){return od(this,t).set(t,e),this};var ud=ld((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(pd(t))return Zf?Zf.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return Sf.test(t)&&r.push(""),t.replace(Pf,(function(t,e,n,i){r.push(n?i.replace(If,"$1"):e||t)})),r}));function hd(t){if("string"==typeof t||pd(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ld(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(ld.Cache||td),r}function cd(t,e){return t===e||t!=t&&e!=e}ld.Cache=td;var fd=Array.isArray;function dd(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function pd(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==Vf.call(t)}var md=function(t,e,r){return null==t?t:id(t,e,r)},gd=function(){function t(t,e,r,n){this.options={},this.calls=[],this.paths=[],this.network=t,this.provider=e,this.abi=r,this.options=n||{}}return t.prototype.call=function(t,e,r,n){return this.calls.push([e,r,n]),this.paths.push(t),this},t.prototype.execute=function(t){return e(this,void 0,void 0,(function(){var e,n=this;return r(this,(function(r){switch(r.label){case 0:return e=t||{},[4,ng(this.network,this.provider,this.abi,this.calls,this.options)];case 1:return r.sent().forEach((function(t,r){return md(e,n.paths[r],t.length>1?t:t[0])})),this.calls=[],this.paths=[],[2,e]}}))}))},t}(),yd={},vd=0;const wd=new b("networks/5.6.4");function bd(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 bd(t)},e}function Ed(t,e){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null};return r.renetwork=function(e){return Ed(t,e)},r}const _d={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:bd("homestead")},Ad={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:bd("ropsten")},Md={chainId:63,name:"classicMordor",_defaultProvider:Ed("https://www.ethercluster.com/mordor","classicMordor")},kd={unspecified:{chainId:0,name:"unspecified"},homestead:_d,mainnet:_d,morden:{chainId:2,name:"morden"},ropsten:Ad,testnet:Ad,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:bd("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:bd("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:bd("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},classic:{chainId:61,name:"classic",_defaultProvider:Ed("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Md,classicTestnet:Md,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:Ed("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:bd("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:bd("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 Nd(t){t=atob(t);const e=[];for(let r=0;r<t.length;r++)e.push(t.charCodeAt(r));return x(e)}function xd(t){t=x(t);let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}class Sd{constructor(t){wr(this,"alphabet",t),wr(this,"base",t.length),wr(this,"_alphabetMap",{}),wr(this,"_leader",t.charAt(0));for(let e=0;e<t.length;e++)this._alphabetMap[t.charAt(e)]=e}encode(t){let e=x(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 x(new Uint8Array(e.reverse()))}}new Sd("abcdefghijklmnopqrstuvwxyz234567");const Pd=new Sd("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function Id(t){return _e(kn(t))}const Rd="hash/5.6.1",Cd=new b(Rd),Td=new Uint8Array(32);Td.fill(0);const Od=new RegExp("^((.*)\\.)?([^.]+)$");function $d(t){"string"!=typeof t&&Cd.throwArgumentError("invalid ENS name; not a string","name",t);let e=t,r=Td;for(;e.length;){const n=e.match(Od);null!=n&&""!==n[2]||Cd.throwArgumentError("invalid ENS address; missing component","name",t);r=_e(S([r,_e(kn(jn(n[3])))])),e=n[2]||""}return C(r)}var Bd=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const Dd=new b(Rd),Fd=new Uint8Array(32);Fd.fill(0);const jd=Ht.from(-1),Ud=Ht.from(0),Ld=Ht.from(1),zd=Ht.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const qd=D(Ld.toHexString(),32),Vd=D(Ud.toHexString(),32),Gd={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Hd=["name","version","chainId","verifyingContract","salt"];function Kd(t){return function(e){return"string"!=typeof e&&Dd.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const Qd={name:Kd("name"),version:Kd("version"),chainId:function(t){try{return Ht.from(t).toString()}catch(t){}return Dd.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return $e(t).toLowerCase()}catch(t){}return Dd.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=x(t);if(32!==e.length)throw new Error("bad length");return C(e)}catch(t){}return Dd.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Jd(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))&&Dd.throwArgumentError("invalid numeric width","type",t);const i=zd.mask(r?n-1:n),o=r?i.add(Ld).mul(jd):Ud;return function(e){const r=Ht.from(e);return(r.lt(o)||r.gt(i))&&Dd.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),D(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))&&Dd.throwArgumentError("invalid bytes width","type",t),function(e){return x(e).length!==r&&Dd.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=x(t),r=e.length%32;return r?$([e,Fd.slice(r)]):C(e)}(e)}}}switch(t){case"address":return function(t){return D($e(t),32)};case"bool":return function(t){return t?qd:Vd};case"bytes":return function(t){return _e(t)};case"string":return function(t){return Id(t)}}return null}function Yd(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class Zd{constructor(t){wr(this,"types",Object.freeze(Nr(t))),wr(this,"_encoderCache",{}),wr(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]&&Dd.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&&Dd.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);Jd(s)||(r[s]||Dd.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?Dd.throwArgumentError("missing primary type","types",t):i.length>1&&Dd.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),wr(this,"primaryType",i[0]),function i(o,s){s[o]&&Dd.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]=Yd(e,t[e])+r.map((e=>Yd(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=Jd(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&&Dd.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(r);return this._types[t]&&(i=i.map(_e)),_e($(i))}}const r=this.types[t];if(r){const e=Id(this._types[t]);return t=>{const n=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return this._types[r]?_e(n):n}));return n.unshift(e),$(n)}}return Dd.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||Dd.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return _e(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(Jd(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&&Dd.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)),{}):Dd.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new Zd(t)}static getPrimaryType(t){return Zd.from(t).primaryType}static hashStruct(t,e,r){return Zd.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=Gd[r];n||Dd.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>Hd.indexOf(t.name)-Hd.indexOf(e.name))),Zd.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return $(["0x1901",Zd.hashDomain(t),Zd.from(e).hash(r)])}static hash(t,e,r){return _e(Zd.encode(t,e,r))}static resolveNames(t,e,r,n){return Bd(this,void 0,void 0,(function*(){t=_r(t);const i={};t.verifyingContract&&!I(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const o=Zd.from(e);o.visit(r,((t,e)=>("address"!==t||I(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){Zd.hashDomain(t);const n={},i=[];Hd.forEach((e=>{const r=t[e];null!=r&&(n[e]=Qd[e](r),i.push({name:e,type:Gd[e]}))}));const o=Zd.from(e),s=_r(e);return s.EIP712Domain?Dd.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 C(x(e));if(t.match(/^u?int/))return Ht.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&Dd.throwArgumentError("invalid string","value",e),e}return Dd.throwArgumentError("unsupported type","type",t)}))}}}new b("sha2/5.6.1");function Wd(t){return"0x"+Jo.sha256().update(x(t)).digest("hex")}var Xd=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};function tp(t,e){return Xd(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:x(new Uint8Array(i))}}))}var ep=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const rp=new b("web/5.6.1");function np(t){return new Promise((e=>{setTimeout(e,t)}))}function ip(t,e){if(null==t)return null;if("string"==typeof t)return t;if(M(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return xn(t)}catch(t){}return C(t)}return t}function op(t,e,r){let n=null;if(null!=e){n=kn(e);const r="string"==typeof t?{url:t}:_r(t);if(r.headers){0!==Object.keys(r.headers).filter((t=>"content-type"===t.toLowerCase())).length||(r.headers=_r(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;rp.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;rp.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const s="object"==typeof t&&!!t.errorPassThrough,a={};let u=null;const h={method:"GET"};let l=!1,c=12e4;if("string"==typeof t)u=t;else if("object"==typeof t){if(null!=t&&null!=t.url||rp.throwArgumentError("missing URL","connection.url",t),u=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(h.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==u.substring(0,6)&&!0!==t.allowInsecureAuthentication&&rp.throwError("basic authentication requires a secure https url",b.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:t.user,password:"[REDACTED]"});const e=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+xd(kn(e))}}null!=t.skipFetchSetup&&(h.skipFetchSetup=!!t.skipFetchSetup)}const f=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i"),d=u?u.match(f):null;if(d)try{const t={statusCode:200,statusMessage:"OK",headers:{"content-type":d[1]},body:Nd(d[2])};let e=t.body;return r&&(e=r(t.body,t)),Promise.resolve(e)}catch(t){rp.throwError("processing response error",b.errors.SERVER_ERROR,{body:ip(d[1],d[2]),error:t,requestBody:null,requestMethod:"GET",url:u})}e&&(h.method="POST",h.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 p={};Object.keys(a).forEach((t=>{const e=a[t];p[e.key]=e.value})),h.headers=p;const m=function(){let t=null;return{promise:new Promise((function(e,r){c&&(t=setTimeout((()=>{null!=t&&(t=null,r(rp.makeError("timeout",b.errors.TIMEOUT,{requestBody:ip(h.body,p["content-type"]),requestMethod:h.method,timeout:c,url:u})))}),c))})),cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),g=function(){return ep(this,void 0,void 0,(function*(){for(let t=0;t<n;t++){let e=null;try{if(e=yield tp(u,h),t<n)if(301===e.statusCode||302===e.statusCode){const t=e.headers.location||"";if("GET"===h.method&&t.match(/^https:/)){u=e.headers.location;continue}}else if(429===e.statusCode){let r=!0;if(i&&(r=yield i(t,u)),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 np(r);continue}}}catch(t){e=t.response,null==e&&(m.cancel(),rp.throwError("missing response",b.errors.SERVER_ERROR,{requestBody:ip(h.body,p["content-type"]),requestMethod:h.method,serverError:t,url:u}))}let a=e.body;if(l&&304===e.statusCode?a=null:!s&&(e.statusCode<200||e.statusCode>=300)&&(m.cancel(),rp.throwError("bad response",b.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:ip(a,e.headers?e.headers["content-type"]:null),requestBody:ip(h.body,p["content-type"]),requestMethod:h.method,url:u})),r)try{const t=yield r(a,e);return m.cancel(),t}catch(r){if(r.throttleRetry&&t<n){let e=!0;if(i&&(e=yield i(t,u)),e){const e=o*parseInt(String(Math.random()*Math.pow(2,t)));yield np(e);continue}}m.cancel(),rp.throwError("processing response error",b.errors.SERVER_ERROR,{body:ip(a,e.headers?e.headers["content-type"]:null),error:r,requestBody:ip(h.body,p["content-type"]),requestMethod:h.method,url:u})}return m.cancel(),a}return rp.throwError("failed response",b.errors.SERVER_ERROR,{requestBody:ip(h.body,p["content-type"]),requestMethod:h.method,url:u})}))}();return Promise.race([m.promise,g])}(t,n,((t,e)=>{let n=null;if(null!=t)try{n=JSON.parse(xn(t))}catch(e){rp.throwError("invalid JSON",b.errors.SERVER_ERROR,{body:t,error:e})}return r&&(n=r(n,e)),n}))}function sp(t,e){return e||(e={}),null==(e=_r(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 u=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(u++,u>a)return void(s()&&n(new Error("retry limit reached")));let t=e.interval*parseInt(String(Math.random()*Math.pow(2,u)));t<e.floor&&(t=e.floor),t>e.ceiling&&(t=e.ceiling),setTimeout(i,t)}return null}),(function(t){s()&&n(t)}))}()}))}for(var ap="qpzry9x8gf2tvdw0s3jn54khce6mua7l",up={},hp=0;hp<ap.length;hp++){var lp=ap.charAt(hp);if(void 0!==up[lp])throw new TypeError(lp+" is ambiguous");up[lp]=hp}function cp(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 fp(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=cp(e)^n>>5}for(e=cp(e),r=0;r<t.length;++r){var i=t.charCodeAt(r);e=cp(e)^31&i}return e}function dp(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=fp(o);if("string"==typeof a)return a;for(var u=[],h=0;h<s.length;++h){var l=s.charAt(h),c=up[l];if(void 0===c)return"Unknown character "+l;a=cp(a)^c,h+6>=s.length||u.push(c)}return 1!==a?"Invalid checksum for "+t:{prefix:o,words:u}}function pp(t,e,r,n){for(var i=0,o=0,s=(1<<r)-1,a=[],u=0;u<t.length;++u)for(i=i<<e|t[u],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 mp={decodeUnsafe:function(){var t=dp.apply(null,arguments);if("object"==typeof t)return t},decode:function(t){var e=dp.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=fp(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=cp(n)^s,i+=ap.charAt(s)}for(o=0;o<6;++o)n=cp(n);for(n^=1,o=0;o<6;++o){i+=ap.charAt(n>>5*(5-o)&31)}return i},toWordsUnsafe:function(t){var e=pp(t,8,5,!0);if(Array.isArray(e))return e},toWords:function(t){var e=pp(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)},fromWordsUnsafe:function(t){var e=pp(t,5,8,!1);if(Array.isArray(e))return e},fromWords:function(t){var e=pp(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}};const gp="providers/5.6.8",yp=new b(gp);class vp{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),u=this.type.bind(this);return t.transaction={hash:o,type:u,accessList:vp.allowNull(this.accessList.bind(this),null),blockHash:vp.allowNull(o,null),blockNumber:vp.allowNull(a,null),transactionIndex:vp.allowNull(a,null),confirmations:vp.allowNull(a,null),from:e,gasPrice:vp.allowNull(r),maxPriorityFeePerGas:vp.allowNull(r),maxFeePerGas:vp.allowNull(r),gasLimit:r,to:vp.allowNull(e,null),value:r,nonce:a,data:i,r:vp.allowNull(this.uint256),s:vp.allowNull(this.uint256),v:vp.allowNull(a),creates:vp.allowNull(e,null),raw:vp.allowNull(i)},t.transactionRequest={from:vp.allowNull(e),nonce:vp.allowNull(a),gasLimit:vp.allowNull(r),gasPrice:vp.allowNull(r),maxPriorityFeePerGas:vp.allowNull(r),maxFeePerGas:vp.allowNull(r),to:vp.allowNull(e),value:vp.allowNull(r),data:vp.allowNull((t=>this.data(t,!0))),type:vp.allowNull(a),accessList:vp.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:o,address:e,topics:vp.arrayOf(o),data:i,logIndex:a,blockHash:o},t.receipt={to:vp.allowNull(this.address,null),from:vp.allowNull(this.address,null),contractAddress:vp.allowNull(e,null),transactionIndex:a,root:vp.allowNull(s),gasUsed:r,logsBloom:vp.allowNull(i),blockHash:o,transactionHash:o,logs:vp.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:vp.allowNull(a,null),cumulativeGasUsed:r,effectiveGasPrice:vp.allowNull(r),status:vp.allowNull(a),type:u},t.block={hash:vp.allowNull(o),parentHash:o,number:a,timestamp:a,nonce:vp.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:vp.allowNull(e),extraData:i,transactions:vp.allowNull(vp.arrayOf(o)),baseFeePerGas:vp.allowNull(r)},t.blockWithTransactions=_r(t.block),t.blockWithTransactions.transactions=vp.allowNull(vp.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:vp.allowNull(n,void 0),toBlock:vp.allowNull(n,void 0),blockHash:vp.allowNull(o,void 0),address:vp.allowNull(e,void 0),topics:vp.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:vp.allowNull(a),blockHash:vp.allowNull(o),transactionIndex:a,removed:vp.allowNull(this.boolean.bind(this)),address:e,data:vp.allowFalsish(i,"0x"),topics:vp.arrayOf(o),transactionHash:o,logIndex:a},t}accessList(t){return Vs(t||[])}number(t){return"0x"===t?0:Ht.from(t).toNumber()}type(t){return"0x"===t||null==t?0:Ht.from(t).toNumber()}bigNumber(t){return Ht.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),I(t))?t.toLowerCase():yp.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 $e(t)}callAddress(t){if(!I(t,32))return null;const e=$e(O(t,12));return"0x0000000000000000000000000000000000000000"===e?null:e}contractAddress(t){return De(t)}blockTag(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t||I(t))return B(t);throw new Error("invalid blockTag")}hash(t,e){const r=this.hex(t,e);return 32!==T(r)?yp.throwArgumentError("invalid hash","value",t):r}difficulty(t){if(null==t)return null;const e=Ht.from(t);try{return e.toNumber()}catch(t){}return null}uint256(t){if(!I(t))throw new Error("invalid uint256");return D(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=vp.check(e,t);return n._difficulty=null==r?null:Ht.from(r),n}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return vp.check(this.formats.transactionRequest,t)}transactionResponse(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&Ht.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=vp.check(this.formats.transaction,t);if(null!=t.chainId){let r=t.chainId;I(r)&&(r=Ht.from(r).toNumber()),e.chainId=r}else{let r=t.networkId;null==r&&null==e.v&&(r=t.chainId),I(r)&&(r=Ht.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 Js(t)}receiptLog(t){return vp.check(this.formats.receiptLog,t)}receipt(t){const e=vp.check(this.formats.receipt,t);if(null!=e.root)if(e.root.length<=4){const t=Ht.from(e.root).toNumber();0===t||1===t?(null!=e.status&&e.status!==t&&yp.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=t,delete e.root):yp.throwArgumentError("invalid alt-root-status","value.root",e.root)}else 66!==e.root.length&&yp.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 vp.check(this.formats.filter,t)}filterLog(t){return vp.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 wp=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const bp=new b(gp);function Ep(t){return null==t?"null":(32!==T(t)&&bp.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function _p(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[Ep(t)]=!0}));const r=Object.keys(e);return r.sort(),r.join("|")}return Ep(t)})).join("&")}function Ap(t){if("string"==typeof t){if(32===T(t=t.toLowerCase()))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter:*:"+_p(t);if(ni.isForkEvent(t))throw bp.warn("not implemented"),new Error("not implemented");if(t&&"object"==typeof t)return"filter:"+(t.address||"*")+":"+_p(t.topics||[])}throw new Error("invalid event - "+t)}function Mp(){return(new Date).getTime()}function kp(t){return new Promise((e=>{setTimeout(e,t)}))}const Np=["block","network","pending","poll"];class xp{constructor(t,e,r){wr(this,"tag",t),wr(this,"listener",e),wr(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||Np.indexOf(this.tag)>=0}}const Sp={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 Pp(t){return D(Ht.from(t).toHexString(),32)}function Ip(t){return Pd.encode(S([t,O(Wd(Wd(t)),0,4)]))}const Rp=new RegExp("^(ipfs)://(.*)$","i"),Cp=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Rp,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Tp(t,e){try{return xn(Op(t,e))}catch(t){}return null}function Op(t,e){if("0x"===t)return null;const r=Ht.from(O(t,e,e+32)).toNumber(),n=Ht.from(O(t,r,r+32)).toNumber();return O(t,r+32,r+32+n)}function $p(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):bp.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function Bp(t){const e=x(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 Dp(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function Fp(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=x(t[n]);e[n]=Bp(r),e.push(Bp(i.length)),e.push(Dp(i)),r+=32+32*Math.ceil(i.length/32)}return $(e)}class jp{constructor(t,e,r,n){wr(this,"provider",t),wr(this,"name",r),wr(this,"address",t.formatter.address(e)),wr(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((t=>Ht.from(t).eq(1))).catch((t=>{if(t.code===b.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t}))),this._supportsEip2544}_fetch(t,e){return wp(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:$([t,$d(this.name),e||"0x"])};let n=!1;var i;(yield this.supportsWildcard())&&(n=!0,r.data=$(["0x9061b923",Fp([(i=this.name,C(S(i.split(".").map((t=>{const e=kn("_"+jn(t));return e[0]=e.length-1,e}))))+"00"),r.data])]));try{let t=yield this.provider.call(r);return x(t).length%32==4&&bp.throwError("resolver threw error",b.errors.CALL_EXCEPTION,{transaction:r,data:t}),n&&(t=Op(t,0)),t}catch(t){if(t.code===b.errors.CALL_EXCEPTION)return null;throw t}}))}_fetchBytes(t,e){return wp(this,void 0,void 0,(function*(){const r=yield this._fetch(t,e);return null!=r?Op(r,0):null}))}_getAddress(t,e){const r=Sp[String(t)];if(null==r&&bp.throwError(`unsupported coin type: ${t}`,b.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),"eth"===r.ilk)return this.provider.formatter.address(e);const n=x(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 Ip(S([[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 Ip(S([[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=mp.toWords(n.slice(2));return t.unshift(e),mp.encode(r.prefix,t)}}return null}getAddress(t){return wp(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===b.errors.CALL_EXCEPTION)return null;throw t}const e=yield this._fetchBytes("0xf1cb7e06",Pp(t));if(null==e||"0x"===e)return null;const r=this._getAddress(t,e);return null==r&&bp.throwError("invalid or unsupported coin data",b.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:e}),r}))}getAvatar(){return wp(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<Cp.length;r++){const n=e.match(Cp[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:$p(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]),u=D(Ht.from(s[1]).toHexString(),32);if("erc721"===i){const e=this.provider.formatter.callAddress(yield this.provider.call({to:a,data:$(["0x6352211e",u])}));if(o!==e)return null;t.push({type:"owner",content:e})}else if("erc1155"===i){const e=Ht.from(yield this.provider.call({to:a,data:$(["0x00fdd58e",D(o,32),u])}));if(e.isZero())return null;t.push({type:"balance",content:e.toString()})}const h={to:this.provider.formatter.address(s[0]),data:$([r,u])};let l=Tp(yield this.provider.call(h),0);if(null==l)return null;t.push({type:"metadata-url-base",content:l}),"erc1155"===i&&(l=l.replace("{id}",u.substring(2)),t.push({type:"metadata-url-expanded",content:l})),l.match(/^ipfs:/i)&&(l=$p(l)),t.push({type:"metadata-url",content:l});const c=yield op(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(Rp))return null;t.push({type:"url-ipfs",content:f}),f=$p(f)}return t.push({type:"url",content:f}),{linkage:t,url:f}}}}}catch(t){}return null}))}getContentHash(){return wp(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://"+Pd.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://"+Pd.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://"+xd("0x"+i[1]).replace(/[=+\/]/g,(e=>t[e]))}return bp.throwError("invalid or unsupported content hash data",b.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})}))}getText(t){return wp(this,void 0,void 0,(function*(){let e=kn(t);e=S([Pp(64),Pp(e.length),e]),e.length%32!=0&&(e=S([e,D("0x",32-t.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",C(e));return null==r||"0x"===r?null:xn(r)}))}}let Up=null,Lp=1;class zp extends ii{constructor(t){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),wr(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=br(new.target,"getNetwork")(t);e?(wr(this,"_network",e),this.emit("network",e,null)):bp.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return wp(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||bp.throwError("no network detected",b.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:wr(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return sp((()=>this._ready().then((t=>t),(t=>{if(t.code!==b.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))))}static getFormatter(){return null==Up&&(Up=new vp),Up}static getNetwork(t){return function(t){if(null==t)return null;if("number"==typeof t){for(const e in kd){const r=kd[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=kd[t];return null==e?null:{name:e.name,chainId:e.chainId,ensAddress:e.ensAddress,_defaultProvider:e._defaultProvider||null}}const e=kd[t.name];if(!e)return"number"!=typeof t.chainId&&wd.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==e.chainId&&wd.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 wp(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}),u=yield op({url:s,errorPassThrough:!0},a,((t,e)=>(t.status=e.statusCode,t)));if(u.data)return u.data;const h=u.message||"unknown error";if(u.status>=400&&u.status<500)return bp.throwError(`response not found during CCIP fetch: ${h}`,b.errors.SERVER_ERROR,{url:e,errorMessage:h});o.push(h)}return bp.throwError(`error encountered during CCIP fetch: ${o.map((t=>JSON.stringify(t))).join(", ")}`,b.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(t){return wp(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(Mp()-r.respTime<=t)return r.blockNumber;break}catch(t){if(this._internalBlockNumber===e)break}}const e=Mp(),r=Er({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=Mp();return(t=Ht.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 wp(this,void 0,void 0,(function*(){const t=Lp++,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)bp.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",bp.makeError("network block skew detected",b.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 wp(this,void 0,void 0,(function*(){return bp.throwError("provider does not support network detection",b.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return wp(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 kp(0),this._network;const r=bp.makeError("underlying network changed",b.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=Mp();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=Mp(),(null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,r){return wp(this,void 0,void 0,(function*(){return this._waitForTransaction(t,null==e?1:e,r||0,null)}))}_waitForTransaction(t,e,r,n){return wp(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 u=function(){return!!a||(a=!0,s.forEach((t=>{t()})),!1)},h=t=>{t.confirmations<e||u()||i(t)};if(this.on(t,h),s.push((()=>{this.removeListener(t,h)})),n){let r=n.startBlock,i=null;const h=s=>wp(this,void 0,void 0,(function*(){a||(yield kp(1e3),this.getTransactionCount(n.from).then((l=>wp(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(u())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(bp.makeError("transaction was replaced",b.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:this._wrapTransaction(s),hash:t,receipt:r}))}}i++}}a||this.once("block",h)}}))),(t=>{a||this.once("block",h)})))}));if(a)return;this.once("block",h),s.push((()=>{this.removeListener("block",h)}))}if("number"==typeof r&&r>0){const t=setTimeout((()=>{u()||o(bp.makeError("timeout exceeded",b.errors.TIMEOUT,{timeout:r}))}),r);t.unref&&t.unref(),s.push((()=>{clearTimeout(t)}))}}))}))}getBlockNumber(){return wp(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return wp(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield this.perform("getGasPrice",{});try{return Ht.from(t)}catch(e){return bp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}}))}getBalance(t,e){return wp(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Er({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getBalance",r);try{return Ht.from(n)}catch(t){return bp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:t})}}))}getTransactionCount(t,e){return wp(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Er({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getTransactionCount",r);try{return Ht.from(n).toNumber()}catch(t){return bp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:t})}}))}getCode(t,e){return wp(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Er({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getCode",r);try{return C(n)}catch(t){return bp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:t})}}))}getStorageAt(t,e,r){return wp(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield Er({address:this._getAddress(t),blockTag:this._getBlockTag(r),position:Promise.resolve(e).then((t=>B(t)))}),i=yield this.perform("getStorageAt",n);try{return C(i)}catch(t){return bp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:t})}}))}_wrapTransaction(t,e,r){if(null!=e&&32!==T(e))throw new Error("invalid response - sendTransaction");const n=t;return null!=e&&t.hash!==e&&bp.throwError("Transaction hash mismatch from Provider.sendTransaction.",b.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),n.wait=(e,n)=>wp(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&&bp.throwError("transaction failed",b.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:o}),o)})),n}sendTransaction(t){return wp(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Promise.resolve(t).then((t=>C(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 wp(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?Ht.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?C(t):null)))})),this.formatter.transactionRequest(yield Er(r))}))}_getFilter(t){return wp(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 Er(e))}))}_call(t,e,r){return wp(this,void 0,void 0,(function*(){r>=10&&bp.throwError("CCIP read exceeded maximum redirections",b.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)&&T(i)%32==4)try{const o=O(i,4),s=O(o,0,32);Ht.from(s).eq(n)||bp.throwError("CCIP Read sender did not match",b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const a=[],u=Ht.from(O(o,32,64)).toNumber(),h=Ht.from(O(o,u,u+32)).toNumber(),l=O(o,u+32);for(let e=0;e<h;e++){const r=Tp(l,32*e);null==r&&bp.throwError("CCIP Read contained corrupt URL string",b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i}),a.push(r)}const c=Op(o,64);Ht.from(O(o,100,128)).isZero()||bp.throwError("CCIP Read callback selector included junk",b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const f=O(o,96,100),d=Op(o,128),p=yield this.ccipReadFetch(t,c,a);null==p&&bp.throwError("CCIP Read disabled or provided no URLs",b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const m={to:n,data:$([f,Fp([p,d])])};return this._call(m,e,r+1)}catch(t){if(t.code===b.errors.SERVER_ERROR)throw t}try{return C(i)}catch(r){return bp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"call",params:{transaction:t,blockTag:e},result:i,error:r})}}))}call(t,e){return wp(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Er({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 wp(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Er({transaction:this._getTransactionRequest(t)}),r=yield this.perform("estimateGas",e);try{return Ht.from(r)}catch(t){return bp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"estimateGas",params:e,result:r,error:t})}}))}_getAddress(t){return wp(this,void 0,void 0,(function*(){"string"!=typeof(t=yield t)&&bp.throwArgumentError("invalid address or ENS name","name",t);const e=yield this.resolveName(t);return null==e&&bp.throwError("ENS name not configured",b.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(t)})`}),e}))}_getBlock(t,e){return wp(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;let r=-128;const n={includeTransactions:!!e};if(I(t,32))n.blockHash=t;else try{n.blockTag=yield this._getBlockTag(t),I(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(e){bp.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",t)}return sp((()=>wp(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 wp(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return sp((()=>wp(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 wp(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return sp((()=>wp(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 wp(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Er({filter:this._getFilter(t)}),r=yield this.perform("getLogs",e);return r.forEach((t=>{null==t.removed&&(t.removed=!1)})),vp.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return wp(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(t){return wp(this,void 0,void 0,(function*(){if("number"==typeof(t=yield t)&&t<0){t%1&&bp.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 wp(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 jp(this,r,t);return e===t||(yield n.supportsWildcard())?n:null}e=e.split(".").slice(1).join(".")}}))}_getResolver(t,e){return wp(this,void 0,void 0,(function*(){null==e&&(e="ENS");const r=yield this.getNetwork();r.ensAddress||bp.throwError("network does not support ENS",b.errors.UNSUPPORTED_OPERATION,{operation:e,network:r.name});try{const e=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+$d(t).substring(2)});return this.formatter.callAddress(e)}catch(t){}return null}))}resolveName(t){return wp(this,void 0,void 0,(function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(e){if(I(t))throw e}"string"!=typeof t&&bp.throwArgumentError("invalid ENS name","name",t);const e=yield this.getResolver(t);return e?yield e.getAddress():null}))}lookupAddress(t){return wp(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=Tp(yield this.call({to:r,data:"0x691f3431"+$d(e).substring(2)}),0);return(yield this.resolveName(n))!=t?null:n}))}getAvatar(t){return wp(this,void 0,void 0,(function*(){let e=null;if(I(t)){const r=this.formatter.address(t).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;e=new jp(this,n,r);try{const t=yield e.getAvatar();if(t)return t.url}catch(t){if(t.code!==b.errors.CALL_EXCEPTION)throw t}try{const t=Tp(yield this.call({to:n,data:"0x691f3431"+$d(r).substring(2)}),0);e=yield this.getResolver(t)}catch(t){if(t.code!==b.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 bp.throwError(t+" not implemented",b.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 xp(Ap(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=Ap(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=Ap(t);return this._events.filter((t=>t.tag===e)).length}listeners(t){if(null==t)return this._events.map((t=>t.listener));let e=Ap(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=Ap(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=Ap(t);this._events=this._events.filter((t=>t.tag!==r||(e.push(t),!1)))}return e.forEach((t=>{this._stopEvent(t)})),this}}var qp=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const Vp=new b(gp),Gp=["call","estimateGas"];function Hp(t,e){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")){const r=I(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=Hp(t[r],e);if(n)return n}return null}if("string"==typeof t)try{return Hp(JSON.parse(t),e)}catch(t){}return null}function Kp(t,e,r){const n=r.transaction||r.signedTransaction;if("call"===t){const t=Hp(e,!0);if(t)return t.data;Vp.throwError("missing revert data in call exception; Transaction reverted without a reason string",b.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if("estimateGas"===t){let r=Hp(e.body,!1);null==r&&(r=Hp(e,!1)),r&&Vp.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",b.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===b.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)&&Vp.throwError("insufficient funds for intrinsic transaction cost",b.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&Vp.throwError("nonce has already been used",b.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Vp.throwError("replacement fee too low",b.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&Vp.throwError("legacy pre-eip-155 transactions not supported",b.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),Gp.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&Vp.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function Qp(t){return new Promise((function(e){setTimeout(e,t)}))}function Jp(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 Yp(t){return t?t.toLowerCase():t}const Zp={};class Wp extends hi{constructor(t,e,r){if(super(),t!==Zp)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");wr(this,"provider",e),null==r&&(r=0),"string"==typeof r?(wr(this,"_address",this.provider.formatter.address(r)),wr(this,"_index",null)):"number"==typeof r?(wr(this,"_index",r),wr(this,"_address",null)):Vp.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(t){return Vp.throwError("cannot alter JSON-RPC Signer connection",b.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Xp(Zp,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&&Vp.throwError("unknown account #"+this._index,b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index]))))}sendUncheckedTransaction(t){t=_r(t);const e=this.getAddress().then((t=>(t&&(t=t.toLowerCase()),t)));if(null==t.gasLimit){const r=_r(t);r.from=e,t.gasLimit=this.provider.estimateGas(r)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((t=>qp(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.provider.resolveName(t);return null==e&&Vp.throwArgumentError("provided ENS name resolves to null","tx.to",t),e}))))),Er({tx:Er(t),sender:e}).then((({tx:e,sender:r})=>{null!=e.from?e.from.toLowerCase()!==r&&Vp.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=>Kp("sendTransaction",t,n)))}))}signTransaction(t){return Vp.throwError("signing transactions is unsupported",b.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return qp(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 sp((()=>qp(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 qp(this,void 0,void 0,(function*(){const e="string"==typeof t?kn(t):t,r=yield this.getAddress();return yield this.provider.send("personal_sign",[C(e),r.toLowerCase()])}))}_legacySignMessage(t){return qp(this,void 0,void 0,(function*(){const e="string"==typeof t?kn(t):t,r=yield this.getAddress();return yield this.provider.send("eth_sign",[r.toLowerCase(),C(e)])}))}_signTypedData(t,e,r){return qp(this,void 0,void 0,(function*(){const n=yield Zd.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(Zd.getPayload(n.domain,e,n.value))])}))}unlock(t){return qp(this,void 0,void 0,(function*(){const e=this.provider,r=yield this.getAddress();return e.send("personal_unlockAccount",[r.toLowerCase(),t,null])}))}}class Xp extends Wp{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 tm={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class em extends zp{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=br(this.constructor,"defaultUrl")()),wr(this,"connection","string"==typeof t?Object.freeze({url:t}):Object.freeze(_r(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 qp(this,void 0,void 0,(function*(){yield Qp(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=br(this.constructor,"getNetwork");try{return e(Ht.from(t).toNumber())}catch(e){return Vp.throwError("could not detect network",b.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e})}}return Vp.throwError("could not detect network",b.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(t){return new Wp(Zp,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:Nr(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(n&&this._cache[t])return this._cache[t];const i=op(this.connection,JSON.stringify(r),Jp).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",[Yp(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Yp(e.address),e.blockTag]];case"getCode":return["eth_getCode",[Yp(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Yp(e.address),D(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",[br(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[br(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=Yp(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return qp(this,void 0,void 0,(function*(){if("call"===t||"estimateGas"===t){const t=e.transaction;if(t&&null!=t.type&&Ht.from(t.type).isZero()&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((e=_r(e)).transaction=_r(t),delete e.transaction.type)}}const r=this.prepareRequest(t,e);null==r&&Vp.throwError(t+" not implemented",b.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(r[0],r[1])}catch(r){return Kp(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 Qp(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=_r(tm);if(e)for(const t in e)e[t]&&(r[t]=!0);!function(t,e){t&&"object"==typeof t||vr.throwArgumentError("invalid object","object",t),Object.keys(t).forEach((r=>{e[r]||vr.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=B(Ht.from(t[e]));"gasLimit"===e&&(e="gas"),n[e]=r})),["from","to","data"].forEach((function(e){null!=t[e]&&(n[e]=C(t[e]))})),t.accessList&&(n.accessList=Vs(t.accessList)),n}}var rm=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const nm=new b(gp);class im extends em{detectNetwork(){const t=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return rm(this,void 0,void 0,(function*(){let e=this.network;return null==e&&(e=yield t.detectNetwork.call(this),e||nm.throwError("no network detected",b.errors.UNKNOWN_ERROR,{}),null==this._network&&(wr(this,"_network",e),this.emit("network",e,null))),e}))}}var om={};function sm(t,e){var r=(void 0===e?{}:e).broviderUrl,n=(void 0===r?"https://rpc.snapshot.org":r)+"/"+t;return om[t]||(om[t]=new im({url:n,timeout:25e3,allowGzip:!0},Number(t))),om[t]}function am(t){return _e(kn(t))}var um=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const hm=new b("hash/5.6.1"),lm=new Uint8Array(32);lm.fill(0);const cm=Ht.from(-1),fm=Ht.from(0),dm=Ht.from(1),pm=Ht.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const mm=D(dm.toHexString(),32),gm=D(fm.toHexString(),32),ym={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},vm=["name","version","chainId","verifyingContract","salt"];function wm(t){return function(e){return"string"!=typeof e&&hm.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const bm={name:wm("name"),version:wm("version"),chainId:function(t){try{return Ht.from(t).toString()}catch(t){}return hm.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return $e(t).toLowerCase()}catch(t){}return hm.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=x(t);if(32!==e.length)throw new Error("bad length");return C(e)}catch(t){}return hm.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Em(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))&&hm.throwArgumentError("invalid numeric width","type",t);const i=pm.mask(r?n-1:n),o=r?i.add(dm).mul(cm):fm;return function(e){const r=Ht.from(e);return(r.lt(o)||r.gt(i))&&hm.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),D(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))&&hm.throwArgumentError("invalid bytes width","type",t),function(e){return x(e).length!==r&&hm.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=x(t),r=e.length%32;return r?$([e,lm.slice(r)]):C(e)}(e)}}}switch(t){case"address":return function(t){return D($e(t),32)};case"bool":return function(t){return t?mm:gm};case"bytes":return function(t){return _e(t)};case"string":return function(t){return am(t)}}return null}function _m(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class Am{constructor(t){wr(this,"types",Object.freeze(Nr(t))),wr(this,"_encoderCache",{}),wr(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]&&hm.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&&hm.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);Em(s)||(r[s]||hm.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?hm.throwArgumentError("missing primary type","types",t):i.length>1&&hm.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),wr(this,"primaryType",i[0]),function i(o,s){s[o]&&hm.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]=_m(e,t[e])+r.map((e=>_m(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=Em(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&&hm.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(r);return this._types[t]&&(i=i.map(_e)),_e($(i))}}const r=this.types[t];if(r){const e=am(this._types[t]);return t=>{const n=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return this._types[r]?_e(n):n}));return n.unshift(e),$(n)}}return hm.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||hm.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return _e(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(Em(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&&hm.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)),{}):hm.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new Am(t)}static getPrimaryType(t){return Am.from(t).primaryType}static hashStruct(t,e,r){return Am.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=ym[r];n||hm.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>vm.indexOf(t.name)-vm.indexOf(e.name))),Am.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return $(["0x1901",Am.hashDomain(t),Am.from(e).hash(r)])}static hash(t,e,r){return _e(Am.encode(t,e,r))}static resolveNames(t,e,r,n){return um(this,void 0,void 0,(function*(){t=_r(t);const i={};t.verifyingContract&&!I(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const o=Am.from(e);o.visit(r,((t,e)=>("address"!==t||I(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){Am.hashDomain(t);const n={},i=[];vm.forEach((e=>{const r=t[e];null!=r&&(n[e]=bm[e](r),i.push({name:e,type:ym[e]}))}));const o=Am.from(e),s=_r(e);return s.EIP712Domain?hm.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 C(x(e));if(t.match(/^u?int/))return Ht.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&hm.throwArgumentError("invalid string","value",e),e}return hm.throwArgumentError("unsupported type","type",t)}))}}}window&&window.__awaiter;new b("wallet/5.6.2");function Mm(t,e,r,n){return Ls(Am.hash(t,e,r),n)}function km(t,n,i,o){return e(this,void 0,void 0,(function(){var e,s,a,u;return r(this,(function(r){switch(r.label){case 0:s="0x1626ba7e",a="function isValidSignature(bytes32 _hash, bytes memory _signature) public view returns (bytes4 magicValue)",r.label=1;case 1:return r.trys.push([1,3,,4]),[4,rg(o,[a],[t,"isValidSignature",[x(i),n]])];case 2:return e=r.sent(),[3,4];case 3:if((u=r.sent()).message.startsWith("missing revert data in call exception"))return[2,!1];throw u;case 4:return[2,e.toLowerCase()===s.toLowerCase()]}}))}))}function Nm(t,n,i,o){return e(this,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return e="0x20c13b0b","function isValidSignature(bytes _hash, bytes memory _signature) public view returns (bytes4 magicValue)",[4,rg(o,["function isValidSignature(bytes _hash, bytes memory _signature) public view returns (bytes4 magicValue)"],[t,"isValidSignature",[x(i),n]])];case 1:return[2,r.sent().toLowerCase()===e.toLowerCase()]}}))}))}function xm(t,n,i,o,s){return void 0===o&&(o="1"),void 0===s&&(s={}),e(this,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return e=sm(o,s),[4,km(t,n,i,e)];case 1:return r.sent()?[2,!0]:[4,Nm(t,n,i,e)];case 2:return[2,r.sent()]}}))}))}function Sm(t){var e=t.domain,r=t.types,n=t.message;return Vh.hash(e,r,n)}var Pm=["cloudflare-ipfs.com","cf-ipfs.com","ipfs.io","ipfs.fleek.co","gateway.pinata.cloud","dweb.link","ipfs.infura.io"],Im={1:{key:"1",name:"Ethereum",chainId:1,network:"homestead",multicall:"0xeefba1e63905ef1d7acba5a8513c70307c1ce441",ensResolvers:["0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63","0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41"],ensNameWrapper:"0xD4416b13d2b3a9aBae7AcD5D6C2BbDBE25686401",ensSubgraph:"https://api.thegraph.com/subgraphs/name/ensdomains/ens",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"},5:{key:"5",name:"Goerli testnet",shortName:"Goerli",chainId:5,network:"goerli",testnet:!0,multicall:"0x77dca2c955b15e9de4dbbcf1246b4b85b651e50e",ensResolvers:["0xd7a4F6473f32aC2Af804B3686AE8F1932bC35750","0x4B1488B7a6B320d2D721406204aBc3eeAa9AD329"],ensNameWrapper:"0x114D4603199df73e7D157787f8778E21fCd13066",ensSubgraph:"https://api.thegraph.com/subgraphs/name/ensdomains/ensgoerli",rpc:["https://eth-goerli.alchemyapi.io/v2/v4nqH_J-J3STit45Mm07TxuYexMHQsYZ"],explorer:{url:"https://goerli.etherscan.io",apiUrl:"https://api-goerli.etherscan.io"},start:743550,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"},280:{key:"280",name:"zkSync Era Testnet",shortName:"zkSync testnet",chainId:280,network:"zkSync alpha testnet",testnet:!0,multicall:"0xbDAd32d600915cB70576D3d935d49bFf3C9cB0CF",rpc:["https://testnet.era.zksync.dev"],explorer:{url:"https://goerli.explorer.zksync.io/"},start:9012429,logo:"ipfs://bafkreih6y7ri7h667cwxe5miisxghfheiidtbw2747y75stoxt3gp3a2yy"},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"},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"},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"},59140:{key:"59140",name:"Linea Goerli testnet",shortName:"linea",chainId:59140,network:"testnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://goerli.lineascan.build/"},start:498623,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"},84531:{key:"84531",name:"Base Goerli Testnet",chainId:84531,network:"Base",testnet:!0,multicall:"0x0012989E982C2c473e36418384Ab707C72f2B782",rpc:["https://goerli.base.org"],explorer:{url:"https://goerli.basescan.org/"},start:1151797,logo:"ipfs://QmaxRoHpxZd8PqccAynherrMznMufG6sdmHZLihkECXmZv"},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},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"},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"}},Rm=function(){function t(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}return t.isValidChoice=function(t,e){return"number"==typeof t&&void 0!==(null==e?void 0:e[t-1])},t.prototype.getValidVotes=function(){var e=this;return this.votes.filter((function(r){return t.isValidChoice(r.choice,e.proposal.choices)}))},t.prototype.getScores=function(){var t=this;return this.proposal.choices.map((function(e,r){var n=t.getValidVotes().filter((function(t){return t.choice===r+1}));return n.reduce((function(t,e){return t+e.balance}),0)}))},t.prototype.getScoresByStrategy=function(){var t=this;return this.proposal.choices.map((function(e,r){var n=t.strategies.map((function(e,n){var i=t.getValidVotes().filter((function(t){return t.choice===r+1}));return i.reduce((function(t,e){return t+e.scores[n]}),0)}));return n}))},t.prototype.getScoresTotal=function(){return this.votes.reduce((function(t,e){return t+e.balance}),0)},t.prototype.getChoiceString=function(){return this.proposal.choices[this.selected-1]},t}(),Cm=function(){function t(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}return t.isValidChoice=function(t,e){return Array.isArray(t)&&t.every((function(t){return void 0!==(null==e?void 0:e[t-1])}))&&t.length===new Set(t).size},t.prototype.getValidVotes=function(){var e=this;return this.votes.filter((function(r){return t.isValidChoice(r.choice,e.proposal.choices)}))},t.prototype.getScores=function(){var t=this;return this.proposal.choices.map((function(e,r){return t.getValidVotes().filter((function(t){return t.choice.includes(r+1)})).reduce((function(t,e){return t+e.balance}),0)}))},t.prototype.getScoresByStrategy=function(){var t=this;return this.proposal.choices.map((function(e,r){return t.strategies.map((function(e,n){return t.getValidVotes().filter((function(t){return t.choice.includes(r+1)})).reduce((function(t,e){return t+e.scores[n]}),0)}))}))},t.prototype.getScoresTotal=function(){return this.votes.reduce((function(t,e){return t+e.balance}),0)},t.prototype.getChoiceString=function(){var t=this;return this.selected?this.proposal.choices.filter((function(e,r){return t.selected.includes(r+1)})).join(", "):""},t}();function Tm(t,e){var r=t/e.reduce((function(t,e){return t+e}),0);return isNaN(r)?0:r}function Om(t,e){return Math.sqrt(t*e)}function $m(t){return t*t}function Bm(t,e){return t.map((function(t){return e*t}))}var Dm=function(){function t(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}return t.isValidChoice=function(t,e){return"object"==typeof t&&!Array.isArray(t)&&null!==t&&Object.keys(t).every((function(t){return void 0!==(null==e?void 0:e[Number(t)-1])}))&&Object.keys(t).length>0&&Object.values(t).every((function(t){return"number"==typeof t&&t>=0}))&&Object.values(t).some((function(t){return"number"==typeof t&&t>0}))},t.prototype.getValidVotes=function(){var e=this;return this.votes.filter((function(r){return t.isValidChoice(r.choice,e.proposal.choices)}))},t.prototype.getScores=function(){var t=this.getValidVotes(),e=this.getValidVotes().reduce((function(t,e){return t+e.balance}),0),r=this.proposal.choices.map((function(e,r){var n=t.map((function(t){return Om(Tm(t.choice[r+1],Object.values(t.choice)),t.balance)})).reduce((function(t,e){return t+e}),0);return $m(n)}));return Bm(r.map((function(t,e){return Tm(r[e],r)})),e)},t.prototype.getScoresByStrategy=function(){var t=this,e=this.getValidVotes(),r=this.getValidVotes().reduce((function(t,e){return t+e.balance}),0),n=this.proposal.choices.map((function(r,n){return t.strategies.map((function(t,r){return e.map((function(t){return Om(Tm(t.choice[n+1],Object.values(t.choice)),t.scores[r])})).reduce((function(t,e){return t+e}),0)}))})).map((function(t){return t.map((function(t){return[$m(t)]}))}));return n.map((function(e,i){return Bm(t.strategies.map((function(t,e){return Tm(n[i][e][0],n.flat(2))})),r)}))},t.prototype.getScoresTotal=function(){return this.votes.reduce((function(t,e){return t+e.balance}),0)},t.prototype.getChoiceString=function(){var t=this;return this.proposal.choices.map((function(e,r){if(t.selected[r+1]){var n=Tm(t.selected[r+1],Object.values(t.selected));return Math.round(1e3*n)/10+"% for "+e}})).filter((function(t){return null!=t})).join(", ")},t}();function Fm(t,e){var r=i(new Set(t.map((function(t){return t[0]})).flat())),o=Object.entries(t.reduce((function(t,e,r,i){var o=n(e,1)[0],s=i[r][1];t[o[0]][0]+=s;var a=i[r][2];return a.length>1?t[o[0]][1]=a.map((function(e,r){return e+t[o[0]][1][r]||e})):t[o[0]][1]=[t[o[0]][1].concat(a).reduce((function(t,e){return t+e}),0)],t}),Object.assign.apply(Object,i([{}],r.map((function(t){var e;return(e={})[t]=[0,[]],e})))))),s=o.map((function(t){return[t[0],t[1][0]]})),a=n(s.reduce((function(t,e){var r=n(t,2),i=r[0],o=r[1],s=n(e,2),a=s[0],u=s[1];return u>o?[a,u]:[i,o]}),["?",-1/0]),2),u=(a[0],a[1]),h=n(s.reduce((function(t,e){var r=n(t,2),i=r[0],o=r[1],s=n(e,2),a=s[0],u=s[1];return u<o?[a,u]:[i,o]}),["?",1/0]),2),l=h[0],c=(h[1],o.sort((function(t,e){return e[1][0]-t[1][0]}))),f=t.map((function(t){return t[1]})).reduce((function(t,e){return t+e}),0);return e.push({round:e.length+1,sortedByHighest:c}),u>f/2||c.length<3?e:Fm(t.map((function(t){return[t[0].filter((function(t){return t!=l})),t[1],t[2]]})).filter((function(t){return t[0].length>0})),e)}function jm(t){var e=Fm(t.map((function(t){return[t.choice,t.balance,t.scores]})),[]);return e[e.length-1].sortedByHighest}var Um=function(){function t(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}return t.isValidChoice=function(t,e){return Array.isArray(t)&&t.every((function(t){return void 0!==(null==e?void 0:e[t-1])}))&&t.length===new Set(t).size&&t.length>0&&t.length===e.length},t.prototype.getValidVotes=function(){var e=this;return this.votes.filter((function(r){return t.isValidChoice(r.choice,e.proposal.choices)}))},t.prototype.getScores=function(){return function(t,e){var r=jm(t);return e.choices.map((function(t,e){return r.filter((function(t){return Number(t[0])===e+1})).reduce((function(t,e){return t+e[1][0]}),0)}))}(this.getValidVotes(),this.proposal)},t.prototype.getScoresByStrategy=function(){var t=this,e=jm(this.getValidVotes());return this.proposal.choices.map((function(r,n){return t.strategies.map((function(t,r){return e.filter((function(t){return Number(t[0])===n+1})).reduce((function(t,e){return t+e[1][1][r]}),0)}))}))},t.prototype.getScoresTotal=function(){return this.votes.reduce((function(t,e){return t+e.balance}),0)},t.prototype.getChoiceString=function(){var t=this;return this.selected.map((function(e){if(t.proposal.choices[e-1])return t.proposal.choices[e-1]})).map((function(t,e){return"("+hg(e+1)+") "+t})).join(", ")},t}();function Lm(t,e,r){var n=r.reduce((function(t,e){return t+e}),0),i=e[t]/n*100;return isNaN(i)?0:i}function zm(t,e,r){return Lm(t+1,e,Object.values(e))/100*r}var qm=function(){function t(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}return t.isValidChoice=function(t,e){return"object"==typeof t&&!Array.isArray(t)&&null!==t&&Object.keys(t).every((function(t){return void 0!==(null==e?void 0:e[Number(t)-1])}))&&Object.keys(t).length>0&&Object.values(t).every((function(t){return"number"==typeof t&&t>=0}))&&Object.values(t).some((function(t){return"number"==typeof t&&t>0}))},t.prototype.getValidVotes=function(){var e=this;return this.votes.filter((function(r){return t.isValidChoice(r.choice,e.proposal.choices)}))},t.prototype.getScores=function(){var t=this,e=this.proposal.choices.map((function(e,r){return t.getValidVotes().map((function(t){return zm(r,t.choice,t.balance)})).reduce((function(t,e){return t+e}),0)})),r=this.getValidVotes().reduce((function(t,e){return t+e.balance}),0);return e.map((function(t,r){return Lm(r,e,e)})).map((function(t){return r/100*t}))},t.prototype.getScoresByStrategy=function(){var t=this,e=this.proposal.choices.map((function(e,r){return t.strategies.map((function(e,n){return t.getValidVotes().map((function(t){return zm(r,t.choice,t.scores[n])})).reduce((function(t,e){return t+e}),0)}))})).map((function(t){return t.map((function(t){return[t]}))})),r=this.getValidVotes().reduce((function(t,e){return t+e.balance}),0);return e.map((function(n,i){return t.strategies.map((function(t,r){return Lm(0,e[i][r],e.flat(2))})).map((function(t){return[r/100*t]})).flat()}))},t.prototype.getScoresTotal=function(){return this.votes.reduce((function(t,e){return t+e.balance}),0)},t.prototype.getChoiceString=function(){var t=this;return this.proposal.choices.map((function(e,r){if(t.selected[r+1])return Math.round(10*Lm(r+1,t.selected,Object.values(t.selected)))/10+"% for "+e})).filter((function(t){return null!=t})).join(", ")},t}(),Vm={"single-choice":Rm,approval:Cm,quadratic:Dm,"ranked-choice":Um,weighted:qm,basic:Rm},Gm={1:"https://subgrapher.snapshot.org/delegation/1",5:"https://subgrapher.snapshot.org/delegation/5",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"},Hm=1e3;function Km(t){var n=t.url,i=t.spaces,o=t.pivot,s=t.snapshot;return e(this,void 0,void 0,(function(){var t;return r(this,(function(e){switch(e.label){case 0:return t={delegations:{__args:{where:{space_in:i,timestamp_gte:o},first:Hm,skip:0,orderBy:"timestamp",orderDirection:"asc"},delegator:!0,space:!0,delegate:!0,timestamp:!0}},"latest"!==s&&(t.delegations.__args.block={number:s}),[4,ig(n,t)];case 1:return[2,e.sent().delegations||[]]}}))}))}var Qm=["function text(bytes32 node, string calldata key) external view returns (string memory)"],Jm={Accept:"application/json","Content-Type":"application/json"},Ym="https://score.snapshot.org";function Zm(e,r){void 0===e&&(e=Ym),void 0===r&&(r={path:""});var n=new URL(e);r.path&&(n.pathname=r.path);var i=n.searchParams.get("apiKey"),o=t({},Jm);return i&&(n.searchParams.delete("apiKey"),o=t(t({},Jm),{"X-API-KEY":i})),{url:n.toString(),headers:o}}function Wm(t){return e(this,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return[4,t.text()];case 1:e=r.sent();try{e=JSON.parse(e)}catch(r){return[2,Promise.reject({code:t.status||500,message:"Failed to parse response from score API",data:e})]}return e.error?[2,Promise.reject(e.error)]:[2,e]}}))}))}var Xm=new gf({allErrors:!0,allowUnionTypes:!0,$data:!0,passContext:!0});bf(Xm),_f(Xm),Xm.addFormat("address",{validate:function(t){try{return Be(t)}catch(t){return!1}}}),Xm.addFormat("long",{validate:function(){return!0}}),Xm.addFormat("ethValue",{validate:function(t){if(!t.match(/^([0-9]|[1-9][0-9]+)(\.[0-9]+)?$/))return!1;try{return function(t,e){if("string"!=typeof t&&tu.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=eu.indexOf(e);-1!==t&&(e=3*t)}Ja(t,null!=e?e:18)}(t,18),!0}catch(t){return!1}}});var tg=Object.keys(Im),eg=Object.keys(Im).filter((function(t){return!Im[t].testnet}));function rg(t,n,o,s){return e(this,void 0,void 0,(function(){var e,a,u;return r(this,(function(r){switch(r.label){case 0:e=new ha(o[0],n,t),r.label=1;case 1:return r.trys.push([1,3,,4]),a=o[2]||[],[4,e[o[1]].apply(e,i(a,[s||{}]))];case 2:return[2,r.sent()];case 3:return u=r.sent(),[2,Promise.reject(u)];case 4:return[2]}}))}))}function ng(t,i,o,s,a){return e(this,void 0,void 0,(function(){var e,u,h,l,c,f,d,p;return r(this,(function(r){switch(r.label){case 0:e=["function aggregate(tuple(address target, bytes callData)[] calls) view returns (uint256 blockNumber, bytes[] returnData)"],u=(null==a?void 0:a.multicallAddress)||Im[t].multicall,h=new ha(u,e,i),l=new ti(o),r.label=1;case 1:return r.trys.push([1,3,,4]),c=(null==a?void 0:a.limit)||500,(null==a?void 0:a.limit)&&delete a.limit,f=Math.ceil(s.length/c),d=[],Array.from(Array(f)).forEach((function(t,e){var r=s.slice(c*e,c*(e+1));d.push(h.aggregate(r.map((function(t){return[t[0].toLowerCase(),l.encodeFunctionData(t[1],t[2])]})),a||{}))})),[4,Promise.all(d)];case 2:return[2,r.sent().reduce((function(t,e){var r=n(e,2)[1];return t.concat(r)}),[]).map((function(t,e){return l.decodeFunctionResult(s[e][1],t)}))];case 3:return p=r.sent(),[2,Promise.reject(p)];case 4:return[2]}}))}))}function ig(n,i,o){return void 0===o&&(o={}),e(this,void 0,void 0,(function(){var e,s;return r(this,(function(r){switch(r.label){case 0:return[4,l(n,{method:"POST",headers:t({Accept:"application/json","Content-Type":"application/json"},null==o?void 0:o.headers),body:JSON.stringify({query:Yh.jsonToGraphQLQuery({query:i})})})];case 1:return[4,(e=r.sent()).text()];case 2:s=r.sent();try{s=JSON.parse(s)}catch(t){throw new Error("Errors found in subgraphRequest: URL: "+n+", Status: "+e.status+", Response: "+s.substring(0,400))}if(s.errors)throw new Error("Errors found in subgraphRequest: URL: "+n+", Status: "+e.status+", Response: "+JSON.stringify(s.errors).substring(0,400));return[2,s.data||{}]}}))}))}function og(t,e){void 0===e&&(e=Pm[0]);var r="https://"+e;if(!t)return null;if(!(t.startsWith("ipfs://")||t.startsWith("ipns://")||t.startsWith("https://")||t.startsWith("http://")))return r+"/ipfs/"+t;var n=t.split("://")[0];return"ipfs"===n?t.replace("ipfs://",r+"/ipfs/"):"ipns"===n?t.replace("ipns://",r+"/ipns/"):t}function sg(t,n,i,o){return void 0===i&&(i="1"),void 0===o&&(o={}),e(this,void 0,void 0,(function(){var e,s,a,u,h,l;return r(this,(function(r){switch(r.label){case 0:return e=o.ensResolvers,s=o.broviderUrl,a=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r}(o,["ensResolvers","broviderUrl"]),u=e||Im[i].ensResolvers||Im[1].ensResolvers,h=gh(mh(t)),l=sm(i,{broviderUrl:s}),[4,ng(i,l,Qm,u.map((function(t){return[t,"text",[h,n]]})),a)];case 1:return[2,r.sent().flat().find((function(t){return t}))||""]}}))}))}function ag(t,n,i){return void 0===n&&(n="1"),void 0===i&&(i={}),e(this,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,sg(t,"snapshot",n,i)];case 1:return[2,r.sent()];case 2:return e=r.sent(),console.log(e),[2,null];case 3:return[2]}}))}))}function ug(t,n,i){return void 0===n&&(n="1"),void 0===i&&(i={}),e(this,void 0,void 0,(function(){var e,o,s,a,u;return r(this,(function(r){switch(r.label){case 0:return"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",e=sm(n,i),o=new ha("0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",["function owner(bytes32) view returns (address)"],e),s=i.ensNameWrapper||Im[n].ensNameWrapper,a=gh(mh(t)),[4,o.owner(a)];case 1:return(u=r.sent())!==s?[3,3]:[4,new ha(s,["function ownerOf(uint256) view returns (address)"],e).ownerOf(a)];case 2:u=r.sent(),r.label=3;case 3:return[2,u]}}))}))}function hg(t){var e=["th","st","nd","rd"],r=t%100;return t+(e[(r-20)%10]||e[r]||e[0])}function lg(t){return!!Im[t]}function cg(t){return Be(t)&&"0x0000000000000000000000000000000000000000"!==t}function fg(t,e){return"latest"===t||"number"==typeof t&&t>=Im[e].start}function dg(t){return Promise.reject(new Error(t))}Xm.addKeyword({keyword:"snapshotNetwork",validate:function(t,e){return"mainnet"===(this.snapshotEnv||"default")?eg.includes(e):tg.includes(e)},error:{message:"network not allowed"}}),Xm.addKeyword({keyword:"maxLengthWithSpaceType",validate:function t(e,r){var 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}),Xm.addKeyword({keyword:"maxItemsWithSpaceType",validate:function t(e,r){var 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}),Xm.addFormat("customUrl",{type:"string",validate:function(t){return!t.length||(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("ipfs://")||t.startsWith("ipns://")||t.startsWith("snapshot://"))}});var pg={call:rg,multicall:ng,subgraphRequest:ig,ipfsGet:function(t,n,i){return void 0===i&&(i="ipfs"),e(this,void 0,void 0,(function(){return r(this,(function(e){return[2,l("https://"+t+"/"+i+"/"+n).then((function(t){return t.json()}))]}))}))},getUrl:og,getJSON:function(t,n){return void 0===n&&(n={}),e(this,void 0,void 0,(function(){var e;return r(this,(function(r){return e=og(t,n.gateways),[2,l(e).then((function(t){return t.json()}))]}))}))},sendTransaction:function(t,n,o,s,a,u){return void 0===u&&(u={}),e(this,void 0,void 0,(function(){var e,h,l;return r(this,(function(r){switch(r.label){case 0:return e=t.getSigner(),h=new ha(n,o,t),[4,(l=h.connect(e))[s].apply(l,i(a,[u]))];case 1:return[2,r.sent()]}}))}))},getScores:function(t,n,i,o,s,a,u){return void 0===s&&(s="latest"),void 0===a&&(a=Ym),void 0===u&&(u={}),e(this,void 0,void 0,(function(){var e,h,c,f,d,p,m,g;return r(this,(function(r){switch(r.label){case 0:if(!Array.isArray(o))return[2,dg("addresses should be an array of addresses")];if(0===o.length)return[2,dg("addresses can not be empty")];if(e=o.find((function(t){return!cg(t)})))return[2,dg("Invalid address: "+e)];if(!lg(i))return[2,dg("Invalid network: "+i)];if(h=n.find((function(t){return t.network&&!lg(t.network)})))return[2,dg("Invalid network ("+h.network+") in strategy "+h.name)];if(!fg(s,i))return[2,dg("Snapshot ("+s+") must be 'latest' or greater than network start block ("+Im[i].start+")")];new URL(a).pathname="/api/scores",c=Zm(a,{path:"/api/scores"}),f=c.url,d=c.headers,r.label=1;case 1:return r.trys.push([1,4,,5]),p={space:t,network:i,snapshot:s,strategies:n,addresses:o},[4,l(f,{method:"POST",headers:d,body:JSON.stringify({params:p})})];case 2:return[4,Wm(r.sent())];case 3:return m=r.sent(),[2,"all"===u.returnValue?m.result:m.result[u.returnValue||"scores"]];case 4:return(g=r.sent()).errno?[2,Promise.reject({code:g.errno,message:g.toString(),data:""})]:[2,Promise.reject(g)];case 5:return[2]}}))}))},getVp:function(t,n,i,o,s,a,u){return e(this,void 0,void 0,(function(){var e,h,c,f,d,p;return r(this,(function(r){switch(r.label){case 0:if(e=Zm(null==u?void 0:u.url),h=e.url,c=e.headers,!cg(t))return[2,dg("Invalid voter address: "+t)];if(!lg(n))return[2,dg("Invalid network: "+n)];if(f=i.find((function(t){return t.network&&!lg(t.network)})))return[2,dg("Invalid network ("+f.network+") in strategy "+f.name)];if(!fg(o,n))return[2,dg("Snapshot ("+o+") must be 'latest' or greater than network start block ("+Im[n].start+")")];d={method:"POST",headers:c,body:JSON.stringify({jsonrpc:"2.0",method:"get_vp",params:{address:t,network:n,strategies:i,snapshot:o,space:s,delegation:a}})},r.label=1;case 1:return r.trys.push([1,4,,5]),[4,l(h,d)];case 2:return[4,Wm(r.sent())];case 3:return[2,r.sent().result];case 4:return(p=r.sent()).errno?[2,Promise.reject({code:p.errno,message:p.toString(),data:""})]:[2,Promise.reject(p)];case 5:return[2]}}))}))},validateSchema:function(t,e,r){void 0===r&&(r={snapshotEnv:"default",spaceType:"default"});var n=Xm.compile(t),i=n.call(r,e);return i||n.errors},getEnsTextRecord:sg,getSpaceUri:ag,getEnsOwner:ug,getSpaceController:function(t,n,i){return void 0===n&&(n="1"),void 0===i&&(i={}),e(this,void 0,void 0,(function(){var e,o,s,a;return r(this,(function(r){switch(r.label){case 0:return[4,ag(t,n,i)];case 1:if(e=r.sent()){if(Be(e))return[2,e];if(o=e.split("/"),s=o.includes("testnet")?5:4,a=o[s],Be(a))return[2,a]}return[4,ug(t,n,i)];case 2:return[2,r.sent()]}}))}))},getDelegatesBySpace:function(t,n,o,s){return void 0===o&&(o="latest"),void 0===s&&(s={}),e(this,void 0,void 0,(function(){var e,a,u,h,l;return r(this,(function(r){switch(r.label){case 0:if(!(e=s.subgraphUrl||Gm[t]))return[2,Promise.reject("Delegation subgraph not available for network "+t)];a=0,u=new Map,h=function(t){var e=["",t];t.includes(".eth")&&e.push(t.replace(".eth",""));return e}(n),r.label=1;case 1:return[4,Km({url:e,spaces:h,pivot:a,snapshot:o})];case 2:if(l=r.sent(),(c=l).length===Hm&&c[0].timestamp===c[c.length-1].timestamp)throw new Error("Unable to paginate delegation");return l.forEach((function(t){!function(t,e){var r=function(t){return t.delegator+"-"+t.delegate+"-"+t.space}(e);t.has(r)||t.set(r,e)}(u,t),a=t.timestamp})),l.length<Hm?[3,3]:[3,1];case 3:return[2,i(u.values())]}var c}))}))},clone:function(t){return JSON.parse(JSON.stringify(t))},sleep:function(t){return e(this,void 0,void 0,(function(){return r(this,(function(e){return[2,new Promise((function(e){setTimeout(e,t)}))]}))}))},getNumberWithOrdinal:hg,voting:Vm,getProvider:sm,signMessage:function(t,n,i){return e(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return n=C(new Buffer(n,"utf8")),[4,t.send("personal_sign",[n,i])];case 1:return[2,e.sent()]}}))}))},getBlockNumber:function(t){return e(this,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t.getBlockNumber()];case 1:return e=r.sent(),[2,parseInt(e)];case 2:return r.sent(),[2,Promise.reject()];case 3:return[2]}}))}))},Multicaller:gd,getSnapshots:function(t,n,i,o,s){return void 0===s&&(s={}),e(this,void 0,void 0,(function(){var e,a,u,h,l,c,f;return r(this,(function(r){switch(r.label){case 0:return e={},o.forEach((function(t){return e[t]="latest"})),"latest"===n?[2,e]:(a=t+"-"+n+"-"+o.join("-"),u=yd[a],h=Date.now(),u&&vd>h?[2,u]:(vd<h&&(yd={},vd=h+36e5-h%36e5),e[t]=n,l=Object.keys(e).filter((function(e){return t!==e})),0===l.length?[2,e]:[4,i.getBlock(n)]));case 1:return c=r.sent(),f={blocks:{__args:{where:{ts:c.timestamp,network_in:l}},network:!0,number:!0}},[4,ig(s.blockFinderUrl||"https://blockfinder.snapshot.org",f)];case 2:return r.sent().blocks.forEach((function(t){return e[t.network]=t.number})),yd[a]=e,[2,e]}}))}))},getHash:Sm,verify:function(t,n,i,o,s){return void 0===o&&(o="1"),void 0===s&&(s={}),e(this,void 0,void 0,(function(){var e,a,u,h,l;return r(this,(function(r){switch(r.label){case 0:e=i.domain,a=i.types,u=i.message,h=Sm(i);try{if(l=Mm(e,a,u,n),t===l)return[2,!0]}catch(t){}return[4,xm(t,n,h,o,s)];case 1:return[2,r.sent()]}}))}))},validate:function(t,n,i,o,s,a,u){return e(this,void 0,void 0,(function(){var e,h,c,f,d;return r(this,(function(r){switch(r.label){case 0:if(!cg(n))return[2,dg("Invalid author: "+n)];if(!lg(o))return[2,dg("Invalid network: "+o)];if(!fg(s,o))return[2,dg("Snapshot ("+s+") must be 'latest' or greater than network start block ("+Im[o].start+")")];u||(u={}),e=Zm(u.url),h=e.url,c=e.headers,f={method:"POST",headers:c,body:JSON.stringify({jsonrpc:"2.0",method:"validate",params:{validation:t,author:n,space:i,network:o,snapshot:s,params:a}})},r.label=1;case 1:return r.trys.push([1,4,,5]),[4,l(h,f)];case 2:return[4,Wm(r.sent())];case 3:return[2,r.sent().result];case 4:return(d=r.sent()).errno?[2,Promise.reject({code:d.errno,message:d.toString(),data:""})]:[2,Promise.reject(d)];case 5:return[2]}}))}))},SNAPSHOT_SUBGRAPH_URL:Gm};return{Client:ur,Client712:ur,schemas:gr,utils:pg}}));
|
|
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 u=(0,hl.propertyInData)(r,n,s,i.opts.ownProperties);t.setParams({property:s,depsCount:a.length,deps:a.join(", ")}),i.allErrors?r.if(u,(()=>{for(const e of a)(0,hl.checkReportMissingProp)(t,e)})):(r.if(Xh._`${u} && (${(0,hl.checkMissingProp)(t,a,o)})`),(0,hl.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,tl.alwaysValidSchema)(o,e[a])||(r.if((0,hl.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 Nc={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:t})=>Xh._`{propertyName: ${t.propertyName}}`},code(t){const{gen:e,schema:r,data:n,it:i}=t;if((0,tl.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,Xh.not)(o),(()=>{t.error(!0),i.allErrors||e.break()}))})),t.ok(o)}};var xc=Nc,Sc=Object.defineProperty({default:xc},"__esModule",{value:!0});const Pc={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:t})=>Xh._`{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:u}=s;if(s.props=!0,"all"!==u.removeAdditional&&(0,tl.alwaysValidSchema)(s,r))return;const h=(0,hl.allSchemaProperties)(n.properties),l=(0,hl.allSchemaProperties)(n.patternProperties);function c(t){e.code(Xh._`delete ${i}[${t}]`)}function f(n){if("all"===u.removeAdditional||u.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,tl.alwaysValidSchema)(s,r)){const r=e.name("valid");"failing"===u.removeAdditional?(d(n,r,!1),e.if((0,Xh.not)(r),(()=>{t.reset(),c(n)}))):(d(n,r),a||e.if((0,Xh.not)(r),(()=>e.break())))}}}function d(e,r,n){const i={keyword:"additionalProperties",dataProp:e,dataPropType:tl.Type.Str};!1===n&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),t.subschema(i,r)}e.forIn("key",i,(r=>{h.length||l.length?e.if(function(r){let i;if(h.length>8){const t=(0,tl.schemaRefOrVal)(s,n.properties,"properties");i=(0,hl.isOwnProperty)(e,t,r)}else i=h.length?(0,Xh.or)(...h.map((t=>Xh._`${r} === ${t}`))):Xh.nil;return l.length&&(i=(0,Xh.or)(i,...l.map((e=>Xh._`${(0,hl.usePattern)(t,e)}.test(${r})`)))),(0,Xh.not)(i)}(r),(()=>f(r))):f(r)})),t.ok(Xh._`${o} === ${rl.default.errors}`)}};var Ic=Pc,Rc=Object.defineProperty({default:Ic},"__esModule",{value:!0});const Cc={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&&Rc.default.code(new ml.KeywordCxt(o,Rc.default,"additionalProperties"));const s=(0,hl.allSchemaProperties)(r);for(const t of s)o.definedProperties.add(t);o.opts.unevaluated&&s.length&&!0!==o.props&&(o.props=tl.mergeEvaluated.props(e,(0,tl.toHash)(s),o.props));const a=s.filter((t=>!(0,tl.alwaysValidSchema)(o,r[t])));if(0===a.length)return;const u=e.name("valid");for(const r of a)h(r)?l(r):(e.if((0,hl.propertyInData)(e,i,r,o.opts.ownProperties)),l(r),o.allErrors||e.else().var(u,!0),e.endIf()),t.it.definedProperties.add(r),t.ok(u);function h(t){return o.opts.useDefaults&&!o.compositeRule&&void 0!==r[t].default}function l(e){t.subschema({keyword:"properties",schemaProp:e,dataProp:e},u)}}};var Tc=Cc,Oc=Object.defineProperty({default:Tc},"__esModule",{value:!0});const $c=tl,Bc={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,hl.allSchemaProperties)(r),u=a.filter((t=>(0,tl.alwaysValidSchema)(o,r[t])));if(0===a.length||u.length===a.length&&(!o.opts.unevaluated||!0===o.props))return;const h=s.strictSchema&&!s.allowMatchingProperties&&i.properties,l=e.name("valid");!0===o.props||o.props instanceof Xh.Name||(o.props=(0,$c.evaluatedPropsToName)(e,o.props));const{props:c}=o;function f(t){for(const e in h)new RegExp(t).test(e)&&(0,tl.checkStrictMode)(o,`property ${e} matches pattern ${t} (use allowMatchingProperties)`)}function d(r){e.forIn("key",n,(n=>{e.if(Xh._`${(0,hl.usePattern)(t,r)}.test(${n})`,(()=>{const i=u.includes(r);i||t.subschema({keyword:"patternProperties",schemaProp:r,dataProp:n,dataPropType:$c.Type.Str},l),o.opts.unevaluated&&!0!==c?e.assign(Xh._`${c}[${n}]`,!0):i||o.allErrors||e.if((0,Xh.not)(l),(()=>e.break()))}))}))}!function(){for(const t of a)h&&f(t),o.allErrors?d(t):(e.var(l,!0),d(t),e.if(l))}()}};var Dc=Bc,Fc=Object.defineProperty({default:Dc},"__esModule",{value:!0});var jc={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(t){const{gen:e,schema:r,it:n}=t;if((0,tl.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"}},Uc=Object.defineProperty({default:jc},"__esModule",{value:!0});var Lc={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:hl.validateUnion,error:{message:"must match a schema in anyOf"}},zc=Object.defineProperty({default:Lc},"__esModule",{value:!0});var qc={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:t})=>Xh._`{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),u=e.name("_valid");t.setParams({passing:a}),e.block((function(){o.forEach(((r,n)=>{let o;(0,tl.alwaysValidSchema)(i,r)?e.var(u,!0):o=t.subschema({keyword:"oneOf",schemaProp:n,compositeRule:!0},u),n>0&&e.if(Xh._`${u} && ${s}`).assign(s,!1).assign(a,Xh._`[${a}, ${n}]`).else(),e.if(u,(()=>{e.assign(s,!0),e.assign(a,n),o&&t.mergeEvaluated(o,Xh.Name)}))}))})),t.result(s,(()=>t.reset()),(()=>t.error(!0)))}},Vc=Object.defineProperty({default:qc},"__esModule",{value:!0});var Gc={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,tl.alwaysValidSchema)(n,e))return;const o=t.subschema({keyword:"allOf",schemaProp:r},i);t.ok(i),t.mergeEvaluated(o)}))}},Hc=Object.defineProperty({default:Gc},"__esModule",{value:!0});const Kc={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:t})=>Xh.str`must match "${t.ifClause}" schema`,params:({params:t})=>Xh._`{failingKeyword: ${t.ifClause}}`},code(t){const{gen:e,parentSchema:r,it:n}=t;void 0===r.then&&void 0===r.else&&(0,tl.checkStrictMode)(n,'"if" without "then" and "else" is ignored');const i=Qc(n,"then"),o=Qc(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,u("then",r),u("else",r))}else i?e.if(a,u("then")):e.if((0,Xh.not)(a),u("else"));function u(r,n){return()=>{const i=t.subschema({keyword:r},a);e.assign(s,a),t.mergeValidEvaluated(i,s),n?e.assign(n,Xh._`${r}`):t.setParams({ifClause:r})}}t.pass(s,(()=>t.error(!0)))}};function Qc(t,e){const r=t.schema[e];return void 0!==r&&!(0,tl.alwaysValidSchema)(t,r)}var Jc=Kc,Yc=Object.defineProperty({default:Jc},"__esModule",{value:!0});const Zc={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:t,parentSchema:e,it:r}){void 0===e.if&&(0,tl.checkStrictMode)(r,`"${t}" without "if" is ignored`)}};var Wc=Zc,Xc=Object.defineProperty({default:Wc},"__esModule",{value:!0});var tf=function(t=!1){const e=[Uc.default,zc.default,Vc.default,Hc.default,Yc.default,Xc.default,Sc.default,Rc.default,kc.default,Oc.default,Fc.default];return t?e.push(wc.default,_c.default):e.push(gc.default,yc.default),e.push(Mc.default),e},ef=Object.defineProperty({default:tf},"__esModule",{value:!0});const rf={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:t})=>Xh.str`must match format "${t}"`,params:({schemaCode:t})=>Xh._`{format: ${t}}`},code(t,e){const{gen:r,data:n,$data:i,schema:o,schemaCode:s,it:a}=t,{opts:u,errSchemaPath:h,schemaEnv:l,self:c}=a;u.validateFormats&&(i?function(){const i=r.scopeValue("formats",{ref:c.formats,code:u.code.formats}),o=r.const("fDef",Xh._`${i}[${s}]`),a=r.let("fType"),h=r.let("format");r.if(Xh._`typeof ${o} == "object" && !(${o} instanceof RegExp)`,(()=>r.assign(a,Xh._`${o}.type || "string"`).assign(h,Xh._`${o}.validate`)),(()=>r.assign(a,Xh._`"string"`).assign(h,o))),t.fail$data((0,Xh.or)(!1===u.strictSchema?Xh.nil:Xh._`${s} && !${h}`,function(){const t=l.$async?Xh._`(${o}.async ? await ${h}(${n}) : ${h}(${n}))`:Xh._`${h}(${n})`,r=Xh._`(typeof ${h} == "function" ? ${t} : ${h}.test(${n}))`;return Xh._`${h} && ${h} !== true && ${a} === ${e} && !${r}`}()))}():function(){const i=c.formats[o];if(!i)return void function(){if(!1===u.strictSchema)return void c.logger.warn(t());throw new Error(t());function t(){return`unknown format "${o}" ignored in schema at path "${h}"`}}();if(!0===i)return;const[s,a,f]=function(t){const e=t instanceof RegExp?(0,Xh.regexpCode)(t):u.code.formats?Xh._`${u.code.formats}${(0,Xh.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,Xh._`${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 Xh._`await ${f}(${n})`}return"function"==typeof a?Xh._`${f}(${n})`:Xh._`${f}.test(${n})`}())}())}};var nf=rf;var of=[Object.defineProperty({default:nf},"__esModule",{value:!0}).default],sf=Object.defineProperty({default:of},"__esModule",{value:!0}),af=u((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 uf=[Cl.default,mc.default,(0,ef.default)(),sf.default,af.metadataVocabulary,af.contentVocabulary],hf=Object.defineProperty({default:uf},"__esModule",{value:!0}),lf=u((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 cf={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:t,tagName:e}})=>t===lf.DiscrError.Tag?`tag "${e}" must be string`:`value of tag "${e}" must be in oneOf`,params:({params:{discrError:t,tag:e,tagName:r}})=>Xh._`{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 u=e.let("valid",!1),h=e.const("tag",Xh._`${r}${(0,Xh.getProperty)(a)}`);function l(r){const n=e.name("valid"),i=t.subschema({keyword:"oneOf",schemaProp:r},n);return t.mergeEvaluated(i,Xh.Name),n}e.if(Xh._`typeof ${h} == "string"`,(()=>function(){const r=function(){var t;const e={},r=u(i);let n=!0;for(let e=0;e<s.length;e++){let i=s[e];(null==i?void 0:i.$ref)&&!(0,tl.schemaHasRulesButRef)(i,o.self.RULES)&&(i=_l.resolveRef.call(o.self,o.schemaEnv.root,o.baseId,null==i?void 0:i.$ref),i instanceof _l.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||u(i)),h(l,e)}if(!n)throw new Error(`discriminator: "${a}" must be required`);return e;function u({required:t}){return Array.isArray(t)&&t.includes(a)}function h(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(Xh._`${h} === ${t}`),e.assign(u,l(r[t]));e.else(),t.error(!1,{discrError:lf.DiscrError.Mapping,tag:h,tagName:a}),e.endIf()}()),(()=>t.error(!1,{discrError:lf.DiscrError.Tag,tag:h,tagName:a}))),t.ok(u)}};var ff=cf,df=Object.defineProperty({default:ff},"__esModule",{value:!0}),pf={$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},mf=u((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 xl.default{_addVocabularies(){super._addVocabularies(),hf.default.forEach((t=>this.addVocabulary(t))),this.opts.discriminator&&this.addKeyword(df.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const t=this.opts.$data?this.$dataMetaSchema(pf,r):pf;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 ml.KeywordCxt}}),Object.defineProperty(e,"_",{enumerable:!0,get:function(){return Xh._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return Xh.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return Xh.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return Xh.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return Xh.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return Xh.CodeGen}})})),gf=s(mf),yf=u((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(u,h),"date-time":r((function(t){const e=t.split(l);return 2===e.length&&o(e[0])&&u(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 p.lastIndex=0,p.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:m},double:{type:"number",validate:m},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,h),"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 u(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 h(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||h(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 p=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function m(){return!0}const g=/[^\\]\\Z/})),vf=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;const r=Xh.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})=>Xh.str`should be ${n[t].okStr} ${e}`,params:({keyword:t,schemaCode:e})=>Xh._`{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:u}=s;if(!a.validateFormats)return;const h=new mf.KeywordCxt(s,u.RULES.all.format.definition,"format");function l(t){return Xh._`${t}.compare(${r}, ${i}) ${n[o].fail} 0`}h.$data?function(){const r=e.scopeValue("formats",{ref:u.formats,code:a.code.formats}),n=e.const("fmt",Xh._`${r}[${h.schemaCode}]`);t.fail$data(Xh.or(Xh._`typeof ${n} != "object"`,Xh._`${n} instanceof RegExp`,Xh._`typeof ${n}.compare != "function"`,l(n)))}():function(){const r=h.schema,n=u.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?Xh._`${a.code.formats}${Xh.getProperty(r)}`:void 0});t.fail$data(l(i))}()},dependencies:["format"]};e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)})),wf=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r=new Xh.Name("fullFormats"),n=new Xh.Name("fastFormats"),i=(t,e={keywords:!0})=>{if(Array.isArray(e))return o(t,e,yf.fullFormats,r),t;const[i,s]="fast"===e.mode?[yf.fastFormats,n]:[yf.fullFormats,r];return o(t,e.formats||yf.formatNames,i,s),e.keywords&&vf.default(t),t};function o(t,e,r,n){var i,o;null!==(i=(o=t.opts.code).formats)&&void 0!==i||(o.formats=Xh._`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?yf.fastFormats:yf.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})),bf=s(wf),Ef=u((function(t,e){Object.defineProperty(e,"__esModule",{value:!0});const r="errorMessage",n=new mf.Name("emUsed"),i={required:"missingProperty",dependencies:"property",dependentRequired:"property"},o=/\$\{[^}]+\}/,s=/\$\{([^}]+)\}/g,a=/^""\s*\+\s*|\s*\+\s*""$/g;function u(t){return{keyword:r,schemaType:["string","object"],post:!0,code(e){const{gen:u,data:h,schema:l,schemaValue:c,it:f}=e;if(!1===f.createErrors)return;const d=l,p=Xh.strConcat(rl.default.instancePath,f.errorPath);function m(t,e){return Xh.and(mf._`${t}.keyword !== ${r}`,mf._`!${t}.${n}`,mf._`${t}.instancePath === ${p}`,mf._`${t}.keyword in ${e}`,mf._`${t}.schemaPath.indexOf(${f.errSchemaPath}) === 0`,mf._`/^\\/[^\\/]*$/.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 u.object(...r)}function y(t){return o.test(t)?new Zh._Code(Zh.safeStringify(t).replace(s,((t,e)=>`" + JSON.stringify(${ml.getData(e,f)}) + "`)).replace(a,"")):mf.stringify(t)}function v(t){return mf._`function(){return ${y(t)}}`}u.if(mf._`${rl.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=u.const("emErrors",mf.stringify(r)),o=u.const("templates",g(r,l));u.forOf("err",rl.default.vErrors,(t=>u.if(m(t,i),(()=>u.code(mf._`${i}[${t}.keyword].push(${t})`).assign(mf._`${t}.${n}`,!0)))));const{singleError:s}=t;if(s){const t=u.let("message",mf._`""`),r=u.let("paramsErrors",mf._`[]`);a((e=>{u.if(t,(()=>u.code(mf._`${t} += ${"string"==typeof s?s:";"}`))),u.code(mf._`${t} += ${h(e)}`),u.assign(r,mf._`${r}.concat(${i}[${e}])`)})),nl.reportError(e,{message:t,params:mf._`{errors: ${r}}`})}else a((t=>nl.reportError(e,{message:h(t),params:mf._`{errors: ${i}[${t}]}`})));function a(t){u.forIn("key",i,(e=>u.if(mf._`${i}[${e}].length`,(()=>t(e)))))}function h(t){return mf._`${t} in ${o} ? ${o}[${t}]() : ${c}[${t}]`}}(s),o&&function(t){const r=u.const("emErrors",mf.stringify(t)),o=[];for(const e in t)o.push([e,g(t[e],l[e])]);const s=u.const("templates",u.object(...o)),a=u.scopeValue("obj",{ref:i,code:mf.stringify(i)}),h=u.let("emPropParams"),f=u.let("emParamsErrors");u.forOf("err",rl.default.vErrors,(t=>u.if(m(t,r),(()=>{u.assign(h,mf._`${a}[${t}.keyword]`),u.assign(f,mf._`${r}[${t}.keyword][${t}.params[${h}]]`),u.if(f,(()=>u.code(mf._`${f}.push(${t})`).assign(mf._`${t}.${n}`,!0)))})))),u.forIn("key",r,(t=>u.forIn("keyProp",mf._`${r}[${t}]`,(n=>{u.assign(f,mf._`${r}[${t}][${n}]`),u.if(mf._`${f}.length`,(()=>{const r=u.const("tmpl",mf._`${s}[${t}] && ${s}[${t}][${n}]`);nl.reportError(e,{message:mf._`${r} ? ${r}() : ${c}[${t}][${n}]`,params:mf._`{errors: ${f}}`})}))}))))}(o),function(t){const{props:i,items:o}=t;if(!i&&!o)return;const s=mf._`typeof ${h} == "object"`,a=mf._`Array.isArray(${h})`,f=u.let("emErrors");let d,m;const y=u.let("templates");i&&o?(d=u.let("emChildKwd"),u.if(s),u.if(a,(()=>{v(o,l.items),u.assign(d,mf.str`items`)}),(()=>{v(i,l.properties),u.assign(d,mf.str`properties`)})),m=mf._`[${d}]`):o?(u.if(a),v(o,l.items),m=mf._`.items`):i&&(u.if(Xh.and(s,Xh.not(a))),v(i,l.properties),m=mf._`.properties`);function v(t,e){u.assign(f,mf.stringify(t)),u.assign(y,g(t,e))}u.forOf("err",rl.default.vErrors,(t=>function(t,e,i){u.if(Xh.and(mf._`${t}.keyword !== ${r}`,mf._`!${t}.${n}`,mf._`${t}.instancePath.indexOf(${p}) === 0`),(()=>{const r=u.scopeValue("pattern",{ref:/^\/([^/]*)(?:\/|$)/,code:mf._`new RegExp("^\\\/([^/]*)(?:\\\/|$)")`}),n=u.const("emMatches",mf._`${r}.exec(${t}.instancePath.slice(${p}.length))`),o=u.const("emChild",mf._`${n} && ${n}[1].replace(/~1/g, "/").replace(/~0/g, "~")`);u.if(mf._`${o} !== undefined && ${o} in ${e}`,(()=>i(o)))}))}(t,f,(e=>u.code(mf._`${f}[${e}].push(${t})`).assign(mf._`${t}.${n}`,!0))))),u.forIn("key",f,(t=>u.if(mf._`${f}[${t}].length`,(()=>{nl.reportError(e,{message:mf._`${t} in ${y} ? ${y}[${t}]() : ${c}${m}[${t}]`,params:mf._`{errors: ${f}[${t}]}`}),u.assign(mf._`${rl.default.vErrors}[${rl.default.errors}-1].instancePath`,mf._`${p} + "/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`)})))),u.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=u.const("emErrs",mf._`[]`);u.forOf("err",rl.default.vErrors,(t=>u.if(function(t){return Xh.and(mf._`${t}.keyword !== ${r}`,mf._`!${t}.${n}`,Xh.or(mf._`${t}.instancePath === ${p}`,Xh.and(mf._`${t}.instancePath.indexOf(${p}) === 0`,mf._`${t}.instancePath[${p}.length] === "/"`)),mf._`${t}.schemaPath.indexOf(${f.errSchemaPath}) === 0`,mf._`${t}.schemaPath[${f.errSchemaPath}.length] === "/"`)}(t),(()=>u.code(mf._`${i}.push(${t})`).assign(mf._`${t}.${n}`,!0))))),u.if(mf._`${i}.length`,(()=>nl.reportError(e,{message:y(t),params:mf._`{errors: ${i}}`})))}(o),t.keepErrors||function(){const t=u.const("emErrs",mf._`[]`);u.forOf("err",rl.default.vErrors,(e=>u.if(mf._`!${e}.${n}`,(()=>u.code(mf._`${t}.push(${e})`))))),u.assign(rl.default.vErrors,t).assign(rl.default.errors,mf._`${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 h=(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(u(e))};e.default=h,t.exports=h,t.exports.default=h})),_f=s(Ef),Af="__lodash_hash_undefined__",Mf="[object Function]",kf="[object GeneratorFunction]",Nf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,xf=/^\w*$/,Sf=/^\./,Pf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,If=/\\(\\)?/g,Rf=/^\[object .+?Constructor\]$/,Cf=/^(?:0|[1-9]\d*)$/,Tf="object"==typeof o&&o&&o.Object===Object&&o,Of="object"==typeof self&&self&&self.Object===Object&&self,$f=Tf||Of||Function("return this")();var Bf,Df=Array.prototype,Ff=Function.prototype,jf=Object.prototype,Uf=$f["__core-js_shared__"],Lf=(Bf=/[^.]+$/.exec(Uf&&Uf.keys&&Uf.keys.IE_PROTO||""))?"Symbol(src)_1."+Bf:"",zf=Ff.toString,qf=jf.hasOwnProperty,Vf=jf.toString,Gf=RegExp("^"+zf.call(qf).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hf=$f.Symbol,Kf=Df.splice,Qf=sd($f,"Map"),Jf=sd(Object,"create"),Yf=Hf?Hf.prototype:void 0,Zf=Yf?Yf.toString:void 0;function Wf(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 Xf(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 td(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 ed(t,e,r){var n=t[e];qf.call(t,e)&&cd(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function rd(t,e){for(var r=t.length;r--;)if(cd(t[r][0],e))return r;return-1}function nd(t){if(!dd(t)||(e=t,Lf&&Lf in e))return!1;var e,r=function(t){var e=dd(t)?Vf.call(t):"";return e==Mf||e==kf}(t)||function(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}(t)?Gf:Rf;return r.test(function(t){if(null!=t){try{return zf.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function id(t,e,r,n){if(!dd(t))return t;e=function(t,e){if(fd(t))return!1;var r=typeof t;if("number"==r||"symbol"==r||"boolean"==r||null==t||pd(t))return!0;return xf.test(t)||!Nf.test(t)||null!=e&&t in Object(e)}(e,t)?[e]:function(t){return fd(t)?t:ud(t)}(e);for(var i=-1,o=e.length,s=o-1,a=t;null!=a&&++i<o;){var u=hd(e[i]),h=r;if(i!=s){var l=a[u];void 0===(h=n?n(l,u,a):void 0)&&(h=dd(l)?l:ad(e[i+1])?[]:{})}ed(a,u,h),a=a[u]}return t}function od(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 sd(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return nd(r)?r:void 0}function ad(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||Cf.test(t))&&t>-1&&t%1==0&&t<e}Wf.prototype.clear=function(){this.__data__=Jf?Jf(null):{}},Wf.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Wf.prototype.get=function(t){var e=this.__data__;if(Jf){var r=e[t];return r===Af?void 0:r}return qf.call(e,t)?e[t]:void 0},Wf.prototype.has=function(t){var e=this.__data__;return Jf?void 0!==e[t]:qf.call(e,t)},Wf.prototype.set=function(t,e){return this.__data__[t]=Jf&&void 0===e?Af:e,this},Xf.prototype.clear=function(){this.__data__=[]},Xf.prototype.delete=function(t){var e=this.__data__,r=rd(e,t);return!(r<0)&&(r==e.length-1?e.pop():Kf.call(e,r,1),!0)},Xf.prototype.get=function(t){var e=this.__data__,r=rd(e,t);return r<0?void 0:e[r][1]},Xf.prototype.has=function(t){return rd(this.__data__,t)>-1},Xf.prototype.set=function(t,e){var r=this.__data__,n=rd(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},td.prototype.clear=function(){this.__data__={hash:new Wf,map:new(Qf||Xf),string:new Wf}},td.prototype.delete=function(t){return od(this,t).delete(t)},td.prototype.get=function(t){return od(this,t).get(t)},td.prototype.has=function(t){return od(this,t).has(t)},td.prototype.set=function(t,e){return od(this,t).set(t,e),this};var ud=ld((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(pd(t))return Zf?Zf.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var r=[];return Sf.test(t)&&r.push(""),t.replace(Pf,(function(t,e,n,i){r.push(n?i.replace(If,"$1"):e||t)})),r}));function hd(t){if("string"==typeof t||pd(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function ld(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(ld.Cache||td),r}function cd(t,e){return t===e||t!=t&&e!=e}ld.Cache=td;var fd=Array.isArray;function dd(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function pd(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==Vf.call(t)}var md=function(t,e,r){return null==t?t:id(t,e,r)},gd=function(){function t(t,e,r,n){this.options={},this.calls=[],this.paths=[],this.network=t,this.provider=e,this.abi=r,this.options=n||{}}return t.prototype.call=function(t,e,r,n){return this.calls.push([e,r,n]),this.paths.push(t),this},t.prototype.execute=function(t){return e(this,void 0,void 0,(function(){var e,n=this;return r(this,(function(r){switch(r.label){case 0:return e=t||{},[4,ng(this.network,this.provider,this.abi,this.calls,this.options)];case 1:return r.sent().forEach((function(t,r){return md(e,n.paths[r],t.length>1?t:t[0])})),this.calls=[],this.paths=[],[2,e]}}))}))},t}(),yd={},vd=0;const wd=new b("networks/5.6.4");function bd(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 bd(t)},e}function Ed(t,e){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(t,e):null};return r.renetwork=function(e){return Ed(t,e)},r}const _d={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:bd("homestead")},Ad={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:bd("ropsten")},Md={chainId:63,name:"classicMordor",_defaultProvider:Ed("https://www.ethercluster.com/mordor","classicMordor")},kd={unspecified:{chainId:0,name:"unspecified"},homestead:_d,mainnet:_d,morden:{chainId:2,name:"morden"},ropsten:Ad,testnet:Ad,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:bd("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:bd("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:bd("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},classic:{chainId:61,name:"classic",_defaultProvider:Ed("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Md,classicTestnet:Md,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:Ed("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:bd("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:bd("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 Nd(t){t=atob(t);const e=[];for(let r=0;r<t.length;r++)e.push(t.charCodeAt(r));return x(e)}function xd(t){t=x(t);let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}class Sd{constructor(t){wr(this,"alphabet",t),wr(this,"base",t.length),wr(this,"_alphabetMap",{}),wr(this,"_leader",t.charAt(0));for(let e=0;e<t.length;e++)this._alphabetMap[t.charAt(e)]=e}encode(t){let e=x(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 x(new Uint8Array(e.reverse()))}}new Sd("abcdefghijklmnopqrstuvwxyz234567");const Pd=new Sd("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function Id(t){return _e(kn(t))}const Rd="hash/5.6.1",Cd=new b(Rd),Td=new Uint8Array(32);Td.fill(0);const Od=new RegExp("^((.*)\\.)?([^.]+)$");function $d(t){"string"!=typeof t&&Cd.throwArgumentError("invalid ENS name; not a string","name",t);let e=t,r=Td;for(;e.length;){const n=e.match(Od);null!=n&&""!==n[2]||Cd.throwArgumentError("invalid ENS address; missing component","name",t);r=_e(S([r,_e(kn(jn(n[3])))])),e=n[2]||""}return C(r)}var Bd=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const Dd=new b(Rd),Fd=new Uint8Array(32);Fd.fill(0);const jd=Ht.from(-1),Ud=Ht.from(0),Ld=Ht.from(1),zd=Ht.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const qd=D(Ld.toHexString(),32),Vd=D(Ud.toHexString(),32),Gd={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Hd=["name","version","chainId","verifyingContract","salt"];function Kd(t){return function(e){return"string"!=typeof e&&Dd.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const Qd={name:Kd("name"),version:Kd("version"),chainId:function(t){try{return Ht.from(t).toString()}catch(t){}return Dd.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return $e(t).toLowerCase()}catch(t){}return Dd.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=x(t);if(32!==e.length)throw new Error("bad length");return C(e)}catch(t){}return Dd.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Jd(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))&&Dd.throwArgumentError("invalid numeric width","type",t);const i=zd.mask(r?n-1:n),o=r?i.add(Ld).mul(jd):Ud;return function(e){const r=Ht.from(e);return(r.lt(o)||r.gt(i))&&Dd.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),D(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))&&Dd.throwArgumentError("invalid bytes width","type",t),function(e){return x(e).length!==r&&Dd.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=x(t),r=e.length%32;return r?$([e,Fd.slice(r)]):C(e)}(e)}}}switch(t){case"address":return function(t){return D($e(t),32)};case"bool":return function(t){return t?qd:Vd};case"bytes":return function(t){return _e(t)};case"string":return function(t){return Id(t)}}return null}function Yd(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class Zd{constructor(t){wr(this,"types",Object.freeze(Nr(t))),wr(this,"_encoderCache",{}),wr(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]&&Dd.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&&Dd.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);Jd(s)||(r[s]||Dd.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?Dd.throwArgumentError("missing primary type","types",t):i.length>1&&Dd.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),wr(this,"primaryType",i[0]),function i(o,s){s[o]&&Dd.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]=Yd(e,t[e])+r.map((e=>Yd(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=Jd(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&&Dd.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(r);return this._types[t]&&(i=i.map(_e)),_e($(i))}}const r=this.types[t];if(r){const e=Id(this._types[t]);return t=>{const n=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return this._types[r]?_e(n):n}));return n.unshift(e),$(n)}}return Dd.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||Dd.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return _e(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(Jd(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&&Dd.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)),{}):Dd.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new Zd(t)}static getPrimaryType(t){return Zd.from(t).primaryType}static hashStruct(t,e,r){return Zd.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=Gd[r];n||Dd.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>Hd.indexOf(t.name)-Hd.indexOf(e.name))),Zd.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return $(["0x1901",Zd.hashDomain(t),Zd.from(e).hash(r)])}static hash(t,e,r){return _e(Zd.encode(t,e,r))}static resolveNames(t,e,r,n){return Bd(this,void 0,void 0,(function*(){t=_r(t);const i={};t.verifyingContract&&!I(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const o=Zd.from(e);o.visit(r,((t,e)=>("address"!==t||I(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){Zd.hashDomain(t);const n={},i=[];Hd.forEach((e=>{const r=t[e];null!=r&&(n[e]=Qd[e](r),i.push({name:e,type:Gd[e]}))}));const o=Zd.from(e),s=_r(e);return s.EIP712Domain?Dd.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 C(x(e));if(t.match(/^u?int/))return Ht.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&Dd.throwArgumentError("invalid string","value",e),e}return Dd.throwArgumentError("unsupported type","type",t)}))}}}new b("sha2/5.6.1");function Wd(t){return"0x"+Jo.sha256().update(x(t)).digest("hex")}var Xd=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};function tp(t,e){return Xd(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:x(new Uint8Array(i))}}))}var ep=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const rp=new b("web/5.6.1");function np(t){return new Promise((e=>{setTimeout(e,t)}))}function ip(t,e){if(null==t)return null;if("string"==typeof t)return t;if(M(t)){if(e&&("text"===e.split("/")[0]||"application/json"===e.split(";")[0].trim()))try{return xn(t)}catch(t){}return C(t)}return t}function op(t,e,r){let n=null;if(null!=e){n=kn(e);const r="string"==typeof t?{url:t}:_r(t);if(r.headers){0!==Object.keys(r.headers).filter((t=>"content-type"===t.toLowerCase())).length||(r.headers=_r(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;rp.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;rp.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const s="object"==typeof t&&!!t.errorPassThrough,a={};let u=null;const h={method:"GET"};let l=!1,c=12e4;if("string"==typeof t)u=t;else if("object"==typeof t){if(null!=t&&null!=t.url||rp.throwArgumentError("missing URL","connection.url",t),u=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(h.allowGzip=!!t.allowGzip,null!=t.user&&null!=t.password){"https:"!==u.substring(0,6)&&!0!==t.allowInsecureAuthentication&&rp.throwError("basic authentication requires a secure https url",b.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:t.user,password:"[REDACTED]"});const e=t.user+":"+t.password;a.authorization={key:"Authorization",value:"Basic "+xd(kn(e))}}null!=t.skipFetchSetup&&(h.skipFetchSetup=!!t.skipFetchSetup)}const f=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i"),d=u?u.match(f):null;if(d)try{const t={statusCode:200,statusMessage:"OK",headers:{"content-type":d[1]},body:Nd(d[2])};let e=t.body;return r&&(e=r(t.body,t)),Promise.resolve(e)}catch(t){rp.throwError("processing response error",b.errors.SERVER_ERROR,{body:ip(d[1],d[2]),error:t,requestBody:null,requestMethod:"GET",url:u})}e&&(h.method="POST",h.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 p={};Object.keys(a).forEach((t=>{const e=a[t];p[e.key]=e.value})),h.headers=p;const m=function(){let t=null;return{promise:new Promise((function(e,r){c&&(t=setTimeout((()=>{null!=t&&(t=null,r(rp.makeError("timeout",b.errors.TIMEOUT,{requestBody:ip(h.body,p["content-type"]),requestMethod:h.method,timeout:c,url:u})))}),c))})),cancel:function(){null!=t&&(clearTimeout(t),t=null)}}}(),g=function(){return ep(this,void 0,void 0,(function*(){for(let t=0;t<n;t++){let e=null;try{if(e=yield tp(u,h),t<n)if(301===e.statusCode||302===e.statusCode){const t=e.headers.location||"";if("GET"===h.method&&t.match(/^https:/)){u=e.headers.location;continue}}else if(429===e.statusCode){let r=!0;if(i&&(r=yield i(t,u)),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 np(r);continue}}}catch(t){e=t.response,null==e&&(m.cancel(),rp.throwError("missing response",b.errors.SERVER_ERROR,{requestBody:ip(h.body,p["content-type"]),requestMethod:h.method,serverError:t,url:u}))}let a=e.body;if(l&&304===e.statusCode?a=null:!s&&(e.statusCode<200||e.statusCode>=300)&&(m.cancel(),rp.throwError("bad response",b.errors.SERVER_ERROR,{status:e.statusCode,headers:e.headers,body:ip(a,e.headers?e.headers["content-type"]:null),requestBody:ip(h.body,p["content-type"]),requestMethod:h.method,url:u})),r)try{const t=yield r(a,e);return m.cancel(),t}catch(r){if(r.throttleRetry&&t<n){let e=!0;if(i&&(e=yield i(t,u)),e){const e=o*parseInt(String(Math.random()*Math.pow(2,t)));yield np(e);continue}}m.cancel(),rp.throwError("processing response error",b.errors.SERVER_ERROR,{body:ip(a,e.headers?e.headers["content-type"]:null),error:r,requestBody:ip(h.body,p["content-type"]),requestMethod:h.method,url:u})}return m.cancel(),a}return rp.throwError("failed response",b.errors.SERVER_ERROR,{requestBody:ip(h.body,p["content-type"]),requestMethod:h.method,url:u})}))}();return Promise.race([m.promise,g])}(t,n,((t,e)=>{let n=null;if(null!=t)try{n=JSON.parse(xn(t))}catch(e){rp.throwError("invalid JSON",b.errors.SERVER_ERROR,{body:t,error:e})}return r&&(n=r(n,e)),n}))}function sp(t,e){return e||(e={}),null==(e=_r(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 u=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(u++,u>a)return void(s()&&n(new Error("retry limit reached")));let t=e.interval*parseInt(String(Math.random()*Math.pow(2,u)));t<e.floor&&(t=e.floor),t>e.ceiling&&(t=e.ceiling),setTimeout(i,t)}return null}),(function(t){s()&&n(t)}))}()}))}for(var ap="qpzry9x8gf2tvdw0s3jn54khce6mua7l",up={},hp=0;hp<ap.length;hp++){var lp=ap.charAt(hp);if(void 0!==up[lp])throw new TypeError(lp+" is ambiguous");up[lp]=hp}function cp(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 fp(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=cp(e)^n>>5}for(e=cp(e),r=0;r<t.length;++r){var i=t.charCodeAt(r);e=cp(e)^31&i}return e}function dp(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=fp(o);if("string"==typeof a)return a;for(var u=[],h=0;h<s.length;++h){var l=s.charAt(h),c=up[l];if(void 0===c)return"Unknown character "+l;a=cp(a)^c,h+6>=s.length||u.push(c)}return 1!==a?"Invalid checksum for "+t:{prefix:o,words:u}}function pp(t,e,r,n){for(var i=0,o=0,s=(1<<r)-1,a=[],u=0;u<t.length;++u)for(i=i<<e|t[u],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 mp={decodeUnsafe:function(){var t=dp.apply(null,arguments);if("object"==typeof t)return t},decode:function(t){var e=dp.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=fp(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=cp(n)^s,i+=ap.charAt(s)}for(o=0;o<6;++o)n=cp(n);for(n^=1,o=0;o<6;++o){i+=ap.charAt(n>>5*(5-o)&31)}return i},toWordsUnsafe:function(t){var e=pp(t,8,5,!0);if(Array.isArray(e))return e},toWords:function(t){var e=pp(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)},fromWordsUnsafe:function(t){var e=pp(t,5,8,!1);if(Array.isArray(e))return e},fromWords:function(t){var e=pp(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}};const gp="providers/5.6.8",yp=new b(gp);class vp{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),u=this.type.bind(this);return t.transaction={hash:o,type:u,accessList:vp.allowNull(this.accessList.bind(this),null),blockHash:vp.allowNull(o,null),blockNumber:vp.allowNull(a,null),transactionIndex:vp.allowNull(a,null),confirmations:vp.allowNull(a,null),from:e,gasPrice:vp.allowNull(r),maxPriorityFeePerGas:vp.allowNull(r),maxFeePerGas:vp.allowNull(r),gasLimit:r,to:vp.allowNull(e,null),value:r,nonce:a,data:i,r:vp.allowNull(this.uint256),s:vp.allowNull(this.uint256),v:vp.allowNull(a),creates:vp.allowNull(e,null),raw:vp.allowNull(i)},t.transactionRequest={from:vp.allowNull(e),nonce:vp.allowNull(a),gasLimit:vp.allowNull(r),gasPrice:vp.allowNull(r),maxPriorityFeePerGas:vp.allowNull(r),maxFeePerGas:vp.allowNull(r),to:vp.allowNull(e),value:vp.allowNull(r),data:vp.allowNull((t=>this.data(t,!0))),type:vp.allowNull(a),accessList:vp.allowNull(this.accessList.bind(this),null)},t.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:o,address:e,topics:vp.arrayOf(o),data:i,logIndex:a,blockHash:o},t.receipt={to:vp.allowNull(this.address,null),from:vp.allowNull(this.address,null),contractAddress:vp.allowNull(e,null),transactionIndex:a,root:vp.allowNull(s),gasUsed:r,logsBloom:vp.allowNull(i),blockHash:o,transactionHash:o,logs:vp.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:vp.allowNull(a,null),cumulativeGasUsed:r,effectiveGasPrice:vp.allowNull(r),status:vp.allowNull(a),type:u},t.block={hash:vp.allowNull(o),parentHash:o,number:a,timestamp:a,nonce:vp.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:vp.allowNull(e),extraData:i,transactions:vp.allowNull(vp.arrayOf(o)),baseFeePerGas:vp.allowNull(r)},t.blockWithTransactions=_r(t.block),t.blockWithTransactions.transactions=vp.allowNull(vp.arrayOf(this.transactionResponse.bind(this))),t.filter={fromBlock:vp.allowNull(n,void 0),toBlock:vp.allowNull(n,void 0),blockHash:vp.allowNull(o,void 0),address:vp.allowNull(e,void 0),topics:vp.allowNull(this.topics.bind(this),void 0)},t.filterLog={blockNumber:vp.allowNull(a),blockHash:vp.allowNull(o),transactionIndex:a,removed:vp.allowNull(this.boolean.bind(this)),address:e,data:vp.allowFalsish(i,"0x"),topics:vp.arrayOf(o),transactionHash:o,logIndex:a},t}accessList(t){return Vs(t||[])}number(t){return"0x"===t?0:Ht.from(t).toNumber()}type(t){return"0x"===t||null==t?0:Ht.from(t).toNumber()}bigNumber(t){return Ht.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),I(t))?t.toLowerCase():yp.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 $e(t)}callAddress(t){if(!I(t,32))return null;const e=$e(O(t,12));return"0x0000000000000000000000000000000000000000"===e?null:e}contractAddress(t){return De(t)}blockTag(t){if(null==t)return"latest";if("earliest"===t)return"0x0";if("latest"===t||"pending"===t)return t;if("number"==typeof t||I(t))return B(t);throw new Error("invalid blockTag")}hash(t,e){const r=this.hex(t,e);return 32!==T(r)?yp.throwArgumentError("invalid hash","value",t):r}difficulty(t){if(null==t)return null;const e=Ht.from(t);try{return e.toNumber()}catch(t){}return null}uint256(t){if(!I(t))throw new Error("invalid uint256");return D(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=vp.check(e,t);return n._difficulty=null==r?null:Ht.from(r),n}block(t){return this._block(t,this.formats.block)}blockWithTransactions(t){return this._block(t,this.formats.blockWithTransactions)}transactionRequest(t){return vp.check(this.formats.transactionRequest,t)}transactionResponse(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&Ht.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=vp.check(this.formats.transaction,t);if(null!=t.chainId){let r=t.chainId;I(r)&&(r=Ht.from(r).toNumber()),e.chainId=r}else{let r=t.networkId;null==r&&null==e.v&&(r=t.chainId),I(r)&&(r=Ht.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 Js(t)}receiptLog(t){return vp.check(this.formats.receiptLog,t)}receipt(t){const e=vp.check(this.formats.receipt,t);if(null!=e.root)if(e.root.length<=4){const t=Ht.from(e.root).toNumber();0===t||1===t?(null!=e.status&&e.status!==t&&yp.throwArgumentError("alt-root-status/status mismatch","value",{root:e.root,status:e.status}),e.status=t,delete e.root):yp.throwArgumentError("invalid alt-root-status","value.root",e.root)}else 66!==e.root.length&&yp.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 vp.check(this.formats.filter,t)}filterLog(t){return vp.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 wp=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const bp=new b(gp);function Ep(t){return null==t?"null":(32!==T(t)&&bp.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function _p(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[Ep(t)]=!0}));const r=Object.keys(e);return r.sort(),r.join("|")}return Ep(t)})).join("&")}function Ap(t){if("string"==typeof t){if(32===T(t=t.toLowerCase()))return"tx:"+t;if(-1===t.indexOf(":"))return t}else{if(Array.isArray(t))return"filter:*:"+_p(t);if(ni.isForkEvent(t))throw bp.warn("not implemented"),new Error("not implemented");if(t&&"object"==typeof t)return"filter:"+(t.address||"*")+":"+_p(t.topics||[])}throw new Error("invalid event - "+t)}function Mp(){return(new Date).getTime()}function kp(t){return new Promise((e=>{setTimeout(e,t)}))}const Np=["block","network","pending","poll"];class xp{constructor(t,e,r){wr(this,"tag",t),wr(this,"listener",e),wr(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||Np.indexOf(this.tag)>=0}}const Sp={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 Pp(t){return D(Ht.from(t).toHexString(),32)}function Ip(t){return Pd.encode(S([t,O(Wd(Wd(t)),0,4)]))}const Rp=new RegExp("^(ipfs)://(.*)$","i"),Cp=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),Rp,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function Tp(t,e){try{return xn(Op(t,e))}catch(t){}return null}function Op(t,e){if("0x"===t)return null;const r=Ht.from(O(t,e,e+32)).toNumber(),n=Ht.from(O(t,r,r+32)).toNumber();return O(t,r+32,r+32+n)}function $p(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):bp.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function Bp(t){const e=x(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 Dp(t){if(t.length%32==0)return t;const e=new Uint8Array(32*Math.ceil(t.length/32));return e.set(t),e}function Fp(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=x(t[n]);e[n]=Bp(r),e.push(Bp(i.length)),e.push(Dp(i)),r+=32+32*Math.ceil(i.length/32)}return $(e)}class jp{constructor(t,e,r,n){wr(this,"provider",t),wr(this,"name",r),wr(this,"address",t.formatter.address(e)),wr(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((t=>Ht.from(t).eq(1))).catch((t=>{if(t.code===b.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,t}))),this._supportsEip2544}_fetch(t,e){return wp(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:$([t,$d(this.name),e||"0x"])};let n=!1;var i;(yield this.supportsWildcard())&&(n=!0,r.data=$(["0x9061b923",Fp([(i=this.name,C(S(i.split(".").map((t=>{const e=kn("_"+jn(t));return e[0]=e.length-1,e}))))+"00"),r.data])]));try{let t=yield this.provider.call(r);return x(t).length%32==4&&bp.throwError("resolver threw error",b.errors.CALL_EXCEPTION,{transaction:r,data:t}),n&&(t=Op(t,0)),t}catch(t){if(t.code===b.errors.CALL_EXCEPTION)return null;throw t}}))}_fetchBytes(t,e){return wp(this,void 0,void 0,(function*(){const r=yield this._fetch(t,e);return null!=r?Op(r,0):null}))}_getAddress(t,e){const r=Sp[String(t)];if(null==r&&bp.throwError(`unsupported coin type: ${t}`,b.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`}),"eth"===r.ilk)return this.provider.formatter.address(e);const n=x(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 Ip(S([[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 Ip(S([[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=mp.toWords(n.slice(2));return t.unshift(e),mp.encode(r.prefix,t)}}return null}getAddress(t){return wp(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===b.errors.CALL_EXCEPTION)return null;throw t}const e=yield this._fetchBytes("0xf1cb7e06",Pp(t));if(null==e||"0x"===e)return null;const r=this._getAddress(t,e);return null==r&&bp.throwError("invalid or unsupported coin data",b.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${t})`,coinType:t,data:e}),r}))}getAvatar(){return wp(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<Cp.length;r++){const n=e.match(Cp[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:$p(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]),u=D(Ht.from(s[1]).toHexString(),32);if("erc721"===i){const e=this.provider.formatter.callAddress(yield this.provider.call({to:a,data:$(["0x6352211e",u])}));if(o!==e)return null;t.push({type:"owner",content:e})}else if("erc1155"===i){const e=Ht.from(yield this.provider.call({to:a,data:$(["0x00fdd58e",D(o,32),u])}));if(e.isZero())return null;t.push({type:"balance",content:e.toString()})}const h={to:this.provider.formatter.address(s[0]),data:$([r,u])};let l=Tp(yield this.provider.call(h),0);if(null==l)return null;t.push({type:"metadata-url-base",content:l}),"erc1155"===i&&(l=l.replace("{id}",u.substring(2)),t.push({type:"metadata-url-expanded",content:l})),l.match(/^ipfs:/i)&&(l=$p(l)),t.push({type:"metadata-url",content:l});const c=yield op(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(Rp))return null;t.push({type:"url-ipfs",content:f}),f=$p(f)}return t.push({type:"url",content:f}),{linkage:t,url:f}}}}}catch(t){}return null}))}getContentHash(){return wp(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://"+Pd.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://"+Pd.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://"+xd("0x"+i[1]).replace(/[=+\/]/g,(e=>t[e]))}return bp.throwError("invalid or unsupported content hash data",b.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t})}))}getText(t){return wp(this,void 0,void 0,(function*(){let e=kn(t);e=S([Pp(64),Pp(e.length),e]),e.length%32!=0&&(e=S([e,D("0x",32-t.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",C(e));return null==r||"0x"===r?null:xn(r)}))}}let Up=null,Lp=1;class zp extends ii{constructor(t){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),wr(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=br(new.target,"getNetwork")(t);e?(wr(this,"_network",e),this.emit("network",e,null)):bp.throwArgumentError("invalid network","network",t)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return wp(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||bp.throwError("no network detected",b.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:wr(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return sp((()=>this._ready().then((t=>t),(t=>{if(t.code!==b.errors.NETWORK_ERROR||"noNetwork"!==t.event)throw t}))))}static getFormatter(){return null==Up&&(Up=new vp),Up}static getNetwork(t){return function(t){if(null==t)return null;if("number"==typeof t){for(const e in kd){const r=kd[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=kd[t];return null==e?null:{name:e.name,chainId:e.chainId,ensAddress:e.ensAddress,_defaultProvider:e._defaultProvider||null}}const e=kd[t.name];if(!e)return"number"!=typeof t.chainId&&wd.throwArgumentError("invalid network chainId","network",t),t;0!==t.chainId&&t.chainId!==e.chainId&&wd.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 wp(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}),u=yield op({url:s,errorPassThrough:!0},a,((t,e)=>(t.status=e.statusCode,t)));if(u.data)return u.data;const h=u.message||"unknown error";if(u.status>=400&&u.status<500)return bp.throwError(`response not found during CCIP fetch: ${h}`,b.errors.SERVER_ERROR,{url:e,errorMessage:h});o.push(h)}return bp.throwError(`error encountered during CCIP fetch: ${o.map((t=>JSON.stringify(t))).join(", ")}`,b.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(t){return wp(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(Mp()-r.respTime<=t)return r.blockNumber;break}catch(t){if(this._internalBlockNumber===e)break}}const e=Mp(),r=Er({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=Mp();return(t=Ht.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 wp(this,void 0,void 0,(function*(){const t=Lp++,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)bp.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",bp.makeError("network block skew detected",b.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 wp(this,void 0,void 0,(function*(){return bp.throwError("provider does not support network detection",b.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return wp(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 kp(0),this._network;const r=bp.makeError("underlying network changed",b.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=Mp();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=Mp(),(null==this._fastBlockNumber||t>this._fastBlockNumber)&&(this._fastBlockNumber=t,this._fastBlockNumberPromise=Promise.resolve(t)))}waitForTransaction(t,e,r){return wp(this,void 0,void 0,(function*(){return this._waitForTransaction(t,null==e?1:e,r||0,null)}))}_waitForTransaction(t,e,r,n){return wp(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 u=function(){return!!a||(a=!0,s.forEach((t=>{t()})),!1)},h=t=>{t.confirmations<e||u()||i(t)};if(this.on(t,h),s.push((()=>{this.removeListener(t,h)})),n){let r=n.startBlock,i=null;const h=s=>wp(this,void 0,void 0,(function*(){a||(yield kp(1e3),this.getTransactionCount(n.from).then((l=>wp(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(u())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(bp.makeError("transaction was replaced",b.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:this._wrapTransaction(s),hash:t,receipt:r}))}}i++}}a||this.once("block",h)}}))),(t=>{a||this.once("block",h)})))}));if(a)return;this.once("block",h),s.push((()=>{this.removeListener("block",h)}))}if("number"==typeof r&&r>0){const t=setTimeout((()=>{u()||o(bp.makeError("timeout exceeded",b.errors.TIMEOUT,{timeout:r}))}),r);t.unref&&t.unref(),s.push((()=>{clearTimeout(t)}))}}))}))}getBlockNumber(){return wp(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return wp(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield this.perform("getGasPrice",{});try{return Ht.from(t)}catch(e){return bp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e})}}))}getBalance(t,e){return wp(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Er({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getBalance",r);try{return Ht.from(n)}catch(t){return bp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:t})}}))}getTransactionCount(t,e){return wp(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Er({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getTransactionCount",r);try{return Ht.from(n).toNumber()}catch(t){return bp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:t})}}))}getCode(t,e){return wp(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Er({address:this._getAddress(t),blockTag:this._getBlockTag(e)}),n=yield this.perform("getCode",r);try{return C(n)}catch(t){return bp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:t})}}))}getStorageAt(t,e,r){return wp(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield Er({address:this._getAddress(t),blockTag:this._getBlockTag(r),position:Promise.resolve(e).then((t=>B(t)))}),i=yield this.perform("getStorageAt",n);try{return C(i)}catch(t){return bp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:t})}}))}_wrapTransaction(t,e,r){if(null!=e&&32!==T(e))throw new Error("invalid response - sendTransaction");const n=t;return null!=e&&t.hash!==e&&bp.throwError("Transaction hash mismatch from Provider.sendTransaction.",b.errors.UNKNOWN_ERROR,{expectedHash:t.hash,returnedHash:e}),n.wait=(e,n)=>wp(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&&bp.throwError("transaction failed",b.errors.CALL_EXCEPTION,{transactionHash:t.hash,transaction:t,receipt:o}),o)})),n}sendTransaction(t){return wp(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Promise.resolve(t).then((t=>C(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 wp(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?Ht.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?C(t):null)))})),this.formatter.transactionRequest(yield Er(r))}))}_getFilter(t){return wp(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 Er(e))}))}_call(t,e,r){return wp(this,void 0,void 0,(function*(){r>=10&&bp.throwError("CCIP read exceeded maximum redirections",b.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)&&T(i)%32==4)try{const o=O(i,4),s=O(o,0,32);Ht.from(s).eq(n)||bp.throwError("CCIP Read sender did not match",b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const a=[],u=Ht.from(O(o,32,64)).toNumber(),h=Ht.from(O(o,u,u+32)).toNumber(),l=O(o,u+32);for(let e=0;e<h;e++){const r=Tp(l,32*e);null==r&&bp.throwError("CCIP Read contained corrupt URL string",b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i}),a.push(r)}const c=Op(o,64);Ht.from(O(o,100,128)).isZero()||bp.throwError("CCIP Read callback selector included junk",b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const f=O(o,96,100),d=Op(o,128),p=yield this.ccipReadFetch(t,c,a);null==p&&bp.throwError("CCIP Read disabled or provided no URLs",b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:t,data:i});const m={to:n,data:$([f,Fp([p,d])])};return this._call(m,e,r+1)}catch(t){if(t.code===b.errors.SERVER_ERROR)throw t}try{return C(i)}catch(r){return bp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"call",params:{transaction:t,blockTag:e},result:i,error:r})}}))}call(t,e){return wp(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Er({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 wp(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Er({transaction:this._getTransactionRequest(t)}),r=yield this.perform("estimateGas",e);try{return Ht.from(r)}catch(t){return bp.throwError("bad result from backend",b.errors.SERVER_ERROR,{method:"estimateGas",params:e,result:r,error:t})}}))}_getAddress(t){return wp(this,void 0,void 0,(function*(){"string"!=typeof(t=yield t)&&bp.throwArgumentError("invalid address or ENS name","name",t);const e=yield this.resolveName(t);return null==e&&bp.throwError("ENS name not configured",b.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(t)})`}),e}))}_getBlock(t,e){return wp(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;let r=-128;const n={includeTransactions:!!e};if(I(t,32))n.blockHash=t;else try{n.blockTag=yield this._getBlockTag(t),I(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(e){bp.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",t)}return sp((()=>wp(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 wp(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return sp((()=>wp(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 wp(this,void 0,void 0,(function*(){yield this.getNetwork(),t=yield t;const e={transactionHash:this.formatter.hash(t,!0)};return sp((()=>wp(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 wp(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield Er({filter:this._getFilter(t)}),r=yield this.perform("getLogs",e);return r.forEach((t=>{null==t.removed&&(t.removed=!1)})),vp.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return wp(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(t){return wp(this,void 0,void 0,(function*(){if("number"==typeof(t=yield t)&&t<0){t%1&&bp.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 wp(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 jp(this,r,t);return e===t||(yield n.supportsWildcard())?n:null}e=e.split(".").slice(1).join(".")}}))}_getResolver(t,e){return wp(this,void 0,void 0,(function*(){null==e&&(e="ENS");const r=yield this.getNetwork();r.ensAddress||bp.throwError("network does not support ENS",b.errors.UNSUPPORTED_OPERATION,{operation:e,network:r.name});try{const e=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+$d(t).substring(2)});return this.formatter.callAddress(e)}catch(t){}return null}))}resolveName(t){return wp(this,void 0,void 0,(function*(){t=yield t;try{return Promise.resolve(this.formatter.address(t))}catch(e){if(I(t))throw e}"string"!=typeof t&&bp.throwArgumentError("invalid ENS name","name",t);const e=yield this.getResolver(t);return e?yield e.getAddress():null}))}lookupAddress(t){return wp(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=Tp(yield this.call({to:r,data:"0x691f3431"+$d(e).substring(2)}),0);return(yield this.resolveName(n))!=t?null:n}))}getAvatar(t){return wp(this,void 0,void 0,(function*(){let e=null;if(I(t)){const r=this.formatter.address(t).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;e=new jp(this,n,r);try{const t=yield e.getAvatar();if(t)return t.url}catch(t){if(t.code!==b.errors.CALL_EXCEPTION)throw t}try{const t=Tp(yield this.call({to:n,data:"0x691f3431"+$d(r).substring(2)}),0);e=yield this.getResolver(t)}catch(t){if(t.code!==b.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 bp.throwError(t+" not implemented",b.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 xp(Ap(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=Ap(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=Ap(t);return this._events.filter((t=>t.tag===e)).length}listeners(t){if(null==t)return this._events.map((t=>t.listener));let e=Ap(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=Ap(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=Ap(t);this._events=this._events.filter((t=>t.tag!==r||(e.push(t),!1)))}return e.forEach((t=>{this._stopEvent(t)})),this}}var qp=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const Vp=new b(gp),Gp=["call","estimateGas"];function Hp(t,e){if(null==t)return null;if("string"==typeof t.message&&t.message.match("reverted")){const r=I(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=Hp(t[r],e);if(n)return n}return null}if("string"==typeof t)try{return Hp(JSON.parse(t),e)}catch(t){}return null}function Kp(t,e,r){const n=r.transaction||r.signedTransaction;if("call"===t){const t=Hp(e,!0);if(t)return t.data;Vp.throwError("missing revert data in call exception; Transaction reverted without a reason string",b.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if("estimateGas"===t){let r=Hp(e.body,!1);null==r&&(r=Hp(e,!1)),r&&Vp.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",b.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===b.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)&&Vp.throwError("insufficient funds for intrinsic transaction cost",b.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&Vp.throwError("nonce has already been used",b.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Vp.throwError("replacement fee too low",b.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&Vp.throwError("legacy pre-eip-155 transactions not supported",b.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),Gp.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&Vp.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function Qp(t){return new Promise((function(e){setTimeout(e,t)}))}function Jp(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 Yp(t){return t?t.toLowerCase():t}const Zp={};class Wp extends hi{constructor(t,e,r){if(super(),t!==Zp)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");wr(this,"provider",e),null==r&&(r=0),"string"==typeof r?(wr(this,"_address",this.provider.formatter.address(r)),wr(this,"_index",null)):"number"==typeof r?(wr(this,"_index",r),wr(this,"_address",null)):Vp.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(t){return Vp.throwError("cannot alter JSON-RPC Signer connection",b.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Xp(Zp,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&&Vp.throwError("unknown account #"+this._index,b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(t[this._index]))))}sendUncheckedTransaction(t){t=_r(t);const e=this.getAddress().then((t=>(t&&(t=t.toLowerCase()),t)));if(null==t.gasLimit){const r=_r(t);r.from=e,t.gasLimit=this.provider.estimateGas(r)}return null!=t.to&&(t.to=Promise.resolve(t.to).then((t=>qp(this,void 0,void 0,(function*(){if(null==t)return null;const e=yield this.provider.resolveName(t);return null==e&&Vp.throwArgumentError("provided ENS name resolves to null","tx.to",t),e}))))),Er({tx:Er(t),sender:e}).then((({tx:e,sender:r})=>{null!=e.from?e.from.toLowerCase()!==r&&Vp.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=>Kp("sendTransaction",t,n)))}))}signTransaction(t){return Vp.throwError("signing transactions is unsupported",b.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(t){return qp(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 sp((()=>qp(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 qp(this,void 0,void 0,(function*(){const e="string"==typeof t?kn(t):t,r=yield this.getAddress();return yield this.provider.send("personal_sign",[C(e),r.toLowerCase()])}))}_legacySignMessage(t){return qp(this,void 0,void 0,(function*(){const e="string"==typeof t?kn(t):t,r=yield this.getAddress();return yield this.provider.send("eth_sign",[r.toLowerCase(),C(e)])}))}_signTypedData(t,e,r){return qp(this,void 0,void 0,(function*(){const n=yield Zd.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(Zd.getPayload(n.domain,e,n.value))])}))}unlock(t){return qp(this,void 0,void 0,(function*(){const e=this.provider,r=yield this.getAddress();return e.send("personal_unlockAccount",[r.toLowerCase(),t,null])}))}}class Xp extends Wp{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 tm={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class em extends zp{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=br(this.constructor,"defaultUrl")()),wr(this,"connection","string"==typeof t?Object.freeze({url:t}):Object.freeze(_r(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 qp(this,void 0,void 0,(function*(){yield Qp(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=br(this.constructor,"getNetwork");try{return e(Ht.from(t).toNumber())}catch(e){return Vp.throwError("could not detect network",b.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e})}}return Vp.throwError("could not detect network",b.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(t){return new Wp(Zp,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:Nr(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(t)>=0;if(n&&this._cache[t])return this._cache[t];const i=op(this.connection,JSON.stringify(r),Jp).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",[Yp(e.address),e.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Yp(e.address),e.blockTag]];case"getCode":return["eth_getCode",[Yp(e.address),e.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Yp(e.address),D(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",[br(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0}),e.blockTag]];case"estimateGas":return["eth_estimateGas",[br(this.constructor,"hexlifyTransaction")(e.transaction,{from:!0})]];case"getLogs":return e.filter&&null!=e.filter.address&&(e.filter.address=Yp(e.filter.address)),["eth_getLogs",[e.filter]]}return null}perform(t,e){return qp(this,void 0,void 0,(function*(){if("call"===t||"estimateGas"===t){const t=e.transaction;if(t&&null!=t.type&&Ht.from(t.type).isZero()&&null==t.maxFeePerGas&&null==t.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((e=_r(e)).transaction=_r(t),delete e.transaction.type)}}const r=this.prepareRequest(t,e);null==r&&Vp.throwError(t+" not implemented",b.errors.NOT_IMPLEMENTED,{operation:t});try{return yield this.send(r[0],r[1])}catch(r){return Kp(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 Qp(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=_r(tm);if(e)for(const t in e)e[t]&&(r[t]=!0);!function(t,e){t&&"object"==typeof t||vr.throwArgumentError("invalid object","object",t),Object.keys(t).forEach((r=>{e[r]||vr.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=B(Ht.from(t[e]));"gasLimit"===e&&(e="gas"),n[e]=r})),["from","to","data"].forEach((function(e){null!=t[e]&&(n[e]=C(t[e]))})),t.accessList&&(n.accessList=Vs(t.accessList)),n}}var rm=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const nm=new b(gp);class im extends em{detectNetwork(){const t=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return rm(this,void 0,void 0,(function*(){let e=this.network;return null==e&&(e=yield t.detectNetwork.call(this),e||nm.throwError("no network detected",b.errors.UNKNOWN_ERROR,{}),null==this._network&&(wr(this,"_network",e),this.emit("network",e,null))),e}))}}var om={};function sm(t,e){var r=(void 0===e?{}:e).broviderUrl,n=(void 0===r?"https://rpc.snapshot.org":r)+"/"+t;return om[t]||(om[t]=new im({url:n,timeout:25e3,allowGzip:!0},Number(t))),om[t]}function am(t){return _e(kn(t))}var um=window&&window.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{u(n.next(t))}catch(t){o(t)}}function a(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((n=n.apply(t,e||[])).next())}))};const hm=new b("hash/5.6.1"),lm=new Uint8Array(32);lm.fill(0);const cm=Ht.from(-1),fm=Ht.from(0),dm=Ht.from(1),pm=Ht.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const mm=D(dm.toHexString(),32),gm=D(fm.toHexString(),32),ym={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},vm=["name","version","chainId","verifyingContract","salt"];function wm(t){return function(e){return"string"!=typeof e&&hm.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const bm={name:wm("name"),version:wm("version"),chainId:function(t){try{return Ht.from(t).toString()}catch(t){}return hm.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return $e(t).toLowerCase()}catch(t){}return hm.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=x(t);if(32!==e.length)throw new Error("bad length");return C(e)}catch(t){}return hm.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function Em(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))&&hm.throwArgumentError("invalid numeric width","type",t);const i=pm.mask(r?n-1:n),o=r?i.add(dm).mul(cm):fm;return function(e){const r=Ht.from(e);return(r.lt(o)||r.gt(i))&&hm.throwArgumentError(`value out-of-bounds for ${t}`,"value",e),D(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))&&hm.throwArgumentError("invalid bytes width","type",t),function(e){return x(e).length!==r&&hm.throwArgumentError(`invalid length for ${t}`,"value",e),function(t){const e=x(t),r=e.length%32;return r?$([e,lm.slice(r)]):C(e)}(e)}}}switch(t){case"address":return function(t){return D($e(t),32)};case"bool":return function(t){return t?mm:gm};case"bytes":return function(t){return _e(t)};case"string":return function(t){return am(t)}}return null}function _m(t,e){return`${t}(${e.map((({name:t,type:e})=>e+" "+t)).join(",")})`}class Am{constructor(t){wr(this,"types",Object.freeze(Nr(t))),wr(this,"_encoderCache",{}),wr(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]&&hm.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&&hm.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",t);Em(s)||(r[s]||hm.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?hm.throwArgumentError("missing primary type","types",t):i.length>1&&hm.throwArgumentError(`ambiguous primary types or unused types: ${i.map((t=>JSON.stringify(t))).join(", ")}`,"types",t),wr(this,"primaryType",i[0]),function i(o,s){s[o]&&hm.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]=_m(e,t[e])+r.map((e=>_m(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=Em(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&&hm.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);let i=e.map(r);return this._types[t]&&(i=i.map(_e)),_e($(i))}}const r=this.types[t];if(r){const e=am(this._types[t]);return t=>{const n=r.map((({name:e,type:r})=>{const n=this.getEncoder(r)(t[e]);return this._types[r]?_e(n):n}));return n.unshift(e),$(n)}}return hm.throwArgumentError(`unknown type: ${t}`,"type",t)}encodeType(t){const e=this._types[t];return e||hm.throwArgumentError(`unknown type: ${JSON.stringify(t)}`,"name",t),e}encodeData(t,e){return this.getEncoder(t)(e)}hashStruct(t,e){return _e(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(Em(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&&hm.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)),{}):hm.throwArgumentError(`unknown type: ${t}`,"type",t)}visit(t,e){return this._visit(this.primaryType,t,e)}static from(t){return new Am(t)}static getPrimaryType(t){return Am.from(t).primaryType}static hashStruct(t,e,r){return Am.from(e).hashStruct(t,r)}static hashDomain(t){const e=[];for(const r in t){const n=ym[r];n||hm.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",t),e.push({name:r,type:n})}return e.sort(((t,e)=>vm.indexOf(t.name)-vm.indexOf(e.name))),Am.hashStruct("EIP712Domain",{EIP712Domain:e},t)}static encode(t,e,r){return $(["0x1901",Am.hashDomain(t),Am.from(e).hash(r)])}static hash(t,e,r){return _e(Am.encode(t,e,r))}static resolveNames(t,e,r,n){return um(this,void 0,void 0,(function*(){t=_r(t);const i={};t.verifyingContract&&!I(t.verifyingContract,20)&&(i[t.verifyingContract]="0x");const o=Am.from(e);o.visit(r,((t,e)=>("address"!==t||I(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){Am.hashDomain(t);const n={},i=[];vm.forEach((e=>{const r=t[e];null!=r&&(n[e]=bm[e](r),i.push({name:e,type:ym[e]}))}));const o=Am.from(e),s=_r(e);return s.EIP712Domain?hm.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 C(x(e));if(t.match(/^u?int/))return Ht.from(e).toString();switch(t){case"address":return e.toLowerCase();case"bool":return!!e;case"string":return"string"!=typeof e&&hm.throwArgumentError("invalid string","value",e),e}return hm.throwArgumentError("unsupported type","type",t)}))}}}window&&window.__awaiter;new b("wallet/5.6.2");function Mm(t,e,r,n){return Ls(Am.hash(t,e,r),n)}function km(t,n,i,o){return e(this,void 0,void 0,(function(){var e,s,a,u;return r(this,(function(r){switch(r.label){case 0:s="0x1626ba7e",a="function isValidSignature(bytes32 _hash, bytes memory _signature) public view returns (bytes4 magicValue)",r.label=1;case 1:return r.trys.push([1,3,,4]),[4,rg(o,[a],[t,"isValidSignature",[x(i),n]])];case 2:return e=r.sent(),[3,4];case 3:if((u=r.sent()).message.startsWith("missing revert data in call exception"))return[2,!1];throw u;case 4:return[2,e.toLowerCase()===s.toLowerCase()]}}))}))}function Nm(t,n,i,o){return e(this,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return e="0x20c13b0b","function isValidSignature(bytes _hash, bytes memory _signature) public view returns (bytes4 magicValue)",[4,rg(o,["function isValidSignature(bytes _hash, bytes memory _signature) public view returns (bytes4 magicValue)"],[t,"isValidSignature",[x(i),n]])];case 1:return[2,r.sent().toLowerCase()===e.toLowerCase()]}}))}))}function xm(t,n,i,o,s){return void 0===o&&(o="1"),void 0===s&&(s={}),e(this,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return e=sm(o,s),[4,km(t,n,i,e)];case 1:return r.sent()?[2,!0]:[4,Nm(t,n,i,e)];case 2:return[2,r.sent()]}}))}))}function Sm(t){var e=t.domain,r=t.types,n=t.message;return Vh.hash(e,r,n)}var Pm=["cloudflare-ipfs.com","cf-ipfs.com","ipfs.io","ipfs.fleek.co","gateway.pinata.cloud","dweb.link","ipfs.infura.io"],Im={1:{key:"1",name:"Ethereum",chainId:1,network:"homestead",multicall:"0xeefba1e63905ef1d7acba5a8513c70307c1ce441",ensResolvers:["0x231b0Ee14048e9dCcD1d247744d114a4EB5E8E63","0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41"],ensNameWrapper:"0xD4416b13d2b3a9aBae7AcD5D6C2BbDBE25686401",ensSubgraph:"https://api.thegraph.com/subgraphs/name/ensdomains/ens",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"},5:{key:"5",name:"Goerli testnet",shortName:"Goerli",chainId:5,network:"goerli",testnet:!0,multicall:"0x77dca2c955b15e9de4dbbcf1246b4b85b651e50e",ensResolvers:["0xd7a4F6473f32aC2Af804B3686AE8F1932bC35750","0x4B1488B7a6B320d2D721406204aBc3eeAa9AD329"],ensNameWrapper:"0x114D4603199df73e7D157787f8778E21fCd13066",ensSubgraph:"https://api.thegraph.com/subgraphs/name/ensdomains/ensgoerli",rpc:["https://eth-goerli.alchemyapi.io/v2/v4nqH_J-J3STit45Mm07TxuYexMHQsYZ"],explorer:{url:"https://goerli.etherscan.io",apiUrl:"https://api-goerli.etherscan.io"},start:743550,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"},280:{key:"280",name:"zkSync Era Testnet",shortName:"zkSync testnet",chainId:280,network:"zkSync alpha testnet",testnet:!0,multicall:"0xbDAd32d600915cB70576D3d935d49bFf3C9cB0CF",rpc:["https://testnet.era.zksync.dev"],explorer:{url:"https://goerli.explorer.zksync.io/"},start:9012429,logo:"ipfs://bafkreih6y7ri7h667cwxe5miisxghfheiidtbw2747y75stoxt3gp3a2yy"},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"},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"},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"},59140:{key:"59140",name:"Linea Goerli testnet",shortName:"linea",chainId:59140,network:"testnet",multicall:"0xcA11bde05977b3631167028862bE2a173976CA11",rpc:[],explorer:{url:"https://goerli.lineascan.build/"},start:498623,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"},84531:{key:"84531",name:"Base Goerli Testnet",chainId:84531,network:"Base",testnet:!0,multicall:"0x0012989E982C2c473e36418384Ab707C72f2B782",rpc:["https://goerli.base.org"],explorer:{url:"https://goerli.basescan.org/"},start:1151797,logo:"ipfs://QmaxRoHpxZd8PqccAynherrMznMufG6sdmHZLihkECXmZv"},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},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"},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"}},Rm=function(){function t(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}return t.isValidChoice=function(t,e){return"number"==typeof t&&void 0!==(null==e?void 0:e[t-1])},t.prototype.getValidVotes=function(){var e=this;return this.votes.filter((function(r){return t.isValidChoice(r.choice,e.proposal.choices)}))},t.prototype.getScores=function(){var t=this;return this.proposal.choices.map((function(e,r){var n=t.getValidVotes().filter((function(t){return t.choice===r+1}));return n.reduce((function(t,e){return t+e.balance}),0)}))},t.prototype.getScoresByStrategy=function(){var t=this;return this.proposal.choices.map((function(e,r){var n=t.strategies.map((function(e,n){var i=t.getValidVotes().filter((function(t){return t.choice===r+1}));return i.reduce((function(t,e){return t+e.scores[n]}),0)}));return n}))},t.prototype.getScoresTotal=function(){return this.votes.reduce((function(t,e){return t+e.balance}),0)},t.prototype.getChoiceString=function(){return this.proposal.choices[this.selected-1]},t}(),Cm=function(){function t(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}return t.isValidChoice=function(t,e){return Array.isArray(t)&&t.every((function(t){return void 0!==(null==e?void 0:e[t-1])}))&&t.length===new Set(t).size},t.prototype.getValidVotes=function(){var e=this;return this.votes.filter((function(r){return t.isValidChoice(r.choice,e.proposal.choices)}))},t.prototype.getScores=function(){var t=this;return this.proposal.choices.map((function(e,r){return t.getValidVotes().filter((function(t){return t.choice.includes(r+1)})).reduce((function(t,e){return t+e.balance}),0)}))},t.prototype.getScoresByStrategy=function(){var t=this;return this.proposal.choices.map((function(e,r){return t.strategies.map((function(e,n){return t.getValidVotes().filter((function(t){return t.choice.includes(r+1)})).reduce((function(t,e){return t+e.scores[n]}),0)}))}))},t.prototype.getScoresTotal=function(){return this.votes.reduce((function(t,e){return t+e.balance}),0)},t.prototype.getChoiceString=function(){var t=this;return this.selected?this.proposal.choices.filter((function(e,r){return t.selected.includes(r+1)})).join(", "):""},t}();function Tm(t,e){var r=t/e.reduce((function(t,e){return t+e}),0);return isNaN(r)?0:r}function Om(t,e){return Math.sqrt(t*e)}function $m(t){return t*t}function Bm(t,e){return t.map((function(t){return e*t}))}var Dm=function(){function t(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}return t.isValidChoice=function(t,e){return"object"==typeof t&&!Array.isArray(t)&&null!==t&&Object.keys(t).every((function(t){return void 0!==(null==e?void 0:e[Number(t)-1])}))&&Object.keys(t).length>0&&Object.values(t).every((function(t){return"number"==typeof t&&t>=0}))&&Object.values(t).some((function(t){return"number"==typeof t&&t>0}))},t.prototype.getValidVotes=function(){var e=this;return this.votes.filter((function(r){return t.isValidChoice(r.choice,e.proposal.choices)}))},t.prototype.getScores=function(){var t=this.getValidVotes(),e=this.getValidVotes().reduce((function(t,e){return t+e.balance}),0),r=this.proposal.choices.map((function(e,r){var n=t.map((function(t){return Om(Tm(t.choice[r+1],Object.values(t.choice)),t.balance)})).reduce((function(t,e){return t+e}),0);return $m(n)}));return Bm(r.map((function(t,e){return Tm(r[e],r)})),e)},t.prototype.getScoresByStrategy=function(){var t=this,e=this.getValidVotes(),r=this.getValidVotes().reduce((function(t,e){return t+e.balance}),0),n=this.proposal.choices.map((function(r,n){return t.strategies.map((function(t,r){return e.map((function(t){return Om(Tm(t.choice[n+1],Object.values(t.choice)),t.scores[r])})).reduce((function(t,e){return t+e}),0)}))})).map((function(t){return t.map((function(t){return[$m(t)]}))}));return n.map((function(e,i){return Bm(t.strategies.map((function(t,e){return Tm(n[i][e][0],n.flat(2))})),r)}))},t.prototype.getScoresTotal=function(){return this.votes.reduce((function(t,e){return t+e.balance}),0)},t.prototype.getChoiceString=function(){var t=this;return this.proposal.choices.map((function(e,r){if(t.selected[r+1]){var n=Tm(t.selected[r+1],Object.values(t.selected));return Math.round(1e3*n)/10+"% for "+e}})).filter((function(t){return null!=t})).join(", ")},t}();function Fm(t,e){var r=i(new Set(t.map((function(t){return t[0]})).flat())),o=Object.entries(t.reduce((function(t,e,r,i){var o=n(e,1)[0],s=i[r][1];t[o[0]][0]+=s;var a=i[r][2];return a.length>1?t[o[0]][1]=a.map((function(e,r){return e+t[o[0]][1][r]||e})):t[o[0]][1]=[t[o[0]][1].concat(a).reduce((function(t,e){return t+e}),0)],t}),Object.assign.apply(Object,i([{}],r.map((function(t){var e;return(e={})[t]=[0,[]],e})))))),s=o.map((function(t){return[t[0],t[1][0]]})),a=n(s.reduce((function(t,e){var r=n(t,2),i=r[0],o=r[1],s=n(e,2),a=s[0],u=s[1];return u>o?[a,u]:[i,o]}),["?",-1/0]),2),u=(a[0],a[1]),h=n(s.reduce((function(t,e){var r=n(t,2),i=r[0],o=r[1],s=n(e,2),a=s[0],u=s[1];return u<o?[a,u]:[i,o]}),["?",1/0]),2),l=h[0],c=(h[1],o.sort((function(t,e){return e[1][0]-t[1][0]}))),f=t.map((function(t){return t[1]})).reduce((function(t,e){return t+e}),0);return e.push({round:e.length+1,sortedByHighest:c}),u>f/2||c.length<3?e:Fm(t.map((function(t){return[t[0].filter((function(t){return t!=l})),t[1],t[2]]})).filter((function(t){return t[0].length>0})),e)}function jm(t){var e=Fm(t.map((function(t){return[t.choice,t.balance,t.scores]})),[]);return e[e.length-1].sortedByHighest}var Um=function(){function t(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}return t.isValidChoice=function(t,e){return Array.isArray(t)&&t.every((function(t){return void 0!==(null==e?void 0:e[t-1])}))&&t.length===new Set(t).size&&t.length>0&&t.length===e.length},t.prototype.getValidVotes=function(){var e=this;return this.votes.filter((function(r){return t.isValidChoice(r.choice,e.proposal.choices)}))},t.prototype.getScores=function(){return function(t,e){var r=jm(t);return e.choices.map((function(t,e){return r.filter((function(t){return Number(t[0])===e+1})).reduce((function(t,e){return t+e[1][0]}),0)}))}(this.getValidVotes(),this.proposal)},t.prototype.getScoresByStrategy=function(){var t=this,e=jm(this.getValidVotes());return this.proposal.choices.map((function(r,n){return t.strategies.map((function(t,r){return e.filter((function(t){return Number(t[0])===n+1})).reduce((function(t,e){return t+e[1][1][r]}),0)}))}))},t.prototype.getScoresTotal=function(){return this.votes.reduce((function(t,e){return t+e.balance}),0)},t.prototype.getChoiceString=function(){var t=this;return this.selected.map((function(e){if(t.proposal.choices[e-1])return t.proposal.choices[e-1]})).map((function(t,e){return"("+hg(e+1)+") "+t})).join(", ")},t}();function Lm(t,e,r){var n=r.reduce((function(t,e){return t+e}),0),i=e[t]/n*100;return isNaN(i)?0:i}function zm(t,e,r){return Lm(t+1,e,Object.values(e))/100*r}var qm=function(){function t(t,e,r,n){this.proposal=t,this.votes=e,this.strategies=r,this.selected=n}return t.isValidChoice=function(t,e){return"object"==typeof t&&!Array.isArray(t)&&null!==t&&Object.keys(t).every((function(t){return void 0!==(null==e?void 0:e[Number(t)-1])}))&&Object.keys(t).length>0&&Object.values(t).every((function(t){return"number"==typeof t&&t>=0}))&&Object.values(t).some((function(t){return"number"==typeof t&&t>0}))},t.prototype.getValidVotes=function(){var e=this;return this.votes.filter((function(r){return t.isValidChoice(r.choice,e.proposal.choices)}))},t.prototype.getScores=function(){var t=this,e=this.proposal.choices.map((function(e,r){return t.getValidVotes().map((function(t){return zm(r,t.choice,t.balance)})).reduce((function(t,e){return t+e}),0)})),r=this.getValidVotes().reduce((function(t,e){return t+e.balance}),0);return e.map((function(t,r){return Lm(r,e,e)})).map((function(t){return r/100*t}))},t.prototype.getScoresByStrategy=function(){var t=this,e=this.proposal.choices.map((function(e,r){return t.strategies.map((function(e,n){return t.getValidVotes().map((function(t){return zm(r,t.choice,t.scores[n])})).reduce((function(t,e){return t+e}),0)}))})).map((function(t){return t.map((function(t){return[t]}))})),r=this.getValidVotes().reduce((function(t,e){return t+e.balance}),0);return e.map((function(n,i){return t.strategies.map((function(t,r){return Lm(0,e[i][r],e.flat(2))})).map((function(t){return[r/100*t]})).flat()}))},t.prototype.getScoresTotal=function(){return this.votes.reduce((function(t,e){return t+e.balance}),0)},t.prototype.getChoiceString=function(){var t=this;return this.proposal.choices.map((function(e,r){if(t.selected[r+1])return Math.round(10*Lm(r+1,t.selected,Object.values(t.selected)))/10+"% for "+e})).filter((function(t){return null!=t})).join(", ")},t}(),Vm={"single-choice":Rm,approval:Cm,quadratic:Dm,"ranked-choice":Um,weighted:qm,basic:Rm},Gm={1:"https://subgrapher.snapshot.org/delegation/1",5:"https://subgrapher.snapshot.org/delegation/5",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"},Hm=1e3;function Km(t){var n=t.url,i=t.spaces,o=t.pivot,s=t.snapshot;return e(this,void 0,void 0,(function(){var t;return r(this,(function(e){switch(e.label){case 0:return t={delegations:{__args:{where:{space_in:i,timestamp_gte:o},first:Hm,skip:0,orderBy:"timestamp",orderDirection:"asc"},delegator:!0,space:!0,delegate:!0,timestamp:!0}},"latest"!==s&&(t.delegations.__args.block={number:s}),[4,ig(n,t)];case 1:return[2,e.sent().delegations||[]]}}))}))}var Qm=["function text(bytes32 node, string calldata key) external view returns (string memory)"],Jm={Accept:"application/json","Content-Type":"application/json"},Ym="https://score.snapshot.org";function Zm(e,r){void 0===e&&(e=Ym),void 0===r&&(r={path:""});var n=new URL(e);r.path&&(n.pathname=r.path);var i=n.searchParams.get("apiKey"),o=t({},Jm);return i&&(n.searchParams.delete("apiKey"),o=t(t({},Jm),{"X-API-KEY":i})),{url:n.toString(),headers:o}}function Wm(t){return e(this,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return[4,t.text()];case 1:e=r.sent();try{e=JSON.parse(e)}catch(r){return[2,Promise.reject({code:t.status||500,message:"Failed to parse response from score API",data:e})]}return e.error?[2,Promise.reject(e.error)]:[2,e]}}))}))}var Xm=new gf({allErrors:!0,allowUnionTypes:!0,$data:!0,passContext:!0});bf(Xm),_f(Xm),Xm.addFormat("address",{validate:function(t){try{return Be(t)}catch(t){return!1}}}),Xm.addFormat("evmOrStarknetAddress",{validate:function(t){try{return Be(t)||/^0x[0-9a-fA-F]{62,64}$/.test(t)}catch(t){return!1}}}),Xm.addFormat("long",{validate:function(){return!0}}),Xm.addFormat("ethValue",{validate:function(t){if(!t.match(/^([0-9]|[1-9][0-9]+)(\.[0-9]+)?$/))return!1;try{return function(t,e){if("string"!=typeof t&&tu.throwArgumentError("value must be a string","value",t),"string"==typeof e){const t=eu.indexOf(e);-1!==t&&(e=3*t)}Ja(t,null!=e?e:18)}(t,18),!0}catch(t){return!1}}});var tg=Object.keys(Im),eg=Object.keys(Im).filter((function(t){return!Im[t].testnet}));function rg(t,n,o,s){return e(this,void 0,void 0,(function(){var e,a,u;return r(this,(function(r){switch(r.label){case 0:e=new ha(o[0],n,t),r.label=1;case 1:return r.trys.push([1,3,,4]),a=o[2]||[],[4,e[o[1]].apply(e,i(a,[s||{}]))];case 2:return[2,r.sent()];case 3:return u=r.sent(),[2,Promise.reject(u)];case 4:return[2]}}))}))}function ng(t,i,o,s,a){return e(this,void 0,void 0,(function(){var e,u,h,l,c,f,d,p;return r(this,(function(r){switch(r.label){case 0:e=["function aggregate(tuple(address target, bytes callData)[] calls) view returns (uint256 blockNumber, bytes[] returnData)"],u=(null==a?void 0:a.multicallAddress)||Im[t].multicall,h=new ha(u,e,i),l=new ti(o),r.label=1;case 1:return r.trys.push([1,3,,4]),c=(null==a?void 0:a.limit)||500,(null==a?void 0:a.limit)&&delete a.limit,f=Math.ceil(s.length/c),d=[],Array.from(Array(f)).forEach((function(t,e){var r=s.slice(c*e,c*(e+1));d.push(h.aggregate(r.map((function(t){return[t[0].toLowerCase(),l.encodeFunctionData(t[1],t[2])]})),a||{}))})),[4,Promise.all(d)];case 2:return[2,r.sent().reduce((function(t,e){var r=n(e,2)[1];return t.concat(r)}),[]).map((function(t,e){return l.decodeFunctionResult(s[e][1],t)}))];case 3:return p=r.sent(),[2,Promise.reject(p)];case 4:return[2]}}))}))}function ig(n,i,o){return void 0===o&&(o={}),e(this,void 0,void 0,(function(){var e,s;return r(this,(function(r){switch(r.label){case 0:return[4,l(n,{method:"POST",headers:t({Accept:"application/json","Content-Type":"application/json"},null==o?void 0:o.headers),body:JSON.stringify({query:Yh.jsonToGraphQLQuery({query:i})})})];case 1:return[4,(e=r.sent()).text()];case 2:s=r.sent();try{s=JSON.parse(s)}catch(t){throw new Error("Errors found in subgraphRequest: URL: "+n+", Status: "+e.status+", Response: "+s.substring(0,400))}if(s.errors)throw new Error("Errors found in subgraphRequest: URL: "+n+", Status: "+e.status+", Response: "+JSON.stringify(s.errors).substring(0,400));return[2,s.data||{}]}}))}))}function og(t,e){void 0===e&&(e=Pm[0]);var r="https://"+e;if(!t)return null;if(!(t.startsWith("ipfs://")||t.startsWith("ipns://")||t.startsWith("https://")||t.startsWith("http://")))return r+"/ipfs/"+t;var n=t.split("://")[0];return"ipfs"===n?t.replace("ipfs://",r+"/ipfs/"):"ipns"===n?t.replace("ipns://",r+"/ipns/"):t}function sg(t,n,i,o){return void 0===i&&(i="1"),void 0===o&&(o={}),e(this,void 0,void 0,(function(){var e,s,a,u,h,l;return r(this,(function(r){switch(r.label){case 0:return e=o.ensResolvers,s=o.broviderUrl,a=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]])}return r}(o,["ensResolvers","broviderUrl"]),u=e||Im[i].ensResolvers||Im[1].ensResolvers,h=gh(mh(t)),l=sm(i,{broviderUrl:s}),[4,ng(i,l,Qm,u.map((function(t){return[t,"text",[h,n]]})),a)];case 1:return[2,r.sent().flat().find((function(t){return t}))||""]}}))}))}function ag(t,n,i){return void 0===n&&(n="1"),void 0===i&&(i={}),e(this,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,sg(t,"snapshot",n,i)];case 1:return[2,r.sent()];case 2:return e=r.sent(),console.log(e),[2,null];case 3:return[2]}}))}))}function ug(t,n,i){return void 0===n&&(n="1"),void 0===i&&(i={}),e(this,void 0,void 0,(function(){var e,o,s,a,u;return r(this,(function(r){switch(r.label){case 0:return"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",e=sm(n,i),o=new ha("0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",["function owner(bytes32) view returns (address)"],e),s=i.ensNameWrapper||Im[n].ensNameWrapper,a=gh(mh(t)),[4,o.owner(a)];case 1:return(u=r.sent())!==s?[3,3]:[4,new ha(s,["function ownerOf(uint256) view returns (address)"],e).ownerOf(a)];case 2:u=r.sent(),r.label=3;case 3:return[2,u]}}))}))}function hg(t){var e=["th","st","nd","rd"],r=t%100;return t+(e[(r-20)%10]||e[r]||e[0])}function lg(t){return!!Im[t]}function cg(t){return Be(t)&&"0x0000000000000000000000000000000000000000"!==t}function fg(t,e){return"latest"===t||"number"==typeof t&&t>=Im[e].start}function dg(t){return Promise.reject(new Error(t))}Xm.addKeyword({keyword:"snapshotNetwork",validate:function(t,e){return"mainnet"===(this.snapshotEnv||"default")?eg.includes(e):tg.includes(e)},error:{message:"network not allowed"}}),Xm.addKeyword({keyword:"maxLengthWithSpaceType",validate:function t(e,r){var 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}),Xm.addKeyword({keyword:"maxItemsWithSpaceType",validate:function t(e,r){var 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}),Xm.addFormat("customUrl",{type:"string",validate:function(t){return!t.length||(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("ipfs://")||t.startsWith("ipns://")||t.startsWith("snapshot://"))}});var pg={call:rg,multicall:ng,subgraphRequest:ig,ipfsGet:function(t,n,i){return void 0===i&&(i="ipfs"),e(this,void 0,void 0,(function(){return r(this,(function(e){return[2,l("https://"+t+"/"+i+"/"+n).then((function(t){return t.json()}))]}))}))},getUrl:og,getJSON:function(t,n){return void 0===n&&(n={}),e(this,void 0,void 0,(function(){var e;return r(this,(function(r){return e=og(t,n.gateways),[2,l(e).then((function(t){return t.json()}))]}))}))},sendTransaction:function(t,n,o,s,a,u){return void 0===u&&(u={}),e(this,void 0,void 0,(function(){var e,h,l;return r(this,(function(r){switch(r.label){case 0:return e=t.getSigner(),h=new ha(n,o,t),[4,(l=h.connect(e))[s].apply(l,i(a,[u]))];case 1:return[2,r.sent()]}}))}))},getScores:function(t,n,i,o,s,a,u){return void 0===s&&(s="latest"),void 0===a&&(a=Ym),void 0===u&&(u={}),e(this,void 0,void 0,(function(){var e,h,c,f,d,p,m,g;return r(this,(function(r){switch(r.label){case 0:if(!Array.isArray(o))return[2,dg("addresses should be an array of addresses")];if(0===o.length)return[2,dg("addresses can not be empty")];if(e=o.find((function(t){return!cg(t)})))return[2,dg("Invalid address: "+e)];if(!lg(i))return[2,dg("Invalid network: "+i)];if(h=n.find((function(t){return t.network&&!lg(t.network)})))return[2,dg("Invalid network ("+h.network+") in strategy "+h.name)];if(!fg(s,i))return[2,dg("Snapshot ("+s+") must be 'latest' or greater than network start block ("+Im[i].start+")")];new URL(a).pathname="/api/scores",c=Zm(a,{path:"/api/scores"}),f=c.url,d=c.headers,r.label=1;case 1:return r.trys.push([1,4,,5]),p={space:t,network:i,snapshot:s,strategies:n,addresses:o},[4,l(f,{method:"POST",headers:d,body:JSON.stringify({params:p})})];case 2:return[4,Wm(r.sent())];case 3:return m=r.sent(),[2,"all"===u.returnValue?m.result:m.result[u.returnValue||"scores"]];case 4:return(g=r.sent()).errno?[2,Promise.reject({code:g.errno,message:g.toString(),data:""})]:[2,Promise.reject(g)];case 5:return[2]}}))}))},getVp:function(t,n,i,o,s,a,u){return e(this,void 0,void 0,(function(){var e,h,c,f,d,p;return r(this,(function(r){switch(r.label){case 0:if(e=Zm(null==u?void 0:u.url),h=e.url,c=e.headers,!cg(t))return[2,dg("Invalid voter address: "+t)];if(!lg(n))return[2,dg("Invalid network: "+n)];if(f=i.find((function(t){return t.network&&!lg(t.network)})))return[2,dg("Invalid network ("+f.network+") in strategy "+f.name)];if(!fg(o,n))return[2,dg("Snapshot ("+o+") must be 'latest' or greater than network start block ("+Im[n].start+")")];d={method:"POST",headers:c,body:JSON.stringify({jsonrpc:"2.0",method:"get_vp",params:{address:t,network:n,strategies:i,snapshot:o,space:s,delegation:a}})},r.label=1;case 1:return r.trys.push([1,4,,5]),[4,l(h,d)];case 2:return[4,Wm(r.sent())];case 3:return[2,r.sent().result];case 4:return(p=r.sent()).errno?[2,Promise.reject({code:p.errno,message:p.toString(),data:""})]:[2,Promise.reject(p)];case 5:return[2]}}))}))},validateSchema:function(t,e,r){void 0===r&&(r={snapshotEnv:"default",spaceType:"default"});var n=Xm.compile(t),i=n.call(r,e);return i||n.errors},getEnsTextRecord:sg,getSpaceUri:ag,getEnsOwner:ug,getSpaceController:function(t,n,i){return void 0===n&&(n="1"),void 0===i&&(i={}),e(this,void 0,void 0,(function(){var e,o,s,a;return r(this,(function(r){switch(r.label){case 0:return[4,ag(t,n,i)];case 1:if(e=r.sent()){if(Be(e))return[2,e];if(o=e.split("/"),s=o.includes("testnet")?5:4,a=o[s],Be(a))return[2,a]}return[4,ug(t,n,i)];case 2:return[2,r.sent()]}}))}))},getDelegatesBySpace:function(t,n,o,s){return void 0===o&&(o="latest"),void 0===s&&(s={}),e(this,void 0,void 0,(function(){var e,a,u,h,l;return r(this,(function(r){switch(r.label){case 0:if(!(e=s.subgraphUrl||Gm[t]))return[2,Promise.reject("Delegation subgraph not available for network "+t)];a=0,u=new Map,h=function(t){var e=["",t];t.includes(".eth")&&e.push(t.replace(".eth",""));return e}(n),r.label=1;case 1:return[4,Km({url:e,spaces:h,pivot:a,snapshot:o})];case 2:if(l=r.sent(),(c=l).length===Hm&&c[0].timestamp===c[c.length-1].timestamp)throw new Error("Unable to paginate delegation");return l.forEach((function(t){!function(t,e){var r=function(t){return t.delegator+"-"+t.delegate+"-"+t.space}(e);t.has(r)||t.set(r,e)}(u,t),a=t.timestamp})),l.length<Hm?[3,3]:[3,1];case 3:return[2,i(u.values())]}var c}))}))},clone:function(t){return JSON.parse(JSON.stringify(t))},sleep:function(t){return e(this,void 0,void 0,(function(){return r(this,(function(e){return[2,new Promise((function(e){setTimeout(e,t)}))]}))}))},getNumberWithOrdinal:hg,voting:Vm,getProvider:sm,signMessage:function(t,n,i){return e(this,void 0,void 0,(function(){return r(this,(function(e){switch(e.label){case 0:return n=C(new Buffer(n,"utf8")),[4,t.send("personal_sign",[n,i])];case 1:return[2,e.sent()]}}))}))},getBlockNumber:function(t){return e(this,void 0,void 0,(function(){var e;return r(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t.getBlockNumber()];case 1:return e=r.sent(),[2,parseInt(e)];case 2:return r.sent(),[2,Promise.reject()];case 3:return[2]}}))}))},Multicaller:gd,getSnapshots:function(t,n,i,o,s){return void 0===s&&(s={}),e(this,void 0,void 0,(function(){var e,a,u,h,l,c,f;return r(this,(function(r){switch(r.label){case 0:return e={},o.forEach((function(t){return e[t]="latest"})),"latest"===n?[2,e]:(a=t+"-"+n+"-"+o.join("-"),u=yd[a],h=Date.now(),u&&vd>h?[2,u]:(vd<h&&(yd={},vd=h+36e5-h%36e5),e[t]=n,l=Object.keys(e).filter((function(e){return t!==e})),0===l.length?[2,e]:[4,i.getBlock(n)]));case 1:return c=r.sent(),f={blocks:{__args:{where:{ts:c.timestamp,network_in:l}},network:!0,number:!0}},[4,ig(s.blockFinderUrl||"https://blockfinder.snapshot.org",f)];case 2:return r.sent().blocks.forEach((function(t){return e[t.network]=t.number})),yd[a]=e,[2,e]}}))}))},getHash:Sm,verify:function(t,n,i,o,s){return void 0===o&&(o="1"),void 0===s&&(s={}),e(this,void 0,void 0,(function(){var e,a,u,h,l;return r(this,(function(r){switch(r.label){case 0:e=i.domain,a=i.types,u=i.message,h=Sm(i);try{if(l=Mm(e,a,u,n),t===l)return[2,!0]}catch(t){}return[4,xm(t,n,h,o,s)];case 1:return[2,r.sent()]}}))}))},validate:function(t,n,i,o,s,a,u){return e(this,void 0,void 0,(function(){var e,h,c,f,d;return r(this,(function(r){switch(r.label){case 0:if(!cg(n))return[2,dg("Invalid author: "+n)];if(!lg(o))return[2,dg("Invalid network: "+o)];if(!fg(s,o))return[2,dg("Snapshot ("+s+") must be 'latest' or greater than network start block ("+Im[o].start+")")];u||(u={}),e=Zm(u.url),h=e.url,c=e.headers,f={method:"POST",headers:c,body:JSON.stringify({jsonrpc:"2.0",method:"validate",params:{validation:t,author:n,space:i,network:o,snapshot:s,params:a}})},r.label=1;case 1:return r.trys.push([1,4,,5]),[4,l(h,f)];case 2:return[4,Wm(r.sent())];case 3:return[2,r.sent().result];case 4:return(d=r.sent()).errno?[2,Promise.reject({code:d.errno,message:d.toString(),data:""})]:[2,Promise.reject(d)];case 5:return[2]}}))}))},SNAPSHOT_SUBGRAPH_URL:Gm};return{Client:ur,Client712:ur,schemas:gr,utils:pg}}));
|