@magic-ext/siwe 1.0.0-canary.951.18760547078.0
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/LICENSE +176 -0
- package/README.md +51 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/es/index.js +2 -0
- package/dist/es/index.js.map +7 -0
- package/dist/es/index.mjs +2 -0
- package/dist/es/index.mjs.map +7 -0
- package/dist/extension.js +546 -0
- package/dist/types/index.cdn.d.ts +2 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.native.d.ts +1 -0
- package/dist/types/types.d.ts +17 -0
- package/package.json +41 -0
|
@@ -0,0 +1,546 @@
|
|
|
1
|
+
"use strict";var MagicSiweExtension=(()=>{var b4=Object.create;var bc=Object.defineProperty;var x4=Object.getOwnPropertyDescriptor;var m4=Object.getOwnPropertyNames;var y4=Object.getPrototypeOf,w4=Object.prototype.hasOwnProperty;var Pb=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var A4=(r,e)=>()=>(r&&(e=r(r=0)),e);var P=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),uf=(r,e)=>{for(var t in e)bc(r,t,{get:e[t],enumerable:!0})},vb=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of m4(e))!w4.call(r,s)&&s!==t&&bc(r,s,{get:()=>e[s],enumerable:!(n=x4(e,s))||n.enumerable});return r};var _b=(r,e,t)=>(t=r!=null?b4(y4(r)):{},vb(e||!r||!r.__esModule?bc(t,"default",{value:r,enumerable:!0}):t,r)),kb=r=>vb(bc({},"__esModule",{value:!0}),r);var Bb=P((CS,Tb)=>{"use strict";Tb.exports=Magic});var Ob=P(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.grammar=void 0;function E4(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"sign-in-with-ethereum",lower:"sign-in-with-ethereum",index:0,isBkr:!1},this.rules[1]={name:"ex-title",lower:"ex-title",index:1,isBkr:!1},this.rules[2]={name:"nb-title",lower:"nb-title",index:2,isBkr:!1},this.rules[3]={name:"ri-title",lower:"ri-title",index:3,isBkr:!1},this.rules[4]={name:"re-title",lower:"re-title",index:4,isBkr:!1},this.rules[5]={name:"oscheme",lower:"oscheme",index:5,isBkr:!1},this.rules[6]={name:"domain",lower:"domain",index:6,isBkr:!1},this.rules[7]={name:"address",lower:"address",index:7,isBkr:!1},this.rules[8]={name:"statement",lower:"statement",index:8,isBkr:!1},this.rules[9]={name:"empty-statement",lower:"empty-statement",index:9,isBkr:!1},this.rules[10]={name:"version",lower:"version",index:10,isBkr:!1},this.rules[11]={name:"nonce",lower:"nonce",index:11,isBkr:!1},this.rules[12]={name:"issued-at",lower:"issued-at",index:12,isBkr:!1},this.rules[13]={name:"expiration-time",lower:"expiration-time",index:13,isBkr:!1},this.rules[14]={name:"not-before",lower:"not-before",index:14,isBkr:!1},this.rules[15]={name:"request-id",lower:"request-id",index:15,isBkr:!1},this.rules[16]={name:"chain-id",lower:"chain-id",index:16,isBkr:!1},this.rules[17]={name:"resources",lower:"resources",index:17,isBkr:!1},this.rules[18]={name:"resource",lower:"resource",index:18,isBkr:!1},this.rules[19]={name:"URI",lower:"uri",index:19,isBkr:!1},this.rules[20]={name:"hier-part",lower:"hier-part",index:20,isBkr:!1},this.rules[21]={name:"scheme",lower:"scheme",index:21,isBkr:!1},this.rules[22]={name:"authority",lower:"authority",index:22,isBkr:!1},this.rules[23]={name:"path-abempty",lower:"path-abempty",index:23,isBkr:!1},this.rules[24]={name:"path-absolute",lower:"path-absolute",index:24,isBkr:!1},this.rules[25]={name:"path-rootless",lower:"path-rootless",index:25,isBkr:!1},this.rules[26]={name:"path-empty",lower:"path-empty",index:26,isBkr:!1},this.rules[27]={name:"userinfo-at",lower:"userinfo-at",index:27,isBkr:!1},this.rules[28]={name:"userinfo",lower:"userinfo",index:28,isBkr:!1},this.rules[29]={name:"host",lower:"host",index:29,isBkr:!1},this.rules[30]={name:"IP-literal",lower:"ip-literal",index:30,isBkr:!1},this.rules[31]={name:"IPvFuture",lower:"ipvfuture",index:31,isBkr:!1},this.rules[32]={name:"IPv6address",lower:"ipv6address",index:32,isBkr:!1},this.rules[33]={name:"nodcolon",lower:"nodcolon",index:33,isBkr:!1},this.rules[34]={name:"dcolon",lower:"dcolon",index:34,isBkr:!1},this.rules[35]={name:"h16",lower:"h16",index:35,isBkr:!1},this.rules[36]={name:"h16c",lower:"h16c",index:36,isBkr:!1},this.rules[37]={name:"h16n",lower:"h16n",index:37,isBkr:!1},this.rules[38]={name:"h16cn",lower:"h16cn",index:38,isBkr:!1},this.rules[39]={name:"IPv4address",lower:"ipv4address",index:39,isBkr:!1},this.rules[40]={name:"dec-octet",lower:"dec-octet",index:40,isBkr:!1},this.rules[41]={name:"dec-digit",lower:"dec-digit",index:41,isBkr:!1},this.rules[42]={name:"reg-name",lower:"reg-name",index:42,isBkr:!1},this.rules[43]={name:"reg-name-char",lower:"reg-name-char",index:43,isBkr:!1},this.rules[44]={name:"port",lower:"port",index:44,isBkr:!1},this.rules[45]={name:"query",lower:"query",index:45,isBkr:!1},this.rules[46]={name:"fragment",lower:"fragment",index:46,isBkr:!1},this.rules[47]={name:"URI-r",lower:"uri-r",index:47,isBkr:!1},this.rules[48]={name:"hier-part-r",lower:"hier-part-r",index:48,isBkr:!1},this.rules[49]={name:"scheme-r",lower:"scheme-r",index:49,isBkr:!1},this.rules[50]={name:"query-r",lower:"query-r",index:50,isBkr:!1},this.rules[51]={name:"fragment-r",lower:"fragment-r",index:51,isBkr:!1},this.rules[52]={name:"authority-d",lower:"authority-d",index:52,isBkr:!1},this.rules[53]={name:"userinfo-d",lower:"userinfo-d",index:53,isBkr:!1},this.rules[54]={name:"host-d",lower:"host-d",index:54,isBkr:!1},this.rules[55]={name:"port-d",lower:"port-d",index:55,isBkr:!1},this.rules[56]={name:"path-abempty-r",lower:"path-abempty-r",index:56,isBkr:!1},this.rules[57]={name:"path-absolute-r",lower:"path-absolute-r",index:57,isBkr:!1},this.rules[58]={name:"path-rootless-r",lower:"path-rootless-r",index:58,isBkr:!1},this.rules[59]={name:"path-empty-r",lower:"path-empty-r",index:59,isBkr:!1},this.rules[60]={name:"segment",lower:"segment",index:60,isBkr:!1},this.rules[61]={name:"segment-nz",lower:"segment-nz",index:61,isBkr:!1},this.rules[62]={name:"pchar",lower:"pchar",index:62,isBkr:!1},this.rules[63]={name:"pct-encoded",lower:"pct-encoded",index:63,isBkr:!1},this.rules[64]={name:"date-fullyear",lower:"date-fullyear",index:64,isBkr:!1},this.rules[65]={name:"date-month",lower:"date-month",index:65,isBkr:!1},this.rules[66]={name:"date-mday",lower:"date-mday",index:66,isBkr:!1},this.rules[67]={name:"time-hour",lower:"time-hour",index:67,isBkr:!1},this.rules[68]={name:"time-minute",lower:"time-minute",index:68,isBkr:!1},this.rules[69]={name:"time-second",lower:"time-second",index:69,isBkr:!1},this.rules[70]={name:"time-secfrac",lower:"time-secfrac",index:70,isBkr:!1},this.rules[71]={name:"time-numoffset",lower:"time-numoffset",index:71,isBkr:!1},this.rules[72]={name:"time-offset",lower:"time-offset",index:72,isBkr:!1},this.rules[73]={name:"partial-time",lower:"partial-time",index:73,isBkr:!1},this.rules[74]={name:"full-date",lower:"full-date",index:74,isBkr:!1},this.rules[75]={name:"full-time",lower:"full-time",index:75,isBkr:!1},this.rules[76]={name:"date-time",lower:"date-time",index:76,isBkr:!1},this.rules[77]={name:"ALPHA",lower:"alpha",index:77,isBkr:!1},this.rules[78]={name:"LF",lower:"lf",index:78,isBkr:!1},this.rules[79]={name:"DIGIT",lower:"digit",index:79,isBkr:!1},this.rules[80]={name:"HEXDIG",lower:"hexdig",index:80,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:2,children:[1,2,3,4,5,6,7,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,36,41,46]},this.rules[0].opcodes[1]={type:4,index:5},this.rules[0].opcodes[2]={type:4,index:6},this.rules[0].opcodes[3]={type:6,string:[32,119,97,110,116,115,32,121,111,117,32,116,111,32,115,105,103,110,32,105,110,32,119,105,116,104,32,121,111,117,114,32,69,116,104,101,114,101,117,109,32,97,99,99,111,117,110,116,58]},this.rules[0].opcodes[4]={type:4,index:78},this.rules[0].opcodes[5]={type:4,index:7},this.rules[0].opcodes[6]={type:4,index:78},this.rules[0].opcodes[7]={type:1,children:[8,13,14]},this.rules[0].opcodes[8]={type:2,children:[9,10,11,12]},this.rules[0].opcodes[9]={type:4,index:78},this.rules[0].opcodes[10]={type:4,index:8},this.rules[0].opcodes[11]={type:4,index:78},this.rules[0].opcodes[12]={type:4,index:78},this.rules[0].opcodes[13]={type:4,index:9},this.rules[0].opcodes[14]={type:2,children:[15,16]},this.rules[0].opcodes[15]={type:4,index:78},this.rules[0].opcodes[16]={type:4,index:78},this.rules[0].opcodes[17]={type:6,string:[85,82,73,58,32]},this.rules[0].opcodes[18]={type:4,index:19},this.rules[0].opcodes[19]={type:4,index:78},this.rules[0].opcodes[20]={type:6,string:[86,101,114,115,105,111,110,58,32]},this.rules[0].opcodes[21]={type:4,index:10},this.rules[0].opcodes[22]={type:4,index:78},this.rules[0].opcodes[23]={type:6,string:[67,104,97,105,110,32,73,68,58,32]},this.rules[0].opcodes[24]={type:4,index:16},this.rules[0].opcodes[25]={type:4,index:78},this.rules[0].opcodes[26]={type:6,string:[78,111,110,99,101,58,32]},this.rules[0].opcodes[27]={type:4,index:11},this.rules[0].opcodes[28]={type:4,index:78},this.rules[0].opcodes[29]={type:6,string:[73,115,115,117,101,100,32,65,116,58,32]},this.rules[0].opcodes[30]={type:4,index:12},this.rules[0].opcodes[31]={type:3,min:0,max:1},this.rules[0].opcodes[32]={type:2,children:[33,34,35]},this.rules[0].opcodes[33]={type:4,index:78},this.rules[0].opcodes[34]={type:4,index:1},this.rules[0].opcodes[35]={type:4,index:13},this.rules[0].opcodes[36]={type:3,min:0,max:1},this.rules[0].opcodes[37]={type:2,children:[38,39,40]},this.rules[0].opcodes[38]={type:4,index:78},this.rules[0].opcodes[39]={type:4,index:2},this.rules[0].opcodes[40]={type:4,index:14},this.rules[0].opcodes[41]={type:3,min:0,max:1},this.rules[0].opcodes[42]={type:2,children:[43,44,45]},this.rules[0].opcodes[43]={type:4,index:78},this.rules[0].opcodes[44]={type:4,index:3},this.rules[0].opcodes[45]={type:4,index:15},this.rules[0].opcodes[46]={type:3,min:0,max:1},this.rules[0].opcodes[47]={type:2,children:[48,49,50]},this.rules[0].opcodes[48]={type:4,index:78},this.rules[0].opcodes[49]={type:4,index:4},this.rules[0].opcodes[50]={type:4,index:17},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:6,string:[69,120,112,105,114,97,116,105,111,110,32,84,105,109,101,58,32]},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:6,string:[78,111,116,32,66,101,102,111,114,101,58,32]},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:6,string:[82,101,113,117,101,115,116,32,73,68,58,32]},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:6,string:[82,101,115,111,117,114,99,101,115,58]},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:3,min:0,max:1},this.rules[5].opcodes[1]={type:2,children:[2,3,9]},this.rules[5].opcodes[2]={type:4,index:77},this.rules[5].opcodes[3]={type:3,min:0,max:1/0},this.rules[5].opcodes[4]={type:1,children:[5,6,7,8]},this.rules[5].opcodes[5]={type:4,index:77},this.rules[5].opcodes[6]={type:4,index:79},this.rules[5].opcodes[7]={type:6,string:[43]},this.rules[5].opcodes[8]={type:5,min:45,max:46},this.rules[5].opcodes[9]={type:7,string:[58,47,47]},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:4,index:52},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:2,children:[1,2]},this.rules[7].opcodes[1]={type:7,string:[48,120]},this.rules[7].opcodes[2]={type:3,min:40,max:40},this.rules[7].opcodes[3]={type:4,index:80},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:3,min:1,max:1/0},this.rules[8].opcodes[1]={type:1,children:[2,3,4,5,6,7,8,9,10,11,12,13]},this.rules[8].opcodes[2]={type:5,min:97,max:122},this.rules[8].opcodes[3]={type:5,min:65,max:90},this.rules[8].opcodes[4]={type:5,min:48,max:57},this.rules[8].opcodes[5]={type:5,min:32,max:33},this.rules[8].opcodes[6]={type:5,min:35,max:36},this.rules[8].opcodes[7]={type:5,min:38,max:59},this.rules[8].opcodes[8]={type:6,string:[61]},this.rules[8].opcodes[9]={type:5,min:63,max:64},this.rules[8].opcodes[10]={type:6,string:[91]},this.rules[8].opcodes[11]={type:6,string:[93]},this.rules[8].opcodes[12]={type:6,string:[95]},this.rules[8].opcodes[13]={type:6,string:[126]},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:2,children:[1,2,3]},this.rules[9].opcodes[1]={type:4,index:78},this.rules[9].opcodes[2]={type:4,index:78},this.rules[9].opcodes[3]={type:4,index:78},this.rules[10].opcodes=[],this.rules[10].opcodes[0]={type:7,string:[49]},this.rules[11].opcodes=[],this.rules[11].opcodes[0]={type:3,min:8,max:1/0},this.rules[11].opcodes[1]={type:1,children:[2,3]},this.rules[11].opcodes[2]={type:4,index:77},this.rules[11].opcodes[3]={type:4,index:79},this.rules[12].opcodes=[],this.rules[12].opcodes[0]={type:4,index:76},this.rules[13].opcodes=[],this.rules[13].opcodes[0]={type:4,index:76},this.rules[14].opcodes=[],this.rules[14].opcodes[0]={type:4,index:76},this.rules[15].opcodes=[],this.rules[15].opcodes[0]={type:3,min:0,max:1/0},this.rules[15].opcodes[1]={type:4,index:62},this.rules[16].opcodes=[],this.rules[16].opcodes[0]={type:3,min:1,max:1/0},this.rules[16].opcodes[1]={type:4,index:79},this.rules[17].opcodes=[],this.rules[17].opcodes[0]={type:3,min:0,max:1/0},this.rules[17].opcodes[1]={type:2,children:[2,3]},this.rules[17].opcodes[2]={type:4,index:78},this.rules[17].opcodes[3]={type:4,index:18},this.rules[18].opcodes=[],this.rules[18].opcodes[0]={type:2,children:[1,2]},this.rules[18].opcodes[1]={type:7,string:[45,32]},this.rules[18].opcodes[2]={type:4,index:47},this.rules[19].opcodes=[],this.rules[19].opcodes[0]={type:2,children:[1,2,3,4,8]},this.rules[19].opcodes[1]={type:4,index:21},this.rules[19].opcodes[2]={type:7,string:[58]},this.rules[19].opcodes[3]={type:4,index:20},this.rules[19].opcodes[4]={type:3,min:0,max:1},this.rules[19].opcodes[5]={type:2,children:[6,7]},this.rules[19].opcodes[6]={type:7,string:[63]},this.rules[19].opcodes[7]={type:4,index:45},this.rules[19].opcodes[8]={type:3,min:0,max:1},this.rules[19].opcodes[9]={type:2,children:[10,11]},this.rules[19].opcodes[10]={type:7,string:[35]},this.rules[19].opcodes[11]={type:4,index:46},this.rules[20].opcodes=[],this.rules[20].opcodes[0]={type:1,children:[1,5,6,7]},this.rules[20].opcodes[1]={type:2,children:[2,3,4]},this.rules[20].opcodes[2]={type:7,string:[47,47]},this.rules[20].opcodes[3]={type:4,index:22},this.rules[20].opcodes[4]={type:4,index:23},this.rules[20].opcodes[5]={type:4,index:24},this.rules[20].opcodes[6]={type:4,index:25},this.rules[20].opcodes[7]={type:4,index:26},this.rules[21].opcodes=[],this.rules[21].opcodes[0]={type:2,children:[1,2]},this.rules[21].opcodes[1]={type:4,index:77},this.rules[21].opcodes[2]={type:3,min:0,max:1/0},this.rules[21].opcodes[3]={type:1,children:[4,5,6,7]},this.rules[21].opcodes[4]={type:4,index:77},this.rules[21].opcodes[5]={type:4,index:79},this.rules[21].opcodes[6]={type:6,string:[43]},this.rules[21].opcodes[7]={type:5,min:45,max:46},this.rules[22].opcodes=[],this.rules[22].opcodes[0]={type:2,children:[1,3,4]},this.rules[22].opcodes[1]={type:3,min:0,max:1},this.rules[22].opcodes[2]={type:4,index:27},this.rules[22].opcodes[3]={type:4,index:29},this.rules[22].opcodes[4]={type:3,min:0,max:1},this.rules[22].opcodes[5]={type:2,children:[6,7]},this.rules[22].opcodes[6]={type:7,string:[58]},this.rules[22].opcodes[7]={type:4,index:44},this.rules[23].opcodes=[],this.rules[23].opcodes[0]={type:3,min:0,max:1/0},this.rules[23].opcodes[1]={type:2,children:[2,3]},this.rules[23].opcodes[2]={type:7,string:[47]},this.rules[23].opcodes[3]={type:4,index:60},this.rules[24].opcodes=[],this.rules[24].opcodes[0]={type:2,children:[1,2]},this.rules[24].opcodes[1]={type:7,string:[47]},this.rules[24].opcodes[2]={type:3,min:0,max:1},this.rules[24].opcodes[3]={type:2,children:[4,5]},this.rules[24].opcodes[4]={type:4,index:61},this.rules[24].opcodes[5]={type:3,min:0,max:1/0},this.rules[24].opcodes[6]={type:2,children:[7,8]},this.rules[24].opcodes[7]={type:7,string:[47]},this.rules[24].opcodes[8]={type:4,index:60},this.rules[25].opcodes=[],this.rules[25].opcodes[0]={type:2,children:[1,2]},this.rules[25].opcodes[1]={type:4,index:61},this.rules[25].opcodes[2]={type:3,min:0,max:1/0},this.rules[25].opcodes[3]={type:2,children:[4,5]},this.rules[25].opcodes[4]={type:7,string:[47]},this.rules[25].opcodes[5]={type:4,index:60},this.rules[26].opcodes=[],this.rules[26].opcodes[0]={type:7,string:[]},this.rules[27].opcodes=[],this.rules[27].opcodes[0]={type:2,children:[1,2]},this.rules[27].opcodes[1]={type:4,index:28},this.rules[27].opcodes[2]={type:6,string:[64]},this.rules[28].opcodes=[],this.rules[28].opcodes[0]={type:3,min:0,max:1/0},this.rules[28].opcodes[1]={type:1,children:[2,3,4,5,6,7,8,9,10,11,12]},this.rules[28].opcodes[2]={type:5,min:97,max:122},this.rules[28].opcodes[3]={type:5,min:65,max:90},this.rules[28].opcodes[4]={type:5,min:48,max:57},this.rules[28].opcodes[5]={type:4,index:63},this.rules[28].opcodes[6]={type:6,string:[33]},this.rules[28].opcodes[7]={type:6,string:[36]},this.rules[28].opcodes[8]={type:5,min:38,max:46},this.rules[28].opcodes[9]={type:5,min:58,max:59},this.rules[28].opcodes[10]={type:6,string:[61]},this.rules[28].opcodes[11]={type:6,string:[95]},this.rules[28].opcodes[12]={type:6,string:[126]},this.rules[29].opcodes=[],this.rules[29].opcodes[0]={type:1,children:[1,2,6]},this.rules[29].opcodes[1]={type:4,index:30},this.rules[29].opcodes[2]={type:2,children:[3,4]},this.rules[29].opcodes[3]={type:4,index:39},this.rules[29].opcodes[4]={type:13},this.rules[29].opcodes[5]={type:4,index:43},this.rules[29].opcodes[6]={type:4,index:42},this.rules[30].opcodes=[],this.rules[30].opcodes[0]={type:2,children:[1,2,5]},this.rules[30].opcodes[1]={type:7,string:[91]},this.rules[30].opcodes[2]={type:1,children:[3,4]},this.rules[30].opcodes[3]={type:4,index:32},this.rules[30].opcodes[4]={type:4,index:31},this.rules[30].opcodes[5]={type:7,string:[93]},this.rules[31].opcodes=[],this.rules[31].opcodes[0]={type:2,children:[1,2,4,5]},this.rules[31].opcodes[1]={type:7,string:[118]},this.rules[31].opcodes[2]={type:3,min:1,max:1/0},this.rules[31].opcodes[3]={type:4,index:80},this.rules[31].opcodes[4]={type:7,string:[46]},this.rules[31].opcodes[5]={type:3,min:1,max:1/0},this.rules[31].opcodes[6]={type:1,children:[7,8,9,10,11,12,13,14,15,16]},this.rules[31].opcodes[7]={type:5,min:97,max:122},this.rules[31].opcodes[8]={type:5,min:65,max:90},this.rules[31].opcodes[9]={type:5,min:48,max:57},this.rules[31].opcodes[10]={type:6,string:[33]},this.rules[31].opcodes[11]={type:6,string:[36]},this.rules[31].opcodes[12]={type:5,min:38,max:46},this.rules[31].opcodes[13]={type:5,min:58,max:59},this.rules[31].opcodes[14]={type:6,string:[61]},this.rules[31].opcodes[15]={type:6,string:[95]},this.rules[31].opcodes[16]={type:6,string:[126]},this.rules[32].opcodes=[],this.rules[32].opcodes[0]={type:1,children:[1,2]},this.rules[32].opcodes[1]={type:4,index:33},this.rules[32].opcodes[2]={type:4,index:34},this.rules[33].opcodes=[],this.rules[33].opcodes[0]={type:2,children:[1,5]},this.rules[33].opcodes[1]={type:2,children:[2,3]},this.rules[33].opcodes[2]={type:4,index:37},this.rules[33].opcodes[3]={type:3,min:0,max:1/0},this.rules[33].opcodes[4]={type:4,index:38},this.rules[33].opcodes[5]={type:3,min:0,max:1},this.rules[33].opcodes[6]={type:2,children:[7,8]},this.rules[33].opcodes[7]={type:6,string:[58]},this.rules[33].opcodes[8]={type:4,index:39},this.rules[34].opcodes=[],this.rules[34].opcodes[0]={type:2,children:[1,6,7]},this.rules[34].opcodes[1]={type:3,min:0,max:1},this.rules[34].opcodes[2]={type:2,children:[3,4]},this.rules[34].opcodes[3]={type:4,index:35},this.rules[34].opcodes[4]={type:3,min:0,max:1/0},this.rules[34].opcodes[5]={type:4,index:36},this.rules[34].opcodes[6]={type:6,string:[58,58]},this.rules[34].opcodes[7]={type:1,children:[8,17]},this.rules[34].opcodes[8]={type:2,children:[9,13]},this.rules[34].opcodes[9]={type:2,children:[10,11]},this.rules[34].opcodes[10]={type:4,index:37},this.rules[34].opcodes[11]={type:3,min:0,max:1/0},this.rules[34].opcodes[12]={type:4,index:38},this.rules[34].opcodes[13]={type:3,min:0,max:1},this.rules[34].opcodes[14]={type:2,children:[15,16]},this.rules[34].opcodes[15]={type:6,string:[58]},this.rules[34].opcodes[16]={type:4,index:39},this.rules[34].opcodes[17]={type:3,min:0,max:1},this.rules[34].opcodes[18]={type:4,index:39},this.rules[35].opcodes=[],this.rules[35].opcodes[0]={type:3,min:1,max:4},this.rules[35].opcodes[1]={type:4,index:80},this.rules[36].opcodes=[],this.rules[36].opcodes[0]={type:2,children:[1,2]},this.rules[36].opcodes[1]={type:6,string:[58]},this.rules[36].opcodes[2]={type:3,min:1,max:4},this.rules[36].opcodes[3]={type:4,index:80},this.rules[37].opcodes=[],this.rules[37].opcodes[0]={type:2,children:[1,3]},this.rules[37].opcodes[1]={type:3,min:1,max:4},this.rules[37].opcodes[2]={type:4,index:80},this.rules[37].opcodes[3]={type:13},this.rules[37].opcodes[4]={type:6,string:[46]},this.rules[38].opcodes=[],this.rules[38].opcodes[0]={type:2,children:[1,2,4]},this.rules[38].opcodes[1]={type:6,string:[58]},this.rules[38].opcodes[2]={type:3,min:1,max:4},this.rules[38].opcodes[3]={type:4,index:80},this.rules[38].opcodes[4]={type:13},this.rules[38].opcodes[5]={type:6,string:[46]},this.rules[39].opcodes=[],this.rules[39].opcodes[0]={type:2,children:[1,2,3,4,5,6,7]},this.rules[39].opcodes[1]={type:4,index:40},this.rules[39].opcodes[2]={type:7,string:[46]},this.rules[39].opcodes[3]={type:4,index:40},this.rules[39].opcodes[4]={type:7,string:[46]},this.rules[39].opcodes[5]={type:4,index:40},this.rules[39].opcodes[6]={type:7,string:[46]},this.rules[39].opcodes[7]={type:4,index:40},this.rules[40].opcodes=[],this.rules[40].opcodes[0]={type:3,min:0,max:3},this.rules[40].opcodes[1]={type:4,index:41},this.rules[41].opcodes=[],this.rules[41].opcodes[0]={type:5,min:48,max:57},this.rules[42].opcodes=[],this.rules[42].opcodes[0]={type:3,min:0,max:1/0},this.rules[42].opcodes[1]={type:4,index:43},this.rules[43].opcodes=[],this.rules[43].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8,9,10,11]},this.rules[43].opcodes[1]={type:5,min:97,max:122},this.rules[43].opcodes[2]={type:5,min:65,max:90},this.rules[43].opcodes[3]={type:5,min:48,max:57},this.rules[43].opcodes[4]={type:4,index:63},this.rules[43].opcodes[5]={type:6,string:[33]},this.rules[43].opcodes[6]={type:6,string:[36]},this.rules[43].opcodes[7]={type:5,min:38,max:46},this.rules[43].opcodes[8]={type:6,string:[59]},this.rules[43].opcodes[9]={type:6,string:[61]},this.rules[43].opcodes[10]={type:6,string:[95]},this.rules[43].opcodes[11]={type:6,string:[126]},this.rules[44].opcodes=[],this.rules[44].opcodes[0]={type:3,min:0,max:1/0},this.rules[44].opcodes[1]={type:4,index:79},this.rules[45].opcodes=[],this.rules[45].opcodes[0]={type:3,min:0,max:1/0},this.rules[45].opcodes[1]={type:1,children:[2,3,4]},this.rules[45].opcodes[2]={type:4,index:62},this.rules[45].opcodes[3]={type:6,string:[47]},this.rules[45].opcodes[4]={type:6,string:[63]},this.rules[46].opcodes=[],this.rules[46].opcodes[0]={type:3,min:0,max:1/0},this.rules[46].opcodes[1]={type:1,children:[2,3,4]},this.rules[46].opcodes[2]={type:4,index:62},this.rules[46].opcodes[3]={type:6,string:[47]},this.rules[46].opcodes[4]={type:6,string:[63]},this.rules[47].opcodes=[],this.rules[47].opcodes[0]={type:2,children:[1,2,3,4,8]},this.rules[47].opcodes[1]={type:4,index:49},this.rules[47].opcodes[2]={type:7,string:[58]},this.rules[47].opcodes[3]={type:4,index:48},this.rules[47].opcodes[4]={type:3,min:0,max:1},this.rules[47].opcodes[5]={type:2,children:[6,7]},this.rules[47].opcodes[6]={type:7,string:[63]},this.rules[47].opcodes[7]={type:4,index:50},this.rules[47].opcodes[8]={type:3,min:0,max:1},this.rules[47].opcodes[9]={type:2,children:[10,11]},this.rules[47].opcodes[10]={type:7,string:[35]},this.rules[47].opcodes[11]={type:4,index:51},this.rules[48].opcodes=[],this.rules[48].opcodes[0]={type:1,children:[1,5,6,7]},this.rules[48].opcodes[1]={type:2,children:[2,3,4]},this.rules[48].opcodes[2]={type:7,string:[47,47]},this.rules[48].opcodes[3]={type:4,index:52},this.rules[48].opcodes[4]={type:4,index:56},this.rules[48].opcodes[5]={type:4,index:57},this.rules[48].opcodes[6]={type:4,index:58},this.rules[48].opcodes[7]={type:4,index:59},this.rules[49].opcodes=[],this.rules[49].opcodes[0]={type:2,children:[1,2]},this.rules[49].opcodes[1]={type:4,index:77},this.rules[49].opcodes[2]={type:3,min:0,max:1/0},this.rules[49].opcodes[3]={type:1,children:[4,5,6,7]},this.rules[49].opcodes[4]={type:4,index:77},this.rules[49].opcodes[5]={type:4,index:79},this.rules[49].opcodes[6]={type:6,string:[43]},this.rules[49].opcodes[7]={type:5,min:45,max:46},this.rules[50].opcodes=[],this.rules[50].opcodes[0]={type:3,min:0,max:1/0},this.rules[50].opcodes[1]={type:1,children:[2,3,4]},this.rules[50].opcodes[2]={type:4,index:62},this.rules[50].opcodes[3]={type:6,string:[47]},this.rules[50].opcodes[4]={type:6,string:[63]},this.rules[51].opcodes=[],this.rules[51].opcodes[0]={type:3,min:0,max:1/0},this.rules[51].opcodes[1]={type:1,children:[2,3,4]},this.rules[51].opcodes[2]={type:4,index:62},this.rules[51].opcodes[3]={type:6,string:[47]},this.rules[51].opcodes[4]={type:6,string:[63]},this.rules[52].opcodes=[],this.rules[52].opcodes[0]={type:2,children:[1,5,6]},this.rules[52].opcodes[1]={type:3,min:0,max:1},this.rules[52].opcodes[2]={type:2,children:[3,4]},this.rules[52].opcodes[3]={type:4,index:53},this.rules[52].opcodes[4]={type:6,string:[64]},this.rules[52].opcodes[5]={type:4,index:54},this.rules[52].opcodes[6]={type:3,min:0,max:1},this.rules[52].opcodes[7]={type:2,children:[8,9]},this.rules[52].opcodes[8]={type:7,string:[58]},this.rules[52].opcodes[9]={type:4,index:55},this.rules[53].opcodes=[],this.rules[53].opcodes[0]={type:3,min:0,max:1/0},this.rules[53].opcodes[1]={type:1,children:[2,3,4,5,6,7,8,9,10,11,12]},this.rules[53].opcodes[2]={type:5,min:97,max:122},this.rules[53].opcodes[3]={type:5,min:65,max:90},this.rules[53].opcodes[4]={type:5,min:48,max:57},this.rules[53].opcodes[5]={type:4,index:63},this.rules[53].opcodes[6]={type:6,string:[33]},this.rules[53].opcodes[7]={type:6,string:[36]},this.rules[53].opcodes[8]={type:5,min:38,max:46},this.rules[53].opcodes[9]={type:5,min:58,max:59},this.rules[53].opcodes[10]={type:6,string:[61]},this.rules[53].opcodes[11]={type:6,string:[95]},this.rules[53].opcodes[12]={type:6,string:[126]},this.rules[54].opcodes=[],this.rules[54].opcodes[0]={type:1,children:[1,2,6]},this.rules[54].opcodes[1]={type:4,index:30},this.rules[54].opcodes[2]={type:2,children:[3,4]},this.rules[54].opcodes[3]={type:4,index:39},this.rules[54].opcodes[4]={type:13},this.rules[54].opcodes[5]={type:4,index:43},this.rules[54].opcodes[6]={type:4,index:42},this.rules[55].opcodes=[],this.rules[55].opcodes[0]={type:3,min:0,max:1/0},this.rules[55].opcodes[1]={type:4,index:79},this.rules[56].opcodes=[],this.rules[56].opcodes[0]={type:3,min:0,max:1/0},this.rules[56].opcodes[1]={type:2,children:[2,3]},this.rules[56].opcodes[2]={type:7,string:[47]},this.rules[56].opcodes[3]={type:4,index:60},this.rules[57].opcodes=[],this.rules[57].opcodes[0]={type:2,children:[1,2]},this.rules[57].opcodes[1]={type:7,string:[47]},this.rules[57].opcodes[2]={type:3,min:0,max:1},this.rules[57].opcodes[3]={type:2,children:[4,5]},this.rules[57].opcodes[4]={type:4,index:61},this.rules[57].opcodes[5]={type:3,min:0,max:1/0},this.rules[57].opcodes[6]={type:2,children:[7,8]},this.rules[57].opcodes[7]={type:7,string:[47]},this.rules[57].opcodes[8]={type:4,index:60},this.rules[58].opcodes=[],this.rules[58].opcodes[0]={type:2,children:[1,2]},this.rules[58].opcodes[1]={type:4,index:61},this.rules[58].opcodes[2]={type:3,min:0,max:1/0},this.rules[58].opcodes[3]={type:2,children:[4,5]},this.rules[58].opcodes[4]={type:7,string:[47]},this.rules[58].opcodes[5]={type:4,index:60},this.rules[59].opcodes=[],this.rules[59].opcodes[0]={type:7,string:[]},this.rules[60].opcodes=[],this.rules[60].opcodes[0]={type:3,min:0,max:1/0},this.rules[60].opcodes[1]={type:4,index:62},this.rules[61].opcodes=[],this.rules[61].opcodes[0]={type:3,min:1,max:1/0},this.rules[61].opcodes[1]={type:4,index:62},this.rules[62].opcodes=[],this.rules[62].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8,9,10,11,12]},this.rules[62].opcodes[1]={type:5,min:97,max:122},this.rules[62].opcodes[2]={type:5,min:65,max:90},this.rules[62].opcodes[3]={type:5,min:48,max:57},this.rules[62].opcodes[4]={type:4,index:63},this.rules[62].opcodes[5]={type:6,string:[33]},this.rules[62].opcodes[6]={type:6,string:[36]},this.rules[62].opcodes[7]={type:5,min:38,max:46},this.rules[62].opcodes[8]={type:5,min:58,max:59},this.rules[62].opcodes[9]={type:6,string:[61]},this.rules[62].opcodes[10]={type:6,string:[64]},this.rules[62].opcodes[11]={type:6,string:[95]},this.rules[62].opcodes[12]={type:6,string:[126]},this.rules[63].opcodes=[],this.rules[63].opcodes[0]={type:2,children:[1,2,3]},this.rules[63].opcodes[1]={type:6,string:[37]},this.rules[63].opcodes[2]={type:4,index:80},this.rules[63].opcodes[3]={type:4,index:80},this.rules[64].opcodes=[],this.rules[64].opcodes[0]={type:3,min:4,max:4},this.rules[64].opcodes[1]={type:4,index:79},this.rules[65].opcodes=[],this.rules[65].opcodes[0]={type:3,min:2,max:2},this.rules[65].opcodes[1]={type:4,index:79},this.rules[66].opcodes=[],this.rules[66].opcodes[0]={type:3,min:2,max:2},this.rules[66].opcodes[1]={type:4,index:79},this.rules[67].opcodes=[],this.rules[67].opcodes[0]={type:3,min:2,max:2},this.rules[67].opcodes[1]={type:4,index:79},this.rules[68].opcodes=[],this.rules[68].opcodes[0]={type:3,min:2,max:2},this.rules[68].opcodes[1]={type:4,index:79},this.rules[69].opcodes=[],this.rules[69].opcodes[0]={type:3,min:2,max:2},this.rules[69].opcodes[1]={type:4,index:79},this.rules[70].opcodes=[],this.rules[70].opcodes[0]={type:2,children:[1,2]},this.rules[70].opcodes[1]={type:7,string:[46]},this.rules[70].opcodes[2]={type:3,min:1,max:1/0},this.rules[70].opcodes[3]={type:4,index:79},this.rules[71].opcodes=[],this.rules[71].opcodes[0]={type:2,children:[1,4,5,6]},this.rules[71].opcodes[1]={type:1,children:[2,3]},this.rules[71].opcodes[2]={type:7,string:[43]},this.rules[71].opcodes[3]={type:7,string:[45]},this.rules[71].opcodes[4]={type:4,index:67},this.rules[71].opcodes[5]={type:7,string:[58]},this.rules[71].opcodes[6]={type:4,index:68},this.rules[72].opcodes=[],this.rules[72].opcodes[0]={type:1,children:[1,2]},this.rules[72].opcodes[1]={type:7,string:[122]},this.rules[72].opcodes[2]={type:4,index:71},this.rules[73].opcodes=[],this.rules[73].opcodes[0]={type:2,children:[1,2,3,4,5,6]},this.rules[73].opcodes[1]={type:4,index:67},this.rules[73].opcodes[2]={type:7,string:[58]},this.rules[73].opcodes[3]={type:4,index:68},this.rules[73].opcodes[4]={type:7,string:[58]},this.rules[73].opcodes[5]={type:4,index:69},this.rules[73].opcodes[6]={type:3,min:0,max:1},this.rules[73].opcodes[7]={type:4,index:70},this.rules[74].opcodes=[],this.rules[74].opcodes[0]={type:2,children:[1,2,3,4,5]},this.rules[74].opcodes[1]={type:4,index:64},this.rules[74].opcodes[2]={type:7,string:[45]},this.rules[74].opcodes[3]={type:4,index:65},this.rules[74].opcodes[4]={type:7,string:[45]},this.rules[74].opcodes[5]={type:4,index:66},this.rules[75].opcodes=[],this.rules[75].opcodes[0]={type:2,children:[1,2]},this.rules[75].opcodes[1]={type:4,index:73},this.rules[75].opcodes[2]={type:4,index:72},this.rules[76].opcodes=[],this.rules[76].opcodes[0]={type:2,children:[1,2,3]},this.rules[76].opcodes[1]={type:4,index:74},this.rules[76].opcodes[2]={type:7,string:[116]},this.rules[76].opcodes[3]={type:4,index:75},this.rules[77].opcodes=[],this.rules[77].opcodes[0]={type:1,children:[1,2]},this.rules[77].opcodes[1]={type:5,min:65,max:90},this.rules[77].opcodes[2]={type:5,min:97,max:122},this.rules[78].opcodes=[],this.rules[78].opcodes[0]={type:6,string:[10]},this.rules[79].opcodes=[],this.rules[79].opcodes[0]={type:5,min:48,max:57},this.rules[80].opcodes=[],this.rules[80].opcodes[0]={type:1,children:[1,2,3]},this.rules[80].opcodes[1]={type:5,min:48,max:57},this.rules[80].opcodes[2]={type:5,min:65,max:70},this.rules[80].opcodes[3]={type:5,min:97,max:102},this.toString=function(){let e="";return e+=`; LDT 05/06/2024
|
|
2
|
+
`,e+=`; modified in several significant ways
|
|
3
|
+
`,e+=`; 1) Literal strings are replaced with numbers and ranges (%d32 & %d32-126, etc.) when possible.
|
|
4
|
+
`,e+=`; TRB and especially TRG operators are much more efficient than TLS operators.
|
|
5
|
+
`,e+=`; 2) Two rules, authority and URI, are used multiple times in different contexts. These rules will be reproduced and renamed
|
|
6
|
+
`,e+=`; in order to a) recognize the context and b) remove unneccary callback functions for certain contexts.
|
|
7
|
+
`,e+=`; This will simiplify recognizing contexts AND remove unneccesary callbacks
|
|
8
|
+
`,e+=`; 2.a) domain is defined as authority-d which is identical to authority except that there will be no
|
|
9
|
+
`,e+=`; callback functions defined on authority-d or any of its *-d components.
|
|
10
|
+
`,e+=`; 2.b) The resource URI is defined as URI-r and its components defined as *-r.
|
|
11
|
+
`,e+=`; In this way, callback functions can be defined on URI and is components while
|
|
12
|
+
`,e+=`; leaving URI-r to be parsed identically with no unnecessary callback functions to slow it down.
|
|
13
|
+
`,e+=`; 3) IPv6address does not work because of APG's "first-success disambiguation" and "greedy" repetitions.
|
|
14
|
+
`,e+=`; IPv6address redefined and validations moved to callback functions (semantic vs syntactic validation)
|
|
15
|
+
`,e+=`; Redefinition requires negative look-ahead operators, https://en.wikipedia.org/wiki/Syntactic_predicate
|
|
16
|
+
`,e+=`; That is SABNF instead of simple ABNF.
|
|
17
|
+
`,e+=`; 4) IPv4address fails because of "first-success disambiguation".
|
|
18
|
+
`,e+=`; This could be fixed with rearrangement of the alternative terms. However, it would still not
|
|
19
|
+
`,e+=`; accept zero-padded (leading zeros) decimal octets.
|
|
20
|
+
`,e+=`; Therefore, IPv4address is also done with callback functions and semantic validation.
|
|
21
|
+
`,e+=`; 5) The negative look-ahead operator is also needed in the definition of host to
|
|
22
|
+
`,e+=`; prevent failure with a reg-name that begins with an IPv4 address.
|
|
23
|
+
`,e+=`; 6) NOTE: host = 1.1.1.256 is a valid host name even though it is an invalid IPv4address.
|
|
24
|
+
`,e+=`; The IPv4address alternative fails but the reg-name alternative succeeds.
|
|
25
|
+
`,e+=`; 7) The Ethereum spec (https://eips.ethereum.org/EIPS/eip-4361) message format ABNF
|
|
26
|
+
`,e+=`; allows for empty statements. Because of the "first success disambiguation" of APG
|
|
27
|
+
`,e+=`; the an explicit "empty-statement" rule is required to match the spec's intent.
|
|
28
|
+
`,e+=`
|
|
29
|
+
`,e+=`
|
|
30
|
+
`,e+=`sign-in-with-ethereum =
|
|
31
|
+
`,e+=` oscheme domain %s" wants you to sign in with your Ethereum account:" LF
|
|
32
|
+
`,e+=` address LF
|
|
33
|
+
`,e+=` ((LF statement LF LF) / empty-statement / (LF LF))
|
|
34
|
+
`,e+=` %s"URI: " URI LF
|
|
35
|
+
`,e+=` %s"Version: " version LF
|
|
36
|
+
`,e+=` %s"Chain ID: " chain-id LF
|
|
37
|
+
`,e+=` %s"Nonce: " nonce LF
|
|
38
|
+
`,e+=` %s"Issued At: " issued-at
|
|
39
|
+
`,e+=` [ LF ex-title expiration-time ]
|
|
40
|
+
`,e+=` [ LF nb-title not-before ]
|
|
41
|
+
`,e+=` [ LF ri-title request-id ]
|
|
42
|
+
`,e+=` [ LF re-title resources ]
|
|
43
|
+
`,e+=`ex-title = %s"Expiration Time: "
|
|
44
|
+
`,e+=`nb-title = %s"Not Before: "
|
|
45
|
+
`,e+=`ri-title = %s"Request ID: "
|
|
46
|
+
`,e+=`re-title = %s"Resources:"
|
|
47
|
+
`,e+=`oscheme = [ ALPHA *( ALPHA / DIGIT / %d43 / %d45-46 ) "://" ]
|
|
48
|
+
`,e+=`domain = authority-d
|
|
49
|
+
`,e+=`address = "0x" 40*40HEXDIG
|
|
50
|
+
`,e+=` ; Must also conform to captilization
|
|
51
|
+
`,e+=` ; checksum encoding specified in EIP-55
|
|
52
|
+
`,e+=` ; where applicable (EOAs).
|
|
53
|
+
`,e+=`
|
|
54
|
+
`,e+=`statement = 1*( %d97-122 / %d65-90 / %d48-57 / %d32-33 / %d35-36 / %d38-59 / %d61 / %d63-64 / %d91 / %d93 / %d95 / %d126)
|
|
55
|
+
`,e+=` ; The purpose is to exclude LF (line breaks).
|
|
56
|
+
`,e+=` ; LDT 10/04/2023: Do you mean %d32-126? All printing characters
|
|
57
|
+
`,e+=`empty-statement = LF LF LF
|
|
58
|
+
`,e+=`version = "1"
|
|
59
|
+
`,e+=`nonce = 8*( ALPHA / DIGIT )
|
|
60
|
+
`,e+=`issued-at = date-time
|
|
61
|
+
`,e+=`expiration-time = date-time
|
|
62
|
+
`,e+=`not-before = date-time
|
|
63
|
+
`,e+=`request-id = *pchar
|
|
64
|
+
`,e+=`chain-id = 1*DIGIT
|
|
65
|
+
`,e+=` ; See EIP-155 for valid CHAIN_IDs.
|
|
66
|
+
`,e+=`resources = *( LF resource )
|
|
67
|
+
`,e+=`resource = "- " URI-r
|
|
68
|
+
`,e+=`
|
|
69
|
+
`,e+=`; ------------------------------------------------------------------------------
|
|
70
|
+
`,e+=`; RFC 3986
|
|
71
|
+
`,e+=`
|
|
72
|
+
`,e+=`URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
|
|
73
|
+
`,e+=`hier-part = "//" authority path-abempty
|
|
74
|
+
`,e+=` / path-absolute
|
|
75
|
+
`,e+=` / path-rootless
|
|
76
|
+
`,e+=` / path-empty
|
|
77
|
+
`,e+=`scheme = ALPHA *( ALPHA / DIGIT / %d43 / %d45-46 )
|
|
78
|
+
`,e+=`authority = [ userinfo-at ] host [ ":" port ]
|
|
79
|
+
`,e+=`path-abempty = *( "/" segment )
|
|
80
|
+
`,e+=`path-absolute = "/" [ segment-nz *( "/" segment ) ]
|
|
81
|
+
`,e+=`path-rootless = segment-nz *( "/" segment )
|
|
82
|
+
`,e+=`path-empty = ""
|
|
83
|
+
`,e+=`userinfo-at = userinfo %d64
|
|
84
|
+
`,e+=` ; userinfo redefined to include the "@" so that it will fail without it
|
|
85
|
+
`,e+=` ; otherwise userinfo can match host and then the parser will backtrack
|
|
86
|
+
`,e+=` ; incorrectly keeping the captured userinfo phrase
|
|
87
|
+
`,e+=`userinfo = *(%d97-122 / %d65-90 / %d48-57 / pct-encoded / %d33 / %d36 / %d38-46 / %d58-59 / %d61 / %d95 / %d126)
|
|
88
|
+
`,e+=`host = IP-literal / (IPv4address !reg-name-char) / reg-name
|
|
89
|
+
`,e+=` ; negative look-ahead required to prevent IPv4address from being recognized as first part of reg-name
|
|
90
|
+
`,e+=` ; same fix as https://github.com/garycourt/uri-js/issues/4
|
|
91
|
+
`,e+=`IP-literal = "[" ( IPv6address / IPvFuture ) "]"
|
|
92
|
+
`,e+=`IPvFuture = "v" 1*HEXDIG "." 1*( %d97-122 / %d65-90 / %d48-57 / %d33 / %d36 /%d38-46 / %d58-59 /%d61 /%d95 / %d126 )
|
|
93
|
+
`,e+=`IPv6address = nodcolon / dcolon
|
|
94
|
+
`,e+=`nodcolon = (h16n *h16cn) [%d58 IPv4address]
|
|
95
|
+
`,e+=`dcolon = [h16 *h16c] %d58.58 (((h16n *h16cn) [%d58 IPv4address]) / [IPv4address])
|
|
96
|
+
`,e+=`h16 = 1*4HEXDIG
|
|
97
|
+
`,e+=`h16c = %d58 1*4HEXDIG
|
|
98
|
+
`,e+=`h16n = 1*4HEXDIG !%d46
|
|
99
|
+
`,e+=`h16cn = %d58 1*4HEXDIG !%d46
|
|
100
|
+
`,e+=`IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet
|
|
101
|
+
`,e+=`; Here we will will use callback functions to evaluate and validate the (possibly zero-padded) dec-octet.
|
|
102
|
+
`,e+=`dec-octet = *3dec-digit
|
|
103
|
+
`,e+=`dec-digit = %d48-57
|
|
104
|
+
`,e+=`reg-name = *reg-name-char
|
|
105
|
+
`,e+=`reg-name-char = %d97-122 / %d65-90 / %d48-57 / pct-encoded / %d33 / %d36 / %d38-46 / %d59 / %d61 /%d95 / %d126
|
|
106
|
+
`,e+=`port = *DIGIT
|
|
107
|
+
`,e+=`query = *(pchar / %d47 / %d63)
|
|
108
|
+
`,e+=`fragment = *(pchar / %d47 / %d63)
|
|
109
|
+
`,e+=`
|
|
110
|
+
`,e+=`; URI-r is a redefiniton of URI but without the callback functions attached to it
|
|
111
|
+
`,e+=`; it reuses athority-d from domain
|
|
112
|
+
`,e+=`URI-r = scheme-r ":" hier-part-r [ "?" query-r ] [ "#" fragment-r ]
|
|
113
|
+
`,e+=`hier-part-r = "//" authority-d path-abempty-r
|
|
114
|
+
`,e+=` / path-absolute-r
|
|
115
|
+
`,e+=` / path-rootless-r
|
|
116
|
+
`,e+=` / path-empty-r
|
|
117
|
+
`,e+=`scheme-r = ALPHA *( ALPHA / DIGIT / %d43 / %d45-46 )
|
|
118
|
+
`,e+=`query-r = *(pchar / %d47 / %d63)
|
|
119
|
+
`,e+=`fragment-r = *(pchar / %d47 / %d63)
|
|
120
|
+
`,e+=`
|
|
121
|
+
`,e+=`; authority-d is a redefinition of authority for capturing the domian phrase
|
|
122
|
+
`,e+=`; but without callback functions
|
|
123
|
+
`,e+=`; it is reused for URI- for the same reason
|
|
124
|
+
`,e+=`authority-d = [ userinfo-d %d64 ] host-d [ ":" port-d ]
|
|
125
|
+
`,e+=`userinfo-d = *(%d97-122 / %d65-90 / %d48-57 / pct-encoded / %d33 / %d36 / %d38-46 / %d58-59 / %d61 / %d95 / %d126)
|
|
126
|
+
`,e+=`host-d = IP-literal / (IPv4address !reg-name-char) / reg-name
|
|
127
|
+
`,e+=`port-d = *DIGIT
|
|
128
|
+
`,e+=`
|
|
129
|
+
`,e+=`; for use with URI-r
|
|
130
|
+
`,e+=`path-abempty-r = *( "/" segment )
|
|
131
|
+
`,e+=`path-absolute-r = "/" [ segment-nz *( "/" segment ) ]
|
|
132
|
+
`,e+=`path-rootless-r = segment-nz *( "/" segment )
|
|
133
|
+
`,e+=`path-empty-r = ""
|
|
134
|
+
`,e+=`segment = *pchar
|
|
135
|
+
`,e+=`segment-nz = 1*pchar
|
|
136
|
+
`,e+=`pchar = (%d97-122 / %d65-90 / %d48-57 / pct-encoded / %d33 / %d36 / %d38-46 /%d58-59 / %d61 / %d64 / %d95 / %d126)
|
|
137
|
+
`,e+=`pct-encoded = %d37 HEXDIG HEXDIG
|
|
138
|
+
`,e+=`
|
|
139
|
+
`,e+=`; no longer needed - expanded for all usage for fewer branches in the parse there
|
|
140
|
+
`,e+=`; and more efficient use of the TBS & TRG operators in place of TLS and rule names
|
|
141
|
+
`,e+=`; does not work with APG probably because of "first-success disambiguation" and greedy repetitions.
|
|
142
|
+
`,e+=`; will replace with semantic checking of valid number of h16s
|
|
143
|
+
`,e+=`;IPv6address = 6( h16 ":" ) ls32
|
|
144
|
+
`,e+=`; / "::" 5( h16 ":" ) ls32
|
|
145
|
+
`,e+=`; / [ h16 ] "::" 4( h16 ":" ) ls32
|
|
146
|
+
`,e+=`; / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
|
|
147
|
+
`,e+=`; / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
|
|
148
|
+
`,e+=`; / [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
|
|
149
|
+
`,e+=`; / [ *4( h16 ":" ) h16 ] "::" ls32
|
|
150
|
+
`,e+=`; / [ *5( h16 ":" ) h16 ] "::" h16
|
|
151
|
+
`,e+=`; / [ *6( h16 ":" ) h16 ] "::"
|
|
152
|
+
`,e+=`;ls32 = ( h16 ":" h16 ) / IPv4address
|
|
153
|
+
`,e+=`; dec-octet does not work because of "first-success disambiguation".
|
|
154
|
+
`,e+=`; Must have the longest (3-digit) numbers first.
|
|
155
|
+
`,e+=`; Even so, this form does not accept leading zeros.
|
|
156
|
+
`,e+=`; There does not seem to be a clear standard for this (https://en.wikipedia.org/wiki/Dot-decimal_notation)
|
|
157
|
+
`,e+=`; however and early RFC 790 did show leading-zero padding of the three digits.
|
|
158
|
+
`,e+=`;dec-octet = DIGIT ; 0-9
|
|
159
|
+
`,e+=`; / %x31-39 DIGIT ; 10-99
|
|
160
|
+
`,e+=`; / "1" 2DIGIT ; 100-199
|
|
161
|
+
`,e+=`; / "2" %x30-34 DIGIT ; 200-249
|
|
162
|
+
`,e+=`; / "25" %x30-35 ; 250-255
|
|
163
|
+
`,e+=`;statement = 1*( reserved / unreserved / " " )
|
|
164
|
+
`,e+=`;scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
|
|
165
|
+
`,e+=`;authority = [ userinfo "@" ] host [ ":" port ]
|
|
166
|
+
`,e+=`;userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
|
|
167
|
+
`,e+=`;query = *( pchar / "/" / "?" )
|
|
168
|
+
`,e+=`;fragment = *( pchar / "/" / "?" )
|
|
169
|
+
`,e+=`;IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
|
|
170
|
+
`,e+=`;reg-name = *( unreserved / pct-encoded / sub-delims )
|
|
171
|
+
`,e+=`;pct-encoded = "%" HEXDIG HEXDIG
|
|
172
|
+
`,e+=`;pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
|
|
173
|
+
`,e+=`;path-empty = 0pchar; deprecated - empty literal string, "", is more efficient
|
|
174
|
+
`,e+=`;unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
|
|
175
|
+
`,e+=`;reserved = gen-delims / sub-delims
|
|
176
|
+
`,e+=`;gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"
|
|
177
|
+
`,e+=`;sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
|
|
178
|
+
`,e+=`; / "*" / "+" / "," / ";" / "="
|
|
179
|
+
`,e+=`;HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
|
|
180
|
+
`,e+=`
|
|
181
|
+
`,e+=`; ------------------------------------------------------------------------------
|
|
182
|
+
`,e+=`; RFC 3339
|
|
183
|
+
`,e+=`
|
|
184
|
+
`,e+=`date-fullyear = 4DIGIT
|
|
185
|
+
`,e+=`date-month = 2DIGIT ; 01-12
|
|
186
|
+
`,e+=`date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on
|
|
187
|
+
`,e+=` ; month/year
|
|
188
|
+
`,e+=`time-hour = 2DIGIT ; 00-23
|
|
189
|
+
`,e+=`time-minute = 2DIGIT ; 00-59
|
|
190
|
+
`,e+=`time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second
|
|
191
|
+
`,e+=` ; rules
|
|
192
|
+
`,e+=`time-secfrac = "." 1*DIGIT
|
|
193
|
+
`,e+=`time-numoffset = ("+" / "-") time-hour ":" time-minute
|
|
194
|
+
`,e+=`time-offset = "Z" / time-numoffset
|
|
195
|
+
`,e+=`
|
|
196
|
+
`,e+=`partial-time = time-hour ":" time-minute ":" time-second
|
|
197
|
+
`,e+=` [time-secfrac]
|
|
198
|
+
`,e+=`full-date = date-fullyear "-" date-month "-" date-mday
|
|
199
|
+
`,e+=`full-time = partial-time time-offset
|
|
200
|
+
`,e+=`
|
|
201
|
+
`,e+=`date-time = full-date "T" full-time
|
|
202
|
+
`,e+=`
|
|
203
|
+
`,e+=`; ------------------------------------------------------------------------------
|
|
204
|
+
`,e+=`; RFC 5234
|
|
205
|
+
`,e+=`
|
|
206
|
+
`,e+=`ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
|
|
207
|
+
`,e+=`LF = %x0A
|
|
208
|
+
`,e+=` ; linefeed
|
|
209
|
+
`,e+=`DIGIT = %x30-39
|
|
210
|
+
`,e+=` ; 0-9
|
|
211
|
+
`,e+=`HEXDIG = %d48-57 / %d65-70 / %d97-102
|
|
212
|
+
`,e+=`
|
|
213
|
+
`,e}}xc.grammar=E4});var ks=P((IS,Sb)=>{"use strict";Sb.exports={ALT:1,CAT:2,REP:3,RNM:4,TRG:5,TBS:6,TLS:7,UDT:11,AND:12,NOT:13,BKR:14,BKA:15,BKN:16,ABG:17,AEN:18,ACTIVE:100,MATCH:101,EMPTY:102,NOMATCH:103,SEM_PRE:200,SEM_POST:201,SEM_OK:300,SEM_SKIP:301,ATTR_N:400,ATTR_R:401,ATTR_MR:402,LOOKAROUND_NONE:500,LOOKAROUND_AHEAD:501,LOOKAROUND_BEHIND:502,BKR_MODE_UM:601,BKR_MODE_PM:602,BKR_MODE_CS:603,BKR_MODE_CI:604}});var Ko=P((RS,Cb)=>{"use strict";Cb.exports={CLASS_MONOSPACE:"apg-mono",CLASS_ACTIVE:"apg-active",CLASS_EMPTY:"apg-empty",CLASS_MATCH:"apg-match",CLASS_NOMATCH:"apg-nomatch",CLASS_LOOKAHEAD:"apg-lh-match",CLASS_LOOKBEHIND:"apg-lb-match",CLASS_REMAINDER:"apg-remainder",CLASS_CTRLCHAR:"apg-ctrl-char",CLASS_LINEEND:"apg-line-end",CLASS_ERROR:"apg-error",CLASS_PHRASE:"apg-phrase",CLASS_EMPTYPHRASE:"apg-empty-phrase",CLASS_STATE:"apg-state",CLASS_STATS:"apg-stats",CLASS_TRACE:"apg-trace",CLASS_GRAMMAR:"apg-grammar",CLASS_RULES:"apg-rules",CLASS_RULESLINK:"apg-rules-link",CLASS_ATTRIBUTES:"apg-attrs"}});var Rb=P(mc=>{"use strict";mc.byteLength=v4;mc.toByteArray=k4;mc.fromByteArray=O4;var on=[],xr=[],P4=typeof Uint8Array<"u"?Uint8Array:Array,lf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ts=0,Nb=lf.length;Ts<Nb;++Ts)on[Ts]=lf[Ts],xr[lf.charCodeAt(Ts)]=Ts;var Ts,Nb;xr[45]=62;xr[95]=63;function Ib(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var n=t===e?0:4-t%4;return[t,n]}function v4(r){var e=Ib(r),t=e[0],n=e[1];return(t+n)*3/4-n}function _4(r,e,t){return(e+t)*3/4-t}function k4(r){var e,t=Ib(r),n=t[0],s=t[1],i=new P4(_4(r,n,s)),o=0,a=s>0?n-4:n,c;for(c=0;c<a;c+=4)e=xr[r.charCodeAt(c)]<<18|xr[r.charCodeAt(c+1)]<<12|xr[r.charCodeAt(c+2)]<<6|xr[r.charCodeAt(c+3)],i[o++]=e>>16&255,i[o++]=e>>8&255,i[o++]=e&255;return s===2&&(e=xr[r.charCodeAt(c)]<<2|xr[r.charCodeAt(c+1)]>>4,i[o++]=e&255),s===1&&(e=xr[r.charCodeAt(c)]<<10|xr[r.charCodeAt(c+1)]<<4|xr[r.charCodeAt(c+2)]>>2,i[o++]=e>>8&255,i[o++]=e&255),i}function T4(r){return on[r>>18&63]+on[r>>12&63]+on[r>>6&63]+on[r&63]}function B4(r,e,t){for(var n,s=[],i=e;i<t;i+=3)n=(r[i]<<16&16711680)+(r[i+1]<<8&65280)+(r[i+2]&255),s.push(T4(n));return s.join("")}function O4(r){for(var e,t=r.length,n=t%3,s=[],i=16383,o=0,a=t-n;o<a;o+=i)s.push(B4(r,o,o+i>a?a:o+i));return n===1?(e=r[t-1],s.push(on[e>>2]+on[e<<4&63]+"==")):n===2&&(e=(r[t-2]<<8)+r[t-1],s.push(on[e>>10]+on[e>>4&63]+on[e<<2&63]+"=")),s.join("")}});var Lb=P(ff=>{"use strict";ff.read=function(r,e,t,n,s){var i,o,a=s*8-n-1,c=(1<<a)-1,u=c>>1,l=-7,f=t?s-1:0,h=t?-1:1,g=r[e+f];for(f+=h,i=g&(1<<-l)-1,g>>=-l,l+=a;l>0;i=i*256+r[e+f],f+=h,l-=8);for(o=i&(1<<-l)-1,i>>=-l,l+=n;l>0;o=o*256+r[e+f],f+=h,l-=8);if(i===0)i=1-u;else{if(i===c)return o?NaN:(g?-1:1)*(1/0);o=o+Math.pow(2,n),i=i-u}return(g?-1:1)*o*Math.pow(2,i-n)};ff.write=function(r,e,t,n,s,i){var o,a,c,u=i*8-s-1,l=(1<<u)-1,f=l>>1,h=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:i-1,x=n?1:-1,b=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+f>=1?e+=h/c:e+=h*Math.pow(2,1-f),e*c>=2&&(o++,c/=2),o+f>=l?(a=0,o=l):o+f>=1?(a=(e*c-1)*Math.pow(2,s),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,s),o=0));s>=8;r[t+g]=a&255,g+=x,a/=256,s-=8);for(o=o<<s|a,u+=s;u>0;r[t+g]=o&255,g+=x,o/=256,u-=8);r[t+g-x]|=b*128}});var yf=P(ni=>{"use strict";var df=Rb(),ri=Lb(),Mb=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ni.Buffer=M;ni.SlowBuffer=L4;ni.INSPECT_MAX_BYTES=50;var yc=2147483647;ni.kMaxLength=yc;M.TYPED_ARRAY_SUPPORT=S4();!M.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function S4(){try{var r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(M.prototype,"parent",{enumerable:!0,get:function(){if(M.isBuffer(this))return this.buffer}});Object.defineProperty(M.prototype,"offset",{enumerable:!0,get:function(){if(M.isBuffer(this))return this.byteOffset}});function _n(r){if(r>yc)throw new RangeError('The value "'+r+'" is invalid for option "size"');var e=new Uint8Array(r);return Object.setPrototypeOf(e,M.prototype),e}function M(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return bf(r)}return Fb(r,e,t)}M.poolSize=8192;function Fb(r,e,t){if(typeof r=="string")return N4(r,e);if(ArrayBuffer.isView(r))return I4(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(an(r,ArrayBuffer)||r&&an(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(an(r,SharedArrayBuffer)||r&&an(r.buffer,SharedArrayBuffer)))return pf(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var n=r.valueOf&&r.valueOf();if(n!=null&&n!==r)return M.from(n,e,t);var s=R4(r);if(s)return s;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return M.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}M.from=function(r,e,t){return Fb(r,e,t)};Object.setPrototypeOf(M.prototype,Uint8Array.prototype);Object.setPrototypeOf(M,Uint8Array);function Db(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function C4(r,e,t){return Db(r),r<=0?_n(r):e!==void 0?typeof t=="string"?_n(r).fill(e,t):_n(r).fill(e):_n(r)}M.alloc=function(r,e,t){return C4(r,e,t)};function bf(r){return Db(r),_n(r<0?0:xf(r)|0)}M.allocUnsafe=function(r){return bf(r)};M.allocUnsafeSlow=function(r){return bf(r)};function N4(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!M.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var t=Hb(r,e)|0,n=_n(t),s=n.write(r,e);return s!==t&&(n=n.slice(0,s)),n}function hf(r){for(var e=r.length<0?0:xf(r.length)|0,t=_n(e),n=0;n<e;n+=1)t[n]=r[n]&255;return t}function I4(r){if(an(r,Uint8Array)){var e=new Uint8Array(r);return pf(e.buffer,e.byteOffset,e.byteLength)}return hf(r)}function pf(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');var n;return e===void 0&&t===void 0?n=new Uint8Array(r):t===void 0?n=new Uint8Array(r,e):n=new Uint8Array(r,e,t),Object.setPrototypeOf(n,M.prototype),n}function R4(r){if(M.isBuffer(r)){var e=xf(r.length)|0,t=_n(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||mf(r.length)?_n(0):hf(r);if(r.type==="Buffer"&&Array.isArray(r.data))return hf(r.data)}function xf(r){if(r>=yc)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+yc.toString(16)+" bytes");return r|0}function L4(r){return+r!=r&&(r=0),M.alloc(+r)}M.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==M.prototype};M.compare=function(e,t){if(an(e,Uint8Array)&&(e=M.from(e,e.offset,e.byteLength)),an(t,Uint8Array)&&(t=M.from(t,t.offset,t.byteLength)),!M.isBuffer(e)||!M.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,s=t.length,i=0,o=Math.min(n,s);i<o;++i)if(e[i]!==t[i]){n=e[i],s=t[i];break}return n<s?-1:s<n?1:0};M.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};M.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return M.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var s=M.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(an(o,Uint8Array))i+o.length>s.length?M.from(o).copy(s,i):Uint8Array.prototype.set.call(s,o,i);else if(M.isBuffer(o))o.copy(s,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=o.length}return s};function Hb(r,e){if(M.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||an(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);var t=r.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&t===0)return 0;for(var s=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return gf(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return $b(r).length;default:if(s)return n?-1:gf(r).length;e=(""+e).toLowerCase(),s=!0}}M.byteLength=Hb;function M4(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return V4(this,e,t);case"utf8":case"utf-8":return Gb(this,e,t);case"ascii":return z4(this,e,t);case"latin1":case"binary":return K4(this,e,t);case"base64":return q4(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $4(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}M.prototype._isBuffer=!0;function Bs(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}M.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Bs(this,t,t+1);return this};M.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Bs(this,t,t+3),Bs(this,t+1,t+2);return this};M.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Bs(this,t,t+7),Bs(this,t+1,t+6),Bs(this,t+2,t+5),Bs(this,t+3,t+4);return this};M.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?Gb(this,0,e):M4.apply(this,arguments)};M.prototype.toLocaleString=M.prototype.toString;M.prototype.equals=function(e){if(!M.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:M.compare(this,e)===0};M.prototype.inspect=function(){var e="",t=ni.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"};Mb&&(M.prototype[Mb]=M.prototype.inspect);M.prototype.compare=function(e,t,n,s,i){if(an(e,Uint8Array)&&(e=M.from(e,e.offset,e.byteLength)),!M.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),s===void 0&&(s=0),i===void 0&&(i=this.length),t<0||n>e.length||s<0||i>this.length)throw new RangeError("out of range index");if(s>=i&&t>=n)return 0;if(s>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,s>>>=0,i>>>=0,this===e)return 0;for(var o=i-s,a=n-t,c=Math.min(o,a),u=this.slice(s,i),l=e.slice(t,n),f=0;f<c;++f)if(u[f]!==l[f]){o=u[f],a=l[f];break}return o<a?-1:a<o?1:0};function qb(r,e,t,n,s){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,mf(t)&&(t=s?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(s)return-1;t=r.length-1}else if(t<0)if(s)t=0;else return-1;if(typeof e=="string"&&(e=M.from(e,n)),M.isBuffer(e))return e.length===0?-1:jb(r,e,t,n,s);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?s?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):jb(r,[e],t,n,s);throw new TypeError("val must be string, number or Buffer")}function jb(r,e,t,n,s){var i=1,o=r.length,a=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;i=2,o/=2,a/=2,t/=2}function c(g,x){return i===1?g[x]:g.readUInt16BE(x*i)}var u;if(s){var l=-1;for(u=t;u<o;u++)if(c(r,u)===c(e,l===-1?0:u-l)){if(l===-1&&(l=u),u-l+1===a)return l*i}else l!==-1&&(u-=u-l),l=-1}else for(t+a>o&&(t=o-a),u=t;u>=0;u--){for(var f=!0,h=0;h<a;h++)if(c(r,u+h)!==c(e,h)){f=!1;break}if(f)return u}return-1}M.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1};M.prototype.indexOf=function(e,t,n){return qb(this,e,t,n,!0)};M.prototype.lastIndexOf=function(e,t,n){return qb(this,e,t,n,!1)};function j4(r,e,t,n){t=Number(t)||0;var s=r.length-t;n?(n=Number(n),n>s&&(n=s)):n=s;var i=e.length;n>i/2&&(n=i/2);for(var o=0;o<n;++o){var a=parseInt(e.substr(o*2,2),16);if(mf(a))return o;r[t+o]=a}return o}function U4(r,e,t,n){return wc(gf(e,r.length-t),r,t,n)}function F4(r,e,t,n){return wc(W4(e),r,t,n)}function D4(r,e,t,n){return wc($b(e),r,t,n)}function H4(r,e,t,n){return wc(Y4(e,r.length-t),r,t,n)}M.prototype.write=function(e,t,n,s){if(t===void 0)s="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")s=t,n=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(n)?(n=n>>>0,s===void 0&&(s="utf8")):(s=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");s||(s="utf8");for(var o=!1;;)switch(s){case"hex":return j4(this,e,t,n);case"utf8":case"utf-8":return U4(this,e,t,n);case"ascii":case"latin1":case"binary":return F4(this,e,t,n);case"base64":return D4(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return H4(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+s);s=(""+s).toLowerCase(),o=!0}};M.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function q4(r,e,t){return e===0&&t===r.length?df.fromByteArray(r):df.fromByteArray(r.slice(e,t))}function Gb(r,e,t){t=Math.min(r.length,t);for(var n=[],s=e;s<t;){var i=r[s],o=null,a=i>239?4:i>223?3:i>191?2:1;if(s+a<=t){var c,u,l,f;switch(a){case 1:i<128&&(o=i);break;case 2:c=r[s+1],(c&192)===128&&(f=(i&31)<<6|c&63,f>127&&(o=f));break;case 3:c=r[s+1],u=r[s+2],(c&192)===128&&(u&192)===128&&(f=(i&15)<<12|(c&63)<<6|u&63,f>2047&&(f<55296||f>57343)&&(o=f));break;case 4:c=r[s+1],u=r[s+2],l=r[s+3],(c&192)===128&&(u&192)===128&&(l&192)===128&&(f=(i&15)<<18|(c&63)<<12|(u&63)<<6|l&63,f>65535&&f<1114112&&(o=f))}}o===null?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),s+=a}return G4(n)}var Ub=4096;function G4(r){var e=r.length;if(e<=Ub)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=Ub));return t}function z4(r,e,t){var n="";t=Math.min(r.length,t);for(var s=e;s<t;++s)n+=String.fromCharCode(r[s]&127);return n}function K4(r,e,t){var n="";t=Math.min(r.length,t);for(var s=e;s<t;++s)n+=String.fromCharCode(r[s]);return n}function V4(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var s="",i=e;i<t;++i)s+=Z4[r[i]];return s}function $4(r,e,t){for(var n=r.slice(e,t),s="",i=0;i<n.length-1;i+=2)s+=String.fromCharCode(n[i]+n[i+1]*256);return s}M.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var s=this.subarray(e,t);return Object.setPrototypeOf(s,M.prototype),s};function Bt(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}M.prototype.readUintLE=M.prototype.readUIntLE=function(e,t,n){e=e>>>0,t=t>>>0,n||Bt(e,t,this.length);for(var s=this[e],i=1,o=0;++o<t&&(i*=256);)s+=this[e+o]*i;return s};M.prototype.readUintBE=M.prototype.readUIntBE=function(e,t,n){e=e>>>0,t=t>>>0,n||Bt(e,t,this.length);for(var s=this[e+--t],i=1;t>0&&(i*=256);)s+=this[e+--t]*i;return s};M.prototype.readUint8=M.prototype.readUInt8=function(e,t){return e=e>>>0,t||Bt(e,1,this.length),this[e]};M.prototype.readUint16LE=M.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||Bt(e,2,this.length),this[e]|this[e+1]<<8};M.prototype.readUint16BE=M.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||Bt(e,2,this.length),this[e]<<8|this[e+1]};M.prototype.readUint32LE=M.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||Bt(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};M.prototype.readUint32BE=M.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||Bt(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};M.prototype.readIntLE=function(e,t,n){e=e>>>0,t=t>>>0,n||Bt(e,t,this.length);for(var s=this[e],i=1,o=0;++o<t&&(i*=256);)s+=this[e+o]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s};M.prototype.readIntBE=function(e,t,n){e=e>>>0,t=t>>>0,n||Bt(e,t,this.length);for(var s=t,i=1,o=this[e+--s];s>0&&(i*=256);)o+=this[e+--s]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o};M.prototype.readInt8=function(e,t){return e=e>>>0,t||Bt(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};M.prototype.readInt16LE=function(e,t){e=e>>>0,t||Bt(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};M.prototype.readInt16BE=function(e,t){e=e>>>0,t||Bt(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};M.prototype.readInt32LE=function(e,t){return e=e>>>0,t||Bt(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};M.prototype.readInt32BE=function(e,t){return e=e>>>0,t||Bt(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};M.prototype.readFloatLE=function(e,t){return e=e>>>0,t||Bt(e,4,this.length),ri.read(this,e,!0,23,4)};M.prototype.readFloatBE=function(e,t){return e=e>>>0,t||Bt(e,4,this.length),ri.read(this,e,!1,23,4)};M.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||Bt(e,8,this.length),ri.read(this,e,!0,52,8)};M.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||Bt(e,8,this.length),ri.read(this,e,!1,52,8)};function Yt(r,e,t,n,s,i){if(!M.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>s||e<i)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}M.prototype.writeUintLE=M.prototype.writeUIntLE=function(e,t,n,s){if(e=+e,t=t>>>0,n=n>>>0,!s){var i=Math.pow(2,8*n)-1;Yt(this,e,t,n,i,0)}var o=1,a=0;for(this[t]=e&255;++a<n&&(o*=256);)this[t+a]=e/o&255;return t+n};M.prototype.writeUintBE=M.prototype.writeUIntBE=function(e,t,n,s){if(e=+e,t=t>>>0,n=n>>>0,!s){var i=Math.pow(2,8*n)-1;Yt(this,e,t,n,i,0)}var o=n-1,a=1;for(this[t+o]=e&255;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+n};M.prototype.writeUint8=M.prototype.writeUInt8=function(e,t,n){return e=+e,t=t>>>0,n||Yt(this,e,t,1,255,0),this[t]=e&255,t+1};M.prototype.writeUint16LE=M.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t>>>0,n||Yt(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};M.prototype.writeUint16BE=M.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t>>>0,n||Yt(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};M.prototype.writeUint32LE=M.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t>>>0,n||Yt(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};M.prototype.writeUint32BE=M.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t>>>0,n||Yt(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};M.prototype.writeIntLE=function(e,t,n,s){if(e=+e,t=t>>>0,!s){var i=Math.pow(2,8*n-1);Yt(this,e,t,n,i-1,-i)}var o=0,a=1,c=0;for(this[t]=e&255;++o<n&&(a*=256);)e<0&&c===0&&this[t+o-1]!==0&&(c=1),this[t+o]=(e/a>>0)-c&255;return t+n};M.prototype.writeIntBE=function(e,t,n,s){if(e=+e,t=t>>>0,!s){var i=Math.pow(2,8*n-1);Yt(this,e,t,n,i-1,-i)}var o=n-1,a=1,c=0;for(this[t+o]=e&255;--o>=0&&(a*=256);)e<0&&c===0&&this[t+o+1]!==0&&(c=1),this[t+o]=(e/a>>0)-c&255;return t+n};M.prototype.writeInt8=function(e,t,n){return e=+e,t=t>>>0,n||Yt(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};M.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t>>>0,n||Yt(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};M.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t>>>0,n||Yt(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};M.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t>>>0,n||Yt(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};M.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t>>>0,n||Yt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function zb(r,e,t,n,s,i){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Kb(r,e,t,n,s){return e=+e,t=t>>>0,s||zb(r,e,t,4,34028234663852886e22,-34028234663852886e22),ri.write(r,e,t,n,23,4),t+4}M.prototype.writeFloatLE=function(e,t,n){return Kb(this,e,t,!0,n)};M.prototype.writeFloatBE=function(e,t,n){return Kb(this,e,t,!1,n)};function Vb(r,e,t,n,s){return e=+e,t=t>>>0,s||zb(r,e,t,8,17976931348623157e292,-17976931348623157e292),ri.write(r,e,t,n,52,8),t+8}M.prototype.writeDoubleLE=function(e,t,n){return Vb(this,e,t,!0,n)};M.prototype.writeDoubleBE=function(e,t,n){return Vb(this,e,t,!1,n)};M.prototype.copy=function(e,t,n,s){if(!M.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!s&&s!==0&&(s=this.length),t>=e.length&&(t=e.length),t||(t=0),s>0&&s<n&&(s=n),s===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(s<0)throw new RangeError("sourceEnd out of bounds");s>this.length&&(s=this.length),e.length-t<s-n&&(s=e.length-t+n);var i=s-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,n,s):Uint8Array.prototype.set.call(e,this.subarray(n,s),t),i};M.prototype.fill=function(e,t,n,s){if(typeof e=="string"){if(typeof t=="string"?(s=t,t=0,n=this.length):typeof n=="string"&&(s=n,n=this.length),s!==void 0&&typeof s!="string")throw new TypeError("encoding must be a string");if(typeof s=="string"&&!M.isEncoding(s))throw new TypeError("Unknown encoding: "+s);if(e.length===1){var i=e.charCodeAt(0);(s==="utf8"&&i<128||s==="latin1")&&(e=i)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var o;if(typeof e=="number")for(o=t;o<n;++o)this[o]=e;else{var a=M.isBuffer(e)?e:M.from(e,s),c=a.length;if(c===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=a[o%c]}return this};var J4=/[^+/0-9A-Za-z-_]/g;function Q4(r){if(r=r.split("=")[0],r=r.trim().replace(J4,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function gf(r,e){e=e||1/0;for(var t,n=r.length,s=null,i=[],o=0;o<n;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!s){if(t>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&i.push(239,191,189);continue}s=t;continue}if(t<56320){(e-=3)>-1&&i.push(239,191,189),s=t;continue}t=(s-55296<<10|t-56320)+65536}else s&&(e-=3)>-1&&i.push(239,191,189);if(s=null,t<128){if((e-=1)<0)break;i.push(t)}else if(t<2048){if((e-=2)<0)break;i.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;i.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;i.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return i}function W4(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function Y4(r,e){for(var t,n,s,i=[],o=0;o<r.length&&!((e-=2)<0);++o)t=r.charCodeAt(o),n=t>>8,s=t%256,i.push(s),i.push(n);return i}function $b(r){return df.toByteArray(Q4(r))}function wc(r,e,t,n){for(var s=0;s<n&&!(s+t>=e.length||s>=r.length);++s)e[s+t]=r[s];return s}function an(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function mf(r){return r!==r}var Z4=function(){for(var r="0123456789abcdef",e=new Array(256),t=0;t<16;++t)for(var n=t*16,s=0;s<16;++s)e[n+s]=r[t]+r[s];return e}()});var Qb=P(Ot=>{"use strict";"use strict;";var{Buffer:Pt}=yf(),Ac=4294967292,Ec=4294967293,wf=4294967294,Jb=4294967295,K=[0,1,3,7,15,31,63,127,255,511,1023],Gn=["00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F","10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F","20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F","30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F","40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F","50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F","60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F","70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F","80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F","90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF","D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF","E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF","F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"],X4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),lr=[];X4.forEach(r=>{lr.push(r.charCodeAt(0))});Ot.utf8={encode(r){let e=[];return r.forEach(t=>{if(t>=0&&t<=127)e.push(t);else if(t<=2047)e.push(192+(t>>6&K[5])),e.push(128+(t&K[6]));else if(t<55296||t>57343&&t<=65535)e.push(224+(t>>12&K[4])),e.push(128+(t>>6&K[6])),e.push(128+(t&K[6]));else if(t>=65536&&t<=1114111){let n=t>>16&K[5];e.push(240+(n>>2)),e.push(128+((n&K[2])<<4)+(t>>12&K[4])),e.push(128+(t>>6&K[6])),e.push(128+(t&K[6]))}else throw new RangeError(`utf8.encode: character out of range: char: ${t}`)}),Pt.from(e)},decode(r,e){function t(x,b){if((b&192)!==128)return Ec;let y=((x&K[5])<<6)+(b&K[6]);return y<128?Ac:y}function n(x,b,y){if((y&192)!==128||(b&192)!==128)return Ec;let m=((x&K[4])<<12)+((b&K[6])<<6)+(y&K[6]);return m<2048?Ac:m>=55296&&m<=57343?wf:m}function s(x,b,y,m){if((m&192)!==128||(y&192)!==128||(b&192)!==128)return Ec;let E=(((x&K[3])<<2)+(b>>4&K[2])<<16)+((b&K[4])<<12)+((y&K[6])<<6)+(m&K[6]);return E<65536?Ac:E>1114111?wf:E}let i,o,a,c,u,l,f=r.length,h=e?3:0,g=[];for(;h<f;){o=r[h],i=Jb;let x=!0;for(;x;){if(o>=0&&o<=127){i=o,l=1;break}if(a=h+1,a<f&&o>=194&&o<=223){i=t(o,r[a]),l=2;break}if(c=h+2,c<f&&o>=224&&o<=239){i=n(o,r[a],r[c]),l=3;break}if(u=h+3,u<f&&o>=240&&o<=244){i=s(o,r[a],r[c],r[u]),l=4;break}break}if(i>1114111){let b=`byte[${h}]`;throw i===Jb?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${b}`):i===Ec?new RangeError(`utf8.decode: illegal trailing byte found at: ${b}`):i===wf?new RangeError(`utf8.decode: code point out of range found at: ${b}`):i===Ac?new RangeError(`utf8.decode: non-shortest form found at: ${b}`):new RangeError(`utf8.decode: unrecognized error found at: ${b}`)}g.push(i),h+=l}return g}};Ot.utf16be={encode(r){let e=[],t,n,s;for(let i=0;i<r.length;i+=1)if(t=r[i],t>=0&&t<=55295||t>=57344&&t<=65535)e.push(t>>8&K[8]),e.push(t&K[8]);else if(t>=65536&&t<=1114111)s=t-65536,n=55296+(s>>10),s=56320+(s&K[10]),e.push(n>>8&K[8]),e.push(n&K[8]),e.push(s>>8&K[8]),e.push(s&K[8]);else throw new RangeError(`utf16be.encode: UTF16BE value out of range: char[${i}]: ${t}`);return Pt.from(e)},decode(r,e){if(r.length%2>0)throw new RangeError(`utf16be.decode: data length must be even multiple of 2: length: ${r.length}`);let t=[],n=r.length,s=e?2:0,i=0,o,a,c,u,l,f;for(;s<n;){for(;;){if(c=s+1,c<n){if(l=(r[s]<<8)+r[c],l<55296||l>57343){o=l,a=2;break}if(u=s+3,u<n&&(f=(r[s+2]<<8)+r[u],l<=56319&&f>=56320&&f<=57343)){o=65536+(l-55296<<10)+(f-56320),a=4;break}}throw new RangeError(`utf16be.decode: ill-formed UTF16BE byte sequence found: byte[${s}]`)}t[i++]=o,s+=a}return t}};Ot.utf16le={encode(r){let e=[],t,n,s;for(let i=0;i<r.length;i+=1)if(t=r[i],t>=0&&t<=55295||t>=57344&&t<=65535)e.push(t&K[8]),e.push(t>>8&K[8]);else if(t>=65536&&t<=1114111)s=t-65536,n=55296+(s>>10),s=56320+(s&K[10]),e.push(n&K[8]),e.push(n>>8&K[8]),e.push(s&K[8]),e.push(s>>8&K[8]);else throw new RangeError(`utf16le.encode: UTF16LE value out of range: char[${i}]: ${t}`);return Pt.from(e)},decode(r,e){if(r.length%2>0)throw new RangeError(`utf16le.decode: data length must be even multiple of 2: length: ${r.length}`);let t=[],n=r.length,s=e?2:0,i=0,o,a,c,u,l,f;for(;s<n;){for(;;){if(c=s+1,c<n){if(l=(r[c]<<8)+r[s],l<55296||l>57343){o=l,a=2;break}if(u=s+3,u<n&&(f=(r[u]<<8)+r[s+2],l<=56319&&f>=56320&&f<=57343)){o=65536+(l-55296<<10)+(f-56320),a=4;break}}throw new RangeError(`utf16le.decode: ill-formed UTF16LE byte sequence found: byte[${s}]`)}t[i++]=o,s+=a}return t}};Ot.utf32be={encode(r){let e=Pt.alloc(r.length*4),t=0;return r.forEach(n=>{if(n>=55296&&n<=57343||n>1114111)throw new RangeError(`utf32be.encode: UTF32BE character code out of range: char[${t/4}]: ${n}`);e[t++]=n>>24&K[8],e[t++]=n>>16&K[8],e[t++]=n>>8&K[8],e[t++]=n&K[8]}),e},decode(r,e){if(r.length%4>0)throw new RangeError(`utf32be.decode: UTF32BE byte length must be even multiple of 4: length: ${r.length}`);let t=[],n=e?4:0;for(;n<r.length;n+=4){let s=(r[n]<<24)+(r[n+1]<<16)+(r[n+2]<<8)+r[n+3];if(s>=55296&&s<=57343||s>1114111)throw new RangeError(`utf32be.decode: UTF32BE character code out of range: char[${n/4}]: ${s}`);t.push(s)}return t}};Ot.utf32le={encode(r){let e=Pt.alloc(r.length*4),t=0;return r.forEach(n=>{if(n>=55296&&n<=57343||n>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${t/4}]: ${n}`);e[t++]=n&K[8],e[t++]=n>>8&K[8],e[t++]=n>>16&K[8],e[t++]=n>>24&K[8]}),e},decode(r,e){if(r.length%4>0)throw new RangeError(`utf32be.decode: UTF32LE byte length must be even multiple of 4: length: ${r.length}`);let t=[],n=e?4:0;for(;n<r.length;n+=4){let s=(r[n+3]<<24)+(r[n+2]<<16)+(r[n+1]<<8)+r[n];if(s>=55296&&s<=57343||s>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${n/4}]: ${s}`);t.push(s)}return t}};Ot.uint7={encode(r){let e=Pt.alloc(r.length);for(let t=0;t<r.length;t+=1){if(r[t]>127)throw new RangeError(`uint7.encode: UINT7 character code out of range: char[${t}]: ${r[t]}`);e[t]=r[t]}return e},decode(r){let e=[];for(let t=0;t<r.length;t+=1){if(r[t]>127)throw new RangeError(`uint7.decode: UINT7 character code out of range: byte[${t}]: ${r[t]}`);e[t]=r[t]}return e}};Ot.uint8={encode(r){let e=Pt.alloc(r.length);for(let t=0;t<r.length;t+=1){if(r[t]>255)throw new RangeError(`uint8.encode: UINT8 character code out of range: char[${t}]: ${r[t]}`);e[t]=r[t]}return e},decode(r){let e=[];for(let t=0;t<r.length;t+=1)e[t]=r[t];return e}};Ot.uint16be={encode(r){let e=Pt.alloc(r.length*2),t=0;return r.forEach(n=>{if(n>65535)throw new RangeError(`uint16be.encode: UINT16BE character code out of range: char[${t/2}]: ${n}`);e[t++]=n>>8&K[8],e[t++]=n&K[8]}),e},decode(r){if(r.length%2>0)throw new RangeError(`uint16be.decode: UINT16BE byte length must be even multiple of 2: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=2)e.push((r[t]<<8)+r[t+1]);return e}};Ot.uint16le={encode(r){let e=Pt.alloc(r.length*2),t=0;return r.forEach(n=>{if(n>65535)throw new RangeError(`uint16le.encode: UINT16LE character code out of range: char[${t/2}]: ${n}`);e[t++]=n&K[8],e[t++]=n>>8&K[8]}),e},decode(r){if(r.length%2>0)throw new RangeError(`uint16le.decode: UINT16LE byte length must be even multiple of 2: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=2)e.push((r[t+1]<<8)+r[t]);return e}};Ot.uint32be={encode(r){let e=Pt.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n>>24&K[8],e[t++]=n>>16&K[8],e[t++]=n>>8&K[8],e[t++]=n&K[8]}),e},decode(r){if(r.length%4>0)throw new RangeError(`uint32be.decode: UINT32BE byte length must be even multiple of 4: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=4)e.push((r[t]<<24)+(r[t+1]<<16)+(r[t+2]<<8)+r[t+3]);return e}};Ot.uint32le={encode(r){let e=Pt.alloc(r.length*4),t=0;return r.forEach(n=>{e[t++]=n&K[8],e[t++]=n>>8&K[8],e[t++]=n>>16&K[8],e[t++]=n>>24&K[8]}),e},decode(r){if(r.length%4>0)throw new RangeError(`uint32le.decode: UINT32LE byte length must be even multiple of 4: length: ${r.length}`);let e=[];for(let t=0;t<r.length;t+=4)e.push((r[t+3]<<24)+(r[t+2]<<16)+(r[t+1]<<8)+r[t]);return e}};Ot.string={encode(r){return Ot.utf16le.encode(r).toString("utf16le")},decode(r){return Ot.utf16le.decode(Pt.from(r,"utf16le"),0)}};Ot.escaped={encode(r){let e=[];for(let t=0;t<r.length;t+=1){let n=r[t];if(n===96)e.push(n),e.push(n);else if(n===10)e.push(n);else if(n>=32&&n<=126)e.push(n);else{let s="";if(n>=0&&n<=31)s+=`\`x${Gn[n]}`;else if(n>=127&&n<=255)s+=`\`x${Gn[n]}`;else if(n>=256&&n<=65535)s+=`\`u${Gn[n>>8&K[8]]}${Gn[n&K[8]]}`;else if(n>=65536&&n<=4294967295){s+="`u{";let o=n>>24&K[8];o>0&&(s+=Gn[o]),s+=`${Gn[n>>16&K[8]]+Gn[n>>8&K[8]]+Gn[n&K[8]]}}`}else throw new Error("escape.encode(char): char > 0xffffffff not allowed");Pt.from(s).forEach(o=>{e.push(o)})}}return Pt.from(e)},decode(r){function e(f){return f>=48&&f<=57||f>=65&&f<=70||f>=97&&f<=102}function t(f,h,g){let x={char:null,nexti:f+2,error:!0};if(f+1<h&&e(g[f])&&e(g[f+1])){let b=String.fromCodePoint(g[f],g[f+1]);x.char=parseInt(b,16),Number.isNaN(x.char)||(x.error=!1)}return x}function n(f,h,g){let x={char:null,nexti:f+4,error:!0};if(f+3<h&&e(g[f])&&e(g[f+1])&&e(g[f+2])&&e(g[f+3])){let b=String.fromCodePoint(g[f],g[f+1],g[f+2],g[f+3]);x.char=parseInt(b,16),Number.isNaN(x.char)||(x.error=!1)}return x}function s(f,h,g){let x={char:null,nexti:f+4,error:!0},b="";for(;f<h&&e(g[f]);)b+=String.fromCodePoint(g[f]),f+=1;return x.char=parseInt(b,16),g[f]===125&&!Number.isNaN(x.char)&&(x.error=!1),x.nexti=f+1,x}let i=[],o=r.length,a,c,u,l=0;for(;l<o;){for(;;){if(u=!0,r[l]!==96){i.push(r[l]),l+=1,u=!1;break}if(a=l+1,a>=o)break;if(r[a]===96){i.push(96),l+=2,u=!1;break}if(r[a]===120){if(c=t(a+1,o,r),c.error)break;i.push(c.char),l=c.nexti,u=!1;break}if(r[a]===117){if(r[a+1]===123){if(c=s(a+2,o,r),c.error)break;i.push(c.char),l=c.nexti,u=!1;break}if(c=n(a+1,o,r),c.error)break;i.push(c.char),l=c.nexti,u=!1;break}break}if(u)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${l}]`)}return i}};var Vo=13,mr=10;Ot.lineEnds={crlf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Vo:t+1<r.length&&r[t+1]===mr?t+=2:t+=1,e.push(Vo),e.push(mr);break;case mr:e.push(Vo),e.push(mr),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==mr&&(e.push(Vo),e.push(mr)),e},lf(r){let e=[],t=0;for(;t<r.length;)switch(r[t]){case Vo:t+1<r.length&&r[t+1]===mr?t+=2:t+=1,e.push(mr);break;case mr:e.push(mr),t+=1;break;default:e.push(r[t]),t+=1;break}return e.length>0&&e[e.length-1]!==mr&&e.push(mr),e}};Ot.base64={encode(r){if(r.length===0)return Pt.alloc(0);let e,t,n,s=r.length%3;s=s>0?3-s:0;let i=(r.length+s)/3,o=Pt.alloc(i*4);s>0&&(i-=1),e=0,t=0;for(let a=0;a<i;a+=1)n=r[e++]<<16,n+=r[e++]<<8,n+=r[e++],o[t++]=lr[n>>18&K[6]],o[t++]=lr[n>>12&K[6]],o[t++]=lr[n>>6&K[6]],o[t++]=lr[n&K[6]];if(s===0)return o;if(s===1)return n=r[e++]<<16,n+=r[e]<<8,o[t++]=lr[n>>18&K[6]],o[t++]=lr[n>>12&K[6]],o[t++]=lr[n>>6&K[6]],o[t]=lr[64],o;if(s===2)return n=r[e]<<16,o[t++]=lr[n>>18&K[6]],o[t++]=lr[n>>12&K[6]],o[t++]=lr[64],o[t]=lr[64],o},decode(r){function e(l){let f=[],h=0;for(let g=0;g<l.length;g+=1){let x=l[g],b=!0;for(;b&&!(x===32||x===9||x===10||x===13);){if(x>=65&&x<=90){f.push(x-65);break}if(x>=97&&x<=122){f.push(x-71);break}if(x>=48&&x<=57){f.push(x+4);break}if(x===43){f.push(62);break}if(x===47){f.push(63);break}if(x===61){f.push(64),h+=1;break}throw new RangeError(`base64.decode: invalid character buf[${g}]: ${x}`)}}if(f.length%4>0)throw new RangeError(`base64.decode: string length not integral multiple of 4: ${f.length}`);switch(h){case 0:break;case 1:if(f[f.length-1]!==64)throw new RangeError("base64.decode: one tail character found: not last character");break;case 2:if(f[f.length-1]!==64||f[f.length-2]!==64)throw new RangeError("base64.decode: two tail characters found: not last characters");break;default:throw new RangeError(`base64.decode: more than two tail characters found: ${h}`)}return{tail:h,buf:Pt.from(f)}}if(r.length===0)return Pt.alloc(0);let t=e(r),{tail:n}=t,s=t.buf,i,o,a,c=s.length/4,u=Pt.alloc(c*3-n);n>0&&(c-=1),o=0,i=0;for(let l=0;l<c;l+=1)a=s[i++]<<18,a+=s[i++]<<12,a+=s[i++]<<6,a+=s[i++],u[o++]=a>>16&K[8],u[o++]=a>>8&K[8],u[o++]=a&K[8];return n===1&&(a=s[i++]<<18,a+=s[i++]<<12,a+=s[i]<<6,u[o++]=a>>16&K[8],u[o]=a>>8&K[8]),n===2&&(a=s[i++]<<18,a+=s[i++]<<12,u[o]=a>>16&K[8]),u},toString(r){if(r.length%4>0)throw new RangeError(`base64.toString: input buffer length not multiple of 4: ${r.length}`);let e="",t=0;function n(i,o,a,c){switch(t){case 76:e+=`\r
|
|
214
|
+
${i}${o}${a}${c}`,t=4;break;case 75:e+=`${i}\r
|
|
215
|
+
${o}${a}${c}`,t=3;break;case 74:e+=`${i+o}\r
|
|
216
|
+
${a}${c}`,t=2;break;case 73:e+=`${i+o+a}\r
|
|
217
|
+
${c}`,t=1;break;default:e+=i+o+a+c,t+=4;break}}function s(i){return i>=65&&i<=90||i>=97&&i<=122||i>=48&&i<=57||i===43||i===47||i===61}for(let i=0;i<r.length;i+=4){for(let o=i;o<i+4;o+=1)if(!s(r[o]))throw new RangeError(`base64.toString: buf[${o}]: ${r[o]} : not valid base64 character code`);n(String.fromCharCode(r[i]),String.fromCharCode(r[i+1]),String.fromCharCode(r[i+2]),String.fromCharCode(r[i+3]))}return e}}});var ex=P(ci=>{"use strict";"use strict;";var{Buffer:Af}=yf(),Ue=Qb(),$o="UTF8",Pf="UTF16",cn="UTF16BE",kn="UTF16LE",vf="UTF32",un="UTF32BE",Tn="UTF32LE",si="UINT7",Wb="ASCII",Yb="BINARY",ii="UINT8",Zb="UINT16",Pc="UINT16LE",oi="UINT16BE",Xb="UINT32",vc="UINT32LE",ai="UINT32BE",_c="ESCAPED",zn="STRING",e8=function(e){e.type=$o;let t=e.data;e.bom=0,t.length>=3&&t[0]===239&&t[1]===187&&t[2]===191&&(e.bom=3)},t8=function(e){let t=e.data;switch(e.bom=0,e.type){case Pf:e.type=cn,t.length>=2&&(t[0]===254&&t[1]===255?e.bom=2:t[0]===255&&t[1]===254&&(e.type=kn,e.bom=2));break;case cn:if(e.type=cn,t.length>=2){if(t[0]===254&&t[1]===255)e.bom=2;else if(t[0]===255&&t[1]===254)throw new TypeError(`src type: "${cn}" specified but BOM is for "${kn}"`)}break;case kn:if(e.type=kn,t.length>=0){if(t[0]===254&&t[1]===255)throw new TypeError(`src type: "${kn}" specified but BOM is for "${cn}"`);t[0]===255&&t[1]===254&&(e.bom=2)}break;default:throw new TypeError(`UTF16 BOM: src type "${e.type}" unrecognized`)}},r8=function(e){let t=e.data;switch(e.bom=0,e.type){case vf:e.type=un,t.length>=4&&(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255&&(e.bom=4),t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0&&(e.type=Tn,e.bom=4));break;case un:if(e.type=un,t.length>=4&&(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255&&(e.bom=4),t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0))throw new TypeError(`src type: ${un} specified but BOM is for ${Tn}"`);break;case Tn:if(e.type=Tn,t.length>=4){if(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255)throw new TypeError(`src type: "${Tn}" specified but BOM is for "${un}"`);t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0&&(e.bom=4)}break;default:throw new TypeError(`UTF32 BOM: src type "${e.type}" unrecognized`)}},n8=function(e,t){function n(i){let o={type:"",base64:!1},c=/^(base64:)?([a-zA-Z0-9]+)$/i.exec(i);return c&&(c[2]&&(o.type=c[2].toUpperCase()),c[1]&&(o.base64=!0)),o}let s=n(e.toUpperCase());if(s.base64){if(s.type===zn)throw new TypeError(`type: "${e} "BASE64:" prefix not allowed with type ${zn}`);if(Af.isBuffer(t))s.data=Ue.base64.decode(t);else if(typeof t=="string"){let i=Af.from(t,"ascii");s.data=Ue.base64.decode(i)}else throw new TypeError(`type: "${e} unrecognized data type: typeof(data): ${typeof t}`)}else s.data=t;switch(s.type){case $o:e8(s);break;case Pf:case cn:case kn:t8(s);break;case vf:case un:case Tn:r8(s);break;case Zb:s.type=oi;break;case Xb:s.type=ai;break;case Wb:s.type=si;break;case Yb:s.type=ii;break;case si:case ii:case Pc:case oi:case vc:case ai:case zn:case _c:break;default:throw new TypeError(`type: "${e}" not recognized`)}if(s.type===zn){if(typeof s.data!="string")throw new TypeError(`type: "${e}" but data is not a string`)}else if(!Af.isBuffer(s.data))throw new TypeError(`type: "${e}" but data is not a Buffer`);return s},s8=function(e,t){function n(i){let o,a,c={crlf:!1,lf:!1,base64:!1,type:""},u=!0;for(;u;){if(a=i,o=i.slice(0,5),o==="CRLF:"){c.crlf=!0,a=i.slice(5);break}if(o=i.slice(0,3),o==="LF:"){c.lf=!0,a=i.slice(3);break}break}return o=a.split(":"),o.length===1?c.type=o[0]:o.length===2&&o[1]==="BASE64"&&(c.base64=!0,c.type=o[0]),c}if(!Array.isArray(t))throw new TypeError(`dst chars: not array: "${typeof t}`);if(typeof e!="string")throw new TypeError(`dst type: not string: "${typeof e}`);let s=n(e.toUpperCase());switch(s.type){case $o:case cn:case kn:case un:case Tn:case si:case ii:case Pc:case oi:case vc:case ai:case _c:break;case zn:if(s.base64)throw new TypeError(`":BASE64" suffix not allowed with type ${zn}`);break;case Wb:s.type=si;break;case Yb:s.type=ii;break;case Pf:s.type=cn;break;case vf:s.type=un;break;case Zb:s.type=oi;break;case Xb:s.type=ai;break;default:throw new TypeError(`dst type unrecognized: "${e}" : must have form [crlf:|lf:]type[:base64]`)}return s},Ef=function(e,t){switch(e){case $o:return Ue.utf8.encode(t);case cn:return Ue.utf16be.encode(t);case kn:return Ue.utf16le.encode(t);case un:return Ue.utf32be.encode(t);case Tn:return Ue.utf32le.encode(t);case si:return Ue.uint7.encode(t);case ii:return Ue.uint8.encode(t);case oi:return Ue.uint16be.encode(t);case Pc:return Ue.uint16le.encode(t);case ai:return Ue.uint32be.encode(t);case vc:return Ue.uint32le.encode(t);case zn:return Ue.string.encode(t);case _c:return Ue.escaped.encode(t);default:throw new TypeError(`encode type "${e}" not recognized`)}},i8=function(e){switch(e.type){case $o:return Ue.utf8.decode(e.data,e.bom);case kn:return Ue.utf16le.decode(e.data,e.bom);case cn:return Ue.utf16be.decode(e.data,e.bom);case un:return Ue.utf32be.decode(e.data,e.bom);case Tn:return Ue.utf32le.decode(e.data,e.bom);case si:return Ue.uint7.decode(e.data);case ii:return Ue.uint8.decode(e.data);case oi:return Ue.uint16be.decode(e.data);case Pc:return Ue.uint16le.decode(e.data);case ai:return Ue.uint32be.decode(e.data);case vc:return Ue.uint32le.decode(e.data);case zn:return Ue.string.decode(e.data);case _c:return Ue.escaped.decode(e.data);default:throw new TypeError(`decode type "${e.type}" not recognized`)}};ci.decode=function(e,t){let n=n8(e,t);return i8(n)};ci.encode=function(e,t){let n,s,i=s8(e,t);return i.crlf?(n=Ue.lineEnds.crlf(t),s=Ef(i.type,n)):i.lf?(n=Ue.lineEnds.lf(t),s=Ef(i.type,n)):s=Ef(i.type,t),i.base64&&(s=Ue.base64.encode(s)),s};var o8=function(e,t,n){return ci.encode(n,ci.decode(e,t))};ci.convert=o8});var _f=P((DS,tx)=>{"use strict";tx.exports=function(){return`/* This file automatically generated by jsonToless() and LESS. */
|
|
218
|
+
.apg-mono {
|
|
219
|
+
font-family: monospace;
|
|
220
|
+
}
|
|
221
|
+
.apg-active {
|
|
222
|
+
font-weight: bold;
|
|
223
|
+
color: #000000;
|
|
224
|
+
}
|
|
225
|
+
.apg-match {
|
|
226
|
+
font-weight: bold;
|
|
227
|
+
color: #264BFF;
|
|
228
|
+
}
|
|
229
|
+
.apg-empty {
|
|
230
|
+
font-weight: bold;
|
|
231
|
+
color: #0fbd0f;
|
|
232
|
+
}
|
|
233
|
+
.apg-nomatch {
|
|
234
|
+
font-weight: bold;
|
|
235
|
+
color: #FF4000;
|
|
236
|
+
}
|
|
237
|
+
.apg-lh-match {
|
|
238
|
+
font-weight: bold;
|
|
239
|
+
color: #1A97BA;
|
|
240
|
+
}
|
|
241
|
+
.apg-lb-match {
|
|
242
|
+
font-weight: bold;
|
|
243
|
+
color: #5F1687;
|
|
244
|
+
}
|
|
245
|
+
.apg-remainder {
|
|
246
|
+
font-weight: bold;
|
|
247
|
+
color: #999999;
|
|
248
|
+
}
|
|
249
|
+
.apg-ctrl-char {
|
|
250
|
+
font-weight: bolder;
|
|
251
|
+
font-style: italic;
|
|
252
|
+
font-size: 0.6em;
|
|
253
|
+
}
|
|
254
|
+
.apg-line-end {
|
|
255
|
+
font-weight: bold;
|
|
256
|
+
color: #000000;
|
|
257
|
+
}
|
|
258
|
+
.apg-error {
|
|
259
|
+
font-weight: bold;
|
|
260
|
+
color: #FF4000;
|
|
261
|
+
}
|
|
262
|
+
.apg-phrase {
|
|
263
|
+
color: #000000;
|
|
264
|
+
background-color: #8caae6;
|
|
265
|
+
}
|
|
266
|
+
.apg-empty-phrase {
|
|
267
|
+
color: #0fbd0f;
|
|
268
|
+
}
|
|
269
|
+
table.apg-state {
|
|
270
|
+
font-family: monospace;
|
|
271
|
+
margin-top: 5px;
|
|
272
|
+
font-size: 11px;
|
|
273
|
+
line-height: 130%;
|
|
274
|
+
text-align: left;
|
|
275
|
+
border: 1px solid black;
|
|
276
|
+
border-collapse: collapse;
|
|
277
|
+
}
|
|
278
|
+
table.apg-state th,
|
|
279
|
+
table.apg-state td {
|
|
280
|
+
text-align: left;
|
|
281
|
+
border: 1px solid black;
|
|
282
|
+
border-collapse: collapse;
|
|
283
|
+
}
|
|
284
|
+
table.apg-state th:nth-last-child(2),
|
|
285
|
+
table.apg-state td:nth-last-child(2) {
|
|
286
|
+
text-align: right;
|
|
287
|
+
}
|
|
288
|
+
table.apg-state caption {
|
|
289
|
+
font-size: 125%;
|
|
290
|
+
line-height: 130%;
|
|
291
|
+
font-weight: bold;
|
|
292
|
+
text-align: left;
|
|
293
|
+
}
|
|
294
|
+
table.apg-stats {
|
|
295
|
+
font-family: monospace;
|
|
296
|
+
margin-top: 5px;
|
|
297
|
+
font-size: 11px;
|
|
298
|
+
line-height: 130%;
|
|
299
|
+
text-align: right;
|
|
300
|
+
border: 1px solid black;
|
|
301
|
+
border-collapse: collapse;
|
|
302
|
+
}
|
|
303
|
+
table.apg-stats th,
|
|
304
|
+
table.apg-stats td {
|
|
305
|
+
text-align: right;
|
|
306
|
+
border: 1px solid black;
|
|
307
|
+
border-collapse: collapse;
|
|
308
|
+
}
|
|
309
|
+
table.apg-stats caption {
|
|
310
|
+
font-size: 125%;
|
|
311
|
+
line-height: 130%;
|
|
312
|
+
font-weight: bold;
|
|
313
|
+
text-align: left;
|
|
314
|
+
}
|
|
315
|
+
table.apg-trace {
|
|
316
|
+
font-family: monospace;
|
|
317
|
+
margin-top: 5px;
|
|
318
|
+
font-size: 11px;
|
|
319
|
+
line-height: 130%;
|
|
320
|
+
text-align: right;
|
|
321
|
+
border: 1px solid black;
|
|
322
|
+
border-collapse: collapse;
|
|
323
|
+
}
|
|
324
|
+
table.apg-trace caption {
|
|
325
|
+
font-size: 125%;
|
|
326
|
+
line-height: 130%;
|
|
327
|
+
font-weight: bold;
|
|
328
|
+
text-align: left;
|
|
329
|
+
}
|
|
330
|
+
table.apg-trace th,
|
|
331
|
+
table.apg-trace td {
|
|
332
|
+
text-align: right;
|
|
333
|
+
border: 1px solid black;
|
|
334
|
+
border-collapse: collapse;
|
|
335
|
+
}
|
|
336
|
+
table.apg-trace th:last-child,
|
|
337
|
+
table.apg-trace th:nth-last-child(2),
|
|
338
|
+
table.apg-trace td:last-child,
|
|
339
|
+
table.apg-trace td:nth-last-child(2) {
|
|
340
|
+
text-align: left;
|
|
341
|
+
}
|
|
342
|
+
table.apg-grammar {
|
|
343
|
+
font-family: monospace;
|
|
344
|
+
margin-top: 5px;
|
|
345
|
+
font-size: 11px;
|
|
346
|
+
line-height: 130%;
|
|
347
|
+
text-align: right;
|
|
348
|
+
border: 1px solid black;
|
|
349
|
+
border-collapse: collapse;
|
|
350
|
+
}
|
|
351
|
+
table.apg-grammar caption {
|
|
352
|
+
font-size: 125%;
|
|
353
|
+
line-height: 130%;
|
|
354
|
+
font-weight: bold;
|
|
355
|
+
text-align: left;
|
|
356
|
+
}
|
|
357
|
+
table.apg-grammar th,
|
|
358
|
+
table.apg-grammar td {
|
|
359
|
+
text-align: right;
|
|
360
|
+
border: 1px solid black;
|
|
361
|
+
border-collapse: collapse;
|
|
362
|
+
}
|
|
363
|
+
table.apg-grammar th:last-child,
|
|
364
|
+
table.apg-grammar td:last-child {
|
|
365
|
+
text-align: left;
|
|
366
|
+
}
|
|
367
|
+
table.apg-rules {
|
|
368
|
+
font-family: monospace;
|
|
369
|
+
margin-top: 5px;
|
|
370
|
+
font-size: 11px;
|
|
371
|
+
line-height: 130%;
|
|
372
|
+
text-align: right;
|
|
373
|
+
border: 1px solid black;
|
|
374
|
+
border-collapse: collapse;
|
|
375
|
+
}
|
|
376
|
+
table.apg-rules caption {
|
|
377
|
+
font-size: 125%;
|
|
378
|
+
line-height: 130%;
|
|
379
|
+
font-weight: bold;
|
|
380
|
+
text-align: left;
|
|
381
|
+
}
|
|
382
|
+
table.apg-rules th,
|
|
383
|
+
table.apg-rules td {
|
|
384
|
+
text-align: right;
|
|
385
|
+
border: 1px solid black;
|
|
386
|
+
border-collapse: collapse;
|
|
387
|
+
}
|
|
388
|
+
table.apg-rules a {
|
|
389
|
+
color: #003399 !important;
|
|
390
|
+
}
|
|
391
|
+
table.apg-rules a:hover {
|
|
392
|
+
color: #8caae6 !important;
|
|
393
|
+
}
|
|
394
|
+
table.apg-attrs {
|
|
395
|
+
font-family: monospace;
|
|
396
|
+
margin-top: 5px;
|
|
397
|
+
font-size: 11px;
|
|
398
|
+
line-height: 130%;
|
|
399
|
+
text-align: center;
|
|
400
|
+
border: 1px solid black;
|
|
401
|
+
border-collapse: collapse;
|
|
402
|
+
}
|
|
403
|
+
table.apg-attrs caption {
|
|
404
|
+
font-size: 125%;
|
|
405
|
+
line-height: 130%;
|
|
406
|
+
font-weight: bold;
|
|
407
|
+
text-align: left;
|
|
408
|
+
}
|
|
409
|
+
table.apg-attrs th,
|
|
410
|
+
table.apg-attrs td {
|
|
411
|
+
text-align: center;
|
|
412
|
+
border: 1px solid black;
|
|
413
|
+
border-collapse: collapse;
|
|
414
|
+
}
|
|
415
|
+
table.apg-attrs th:nth-child(1),
|
|
416
|
+
table.apg-attrs th:nth-child(2),
|
|
417
|
+
table.apg-attrs th:nth-child(3) {
|
|
418
|
+
text-align: right;
|
|
419
|
+
}
|
|
420
|
+
table.apg-attrs td:nth-child(1),
|
|
421
|
+
table.apg-attrs td:nth-child(2),
|
|
422
|
+
table.apg-attrs td:nth-child(3) {
|
|
423
|
+
text-align: right;
|
|
424
|
+
}
|
|
425
|
+
table.apg-attrs a {
|
|
426
|
+
color: #003399 !important;
|
|
427
|
+
}
|
|
428
|
+
table.apg-attrs a:hover {
|
|
429
|
+
color: #8caae6 !important;
|
|
430
|
+
}
|
|
431
|
+
`}});var ui=P(Ke=>{"use strict";var Zt=Ko(),kf=ex(),a8=_f(),ct=ks(),Kn="utilities.js: ",Os=function(r,e,t){let n,s=e,i=!0;for(;i;){if(r<=0){s=0,n=0;break}if(typeof s!="number"){s=0,n=r;break}if(s>=r){s=r,n=r;break}if(typeof t!="number"){n=r;break}if(n=s+t,n>r){n=r;break}break}return{beg:s,end:n}};Ke.htmlToPage=function(r,e){let t;if(typeof r!="string")throw new Error(`${Kn}htmlToPage: input HTML is not a string`);typeof e!="string"?t="htmlToPage":t=e;let n="";return n+=`<!DOCTYPE html>
|
|
432
|
+
`,n+=`<html lang="en">
|
|
433
|
+
`,n+=`<head>
|
|
434
|
+
`,n+=`<meta charset="utf-8">
|
|
435
|
+
`,n+=`<title>${t}</title>
|
|
436
|
+
`,n+=`<style>
|
|
437
|
+
`,n+=a8(),n+=`</style>
|
|
438
|
+
`,n+=`</head>
|
|
439
|
+
<body>
|
|
440
|
+
`,n+=`<p>${new Date}</p>
|
|
441
|
+
`,n+=r,n+=`</body>
|
|
442
|
+
</html>
|
|
443
|
+
`,n};Ke.parserResultToHtml=function(r,e){let t=null;typeof e=="string"&&e!==""&&(t=e);let n,s;r.success===!0?n=`<span class="${Zt.CLASS_MATCH}">true</span>`:n=`<span class="${Zt.CLASS_NOMATCH}">false</span>`,r.state===ct.EMPTY?s=`<span class="${Zt.CLASS_EMPTY}">EMPTY</span>`:r.state===ct.MATCH?s=`<span class="${Zt.CLASS_MATCH}">MATCH</span>`:r.state===ct.NOMATCH?s=`<span class="${Zt.CLASS_NOMATCH}">NOMATCH</span>`:s=`<span class="${Zt.CLASS_NOMATCH}">unrecognized</span>`;let i="";return i+=`<table class="${Zt.CLASS_STATE}">
|
|
444
|
+
`,t&&(i+=`<caption>${t}</caption>
|
|
445
|
+
`),i+=`<tr><th>state item</th><th>value</th><th>description</th></tr>
|
|
446
|
+
`,i+=`<tr><td>parser success</td><td>${n}</td>
|
|
447
|
+
`,i+=`<td><span class="${Zt.CLASS_MATCH}">true</span> if the parse succeeded,
|
|
448
|
+
`,i+=` <span class="${Zt.CLASS_NOMATCH}">false</span> otherwise`,i+=`<br><i>NOTE: for success, entire string must be matched</i></td></tr>
|
|
449
|
+
`,i+=`<tr><td>parser state</td><td>${s}</td>
|
|
450
|
+
`,i+=`<td><span class="${Zt.CLASS_EMPTY}">EMPTY</span>, `,i+=`<span class="${Zt.CLASS_MATCH}">MATCH</span> or
|
|
451
|
+
`,i+=`<span class="${Zt.CLASS_NOMATCH}">NOMATCH</span></td></tr>
|
|
452
|
+
`,i+=`<tr><td>string length</td><td>${r.length}</td><td>length of the input (sub)string</td></tr>
|
|
453
|
+
`,i+=`<tr><td>matched length</td><td>${r.matched}</td><td>number of input string characters matched</td></tr>
|
|
454
|
+
`,i+=`<tr><td>max matched</td><td>${r.maxMatched}</td><td>maximum number of input string characters matched</td></tr>
|
|
455
|
+
`,i+=`<tr><td>max tree depth</td><td>${r.maxTreeDepth}</td><td>maximum depth of the parse tree reached</td></tr>
|
|
456
|
+
`,i+=`<tr><td>node hits</td><td>${r.nodeHits}</td><td>number of parse tree node hits (opcode function calls)</td></tr>
|
|
457
|
+
`,i+=`<tr><td>input length</td><td>${r.inputLength}</td><td>length of full input string</td></tr>
|
|
458
|
+
`,i+=`<tr><td>sub-string begin</td><td>${r.subBegin}</td><td>sub-string first character index</td></tr>
|
|
459
|
+
`,i+=`<tr><td>sub-string end</td><td>${r.subEnd}</td><td>sub-string end-of-string index</td></tr>
|
|
460
|
+
`,i+=`<tr><td>sub-string length</td><td>${r.subLength}</td><td>sub-string length</td></tr>
|
|
461
|
+
`,i+=`</table>
|
|
462
|
+
`,i};Ke.charsToString=function(r,e,t){let n,s;if(typeof e=="number"){if(e>=r.length)return"";n=e<0?0:e}else n=0;if(typeof t=="number"){if(t<=0)return"";s=t>r.length-n?r.length:n+t}else s=r.length;return n<s?kf.encode("UTF16LE",r.slice(n,s)).toString("utf16le"):""};Ke.stringToChars=function(r){return kf.decode("STRING",r)};Ke.opcodeToString=function(r){let e="unknown";switch(r){case ct.ALT:e="ALT";break;case ct.CAT:e="CAT";break;case ct.RNM:e="RNM";break;case ct.UDT:e="UDT";break;case ct.AND:e="AND";break;case ct.NOT:e="NOT";break;case ct.REP:e="REP";break;case ct.TRG:e="TRG";break;case ct.TBS:e="TBS";break;case ct.TLS:e="TLS";break;case ct.BKR:e="BKR";break;case ct.BKA:e="BKA";break;case ct.BKN:e="BKN";break;case ct.ABG:e="ABG";break;case ct.AEN:e="AEN";break;default:throw new Error("unrecognized opcode")}return e};Ke.stateToString=function(r){let e="unknown";switch(r){case ct.ACTIVE:e="ACTIVE";break;case ct.MATCH:e="MATCH";break;case ct.EMPTY:e="EMPTY";break;case ct.NOMATCH:e="NOMATCH";break;default:throw new Error("unrecognized state")}return e};Ke.asciiChars=["NUL","SOH","STX","ETX","EOT","ENQ","ACK","BEL","BS","TAB","LF","VT","FF","CR","SO","SI","DLE","DC1","DC2","DC3","DC4","NAK","SYN","ETB","CAN","EM","SUB","ESC","FS","GS","RS","US"," ","!",""","#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","DEL"];Ke.charToHex=function(r){let e=r.toString(16).toUpperCase();switch(e.length){case 1:case 3:case 7:e=`0${e}`;break;case 2:case 6:e=`00${e}`;break;case 4:break;case 5:e=`000${e}`;break;default:throw new Error("unrecognized option")}return e};Ke.charsToDec=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Kn}charsToDec: input must be an array of integers`);let s=Os(r.length,e,t);if(s.end>s.beg){n+=r[s.beg];for(let i=s.beg+1;i<s.end;i+=1)n+=`,${r[i]}`}return n};Ke.charsToHex=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Kn}charsToHex: input must be an array of integers`);let s=Os(r.length,e,t);if(s.end>s.beg){n+=`\\x${Ke.charToHex(r[s.beg])}`;for(let i=s.beg+1;i<s.end;i+=1)n+=`,\\x${Ke.charToHex(r[i])}`}return n};Ke.charsToHtmlEntities=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Kn}charsToHex: input must be an array of integers`);let s=Os(r.length,e,t);if(s.end>s.beg)for(let i=s.beg;i<s.end;i+=1)n+=`&#x${r[i].toString(16)};`;return n};function c8(r){return!(r>=55296&&r<=57343||r>1114111)}Ke.charsToUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Kn}charsToUnicode: input must be an array of integers`);let s=Os(r.length,e,t);if(s.end>s.beg)for(let i=s.beg;i<s.end;i+=1)c8(r[i])?n+=`&#${r[i]};`:n+=` U+${Ke.charToHex(r[i])}`;return n};Ke.charsToJsUnicode=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Kn}charsToJsUnicode: input must be an array of integers`);let s=Os(r.length,e,t);if(s.end>s.beg){n+=`\\u${Ke.charToHex(r[s.beg])}`;for(let i=s.beg+1;i<s.end;i+=1)n+=`,\\u${Ke.charToHex(r[i])}`}return n};Ke.charsToAscii=function(r,e,t){let n="";if(!Array.isArray(r))throw new Error(`${Kn}charsToAscii: input must be an array of integers`);let s=Os(r.length,e,t);for(let i=s.beg;i<s.end;i+=1){let o=r[i];o>=32&&o<=126?n+=String.fromCharCode(o):n+=`\\x${Ke.charToHex(o)}`}return n};Ke.charsToAsciiHtml=function(r,e,t){if(!Array.isArray(r))throw new Error(`${Kn}charsToAsciiHtml: input must be an array of integers`);let n="",s,i=Os(r.length,e,t);for(let o=i.beg;o<i.end;o+=1)s=r[o],s<32||s===127?n+=`<span class="${Zt.CLASS_CTRLCHAR}">${Ke.asciiChars[s]}</span>`:s>127?n+=`<span class="${Zt.CLASS_CTRLCHAR}">U+${Ke.charToHex(s)}</span>`:n+=Ke.asciiChars[s];return n};Ke.stringToAsciiHtml=function(r){let e=kf.decode("STRING",r);return this.charsToAsciiHtml(e)}});var nx=P((qS,rx)=>{"use strict";rx.exports=function(){let e=ks(),t=ui(),n="ast.js: ",s=this,i=null,o=null,a=null,c=0,u=[],l=[],f=[],h=[];this.callbacks=[],this.astObject="astObject",this.init=function(b,y,m){f.length=0,h.length=0,u.length=0,c=0,i=b,o=y,a=m;let E,_=[];for(E=0;E<i.length;E+=1)_.push(i[E].lower);for(E=0;E<o.length;E+=1)_.push(o[E].lower);for(c=i.length+o.length,E=0;E<c;E+=1)u[E]=!1,l[E]=null;for(let C in s.callbacks){let L=C.toLowerCase();if(E=_.indexOf(L),E<0)throw new Error(`${n}init: node '${C}' not a rule or udt name`);typeof s.callbacks[C]=="function"&&(u[E]=!0,l[E]=s.callbacks[C]),s.callbacks[C]===!0&&(u[E]=!0)}},this.ruleDefined=function(b){return u[b]!==!1},this.udtDefined=function(b){return u[i.length+b]!==!1},this.down=function(b,y){let m=h.length;return f.push(m),h.push({name:y,thisIndex:m,thatIndex:null,state:e.SEM_PRE,callbackIndex:b,phraseIndex:null,phraseLength:null,stack:f.length}),m},this.up=function(b,y,m,E){let _=h.length,C=f.pop();return h.push({name:y,thisIndex:_,thatIndex:C,state:e.SEM_POST,callbackIndex:b,phraseIndex:m,phraseLength:E,stack:f.length}),h[C].thatIndex=_,h[C].phraseIndex=m,h[C].phraseLength=E,_},this.translate=function(b){let y,m,E;for(let _=0;_<h.length;_+=1)E=h[_],m=l[E.callbackIndex],E.state===e.SEM_PRE?m!==null&&(y=m(e.SEM_PRE,a,E.phraseIndex,E.phraseLength,b),y===e.SEM_SKIP&&(_=E.thatIndex)):m!==null&&m(e.SEM_POST,a,E.phraseIndex,E.phraseLength,b)},this.setLength=function(b){h.length=b,b>0?f.length=h[b-1].stack:f.length=0},this.getLength=function(){return h.length};function g(x){let b="";for(let y=0;y<x;y+=1)b+=" ";return b}this.toXml=function(b){let y=t.charsToDec,m="decimal integer character codes";if(typeof b=="string"&&b.length>=3){let C=b.slice(0,3).toLowerCase();C==="asc"?(y=t.charsToAscii,m="ASCII for printing characters, hex for non-printing"):C==="hex"?(y=t.charsToHex,m="hexadecimal integer character codes"):C==="uni"&&(y=t.charsToUnicode,m="Unicode UTF-32 integer character codes")}let E="",_=0;return E+=`<?xml version="1.0" encoding="utf-8"?>
|
|
463
|
+
`,E+=`<root nodes="${h.length/2}" characters="${a.length}">
|
|
464
|
+
`,E+=`<!-- input string, ${m} -->
|
|
465
|
+
`,E+=g(_+2),E+=y(a),E+=`
|
|
466
|
+
`,h.forEach(C=>{C.state===e.SEM_PRE?(_+=1,E+=g(_),E+=`<node name="${C.name}" index="${C.phraseIndex}" length="${C.phraseLength}">
|
|
467
|
+
`,E+=g(_+2),E+=y(a,C.phraseIndex,C.phraseLength),E+=`
|
|
468
|
+
`):(E+=g(_),E+=`</node><!-- name="${C.name}" -->
|
|
469
|
+
`,_-=1)}),E+=`</root>
|
|
470
|
+
`,E},this.phrases=function(){let b={},y,m;for(y=0;y<h.length;y+=1)m=h[y],m.state===e.SEM_PRE&&(Array.isArray(b[m.name])||(b[m.name]=[]),b[m.name].push({index:m.phraseIndex,length:m.phraseLength}));return b}}});var Tf=P((GS,sx)=>{"use strict";sx.exports=function(){"use strict;";let e="circular-buffer.js: ",t=-1,n=0;this.init=function(i){if(typeof i!="number"||i<=0)throw new Error(`${e}init: circular buffer size must an integer > 0`);n=Math.ceil(i),t=-1},this.increment=function(){return t+=1,(t+n)%n},this.maxSize=function(){return n},this.items=function(){return t+1},this.getListIndex=function(i){return t===-1||i<0||i>t||t-i>=n?-1:(i+n)%n},this.forEach=function(i){if(t!==-1){if(t<n){for(let o=0;o<=t;o+=1)i(o,o);return}for(let o=t-n+1;o<=t;o+=1){let a=(o+n)%n;i(a,o)}}}}});var ox=P((zS,ix)=>{"use strict";ix.exports=function(){let e=ks(),t=ui(),n="parser.js: ",s=this,i;this.ast=null,this.stats=null,this.trace=null,this.callbacks=[];let o=null,a=null,c,u,l,f,h=0,g=0,x=0,b=null,y=null,m=null,E=null,_=null,C=0,L=1/0,A=1/0,O=function(v,p,w){let I=`${n}evaluateRule(): `;if(v>=m.length)throw new Error(`${I}rule index: ${v} out of range`);if(p>=l)throw new Error(`${I}phrase index: ${p} out of range`);let{length:N}=o;o.push({type:e.RNM,index:v}),i(N,p,w),o.pop()},j=function(k,v,p){let w=`${n}evaluateUdt(): `;if(k>=E.length)throw new Error(`${w}udt index: ${k} out of range`);if(v>=l)throw new Error(`${w}phrase index: ${v} out of range`);let{length:I}=o;o.push({type:e.UDT,empty:E[k].empty,index:k}),i(I,v,p),o.pop()},X=function(){h=0,g=0,x=0,C=0,f=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],m=null,E=null,a=null,c=0,u=0,l=0,b=null,y=null,_=null,o=null},oe=function(){let k=[],v=function(){let w={};m.forEach(I=>{I.isBkr&&(w[I.lower]=null)}),E.length>0&&E.forEach(I=>{I.isBkr&&(w[I.lower]=null)}),k.push(w)},p=function(){let w=k[k.length-1],I={};for(let N in w)I[N]=w[N];return I};this.push=function(){k.push(p())},this.pop=function(I){let N=I;if(N||(N=k.length-1),N<1||N>k.length)throw new Error(`${n}backRef.pop(): bad length: ${N}`);return k.length=N,k[k.length-1]},this.length=function(){return k.length},this.savePhrase=function(I,N,q){k[k.length-1][I]={phraseIndex:N,phraseLength:q}},this.getPhrase=function(w){return k[k.length-1][w]},v()},de=function(){let v=this;this.state=e.ACTIVE,this.phraseLength=0,this.ruleIndex=0,this.udtIndex=0,this.lookAround=f[f.length-1],this.uFrame=new oe,this.pFrame=new oe,this.evaluateRule=O,this.evaluateUdt=j,this.refresh=function(){v.state=e.ACTIVE,v.phraseLength=0,v.lookAround=f[f.length-1]}},Le=function(){return f[f.length-1]},Se=function(){return f.length>1},nt=function(){return f[f.length-1].lookAround===e.LOOKAROUND_BEHIND},H=function(){let k=`${n}initializeAst(): `,v=!0;for(;v;){if(s.ast===void 0){s.ast=null;break}if(s.ast===null)break;if(s.ast.astObject!=="astObject")throw new Error(`${k}ast object not recognized`);break}s.ast!==null&&s.ast.init(m,E,a)},V=function(){let k=`${n}initializeTrace(): `,v=!0;for(;v;){if(s.trace===void 0){s.trace=null;break}if(s.trace===null)break;if(s.trace.traceObject!=="traceObject")throw new Error(`${k}trace object not recognized`);break}s.trace!==null&&s.trace.init(m,E,a)},ae=function(){let k=`${n}initializeStats(): `,v=!0;for(;v;){if(s.stats===void 0){s.stats=null;break}if(s.stats===null)break;if(s.stats.statsObject!=="statsObject")throw new Error(`${k}stats object not recognized`);break}s.stats!==null&&s.stats.init(m,E)},ve=function(k){let v=`${n}initializeGrammar(): `;if(!k)throw new Error(`${v}grammar object undefined`);if(k.grammarObject!=="grammarObject")throw new Error(`${v}bad grammar object`);m=k.rules,E=k.udts},Ae=function(k){let v=`${n}initializeStartRule(): `,p=null;if(typeof k=="number"){if(k>=m.length)throw new Error(`${v}start rule index too large: max: ${m.length}: index: ${k}`);p=k}else if(typeof k=="string"){let w=k.toLowerCase();for(let I=0;I<m.length;I+=1)if(w===m[I].lower){p=m[I].index;break}if(p===null)throw new Error(`${v}start rule name '${k}' not recognized`)}else throw new Error(`${v}type of start rule '${typeof k}' not recognized`);return p},Me=function(v,p,w){let I=`${n}initializeInputChars(): `,N=v,q=p,te=w;if(N===void 0)throw new Error(`${I}input string is undefined`);if(N===null)throw new Error(`${I}input string is null`);if(typeof N=="string")N=t.stringToChars(N);else if(!Array.isArray(N))throw new Error(`${I}input string is not a string or array`);if(N.length>0&&typeof N[0]!="number")throw new Error(`${I}input string not an array of integers`);if(typeof q!="number")q=0;else if(q=Math.floor(q),q<0||q>N.length)throw new Error(`${I}input beginning index out of range: ${q}`);if(typeof te!="number")te=N.length-q;else if(te=Math.floor(te),te<0||te>N.length-q)throw new Error(`${I}input length out of range: ${te}`);a=N,c=q,u=te,l=c+u},Qe=function(){let k=`${n}initializeCallbacks(): `,v;for(b=[],y=[],v=0;v<m.length;v+=1)b[v]=null;for(v=0;v<E.length;v+=1)y[v]=null;let p,w=[];for(v=0;v<m.length;v+=1)w.push(m[v].lower);for(v=0;v<E.length;v+=1)w.push(E[v].lower);for(let I in s.callbacks){if(v=w.indexOf(I.toLowerCase()),v<0)throw new Error(`${k}syntax callback '${I}' not a rule or udt name`);if(p=s.callbacks[I],p||(p=null),typeof p=="function"||p===null)v<m.length?b[v]=p:y[v-m.length]=p;else throw new Error(`${k}syntax callback[${I}] must be function reference or 'false' (false/null/undefined/etc.)`)}for(v=0;v<E.length;v+=1)if(y[v]===null)throw new Error(`${k}all UDT callbacks must be defined. UDT callback[${E[v].lower}] not a function reference`)};this.setMaxTreeDepth=function(k){if(typeof k!="number")throw new Error(`parser: max tree depth must be integer > 0: ${k}`);if(L=Math.floor(k),L<=0)throw new Error(`parser: max tree depth must be integer > 0: ${k}`)},this.setMaxNodeHits=function(k){if(typeof k!="number")throw new Error(`parser: max node hits must be integer > 0: ${k}`);if(A=Math.floor(k),A<=0)throw new Error(`parser: max node hits must be integer > 0: ${k}`)};let et=function(k,v,p){let w,I=`${n}parse(): `;ve(k);let N=Ae(v);Qe(),V(),ae(),H();let q=new de;switch(p!=null&&(_=p),o=[{type:e.RNM,index:N}],i(0,c,q),o=null,q.state){case e.ACTIVE:throw new Error(`${I}final state should never be 'ACTIVE'`);case e.NOMATCH:w=!1;break;case e.EMPTY:case e.MATCH:q.phraseLength===u?w=!0:w=!1;break;default:throw new Error("unrecognized state")}return{success:w,state:q.state,length:u,matched:q.phraseLength,maxMatched:C,maxTreeDepth:g,nodeHits:x,inputLength:a.length,subBegin:c,subEnd:l,subLength:u}};this.parseSubstring=function(v,p,w,I,N,q){return X(),Me(w,I,N),et(v,p,q)},this.parse=function(v,p,w,I){return X(),Me(w,0,w.length),et(v,p,I)};let ar=function(k,v,p){let w=o[k];for(let I=0;I<w.children.length&&(i(w.children[I],v,p),p.state===e.NOMATCH);I+=1);},cr=function(k,v,p){let w,I,N,q,te=o[k],ft=p.uFrame.length(),at=p.pFrame.length();s.ast&&(I=s.ast.getLength()),w=!0,N=v,q=0;for(let _e=0;_e<te.children.length;_e+=1)if(i(te.children[_e],N,p),p.state===e.NOMATCH){w=!1;break}else N+=p.phraseLength,q+=p.phraseLength;w?(p.state=q===0?e.EMPTY:e.MATCH,p.phraseLength=q):(p.state=e.NOMATCH,p.phraseLength=0,p.uFrame.pop(ft),p.pFrame.pop(at),s.ast&&s.ast.setLength(I))},nn=function(k,v,p){let w,I,N,q,te=o[k];if(te.max===0){p.state=e.EMPTY,p.phraseLength=0;return}I=v,N=0,q=0;let ft=p.uFrame.length(),at=p.pFrame.length();s.ast&&(w=s.ast.getLength());let _e=!0;for(;_e&&!(I>=l||(i(k+1,I,p),p.state===e.NOMATCH)||p.state===e.EMPTY||(q+=1,N+=p.phraseLength,I+=p.phraseLength,q===te.max)););p.state===e.EMPTY||q>=te.min?(p.state=N===0?e.EMPTY:e.MATCH,p.phraseLength=N):(p.state=e.NOMATCH,p.phraseLength=0,p.uFrame.pop(ft),p.pFrame.pop(at),s.ast&&s.ast.setLength(w))},sn=function(k,v,p,w){if(v.phraseLength>p){let I=`${n}opRNM(${k.name}): callback function error: `;throw I+=`sysData.phraseLength: ${v.phraseLength}`,I+=` must be <= remaining chars: ${p}`,new Error(I)}switch(v.state){case e.ACTIVE:if(w!==!0)throw new Error(`${n}opRNM(${k.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:v.phraseLength=0;break;case e.MATCH:v.phraseLength===0&&(v.state=e.EMPTY);break;case e.NOMATCH:v.phraseLength=0;break;default:throw new Error(`${n}opRNM(${k.name}): callback function return error. Unrecognized return state: ${v.state}`)}},ur=function(k,v,p){let w,I,N,q,te,ft,at=o[k],_e=m[at.index],gt=b[_e.index],qn=!Se();if(qn&&(I=s.ast&&s.ast.ruleDefined(at.index),I&&(w=s.ast.getLength(),s.ast.down(at.index,m[at.index].name)),q=p.uFrame.length(),te=p.pFrame.length(),p.uFrame.push(),p.pFrame.push(),ft=p.pFrame,p.pFrame=new oe),gt===null)N=o,o=_e.opcodes,i(0,v,p),o=N;else{let Eb=l-v;p.ruleIndex=_e.index,gt(p,a,v,_),sn(_e,p,Eb,!0),p.state===e.ACTIVE&&(N=o,o=_e.opcodes,i(0,v,p),o=N,p.ruleIndex=_e.index,gt(p,a,v,_),sn(_e,p,Eb,!1))}qn&&(I&&(p.state===e.NOMATCH?s.ast.setLength(w):s.ast.up(at.index,_e.name,v,p.phraseLength)),p.pFrame=ft,p.state===e.NOMATCH?(p.uFrame.pop(q),p.pFrame.pop(te)):_e.isBkr&&(p.pFrame.savePhrase(_e.lower,v,p.phraseLength),p.uFrame.savePhrase(_e.lower,v,p.phraseLength)))},B=function(k,v,p){if(v.phraseLength>p){let w=`${n}opUDT(${k.name}): callback function error: `;throw w+=`sysData.phraseLength: ${v.phraseLength}`,w+=` must be <= remaining chars: ${p}`,new Error(w)}switch(v.state){case e.ACTIVE:throw new Error(`${n}opUDT(${k.name}): callback function return error. ACTIVE state not allowed.`);case e.EMPTY:if(k.empty===!1)throw new Error(`${n}opUDT(${k.name}): callback function return error. May not return EMPTY.`);v.phraseLength=0;break;case e.MATCH:if(v.phraseLength===0){if(k.empty===!1)throw new Error(`${n}opUDT(${k.name}): callback function return error. May not return EMPTY.`);v.state=e.EMPTY}break;case e.NOMATCH:v.phraseLength=0;break;default:throw new Error(`${n}opUDT(${k.name}): callback function return error. Unrecognized return state: ${v.state}`)}},T=function(k,v,p){let w,I,N,q,te,ft,at=o[k],_e=E[at.index];p.UdtIndex=_e.index;let gt=!Se();gt&&(N=s.ast&&s.ast.udtDefined(at.index),N&&(I=m.length+at.index,w=s.ast.getLength(),s.ast.down(I,_e.name)),q=p.uFrame.length(),te=p.pFrame.length(),p.uFrame.push(),p.pFrame.push(),ft=p.pFrame,p.pFrame=new oe);let qn=l-v;y[at.index](p,a,v,_),B(_e,p,qn),gt&&(N&&(p.state===e.NOMATCH?s.ast.setLength(w):s.ast.up(I,_e.name,v,p.phraseLength)),p.pFrame=ft,p.state===e.NOMATCH?(p.uFrame.pop(q),p.pFrame.pop(te)):_e.isBkr&&(p.pFrame.savePhrase(_e.lower,v,p.phraseLength),p.uFrame.savePhrase(_e.lower,v,p.phraseLength)))},S=function(k,v,p){f.push({lookAround:e.LOOKAROUND_AHEAD,anchor:v,charsEnd:l,charsLength:u}),l=a.length,u=a.length-c,i(k+1,v,p);let w=f.pop();switch(l=w.charsEnd,u=w.charsLength,p.phraseLength=0,p.state){case e.EMPTY:p.state=e.EMPTY;break;case e.MATCH:p.state=e.EMPTY;break;case e.NOMATCH:p.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${p.state}`)}},F=function(k,v,p){f.push({lookAround:e.LOOKAROUND_AHEAD,anchor:v,charsEnd:l,charsLength:u}),l=a.length,u=a.length-c,i(k+1,v,p);let w=f.pop();switch(l=w.charsEnd,u=w.charsLength,p.phraseLength=0,p.state){case e.EMPTY:case e.MATCH:p.state=e.NOMATCH;break;case e.NOMATCH:p.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${p.state}`)}},J=function(k,v,p){let w=o[k];p.state=e.NOMATCH,v<l&&w.min<=a[v]&&a[v]<=w.max&&(p.state=e.MATCH,p.phraseLength=1)},W=function(k,v,p){let w,I=o[k],N=I.string.length;if(p.state=e.NOMATCH,v+N<=l){for(w=0;w<N;w+=1)if(a[v+w]!==I.string[w])return;p.state=e.MATCH,p.phraseLength=N}},re=function(k,v,p){let w,I,N=o[k];p.state=e.NOMATCH;let q=N.string.length;if(q===0){p.state=e.EMPTY;return}if(v+q<=l){for(w=0;w<q;w+=1)if(I=a[v+w],I>=65&&I<=90&&(I+=32),I!==N.string[w])return;p.state=e.MATCH,p.phraseLength=q}},Fe=function(k,v,p){p.state=e.NOMATCH,p.phraseLength=0,p.state=v===0?e.EMPTY:e.NOMATCH},je=function(k,v,p){p.state=e.NOMATCH,p.phraseLength=0,p.state=v===a.length?e.EMPTY:e.NOMATCH},Y=function(k,v,p){let w,I,N,q,te=o[k];p.state=e.NOMATCH,te.index<m.length?q=m[te.index].lower:q=E[te.index-m.length].lower;let ft=te.bkrMode===e.BKR_MODE_PM?p.pFrame.getPhrase(q):p.uFrame.getPhrase(q),at=te.bkrCase===e.BKR_MODE_CI;if(ft===null)return;let _e=ft.phraseIndex,gt=ft.phraseLength;if(gt===0){p.state=e.EMPTY;return}if(v+gt<=l){if(at){for(w=0;w<gt;w+=1)if(I=a[v+w],N=a[_e+w],I>=65&&I<=90&&(I+=32),N>=65&&N<=90&&(N+=32),I!==N)return;p.state=e.MATCH,p.phraseLength=gt}else for(w=0;w<gt;w+=1)if(I=a[v+w],N=a[_e+w],I!==N)return;p.state=e.MATCH,p.phraseLength=gt}},He=function(k,v,p){switch(f.push({lookAround:e.LOOKAROUND_BEHIND,anchor:v}),i(k+1,v,p),f.pop(),p.phraseLength=0,p.state){case e.EMPTY:p.state=e.EMPTY;break;case e.MATCH:p.state=e.EMPTY;break;case e.NOMATCH:p.state=e.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${p.state}`)}},Oe=function(k,v,p){switch(f.push({lookAround:e.LOOKAROUND_BEHIND,anchor:v}),i(k+1,v,p),f.pop(),p.phraseLength=0,p.state){case e.EMPTY:case e.MATCH:p.state=e.NOMATCH;break;case e.NOMATCH:p.state=e.EMPTY;break;default:throw new Error(`opBKN: invalid state ${p.state}`)}},ot=function(k,v,p){let w,I,N,q,te=o[k],ft=p.uFrame.length(),at=p.pFrame.length();s.ast&&(I=s.ast.getLength()),w=!0,N=v,q=0;for(let _e=te.children.length-1;_e>=0;_e-=1)if(i(te.children[_e],N,p),N-=p.phraseLength,q+=p.phraseLength,p.state===e.NOMATCH){w=!1;break}w?(p.state=q===0?e.EMPTY:e.MATCH,p.phraseLength=q):(p.state=e.NOMATCH,p.phraseLength=0,p.uFrame.pop(ft),p.pFrame.pop(at),s.ast&&s.ast.setLength(I))},Dr=function(k,v,p){let w,I,N,q,te=o[k];I=v,N=0,q=0;let ft=p.uFrame.length(),at=p.pFrame.length();s.ast&&(w=s.ast.getLength());let _e=!0;for(;_e&&!(I<=0||(i(k+1,I,p),p.state===e.NOMATCH)||p.state===e.EMPTY||(q+=1,N+=p.phraseLength,I-=p.phraseLength,q===te.max)););p.state===e.EMPTY||q>=te.min?(p.state=N===0?e.EMPTY:e.MATCH,p.phraseLength=N):(p.state=e.NOMATCH,p.phraseLength=0,p.uFrame.pop(ft),p.pFrame.pop(at),s.ast&&s.ast.setLength(w))},Tt=function(k,v,p){let w=o[k];if(p.state=e.NOMATCH,p.phraseLength=0,v>0){let I=a[v-1];w.min<=I&&I<=w.max&&(p.state=e.MATCH,p.phraseLength=1)}},Hn=function(k,v,p){let w,I=o[k];p.state=e.NOMATCH;let N=I.string.length,q=v-N;if(q>=0){for(w=0;w<N;w+=1)if(a[q+w]!==I.string[w])return;p.state=e.MATCH,p.phraseLength=N}},ti=function(k,v,p){let w,I=o[k];p.state=e.NOMATCH;let N=I.string.length;if(N===0){p.state=e.EMPTY;return}let q=v-N;if(q>=0){for(let te=0;te<N;te+=1)if(w=a[q+te],w>=65&&w<=90&&(w+=32),w!==I.string[te])return;p.state=e.MATCH,p.phraseLength=N}},gc=function(k,v,p){let w,I,N,q,te=o[k];p.state=e.NOMATCH,p.phraseLength=0,te.index<m.length?q=m[te.index].lower:q=E[te.index-m.length].lower;let ft=te.bkrMode===e.BKR_MODE_PM?p.pFrame.getPhrase(q):p.uFrame.getPhrase(q),at=te.bkrCase===e.BKR_MODE_CI;if(ft===null)return;let _e=ft.phraseIndex,gt=ft.phraseLength;if(gt===0){p.state=e.EMPTY,p.phraseLength=0;return}let qn=v-gt;if(qn>=0){if(at){for(w=0;w<gt;w+=1)if(I=a[qn+w],N=a[_e+w],I>=65&&I<=90&&(I+=32),N>=65&&N<=90&&(N+=32),I!==N)return;p.state=e.MATCH,p.phraseLength=gt}else for(w=0;w<gt;w+=1)if(I=a[qn+w],N=a[_e+w],I!==N)return;p.state=e.MATCH,p.phraseLength=gt}};i=function(v,p,w){let I=!0,N=o[v];if(x+=1,x>A)throw new Error(`parser: maximum number of node hits exceeded: ${A}`);if(h+=1,h>g&&(g=h,g>L))throw new Error(`parser: maximum parse tree depth exceeded: ${L}`);if(w.refresh(),s.trace!==null){let q=Le();s.trace.down(N,w.state,p,w.phraseLength,q.anchor,q.lookAround)}if(nt())switch(N.type){case e.ALT:ar(v,p,w);break;case e.CAT:ot(v,p,w);break;case e.REP:Dr(v,p,w);break;case e.RNM:ur(v,p,w);break;case e.UDT:T(v,p,w);break;case e.AND:S(v,p,w);break;case e.NOT:F(v,p,w);break;case e.TRG:Tt(v,p,w);break;case e.TBS:Hn(v,p,w);break;case e.TLS:ti(v,p,w);break;case e.BKR:gc(v,p,w);break;case e.BKA:He(v,p,w);break;case e.BKN:Oe(v,p,w);break;case e.ABG:Fe(v,p,w);break;case e.AEN:je(v,p,w);break;default:I=!1;break}else switch(N.type){case e.ALT:ar(v,p,w);break;case e.CAT:cr(v,p,w);break;case e.REP:nn(v,p,w);break;case e.RNM:ur(v,p,w);break;case e.UDT:T(v,p,w);break;case e.AND:S(v,p,w);break;case e.NOT:F(v,p,w);break;case e.TRG:J(v,p,w);break;case e.TBS:W(v,p,w);break;case e.TLS:re(v,p,w);break;case e.BKR:Y(v,p,w);break;case e.BKA:He(v,p,w);break;case e.BKN:Oe(v,p,w);break;case e.ABG:Fe(v,p,w);break;case e.AEN:je(v,p,w);break;default:I=!1;break}if(!Se()&&p+w.phraseLength>C&&(C=p+w.phraseLength),s.stats!==null&&s.stats.collect(N,w),s.trace!==null){let q=Le();s.trace.up(N,w.state,p,w.phraseLength,q.anchor,q.lookAround)}return h-=1,I}}});var cx=P((KS,ax)=>{"use strict";ax.exports=function(){let e=ks(),t=ui(),n=Ko(),s="stats.js: ",i=[],o=[],a=[],c,u=[],l=[];this.statsObject="statsObject";let f="stats",h=function(A,O){return A.lower<O.lower?-1:A.lower>O.lower?1:0},g=function(A,O){return A.total<O.total?1:A.total>O.total?-1:h(A,O)},x=function(A,O){return A.index<O.index?-1:A.index>O.index?1:0},b=function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},y=function(){a.length=0,c=new b,a[e.ALT]=new b,a[e.CAT]=new b,a[e.REP]=new b,a[e.RNM]=new b,a[e.TRG]=new b,a[e.TBS]=new b,a[e.TLS]=new b,a[e.UDT]=new b,a[e.AND]=new b,a[e.NOT]=new b,a[e.BKR]=new b,a[e.BKA]=new b,a[e.BKN]=new b,a[e.ABG]=new b,a[e.AEN]=new b,u.length=0;for(let A=0;A<i.length;A+=1)u.push({empty:0,match:0,nomatch:0,total:0,name:i[A].name,lower:i[A].lower,index:i[A].index});if(o.length>0){l.length=0;for(let A=0;A<o.length;A+=1)l.push({empty:0,match:0,nomatch:0,total:0,name:o[A].name,lower:o[A].lower,index:o[A].index})}},m=function(A,O){switch(A.total+=1,O){case e.EMPTY:A.empty+=1;break;case e.MATCH:A.match+=1;break;case e.NOMATCH:A.nomatch+=1;break;default:throw new Error(`${s}collect(): incStat(): unrecognized state: ${O}`)}},E=function(A,O){let j="";return j+="<tr>",j+=`<td class="${n.CLASS_ACTIVE}">${A}</td>`,j+=`<td class="${n.CLASS_EMPTY}">${O.empty}</td>`,j+=`<td class="${n.CLASS_MATCH}">${O.match}</td>`,j+=`<td class="${n.CLASS_NOMATCH}">${O.nomatch}</td>`,j+=`<td class="${n.CLASS_ACTIVE}">${O.total}</td>`,j+=`</tr>
|
|
471
|
+
`,j},_=function(){let A="";return A+=E("ALT",a[e.ALT]),A+=E("CAT",a[e.CAT]),A+=E("REP",a[e.REP]),A+=E("RNM",a[e.RNM]),A+=E("TRG",a[e.TRG]),A+=E("TBS",a[e.TBS]),A+=E("TLS",a[e.TLS]),A+=E("UDT",a[e.UDT]),A+=E("AND",a[e.AND]),A+=E("NOT",a[e.NOT]),A+=E("BKR",a[e.BKR]),A+=E("BKA",a[e.BKA]),A+=E("BKN",a[e.BKN]),A+=E("ABG",a[e.ABG]),A+=E("AEN",a[e.AEN]),A+=E("totals",c),A},C=function(){let A="";A+=`<tr><th></th><th></th><th></th><th></th><th></th></tr>
|
|
472
|
+
`,A+=`<tr><th>rules</th><th></th><th></th><th></th><th></th></tr>
|
|
473
|
+
`;for(let O=0;O<i.length;O+=1)u[O].total>0&&(A+="<tr>",A+=`<td class="${n.CLASS_ACTIVE}">${u[O].name}</td>`,A+=`<td class="${n.CLASS_EMPTY}">${u[O].empty}</td>`,A+=`<td class="${n.CLASS_MATCH}">${u[O].match}</td>`,A+=`<td class="${n.CLASS_NOMATCH}">${u[O].nomatch}</td>`,A+=`<td class="${n.CLASS_ACTIVE}">${u[O].total}</td>`,A+=`</tr>
|
|
474
|
+
`);if(o.length>0){A+=`<tr><th></th><th></th><th></th><th></th><th></th></tr>
|
|
475
|
+
`,A+=`<tr><th>udts</th><th></th><th></th><th></th><th></th></tr>
|
|
476
|
+
`;for(let O=0;O<o.length;O+=1)l[O].total>0&&(A+="<tr>",A+=`<td class="${n.CLASS_ACTIVE}">${l[O].name}</td>`,A+=`<td class="${n.CLASS_EMPTY}">${l[O].empty}</td>`,A+=`<td class="${n.CLASS_MATCH}">${l[O].match}</td>`,A+=`<td class="${n.CLASS_NOMATCH}">${l[O].nomatch}</td>`,A+=`<td class="${n.CLASS_ACTIVE}">${l[O].total}</td>`,A+=`</tr>
|
|
477
|
+
`)}return A};this.validate=function(A){let O=!1;return typeof A=="string"&&f===A&&(O=!0),O},this.init=function(A,O){i=A,o=O,y()},this.collect=function(A,O){m(c,O.state,O.phraseLength),m(a[A.type],O.state,O.phraseLength),A.type===e.RNM&&m(u[A.index],O.state,O.phraseLength),A.type===e.UDT&&m(l[A.index],O.state,O.phraseLength)},this.toHtml=function(A,O){let j="";j+=`<table class="${n.CLASS_STATS}">
|
|
478
|
+
`,typeof O=="string"&&(j+=`<caption>${O}</caption>
|
|
479
|
+
`),j+=`<tr><th class="${n.CLASS_ACTIVE}">ops</th>
|
|
480
|
+
`,j+=`<th class="${n.CLASS_EMPTY}">EMPTY</th>
|
|
481
|
+
`,j+=`<th class="${n.CLASS_MATCH}">MATCH</th>
|
|
482
|
+
`,j+=`<th class="${n.CLASS_NOMATCH}">NOMATCH</th>
|
|
483
|
+
`,j+=`<th class="${n.CLASS_ACTIVE}">totals</th></tr>
|
|
484
|
+
`;let X=!0;for(;X;){if(A===void 0){j+=_();break}if(A===null){j+=_();break}if(A==="ops"){j+=_();break}if(A==="index"){u.sort(x),l.length>0&&l.sort(x),j+=_(),j+=C();break}if(A==="hits"){u.sort(g),l.length>0&&l.sort(x),j+=_(),j+=C();break}if(A==="alpha"){u.sort(h),l.length>0&&l.sort(h),j+=_(),j+=C();break}break}return j+=`</table>
|
|
485
|
+
`,j},this.toHtmlPage=function(A,O,j){return t.htmlToPage(this.toHtml(A,O),j)}}});var lx=P((VS,ux)=>{"use strict";ux.exports=function(){let e=ui(),t=Ko(),n=new(Tf()),s=ks(),i="trace.js: ",o=this,a=16,c=10,u=8,l=32,f=80,h=5,g=[],x=5e3,b=-1,y=0,m=0,E=[],_=null,C=null,L=null,A=[],O=[],j=`<span class="${t.CLASS_LINEEND}">•</span>`,X=`<span class="${t.CLASS_LINEEND}">…</span>`,oe=`<span class="${t.CLASS_EMPTY}">𝜺</span>`,de=function(){let B=function(S){A[s.ALT]=S,A[s.CAT]=S,A[s.REP]=S,A[s.TLS]=S,A[s.TBS]=S,A[s.TRG]=S,A[s.AND]=S,A[s.NOT]=S,A[s.BKR]=S,A[s.BKA]=S,A[s.BKN]=S,A[s.ABG]=S,A[s.AEN]=S},T=0;for(let S in o.filter.operators)T+=1;if(T===0){B(!1);return}for(let S in o.filter.operators){let F=S.toUpperCase();if(F==="<ALL>"){B(!0);return}if(F==="<NONE>"){B(!1);return}}B(!1);for(let S in o.filter.operators){let F=S.toUpperCase();if(F==="ALT")A[s.ALT]=o.filter.operators[S]===!0;else if(F==="CAT")A[s.CAT]=o.filter.operators[S]===!0;else if(F==="REP")A[s.REP]=o.filter.operators[S]===!0;else if(F==="AND")A[s.AND]=o.filter.operators[S]===!0;else if(F==="NOT")A[s.NOT]=o.filter.operators[S]===!0;else if(F==="TLS")A[s.TLS]=o.filter.operators[S]===!0;else if(F==="TBS")A[s.TBS]=o.filter.operators[S]===!0;else if(F==="TRG")A[s.TRG]=o.filter.operators[S]===!0;else if(F==="BKR")A[s.BKR]=o.filter.operators[S]===!0;else if(F==="BKA")A[s.BKA]=o.filter.operators[S]===!0;else if(F==="BKN")A[s.BKN]=o.filter.operators[S]===!0;else if(F==="ABG")A[s.ABG]=o.filter.operators[S]===!0;else if(F==="AEN")A[s.AEN]=o.filter.operators[S]===!0;else throw new Error(`${i}initOpratorFilter: '${S}' not a valid operator name. Must be <all>, <none>, alt, cat, rep, tls, tbs, trg, and, not, bkr, bka or bkn`)}},Le=function(){let B=function(J){A[s.RNM]=J,A[s.UDT]=J;let W=C.length+L.length;O.length=0;for(let re=0;re<W;re+=1)O.push(J)},T,S,F=[];for(S=0;S<C.length;S+=1)F.push(C[S].lower);for(S=0;S<L.length;S+=1)F.push(L[S].lower);O.length=0,T=0;for(let J in o.filter.rules)T+=1;if(T===0){B(!0);return}for(let J in o.filter.rules){let W=J.toLowerCase();if(W==="<all>"){B(!0);return}if(W==="<none>"){B(!1);return}}B(!1),A[s.RNM]=!0,A[s.UDT]=!0;for(let J in o.filter.rules){let W=J.toLowerCase();if(S=F.indexOf(W),S<0)throw new Error(`${i}initRuleFilter: '${J}' not a valid rule or udt name`);O[S]=o.filter.rules[J]===!0}};this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(B,T){if(b=-1,typeof B=="number"&&B>0)x=Math.ceil(B);else{x=0;return}typeof T=="number"&&(b=Math.floor(T),b<0&&(b=-1))},this.getMaxRecords=function(){return x},this.getLastRecord=function(){return b},this.init=function(B,T,S){g.length=0,E.length=0,y=0,m=0,_=S,C=B,L=T,de(),Le(),n.init(x)};let Se=function(B){let T=!1;return B.type===s.RNM?A[B.type]&&O[B.index]?T=!0:T=!1:B.type===s.UDT?A[B.type]&&O[C.length+B.index]?T=!0:T=!1:T=A[B.type],T},nt=function(B){return b===-1||B<=b};this.down=function(B,T,S,F,J,W){nt(y)&&Se(B)&&(E.push(y),g[n.increment()]={dirUp:!1,depth:m,thisLine:y,thatLine:void 0,opcode:B,state:T,phraseIndex:S,phraseLength:F,lookAnchor:J,lookAround:W},y+=1,m+=1)},this.up=function(B,T,S,F,J,W){if(nt(y)&&Se(B)){let re=y,Fe=E.pop(),je=n.getListIndex(Fe);je!==-1&&(g[je].thatLine=re),m-=1,g[n.increment()]={dirUp:!0,depth:m,thisLine:re,thatLine:Fe,opcode:B,state:T,phraseIndex:S,phraseLength:F,lookAnchor:J,lookAround:W},y+=1}};let H=function(){function B(p,w){let I,N,q;if(w)switch(p.op={id:w.type,name:e.opcodeToString(w.type)},p.opData=void 0,w.type){case s.RNM:p.opData=C[w.index].name;break;case s.UDT:p.opData=L[w.index].name;break;case s.BKR:w.index<C.length?I=C[w.index].name:I=L[w.index-C.length].name,N=w.bkrCase===s.BKR_MODE_CI?"%i":"%s",q=w.bkrMode===s.BKR_MODE_UM?"%u":"%p",p.opData=`\\\\${N}${q}${I}`;break;case s.TLS:p.opData=[];for(let te=0;te<w.string.length;te+=1)p.opData.push(w.string[te]);break;case s.TBS:p.opData=[];for(let te=0;te<w.string.length;te+=1)p.opData.push(w.string[te]);break;case s.TRG:p.opData=[w.min,w.max];break;case s.REP:p.opData=[w.min,w.max];break;default:throw new Error("unrecognized opcode")}else p.op={id:void 0,name:void 0},p.opData=void 0}function T(p,w,I){return p===s.MATCH?{index:w,length:I}:p===s.NOMATCH?{index:w,length:0}:p===s.EMPTY?{index:w,length:0}:null}let S=-1;function F(p,w,I){let N={id:S++,branch:-1,parent:p,up:!1,down:!1,depth:I,children:[]};return w?(N.down=!0,N.state={id:w.state,name:e.stateToString(w.state)},N.phrase=null,B(N,w.opcode)):(N.state={id:void 0,name:void 0},N.phrase=T(),B(N,void 0)),N}function J(p,w){w&&(p.up=!0,p.state={id:w.state,name:e.stateToString(w.state)},p.phrase=T(w.state,w.phraseIndex,w.phraseLength),p.down||B(p,w.opcode))}let W=0,re=-1,Fe=1;function je(p){if(re+=1,p.branch=Fe,re>m&&(m=re),p.children.length===0)W+=1;else for(let w=0;w<p.children.length;w+=1)w>0&&(Fe+=1),p.children[w].leftMost=!1,p.children[w].rightMost=!1,p.leftMost&&(p.children[w].leftMost=w===0),p.rightMost&&(p.children[w].rightMost=w===p.children.length-1),je(p.children[w]);re-=1}function Y(p,w){let I,N={};if(N.id=p.id,N.branch=p.branch,N.leftMost=p.leftMost,N.rightMost=p.rightMost,I=p.state.name?p.state.name:"ACTIVE",N.state={id:p.state.id,name:I},I=p.op.name?p.op.name:"?",N.op={id:p.op.id,name:I},typeof p.opData=="string")N.opData=p.opData;else if(Array.isArray(p.opData)){N.opData=[];for(let q=0;q<p.opData.length;q+=1)N.opData[q]=p.opData[q]}else N.opData=void 0;p.phrase?N.phrase={index:p.phrase.index,length:p.phrase.length}:N.phrase=null,N.depth=p.depth,N.children=[];for(let q=0;q<p.children.length;q+=1){let te=q!==p.children.length-1;N.children[q]=Y(p.children[q],w,te)}return N}let He=[],Oe,ot,Dr,Tt,Hn=!0,ti=F(null,null,-1);for(He.push(ti),ot=ti,n.forEach(p=>{if(Tt=g[p],Hn&&(Hn=!1,Tt.depth>0)){let w=Tt.dirUp?Tt.depth+1:Tt.depth;for(let I=0;I<w;I+=1)Dr=ot,ot=F(ot,null,I),He.push(ot),Dr.children.push(ot)}Tt.dirUp?(ot=He.pop(),J(ot,Tt),ot=He[He.length-1]):(Dr=ot,ot=F(ot,Tt,Tt.depth),He.push(ot),Dr.children.push(ot))});He.length>1;)ot=He.pop(),J(ot,null);if(ti.children.length===0)throw new Error("trace.toTree(): parse tree has no nodes");if(He.length===0)throw new Error("trace.toTree(): integrity check: dummy root node disappeared?");Oe=ti.children[0];let gc=Oe;for(;Oe&&!Oe.down&&!Oe.up;)gc=Oe,Oe=Oe.children[0];Oe=gc,Oe.leftMost=!0,Oe.rightMost=!0,je(Oe),Oe.branch=0;let k={};k.string=[];for(let p=0;p<_.length;p+=1)k.string[p]=_[p];k.rules=[];for(let p=0;p<C.length;p+=1)k.rules[p]=C[p].name;k.udts=[];for(let p=0;p<L.length;p+=1)k.udts[p]=L[p].name;k.id={},k.id.ALT={id:s.ALT,name:"ALT"},k.id.CAT={id:s.CAT,name:"CAT"},k.id.REP={id:s.REP,name:"REP"},k.id.RNM={id:s.RNM,name:"RNM"},k.id.TLS={id:s.TLS,name:"TLS"},k.id.TBS={id:s.TBS,name:"TBS"},k.id.TRG={id:s.TRG,name:"TRG"},k.id.UDT={id:s.UDT,name:"UDT"},k.id.AND={id:s.AND,name:"AND"},k.id.NOT={id:s.NOT,name:"NOT"},k.id.BKR={id:s.BKR,name:"BKR"},k.id.BKA={id:s.BKA,name:"BKA"},k.id.BKN={id:s.BKN,name:"BKN"},k.id.ABG={id:s.ABG,name:"ABG"},k.id.AEN={id:s.AEN,name:"AEN"},k.id.ACTIVE={id:s.ACTIVE,name:"ACTIVE"},k.id.MATCH={id:s.MATCH,name:"MATCH"},k.id.EMPTY={id:s.EMPTY,name:"EMPTY"},k.id.NOMATCH={id:s.NOMATCH,name:"NOMATCH"},k.treeDepth=m,k.leafNodes=W;let v;return Oe.down?Oe.up?v="none":v="right":Oe.up?v="left":v="both",k.branchesIncomplete=v,k.tree=Y(Oe,Oe.depth,!1),k};this.toTree=function(B){let T=H();return B?JSON.stringify(T):T},this.toHtmlPage=function(B,T,S){return e.htmlToPage(this.toHtml(B,T),S)};let V=function(B,T){let S;switch(B){case a:S="hexadecimal";break;case c:S="decimal";break;case u:S="ASCII";break;case l:S="UNICODE";break;default:throw new Error(`${i}htmlHeader: unrecognized mode: ${B}`)}let F="";return F+=`<p>display mode: ${S}</p>
|
|
486
|
+
`,F+=`<table class="${t.CLASS_TRACE}">
|
|
487
|
+
`,typeof T=="string"&&(F+=`<caption>${T}</caption>`),F},ae=function(){let B="";return B+=`</table>
|
|
488
|
+
`,B+=`<p class="${t.CLASS_MONOSPACE}">legend:<br>
|
|
489
|
+
`,B+=`(a) - line number<br>
|
|
490
|
+
`,B+=`(b) - matching line number<br>
|
|
491
|
+
`,B+=`(c) - phrase offset<br>
|
|
492
|
+
`,B+=`(d) - phrase length<br>
|
|
493
|
+
`,B+=`(e) - tree depth<br>
|
|
494
|
+
`,B+=`(f) - operator state<br>
|
|
495
|
+
`,B+=` - <span class="${t.CLASS_ACTIVE}">↓</span> phrase opened<br>
|
|
496
|
+
`,B+=` - <span class="${t.CLASS_MATCH}">↑M</span> phrase matched<br>
|
|
497
|
+
`,B+=` - <span class="${t.CLASS_EMPTY}">↑E</span> empty phrase matched<br>
|
|
498
|
+
`,B+=` - <span class="${t.CLASS_NOMATCH}">↑N</span> phrase not matched<br>
|
|
499
|
+
`,B+=`operator - ALT, CAT, REP, RNM, TRG, TLS, TBS<sup>†</sup>, UDT, AND, NOT, BKA, BKN, BKR, ABG, AEN<sup>‡</sup><br>
|
|
500
|
+
`,B+=`phrase - up to ${f} characters of the phrase being matched<br>
|
|
501
|
+
`,B+=` - <span class="${t.CLASS_MATCH}">matched characters</span><br>
|
|
502
|
+
`,B+=` - <span class="${t.CLASS_LOOKAHEAD}">matched characters in look ahead mode</span><br>
|
|
503
|
+
`,B+=` - <span class="${t.CLASS_LOOKBEHIND}">matched characters in look behind mode</span><br>
|
|
504
|
+
`,B+=` - <span class="${t.CLASS_REMAINDER}">remainder characters(not yet examined by parser)</span><br>
|
|
505
|
+
`,B+=` - <span class="${t.CLASS_CTRLCHAR}">control characters, TAB, LF, CR, etc. (ASCII mode only)</span><br>
|
|
506
|
+
`,B+=` - ${oe} empty string<br>
|
|
507
|
+
`,B+=` - ${j} end of input string<br>
|
|
508
|
+
`,B+=` - ${X} input string display truncated<br>
|
|
509
|
+
`,B+=`</p>
|
|
510
|
+
`,B+=`<p class="${t.CLASS_MONOSPACE}">
|
|
511
|
+
`,B+=`<sup>†</sup>original ABNF operators:<br>
|
|
512
|
+
`,B+=`ALT - alternation<br>
|
|
513
|
+
`,B+=`CAT - concatenation<br>
|
|
514
|
+
`,B+=`REP - repetition<br>
|
|
515
|
+
`,B+=`RNM - rule name<br>
|
|
516
|
+
`,B+=`TRG - terminal range<br>
|
|
517
|
+
`,B+=`TLS - terminal literal string (case insensitive)<br>
|
|
518
|
+
`,B+=`TBS - terminal binary string (case sensitive)<br>
|
|
519
|
+
`,B+=`<br>
|
|
520
|
+
`,B+=`<sup>‡</sup>super set SABNF operators:<br>
|
|
521
|
+
`,B+=`UDT - user-defined terminal<br>
|
|
522
|
+
`,B+=`AND - positive look ahead<br>
|
|
523
|
+
`,B+=`NOT - negative look ahead<br>
|
|
524
|
+
`,B+=`BKA - positive look behind<br>
|
|
525
|
+
`,B+=`BKN - negative look behind<br>
|
|
526
|
+
`,B+=`BKR - back reference<br>
|
|
527
|
+
`,B+=`ABG - anchor - begin of input string<br>
|
|
528
|
+
`,B+=`AEN - anchor - end of input string<br>
|
|
529
|
+
`,B+=`</p>
|
|
530
|
+
`,B};this.indent=function(B){let T="";for(let S=0;S<B;S+=1)T+=".";return T};let ve=function(B,T){let S="";if(T.type===s.TRG)if(B===a||B===l){let F=T.min.toString(16).toUpperCase();F.length%2!==0&&(F=`0${F}`),S+=B===a?"%x":"U+",S+=F,F=T.max.toString(16).toUpperCase(),F.length%2!==0&&(F=`0${F}`),S+=`–${F}`}else S=`%d${T.min.toString(10)}–${T.max.toString(10)}`;return S},Ae=function(B,T){let S="";if(T.type===s.REP)if(B===a){let F=T.min.toString(16).toUpperCase();F.length%2!==0&&(F=`0${F}`),S=`x${F}`,T.max<1/0?(F=T.max.toString(16).toUpperCase(),F.length%2!==0&&(F=`0${F}`)):F="inf",S+=`–${F}`}else T.max<1/0?S=`${T.min.toString(10)}–${T.max.toString(10)}`:S=`${T.min.toString(10)}–inf`;return S},Me=function(B,T){let S="";if(T.type===s.TBS){let F=Math.min(T.string.length,h*2);if(B===a||B===l){S+=B===a?"%x":"U+";for(let J=0;J<F;J+=1){let W;J>0&&(S+="."),W=T.string[J].toString(16).toUpperCase(),W.length%2!==0&&(W=`0${W}`),S+=W}}else{S="%d";for(let J=0;J<F;J+=1)J>0&&(S+="."),S+=T.string[J].toString(10)}F<T.string.length&&(S+=X)}return S},Qe=function(B,T){let S="";if(T.type===s.TLS){let F=Math.min(T.string.length,h);if(B===a||B===c){let J,W,re;B===a?(S="%x",re=16):(S="%d",re=10);for(let Fe=0;Fe<F;Fe+=1)Fe>0&&(S+="."),W=T.string[Fe],W>=97&&W<=122?(J=W-32,S+=`${J.toString(re)}/${W.toString(re)}`.toUpperCase()):W>=65&&W<=90?(J=W,W+=32,S+=`${J.toString(re)}/${W.toString(re)}`.toUpperCase()):S+=W.toString(re).toUpperCase();F<T.string.length&&(S+=X)}else{S='"';for(let J=0;J<F;J+=1)S+=e.asciiChars[T.string[J]];F<T.string.length&&(S+=X),S+='"'}}return S},et=function(B,T,S,F,J){if(F===0)return"";let W="",re=J?",":"";switch(B){case a:W=re+e.charsToHex(T,S,F);break;case c:if(J)return`,${e.charsToDec(T,S,F)}`;W=re+e.charsToDec(T,S,F);break;case l:W=e.charsToUnicode(T,S,F);break;case u:default:W=e.charsToAsciiHtml(T,S,F);break}return W},ar=function(B,T,S,F,J,W){let re="",Fe,je,Y,He,Oe=j,ot=`<span class="${t.CLASS_LOOKBEHIND}">`,Dr=`<span class="${t.CLASS_REMAINDER}">`,Tt="</span>",Hn=!1;switch(S){case s.EMPTY:re+=oe;case s.NOMATCH:case s.MATCH:case s.ACTIVE:Fe=F-J,je=W-Fe,Y=W,He=T.length-Y;break;default:throw new Error("unrecognized state")}return Oe=j,je>f?(je=f,Oe=X,He=0):je+He>f&&(Oe=X,He=f-je),je>0&&(re+=ot,re+=et(B,T,Fe,je,Hn),re+=Tt,Hn=!0),He>0&&(re+=Dr,re+=et(B,T,Y,He,Hn),re+=Tt),re+Oe},cr=function(B,T,S,F,J,W){let re="",Fe,je,Y,He,Oe=j,ot=`<span class="${t.CLASS_REMAINDER}">`,Dr="</span>",Tt=!1;switch(S){case s.EMPTY:re+=oe;case s.NOMATCH:case s.ACTIVE:Fe=F,je=0,Y=F,He=T.length-Y;break;case s.MATCH:Fe=F,je=J,Y=F+je,He=T.length-Y;break;default:throw new Error("unrecognized state")}return Oe=j,je>f?(je=f,Oe=X,He=0):je+He>f&&(Oe=X,He=f-je),je>0&&(re+=W,re+=et(B,T,Fe,je,Tt),re+=Dr,Tt=!0),He>0&&(re+=ot,re+=et(B,T,Y,He,Tt),re+=Dr),re+Oe},nn=function(B,T,S,F,J){let W=`<span class="${t.CLASS_LOOKAHEAD}">`;return cr(B,T,S,F,J,W)},sn=function(B,T,S,F,J){let W=`<span class="${t.CLASS_MATCH}">`;return cr(B,T,S,F,J,W)},ur=function(B){if(C===null)return"";let T="",S,F,J,W,re,Fe;return T+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",T+=`<th>operator</th><th>phrase</th></tr>
|
|
531
|
+
`,n.forEach(je=>{let Y=g[je];switch(S=Y.thisLine,F=Y.thatLine!==void 0?Y.thatLine:"--",J=!1,W=!1,re=!1,Y.lookAround===s.LOOKAROUND_AHEAD&&(J=!0,re=!0,Fe=Y.lookAnchor),(Y.opcode.type===s.AND||Y.opcode.type===s.NOT)&&(J=!0,re=!0,Fe=Y.phraseIndex),Y.lookAround===s.LOOKAROUND_BEHIND&&(W=!0,re=!0,Fe=Y.lookAnchor),(Y.opcode.type===s.BKA||Y.opcode.type===s.BKN)&&(W=!0,re=!0,Fe=Y.phraseIndex),T+="<tr>",T+=`<td>${S}</td><td>${F}</td>`,T+=`<td>${Y.phraseIndex}</td>`,T+=`<td>${Y.phraseLength}</td>`,T+=`<td>${Y.depth}</td>`,T+="<td>",Y.state){case s.ACTIVE:T+=`<span class="${t.CLASS_ACTIVE}">↓ </span>`;break;case s.MATCH:T+=`<span class="${t.CLASS_MATCH}">↑M</span>`;break;case s.NOMATCH:T+=`<span class="${t.CLASS_NOMATCH}">↑N</span>`;break;case s.EMPTY:T+=`<span class="${t.CLASS_EMPTY}">↑E</span>`;break;default:T+=`<span class="${t.CLASS_ACTIVE}">--</span>`;break}if(T+="</td>",T+="<td>",T+=o.indent(Y.depth),J?T+=`<span class="${t.CLASS_LOOKAHEAD}">`:W&&(T+=`<span class="${t.CLASS_LOOKBEHIND}">`),T+=e.opcodeToString(Y.opcode.type),Y.opcode.type===s.RNM&&(T+=`(${C[Y.opcode.index].name}) `),Y.opcode.type===s.BKR){let He=Y.opcode.bkrCase===s.BKR_MODE_CI?"%i":"%s",Oe=Y.opcode.bkrMode===s.BKR_MODE_UM?"%u":"%p";T+=`(\\${He}${Oe}${C[Y.opcode.index].name}) `}Y.opcode.type===s.UDT&&(T+=`(${L[Y.opcode.index].name}) `),Y.opcode.type===s.TRG&&(T+=`(${ve(B,Y.opcode)}) `),Y.opcode.type===s.TBS&&(T+=`(${Me(B,Y.opcode)}) `),Y.opcode.type===s.TLS&&(T+=`(${Qe(B,Y.opcode)}) `),Y.opcode.type===s.REP&&(T+=`(${Ae(B,Y.opcode)}) `),re&&(T+="</span>"),T+="</td>",T+="<td>",W?T+=ar(B,_,Y.state,Y.phraseIndex,Y.phraseLength,Fe):J?T+=nn(B,_,Y.state,Y.phraseIndex,Y.phraseLength):T+=sn(B,_,Y.state,Y.phraseIndex,Y.phraseLength),T+=`</td></tr>
|
|
532
|
+
`}),T+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",T+=`<th>operator</th><th>phrase</th></tr>
|
|
533
|
+
`,T+=`</table>
|
|
534
|
+
`,T};this.toHtml=function(B,T){let S=u;if(typeof B=="string"&&B.length>=3){let J=B.toLowerCase().slice(0,3);J==="hex"?S=a:J==="dec"?S=c:J==="uni"&&(S=l)}let F="";return F+=V(S,T),F+=ur(S),F+=ae(),F}}});var Bf=P(($S,fx)=>{"use strict";fx.exports={ast:nx(),circular:Tf(),ids:ks(),parser:ox(),stats:cx(),trace:lx(),utils:ui(),emitcss:_f(),style:Ko()}});var Ix=P(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.toBig=he.shrSL=he.shrSH=he.rotrSL=he.rotrSH=he.rotrBL=he.rotrBH=he.rotr32L=he.rotr32H=he.rotlSL=he.rotlSH=he.rotlBL=he.rotlBH=he.add5L=he.add5H=he.add4L=he.add4H=he.add3L=he.add3H=void 0;he.add=kx;he.fromBig=Sf;he.split=dx;var kc=BigInt(2**32-1),Of=BigInt(32);function Sf(r,e=!1){return e?{h:Number(r&kc),l:Number(r>>Of&kc)}:{h:Number(r>>Of&kc)|0,l:Number(r&kc)|0}}function dx(r,e=!1){let t=r.length,n=new Uint32Array(t),s=new Uint32Array(t);for(let i=0;i<t;i++){let{h:o,l:a}=Sf(r[i],e);[n[i],s[i]]=[o,a]}return[n,s]}var hx=(r,e)=>BigInt(r>>>0)<<Of|BigInt(e>>>0);he.toBig=hx;var px=(r,e,t)=>r>>>t;he.shrSH=px;var gx=(r,e,t)=>r<<32-t|e>>>t;he.shrSL=gx;var bx=(r,e,t)=>r>>>t|e<<32-t;he.rotrSH=bx;var xx=(r,e,t)=>r<<32-t|e>>>t;he.rotrSL=xx;var mx=(r,e,t)=>r<<64-t|e>>>t-32;he.rotrBH=mx;var yx=(r,e,t)=>r>>>t-32|e<<64-t;he.rotrBL=yx;var wx=(r,e)=>e;he.rotr32H=wx;var Ax=(r,e)=>r;he.rotr32L=Ax;var Ex=(r,e,t)=>r<<t|e>>>32-t;he.rotlSH=Ex;var Px=(r,e,t)=>e<<t|r>>>32-t;he.rotlSL=Px;var vx=(r,e,t)=>e<<t-32|r>>>64-t;he.rotlBH=vx;var _x=(r,e,t)=>r<<t-32|e>>>64-t;he.rotlBL=_x;function kx(r,e,t,n){let s=(e>>>0)+(n>>>0);return{h:r+t+(s/2**32|0)|0,l:s|0}}var Tx=(r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0);he.add3L=Tx;var Bx=(r,e,t,n)=>e+t+n+(r/2**32|0)|0;he.add3H=Bx;var Ox=(r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0);he.add4L=Ox;var Sx=(r,e,t,n,s)=>e+t+n+s+(r/2**32|0)|0;he.add4H=Sx;var Cx=(r,e,t,n,s)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(s>>>0);he.add5L=Cx;var Nx=(r,e,t,n,s,i)=>e+t+n+s+i+(r/2**32|0)|0;he.add5H=Nx;var u8={fromBig:Sf,split:dx,toBig:hx,shrSH:px,shrSL:gx,rotrSH:bx,rotrSL:xx,rotrBH:mx,rotrBL:yx,rotr32H:wx,rotr32L:Ax,rotlSH:Ex,rotlSL:Px,rotlBH:vx,rotlBL:_x,add:kx,add3L:Tx,add3H:Bx,add4L:Ox,add4H:Sx,add5H:Nx,add5L:Cx};he.default=u8});var Rx=P(Tc=>{"use strict";Object.defineProperty(Tc,"__esModule",{value:!0});Tc.crypto=void 0;Tc.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});var Lf=P(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.wrapXOFConstructorWithOpts=se.wrapConstructorWithOpts=se.wrapConstructor=se.Hash=se.nextTick=se.swap32IfBE=se.byteSwapIfBE=se.swap8IfBE=se.isLE=void 0;se.isBytes=Mx;se.anumber=Cf;se.abytes=fi;se.ahash=l8;se.aexists=f8;se.aoutput=d8;se.u8=h8;se.u32=p8;se.clean=g8;se.createView=b8;se.rotr=x8;se.rotl=m8;se.byteSwap=If;se.byteSwap32=jx;se.bytesToHex=w8;se.hexToBytes=A8;se.asyncLoop=P8;se.utf8ToBytes=Rf;se.bytesToUtf8=v8;se.toBytes=Bc;se.kdfInputToBytes=_8;se.concatBytes=k8;se.checkOpts=T8;se.createHasher=Fx;se.createOptHasher=Dx;se.createXOFer=Hx;se.randomBytes=B8;var li=Rx();function Mx(r){return r instanceof Uint8Array||ArrayBuffer.isView(r)&&r.constructor.name==="Uint8Array"}function Cf(r){if(!Number.isSafeInteger(r)||r<0)throw new Error("positive integer expected, got "+r)}function fi(r,...e){if(!Mx(r))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(r.length))throw new Error("Uint8Array expected of length "+e+", got length="+r.length)}function l8(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Cf(r.outputLen),Cf(r.blockLen)}function f8(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}function d8(r,e){fi(r);let t=e.outputLen;if(r.length<t)throw new Error("digestInto() expects output buffer of length at least "+t)}function h8(r){return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}function p8(r){return new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4))}function g8(...r){for(let e=0;e<r.length;e++)r[e].fill(0)}function b8(r){return new DataView(r.buffer,r.byteOffset,r.byteLength)}function x8(r,e){return r<<32-e|r>>>e}function m8(r,e){return r<<e|r>>>32-e>>>0}se.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function If(r){return r<<24&4278190080|r<<8&16711680|r>>>8&65280|r>>>24&255}se.swap8IfBE=se.isLE?r=>r:r=>If(r);se.byteSwapIfBE=se.swap8IfBE;function jx(r){for(let e=0;e<r.length;e++)r[e]=If(r[e]);return r}se.swap32IfBE=se.isLE?r=>r:jx;var Ux=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",y8=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function w8(r){if(fi(r),Ux)return r.toHex();let e="";for(let t=0;t<r.length;t++)e+=y8[r[t]];return e}var Bn={_0:48,_9:57,A:65,F:70,a:97,f:102};function Lx(r){if(r>=Bn._0&&r<=Bn._9)return r-Bn._0;if(r>=Bn.A&&r<=Bn.F)return r-(Bn.A-10);if(r>=Bn.a&&r<=Bn.f)return r-(Bn.a-10)}function A8(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);if(Ux)return Uint8Array.fromHex(r);let e=r.length,t=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(t);for(let s=0,i=0;s<t;s++,i+=2){let o=Lx(r.charCodeAt(i)),a=Lx(r.charCodeAt(i+1));if(o===void 0||a===void 0){let c=r[i]+r[i+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+i)}n[s]=o*16+a}return n}var E8=async()=>{};se.nextTick=E8;async function P8(r,e,t){let n=Date.now();for(let s=0;s<r;s++){t(s);let i=Date.now()-n;i>=0&&i<e||(await(0,se.nextTick)(),n+=i)}}function Rf(r){if(typeof r!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(r))}function v8(r){return new TextDecoder().decode(r)}function Bc(r){return typeof r=="string"&&(r=Rf(r)),fi(r),r}function _8(r){return typeof r=="string"&&(r=Rf(r)),fi(r),r}function k8(...r){let e=0;for(let n=0;n<r.length;n++){let s=r[n];fi(s),e+=s.length}let t=new Uint8Array(e);for(let n=0,s=0;n<r.length;n++){let i=r[n];t.set(i,s),s+=i.length}return t}function T8(r,e){if(e!==void 0&&{}.toString.call(e)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(r,e)}var Nf=class{};se.Hash=Nf;function Fx(r){let e=n=>r().update(Bc(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}function Dx(r){let e=(n,s)=>r(s).update(Bc(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}function Hx(r){let e=(n,s)=>r(s).update(Bc(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}se.wrapConstructor=Fx;se.wrapConstructorWithOpts=Dx;se.wrapXOFConstructorWithOpts=Hx;function B8(r=32){if(li.crypto&&typeof li.crypto.getRandomValues=="function")return li.crypto.getRandomValues(new Uint8Array(r));if(li.crypto&&typeof li.crypto.randomBytes=="function")return Uint8Array.from(li.crypto.randomBytes(r));throw new Error("crypto.getRandomValues must be defined")}});var Wx=P(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.shake256=We.shake128=We.keccak_512=We.keccak_384=We.keccak_256=We.keccak_224=We.sha3_512=We.sha3_384=We.sha3_256=We.sha3_224=We.Keccak=void 0;We.keccakP=Jx;var Qo=Ix(),Lt=Lf(),O8=BigInt(0),Jo=BigInt(1),S8=BigInt(2),C8=BigInt(7),N8=BigInt(256),I8=BigInt(113),zx=[],Kx=[],Vx=[];for(let r=0,e=Jo,t=1,n=0;r<24;r++){[t,n]=[n,(2*t+3*n)%5],zx.push(2*(5*n+t)),Kx.push((r+1)*(r+2)/2%64);let s=O8;for(let i=0;i<7;i++)e=(e<<Jo^(e>>C8)*I8)%N8,e&S8&&(s^=Jo<<(Jo<<BigInt(i))-Jo);Vx.push(s)}var $x=(0,Qo.split)(Vx,!0),R8=$x[0],L8=$x[1],qx=(r,e,t)=>t>32?(0,Qo.rotlBH)(r,e,t):(0,Qo.rotlSH)(r,e,t),Gx=(r,e,t)=>t>32?(0,Qo.rotlBL)(r,e,t):(0,Qo.rotlSL)(r,e,t);function Jx(r,e=24){let t=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)t[o]=r[o]^r[o+10]^r[o+20]^r[o+30]^r[o+40];for(let o=0;o<10;o+=2){let a=(o+8)%10,c=(o+2)%10,u=t[c],l=t[c+1],f=qx(u,l,1)^t[a],h=Gx(u,l,1)^t[a+1];for(let g=0;g<50;g+=10)r[o+g]^=f,r[o+g+1]^=h}let s=r[2],i=r[3];for(let o=0;o<24;o++){let a=Kx[o],c=qx(s,i,a),u=Gx(s,i,a),l=zx[o];s=r[l],i=r[l+1],r[l]=c,r[l+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)t[a]=r[o+a];for(let a=0;a<10;a++)r[o+a]^=~t[(a+2)%10]&t[(a+4)%10]}r[0]^=R8[n],r[1]^=L8[n]}(0,Lt.clean)(t)}var Wo=class r extends Lt.Hash{constructor(e,t,n,s=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=s,this.rounds=i,(0,Lt.anumber)(n),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,Lt.u32)(this.state)}clone(){return this._cloneInto()}keccak(){(0,Lt.swap32IfBE)(this.state32),Jx(this.state32,this.rounds),(0,Lt.swap32IfBE)(this.state32),this.posOut=0,this.pos=0}update(e){(0,Lt.aexists)(this),e=(0,Lt.toBytes)(e),(0,Lt.abytes)(e);let{blockLen:t,state:n}=this,s=e.length;for(let i=0;i<s;){let o=Math.min(t-this.pos,s-i);for(let a=0;a<o;a++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:s}=this;e[n]^=t,(t&128)!==0&&n===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){(0,Lt.aexists)(this,!1),(0,Lt.abytes)(e),this.finish();let t=this.state,{blockLen:n}=this;for(let s=0,i=e.length;s<i;){this.posOut>=n&&this.keccak();let o=Math.min(n-this.posOut,i-s);e.set(t.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,Lt.anumber)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,Lt.aoutput)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,Lt.clean)(this.state)}_cloneInto(e){let{blockLen:t,suffix:n,outputLen:s,rounds:i,enableXOF:o}=this;return e||(e=new r(t,n,s,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}};We.Keccak=Wo;var Vn=(r,e,t)=>(0,Lt.createHasher)(()=>new Wo(e,r,t));We.sha3_224=Vn(6,144,224/8);We.sha3_256=Vn(6,136,256/8);We.sha3_384=Vn(6,104,384/8);We.sha3_512=Vn(6,72,512/8);We.keccak_224=Vn(1,144,224/8);We.keccak_256=Vn(1,136,256/8);We.keccak_384=Vn(1,104,384/8);We.keccak_512=Vn(1,72,512/8);var Qx=(r,e,t)=>(0,Lt.createXOFer)((n={})=>new Wo(e,r,n.dkLen===void 0?t:n.dkLen,!0));We.shake128=Qx(31,168,128/8);We.shake256=Qx(31,136,256/8)});var Mf=P(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.parseIntegerNumber=di.isEIP55Address=void 0;var M8=Wx(),j8=Lf(),U8=r=>{if(r.length!=42)return!1;let e=`${r}`.toLowerCase().replace("0x",""),t=(0,j8.bytesToHex)((0,M8.keccak_256)(e)),n="0x";for(let s=0;s<e.length;s++)parseInt(t[s],16)>=8?n+=e[s].toUpperCase():n+=e[s];return r===n};di.isEIP55Address=U8;var F8=r=>{let e=parseInt(r);if(isNaN(e))throw new Error("Invalid number.");if(e===1/0)throw new Error("Invalid number.");return e};di.parseIntegerNumber=F8});var Xx=P(hi=>{"use strict";var D8=hi&&hi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(hi,"__esModule",{value:!0});hi.cb=void 0;var Zx=D8(Bf()),st=Zx.default.utils,z=Zx.default.ids,jf=Mf(),Yx=/^(?<date>[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]))[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(.[0-9]+)?(([Zz])|([+|-]([01][0-9]|2[0-3]):[0-5][0-9]))$/,Uf=r=>{let e=Yx.exec(r);if(!e)return!1;let t=new Date(e.groups.date).toISOString(),n=Yx.exec(t);return e.groups.date===n.groups.date};hi.cb={signInWithEtherium:function(r,e,t,n){switch(r.state){case z.ACTIVE:if(typeof n!="object"||n===null)throw new Error("data must be an object");break;case z.NOMATCH:n.errors.push(`invalid message: max line number was ${n.lineno}`)}},lineno:function(e,t,n,s){e.state===z.MATCH&&(s.lineno+=1)},exTitle:function(e,t,n,s){e.state===z.NOMATCH&&(s.lineno-=1)},nbTitle:function(e,t,n,s){e.state===z.NOMATCH&&(s.lineno-=1)},riTitle:function(e,t,n,s){e.state===z.NOMATCH&&(s.lineno-=1)},reTitle:function(e,t,n,s){e.state===z.MATCH?s.resources=[]:e.state===z.NOMATCH&&(s.lineno-=1)},oscheme:function(e,t,n,s){e.state===z.MATCH&&(s.scheme=st.charsToString(t,n,e.phraseLength-3))},domain:function(e,t,n,s){switch(e.state){case z.MATCH:s.domain=st.charsToString(t,n,e.phraseLength);break;case z.EMPTY:s.errors.push(`line ${s.lineno}: domain cannot be empty`);break;case z.NOMATCH:s.errors.push(`line ${s.lineno}: invalid domain`)}},address:function(e,t,n,s){switch(e.state){case z.MATCH:s.address=st.charsToString(t,n,e.phraseLength),(0,jf.isEIP55Address)(s.address)||s.errors.push(`line ${s.lineno}: invalid EIP-55 address - ${s.address}`);break;case z.NOMATCH:s.errors.push(`line ${s.lineno}: invalid address`);break}},statement:function(e,t,n,s){e.state===z.MATCH&&(s.statement=st.charsToString(t,n,e.phraseLength))},emptyStatement:function(e,t,n,s){e.state===z.MATCH&&(s.statement="")},version:function(e,t,n,s){switch(e.state){case z.MATCH:s.version=st.charsToString(t,n,e.phraseLength);break;case z.NOMATCH:s.errors.push(`line ${s.lineno}: invalid version`);break}},nonce:function(e,t,n,s){switch(e.state){case z.MATCH:s.nonce=st.charsToString(t,n,e.phraseLength);break;case z.NOMATCH:s.errors.push(`line ${s.lineno}: invalid nonce`);break}},issuedAt:function(e,t,n,s){switch(e.state){case z.MATCH:s.issuedAt=st.charsToString(t,n,e.phraseLength),Uf(s.issuedAt)||s.errors.push(`line ${s.lineno}: invalid issued-at date time semantics`);break;case z.NOMATCH:s.errors.push(`line ${s.lineno}: invalid issued-at date time syntax`);break}},expirationTime:function(e,t,n,s){switch(e.state){case z.MATCH:s.expirationTime=st.charsToString(t,n,e.phraseLength),Uf(s.expirationTime)||s.errors.push(`line ${s.lineno}: invalid expiration-time date time semantics`);break;case z.NOMATCH:s.errors.push(`line ${s.lineno}: invalid expiration-time date time syntax`);break}},notBefore:function(e,t,n,s){switch(e.state){case z.MATCH:s.notBefore=st.charsToString(t,n,e.phraseLength),Uf(s.notBefore)||s.errors.push(`line ${s.lineno}: invalid not-before date time semantics`);break;case z.NOMATCH:s.errors.push(`line ${s.lineno}: invalid not-before date time syntax`);break}},requestId:function(e,t,n,s){switch(e.state){case z.MATCH:s.requestId=st.charsToString(t,n,e.phraseLength);break;case z.EMPTY:s.requestId="";break;case z.NOMATCH:s.errors.push(`line ${s.lineno}: invalid requestID`);break}},chainId:function(e,t,n,s){switch(e.state){case z.MATCH:s.chainId=(0,jf.parseIntegerNumber)(st.charsToString(t,n,e.phraseLength));break;case z.NOMATCH:s.errors.push(`line ${s.lineno}: invalid chain-id`);break}},uriR:function(e,t,n,s){switch(e.state){case z.MATCH:s.uriR=st.charsToString(t,n,e.phraseLength);break;case z.NOMATCH:s.errors.push(`line ${s.lineno}: invalid resource URI`);break}},resource:function(e,t,n,s){switch(e.state){case z.MATCH:s.resources.push(s.uriR),delete s.uriR;break;case z.NOMATCH:s.errors.push(`line ${s.lineno}: invalid resource`);break}},scheme:function(e,t,n,s){switch(e.state){case z.MATCH:s.uriElements.scheme=st.charsToString(t,n,e.phraseLength);break;case z.NOMATCH:s.errors.push(`line ${s.lineno}: invalid URI scheme`);break}},userinfo:function(e,t,n,s){switch(e.state){case z.MATCH:s.uriElements.userinfo=st.charsToString(t,n,e.phraseLength-1);break}},host:function(e,t,n,s){switch(e.state){case z.ACTIVE:s.iplit=!1;break;case z.MATCH:s.iplit?s.uriElements.host=st.charsToString(t,n+1,e.phraseLength-2):s.uriElements.host=st.charsToString(t,n,e.phraseLength);break;case z.EMPTY:s.uriElements.host="";break;case z.NOMATCH:s.errors.push(`line ${s.lineno}: invalid URI host`);break}},ipLiteral:function(e,t,n,s){e.state===z.MATCH&&(s.iplit=!0)},port:function(e,t,n,s){switch(e.state){case z.MATCH:s.uriElements.port=(0,jf.parseIntegerNumber)(st.charsToString(t,n,e.phraseLength));break;case z.EMPTY:s.uriElements.port="";break;case z.NOMATCH:s.errors.push(`line ${s.lineno}: invalid URI port`);break}},pathAbempty:function(e,t,n,s){switch(e.state){case z.MATCH:s.uriElements.path=st.charsToString(t,n,e.phraseLength);break;case z.EMPTY:s.uriElements.path="";break;case z.NOMATCH:s.errors.push(`line ${s.lineno}: invalid URI path-abempty`);break}},pathAbsolute:function(e,t,n,s){switch(e.state){case z.MATCH:s.uriElements.path=st.charsToString(t,n,e.phraseLength);break}},pathRootless:function(e,t,n,s){switch(e.state){case z.MATCH:s.uriElements.path=st.charsToString(t,n,e.phraseLength);break}},pathEmpty:function(e,t,n,s){switch(e.state){case z.MATCH:case z.NOMATCH:s.errors.push(`line ${s.lineno}: invalid URI - path-empty must be empty`);break;case z.EMPTY:s.uriElements.path="";break}},query:function(e,t,n,s){switch(e.state){case z.MATCH:s.uriElements.query=st.charsToString(t,n,e.phraseLength);break;case z.EMPTY:s.uriElements.query="";break;case z.NOMATCH:s.errors.push(`line ${s.lineno}: invalid URI query`);break}},fragment:function(e,t,n,s){switch(e.state){case z.MATCH:s.uriElements.fragment=st.charsToString(t,n,e.phraseLength);break;case z.EMPTY:s.uriElements.fragment="";break;case z.NOMATCH:s.errors.push(`line ${s.lineno}: invalid URI fragment`);break}},uri:function(e,t,n,s){switch(e.state){case z.MATCH:s.uri=st.charsToString(t,n,e.phraseLength);break;case z.EMPTY:case z.NOMATCH:s.errors.push(`line ${s.lineno}: invalid URI`);break}},ipv4:function(e,t,n,s){e.state===z.MATCH&&(s.ipv4=!0)},h16:function(e,t,n,s){e.state===z.MATCH&&(s.h16count+=1)},nodcolon:function(e,t,n,s){switch(e.state){case z.ACTIVE:s.h16count=0,s.ipv4=!1;break;case z.MATCH:s.ipv4?s.h16count===6?e.state=z.MATCH:(e.state=z.NOMATCH,e.phraseLength=0):s.h16count===8?e.state=z.MATCH:(e.state=z.NOMATCH,e.phraseLength=0);break}},dcolon:function(e,t,n,s){switch(e.state){case z.ACTIVE:s.h16count=0,s.ipv4=!1;break;case z.MATCH:s.ipv4?s.h16count<6?e.state=z.MATCH:(e.state=z.NOMATCH,e.phraseLength=0):s.h16count<8?e.state=z.MATCH:(e.state=z.NOMATCH,e.phraseLength=0);break}},decOctet:function(e,t,n,s){switch(e.state){case z.ACTIVE:s.octet=0;break;case z.MATCH:s.octet>255?(e.state=z.NOMATCH,e.phraseLength=0):e.state=z.MATCH;break}},decDigit:function(e,t,n,s){switch(e.state){case z.MATCH:s.octet=10*s.octet+t[n]-48;break}}}});var Df=P($n=>{"use strict";var H8=$n&&$n.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty($n,"__esModule",{value:!0});$n.isUri=$n.ParsedMessage=void 0;var q8=Ob(),ie=Xx(),em=H8(Bf()),tm=new q8.grammar,Ff=class{constructor(e){let t=new em.default.parser;t.callbacks["sign-in-with-ethereum"]=ie.cb.signInWithEtherium,t.callbacks.oscheme=ie.cb.oscheme,t.callbacks.domain=ie.cb.domain,t.callbacks.LF=ie.cb.lineno,t.callbacks["ex-title"]=ie.cb.exTitle,t.callbacks["nb-title"]=ie.cb.nbTitle,t.callbacks["ri-title"]=ie.cb.riTitle,t.callbacks["re-title"]=ie.cb.reTitle,t.callbacks.address=ie.cb.address,t.callbacks.statement=ie.cb.statement,t.callbacks["empty-statement"]=ie.cb.emptyStatement,t.callbacks.version=ie.cb.version,t.callbacks["chain-id"]=ie.cb.chainId,t.callbacks.nonce=ie.cb.nonce,t.callbacks["issued-at"]=ie.cb.issuedAt,t.callbacks["expiration-time"]=ie.cb.expirationTime,t.callbacks["not-before"]=ie.cb.notBefore,t.callbacks["request-id"]=ie.cb.requestId,t.callbacks.uri=ie.cb.uri,t.callbacks["uri-r"]=ie.cb.uriR,t.callbacks.resource=ie.cb.resource,t.callbacks.scheme=ie.cb.scheme,t.callbacks["userinfo-at"]=ie.cb.userinfo,t.callbacks.host=ie.cb.host,t.callbacks["IP-literal"]=ie.cb.ipLiteral,t.callbacks.port=ie.cb.port,t.callbacks["path-abempty"]=ie.cb.pathAbempty,t.callbacks["path-absolute"]=ie.cb.pathAbsolute,t.callbacks["path-rootless"]=ie.cb.pathRootless,t.callbacks["path-empty"]=ie.cb.pathEmpty,t.callbacks.query=ie.cb.query,t.callbacks.fragment=ie.cb.fragment,t.callbacks.IPv4address=ie.cb.ipv4,t.callbacks.nodcolon=ie.cb.nodcolon,t.callbacks.dcolon=ie.cb.dcolon,t.callbacks.h16=ie.cb.h16,t.callbacks.h16c=ie.cb.h16,t.callbacks.h16n=ie.cb.h16,t.callbacks.h16cn=ie.cb.h16,t.callbacks["dec-octet"]=ie.cb.decOctet,t.callbacks["dec-digit"]=ie.cb.decDigit;let n={errors:[],lineno:1,scheme:void 0,domain:void 0,address:void 0,statement:void 0,uri:void 0,version:void 0,chainId:void 0,nonce:void 0,issuedAt:void 0,expirationTime:void 0,notBefore:void 0,requestId:void 0,resources:void 0,uriElements:{scheme:void 0,userinfo:void 0,host:void 0,port:void 0,path:void 0,query:void 0,fragment:void 0}},s=t.parse(tm,0,e,n),i="";for(let o=0;o<n.errors.length;o+=1)i+=n.errors[o]+`
|
|
535
|
+
`;if(s.success||(i+=`Invalid message: ${JSON.stringify(s)}`),i!=="")throw new Error(i);this.scheme=n.scheme,this.domain=n.domain,this.address=n.address,this.statement=n.statement,this.uri=n.uri,this.version=n.version,this.chainId=n.chainId,this.nonce=n.nonce,this.issuedAt=n.issuedAt,this.expirationTime=n.expirationTime,this.notBefore=n.notBefore,this.requestId=n.requestId,this.resources=n.resources,this.uriElements=n.uriElements}};$n.ParsedMessage=Ff;var G8=r=>{let e=new em.default.parser;e.callbacks["IP-literal"]=ie.cb.ipLiteral,e.callbacks.IPv4address=ie.cb.ipv4,e.callbacks.nodcolon=ie.cb.nodcolon,e.callbacks.dcolon=ie.cb.dcolon,e.callbacks.h16=ie.cb.h16,e.callbacks.h16c=ie.cb.h16,e.callbacks.h16n=ie.cb.h16,e.callbacks.h16cn=ie.cb.h16,e.callbacks["dec-octet"]=ie.cb.decOctet,e.callbacks["dec-digit"]=ie.cb.decDigit;let t={errors:[]};return e.parse(tm,"uri-r",r,t).success};$n.isUri=G8});var rm=P(Hr=>{"use strict";var z8=Hr&&Hr.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),K8=Hr&&Hr.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&z8(e,r,t)};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.isUri=Hr.ParsedMessage=void 0;var V8=Df();Object.defineProperty(Hr,"ParsedMessage",{enumerable:!0,get:function(){return V8.ParsedMessage}});var $8=Df();Object.defineProperty(Hr,"isUri",{enumerable:!0,get:function(){return $8.isUri}});K8(Mf(),Hr)});var _m={};uf(_m,{__addDisposableResource:()=>Pm,__assign:()=>Oc,__asyncDelegator:()=>gm,__asyncGenerator:()=>pm,__asyncValues:()=>bm,__await:()=>pi,__awaiter:()=>cm,__classPrivateFieldGet:()=>wm,__classPrivateFieldIn:()=>Em,__classPrivateFieldSet:()=>Am,__createBinding:()=>Cc,__decorate:()=>im,__disposeResources:()=>vm,__esDecorate:()=>J8,__exportStar:()=>lm,__extends:()=>nm,__generator:()=>um,__importDefault:()=>ym,__importStar:()=>mm,__makeTemplateObject:()=>xm,__metadata:()=>am,__param:()=>om,__propKey:()=>W8,__read:()=>qf,__rest:()=>sm,__runInitializers:()=>Q8,__setFunctionName:()=>Y8,__spread:()=>fm,__spreadArray:()=>hm,__spreadArrays:()=>dm,__values:()=>Sc,default:()=>e5});function nm(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Hf(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function sm(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(r);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(r,n[s])&&(t[n[s]]=r[n[s]]);return t}function im(r,e,t,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,t,n);else for(var a=r.length-1;a>=0;a--)(o=r[a])&&(i=(s<3?o(i):s>3?o(e,t,i):o(e,t))||i);return s>3&&i&&Object.defineProperty(e,t,i),i}function om(r,e){return function(t,n){e(t,n,r)}}function J8(r,e,t,n,s,i){function o(m){if(m!==void 0&&typeof m!="function")throw new TypeError("Function expected");return m}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",u=!e&&r?n.static?r:r.prototype:null,l=e||(u?Object.getOwnPropertyDescriptor(u,n.name):{}),f,h=!1,g=t.length-1;g>=0;g--){var x={};for(var b in n)x[b]=b==="access"?{}:n[b];for(var b in n.access)x.access[b]=n.access[b];x.addInitializer=function(m){if(h)throw new TypeError("Cannot add initializers after decoration has completed");i.push(o(m||null))};var y=(0,t[g])(a==="accessor"?{get:l.get,set:l.set}:l[c],x);if(a==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(f=o(y.get))&&(l.get=f),(f=o(y.set))&&(l.set=f),(f=o(y.init))&&s.unshift(f)}else(f=o(y))&&(a==="field"?s.unshift(f):l[c]=f)}u&&Object.defineProperty(u,n.name,l),h=!0}function Q8(r,e,t){for(var n=arguments.length>2,s=0;s<e.length;s++)t=n?e[s].call(r,t):e[s].call(r);return n?t:void 0}function W8(r){return typeof r=="symbol"?r:"".concat(r)}function Y8(r,e,t){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(r,"name",{configurable:!0,value:t?"".concat(t," ",e):e})}function am(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function cm(r,e,t,n){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{u(n.next(l))}catch(f){o(f)}}function c(l){try{u(n.throw(l))}catch(f){o(f)}}function u(l){l.done?i(l.value):s(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})}function um(r,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(l){return c([u,l])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(t=0)),t;)try{if(n=1,s&&(i=u[0]&2?s.return:u[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,u[1])).done)return i;switch(s=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,s=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){t.label=u[1];break}if(u[0]===6&&t.label<i[1]){t.label=i[1],i=u;break}if(i&&t.label<i[2]){t.label=i[2],t.ops.push(u);break}i[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(r,t)}catch(l){u=[6,l],s=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function lm(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Cc(e,r,t)}function Sc(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function qf(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),s,i=[],o;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)i.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return i}function fm(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(qf(arguments[e]));return r}function dm(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),s=0,e=0;e<t;e++)for(var i=arguments[e],o=0,a=i.length;o<a;o++,s++)n[s]=i[o];return n}function hm(r,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return r.concat(i||Array.prototype.slice.call(e))}function pi(r){return this instanceof pi?(this.v=r,this):new pi(r)}function pm(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(g){return function(x){return Promise.resolve(x).then(g,f)}}function a(g,x){n[g]&&(s[g]=function(b){return new Promise(function(y,m){i.push([g,b,y,m])>1||c(g,b)})},x&&(s[g]=x(s[g])))}function c(g,x){try{u(n[g](x))}catch(b){h(i[0][3],b)}}function u(g){g.value instanceof pi?Promise.resolve(g.value.v).then(l,f):h(i[0][2],g)}function l(g){c("next",g)}function f(g){c("throw",g)}function h(g,x){g(x),i.shift(),i.length&&c(i[0][0],i[0][1])}}function gm(r){var e,t;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,i){e[s]=r[s]?function(o){return(t=!t)?{value:pi(r[s](o)),done:!1}:i?i(o):o}:i}}function bm(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Sc=="function"?Sc(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=r[i]&&function(o){return new Promise(function(a,c){o=r[i](o),s(a,c,o.done,o.value)})}}function s(i,o,a,c){Promise.resolve(c).then(function(u){i({value:u,done:a})},o)}}function xm(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function mm(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&Cc(e,r,t);return Z8(e,r),e}function ym(r){return r&&r.__esModule?r:{default:r}}function wm(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)}function Am(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t}function Em(r,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof r=="function"?e===r:r.has(e)}function Pm(r,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,s;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],t&&(s=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");s&&(n=function(){try{s.call(this)}catch(i){return Promise.reject(i)}}),r.stack.push({value:e,dispose:n,async:t})}else t&&r.stack.push({async:!0});return e}function vm(r){function e(i){r.error=r.hasError?new X8(i,r.error,"An error was suppressed during disposal."):i,r.hasError=!0}var t,n=0;function s(){for(;t=r.stack.pop();)try{if(!t.async&&n===1)return n=0,r.stack.push(t),Promise.resolve().then(s);if(t.dispose){var i=t.dispose.call(t.value);if(t.async)return n|=2,Promise.resolve(i).then(s,function(o){return e(o),s()})}else n|=1}catch(o){e(o)}if(n===1)return r.hasError?Promise.reject(r.error):Promise.resolve();if(r.hasError)throw r.error}return s()}var Hf,Oc,Cc,Z8,X8,e5,km=A4(()=>{"use strict";Hf=function(r,e){return Hf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])},Hf(r,e)};Oc=function(){return Oc=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Oc.apply(this,arguments)};Cc=Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]};Z8=Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e};X8=typeof SuppressedError=="function"?SuppressedError:function(r,e,t){var n=new Error(t);return n.name="SuppressedError",n.error=r,n.suppressed=e,n};e5={__extends:nm,__assign:Oc,__rest:sm,__decorate:im,__param:om,__metadata:am,__awaiter:cm,__generator:um,__createBinding:Cc,__exportStar:lm,__values:Sc,__read:qf,__spread:fm,__spreadArrays:dm,__spreadArray:hm,__await:pi,__asyncGenerator:pm,__asyncDelegator:gm,__asyncValues:bm,__makeTemplateObject:xm,__importStar:mm,__importDefault:ym,__classPrivateFieldGet:wm,__classPrivateFieldSet:Am,__classPrivateFieldIn:Em,__addDisposableResource:Pm,__disposeResources:vm}});var Ic=P(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.version=void 0;Nc.version="6.15.0"});var Jn=P(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.defineProperties=gi.resolveProperties=void 0;function t5(r,e,t){let n=e.split("|").map(i=>i.trim());for(let i=0;i<n.length;i++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof r===e)return}let s=new Error(`invalid value for type ${e}`);throw s.code="INVALID_ARGUMENT",s.argument=`value.${t}`,s.value=r,s}async function r5(r){let e=Object.keys(r);return(await Promise.all(e.map(n=>Promise.resolve(r[n])))).reduce((n,s,i)=>(n[e[i]]=s,n),{})}gi.resolveProperties=r5;function n5(r,e,t){for(let n in e){let s=e[n],i=t?t[n]:null;i&&t5(s,i,n),Object.defineProperty(r,n,{enumerable:!0,value:s,writable:!1})}}gi.defineProperties=n5});var qr=P(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.assertPrivate=St.assertNormalize=St.assertArgumentCount=St.assertArgument=St.assert=St.makeError=St.isCallException=St.isError=void 0;var s5=Ic(),Tm=Jn();function bi(r,e){if(r==null)return"null";if(e==null&&(e=new Set),typeof r=="object"){if(e.has(r))return"[Circular]";e.add(r)}if(Array.isArray(r))return"[ "+r.map(t=>bi(t,e)).join(", ")+" ]";if(r instanceof Uint8Array){let t="0123456789abcdef",n="0x";for(let s=0;s<r.length;s++)n+=t[r[s]>>4],n+=t[r[s]&15];return n}if(typeof r=="object"&&typeof r.toJSON=="function")return bi(r.toJSON(),e);switch(typeof r){case"boolean":case"number":case"symbol":return r.toString();case"bigint":return BigInt(r).toString();case"string":return JSON.stringify(r);case"object":{let t=Object.keys(r);return t.sort(),"{ "+t.map(n=>`${bi(n,e)}: ${bi(r[n],e)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function Bm(r,e){return r&&r.code===e}St.isError=Bm;function i5(r){return Bm(r,"CALL_EXCEPTION")}St.isCallException=i5;function Om(r,e,t){let n=r;{let i=[];if(t){if("message"in t||"code"in t||"name"in t)throw new Error(`value will overwrite populated values: ${bi(t)}`);for(let o in t){if(o==="shortMessage")continue;let a=t[o];i.push(o+"="+bi(a))}}i.push(`code=${e}`),i.push(`version=${s5.version}`),i.length&&(r+=" ("+i.join(", ")+")")}let s;switch(e){case"INVALID_ARGUMENT":s=new TypeError(r);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":s=new RangeError(r);break;default:s=new Error(r)}return(0,Tm.defineProperties)(s,{code:e}),t&&Object.assign(s,t),s.shortMessage==null&&(0,Tm.defineProperties)(s,{shortMessage:n}),s}St.makeError=Om;function xi(r,e,t,n){if(!r)throw Om(e,t,n)}St.assert=xi;function o5(r,e,t,n){xi(r,e,"INVALID_ARGUMENT",{argument:t,value:n})}St.assertArgument=o5;function a5(r,e,t){t==null&&(t=""),t&&(t=": "+t),xi(r>=e,"missing argument"+t,"MISSING_ARGUMENT",{count:r,expectedCount:e}),xi(r<=e,"too many arguments"+t,"UNEXPECTED_ARGUMENT",{count:r,expectedCount:e})}St.assertArgumentCount=a5;var c5=["NFD","NFC","NFKD","NFKC"].reduce((r,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"\xE9".normalize("NFD")!=="e\u0301")throw new Error("broken");r.push(e)}catch{}return r},[]);function u5(r){xi(c5.indexOf(r)>=0,"platform missing String.prototype.normalize","UNSUPPORTED_OPERATION",{operation:"String.prototype.normalize",info:{form:r}})}St.assertNormalize=u5;function l5(r,e,t){if(t==null&&(t=""),r!==e){let n=t,s="new";t&&(n+=".",s+=" "+t),xi(!1,`private constructor; use ${n}from* methods`,"UNSUPPORTED_OPERATION",{operation:s})}}St.assertPrivate=l5});var yr=P(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.zeroPadBytes=tt.zeroPadValue=tt.stripZerosLeft=tt.dataSlice=tt.dataLength=tt.concat=tt.hexlify=tt.isBytesLike=tt.isHexString=tt.getBytesCopy=tt.getBytes=void 0;var Gf=qr();function Cm(r,e,t){if(r instanceof Uint8Array)return t?new Uint8Array(r):r;if(typeof r=="string"&&r.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){let n=new Uint8Array((r.length-2)/2),s=2;for(let i=0;i<n.length;i++)n[i]=parseInt(r.substring(s,s+2),16),s+=2;return n}(0,Gf.assertArgument)(!1,"invalid BytesLike value",e||"value",r)}function Yo(r,e){return Cm(r,e,!1)}tt.getBytes=Yo;function f5(r,e){return Cm(r,e,!0)}tt.getBytesCopy=f5;function zf(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&r.length!==2+2*e||e===!0&&r.length%2!==0)}tt.isHexString=zf;function d5(r){return zf(r,!0)||r instanceof Uint8Array}tt.isBytesLike=d5;var Sm="0123456789abcdef";function Zo(r){let e=Yo(r),t="0x";for(let n=0;n<e.length;n++){let s=e[n];t+=Sm[(s&240)>>4]+Sm[s&15]}return t}tt.hexlify=Zo;function h5(r){return"0x"+r.map(e=>Zo(e).substring(2)).join("")}tt.concat=h5;function p5(r){return zf(r,!0)?(r.length-2)/2:Yo(r).length}tt.dataLength=p5;function g5(r,e,t){let n=Yo(r);return t!=null&&t>n.length&&(0,Gf.assert)(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:n,length:n.length,offset:t}),Zo(n.slice(e??0,t??n.length))}tt.dataSlice=g5;function b5(r){let e=Zo(r).substring(2);for(;e.startsWith("00");)e=e.substring(2);return"0x"+e}tt.stripZerosLeft=b5;function Nm(r,e,t){let n=Yo(r);(0,Gf.assert)(e>=n.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(n),length:e,offset:e+1});let s=new Uint8Array(e);return s.fill(0),t?s.set(n,e-n.length):s.set(n,0),Zo(s)}function x5(r,e){return Nm(r,e,!0)}tt.zeroPadValue=x5;function m5(r,e){return Nm(r,e,!1)}tt.zeroPadBytes=m5});var yi=P(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.toQuantity=rt.toBeArray=rt.toBeHex=rt.toNumber=rt.getNumber=rt.toBigInt=rt.getUint=rt.getBigInt=rt.mask=rt.toTwos=rt.fromTwos=void 0;var Im=yr(),Xt=qr(),Rc=BigInt(0),Gr=BigInt(1),mi=9007199254740991;function y5(r,e){let t=Xo(r,"value"),n=BigInt(Ss(e,"width"));if((0,Xt.assert)(t>>n===Rc,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:r}),t>>n-Gr){let s=(Gr<<n)-Gr;return-((~t&s)+Gr)}return t}rt.fromTwos=y5;function w5(r,e){let t=Lc(r,"value"),n=BigInt(Ss(e,"width")),s=Gr<<n-Gr;if(t<Rc){t=-t,(0,Xt.assert)(t<=s,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:r});let i=(Gr<<n)-Gr;return(~t&i)+Gr}else(0,Xt.assert)(t<s,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:r});return t}rt.toTwos=w5;function A5(r,e){let t=Xo(r,"value"),n=BigInt(Ss(e,"bits"));return t&(Gr<<n)-Gr}rt.mask=A5;function Lc(r,e){switch(typeof r){case"bigint":return r;case"number":return(0,Xt.assertArgument)(Number.isInteger(r),"underflow",e||"value",r),(0,Xt.assertArgument)(r>=-mi&&r<=mi,"overflow",e||"value",r),BigInt(r);case"string":try{if(r==="")throw new Error("empty string");return r[0]==="-"&&r[1]!=="-"?-BigInt(r.substring(1)):BigInt(r)}catch(t){(0,Xt.assertArgument)(!1,`invalid BigNumberish string: ${t.message}`,e||"value",r)}}(0,Xt.assertArgument)(!1,"invalid BigNumberish value",e||"value",r)}rt.getBigInt=Lc;function Xo(r,e){let t=Lc(r,e);return(0,Xt.assert)(t>=Rc,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:r}),t}rt.getUint=Xo;var Rm="0123456789abcdef";function Lm(r){if(r instanceof Uint8Array){let e="0x0";for(let t of r)e+=Rm[t>>4],e+=Rm[t&15];return BigInt(e)}return Lc(r)}rt.toBigInt=Lm;function Ss(r,e){switch(typeof r){case"bigint":return(0,Xt.assertArgument)(r>=-mi&&r<=mi,"overflow",e||"value",r),Number(r);case"number":return(0,Xt.assertArgument)(Number.isInteger(r),"underflow",e||"value",r),(0,Xt.assertArgument)(r>=-mi&&r<=mi,"overflow",e||"value",r),r;case"string":try{if(r==="")throw new Error("empty string");return Ss(BigInt(r),e)}catch(t){(0,Xt.assertArgument)(!1,`invalid numeric string: ${t.message}`,e||"value",r)}}(0,Xt.assertArgument)(!1,"invalid numeric value",e||"value",r)}rt.getNumber=Ss;function E5(r){return Ss(Lm(r))}rt.toNumber=E5;function P5(r,e){let n=Xo(r,"value").toString(16);if(e==null)n.length%2&&(n="0"+n);else{let s=Ss(e,"width");for((0,Xt.assert)(s*2>=n.length,`value exceeds width (${s} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:r});n.length<s*2;)n="0"+n}return"0x"+n}rt.toBeHex=P5;function Mm(r){let e=Xo(r,"value");if(e===Rc)return new Uint8Array([]);let t=e.toString(16);t.length%2&&(t="0"+t);let n=new Uint8Array(t.length/2);for(let s=0;s<n.length;s++){let i=s*2;n[s]=parseInt(t.substring(i,i+2),16)}return n}rt.toBeArray=Mm;function v5(r){let e=(0,Im.hexlify)((0,Im.isBytesLike)(r)?r:Mm(r)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}rt.toQuantity=v5});var jm=P(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.decodeBase58=wi.encodeBase58=void 0;var _5=yr(),k5=qr(),T5=yi(),jc="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",Mc=null;function B5(r){if(Mc==null){Mc={};for(let t=0;t<jc.length;t++)Mc[jc[t]]=BigInt(t)}let e=Mc[r];return(0,k5.assertArgument)(e!=null,"invalid base58 value","letter",r),e}var O5=BigInt(0),Kf=BigInt(58);function S5(r){let e=(0,_5.getBytes)(r),t=(0,T5.toBigInt)(e),n="";for(;t;)n=jc[Number(t%Kf)]+n,t/=Kf;for(let s=0;s<e.length&&!e[s];s++)n=jc[0]+n;return n}wi.encodeBase58=S5;function C5(r){let e=O5;for(let t=0;t<r.length;t++)e*=Kf,e+=B5(r[t]);return e}wi.decodeBase58=C5});var Vf=P(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.encodeBase64=Ai.decodeBase64=void 0;var Um=yr();function N5(r){r=atob(r);let e=new Uint8Array(r.length);for(let t=0;t<r.length;t++)e[t]=r.charCodeAt(t);return(0,Um.getBytes)(e)}Ai.decodeBase64=N5;function I5(r){let e=(0,Um.getBytes)(r),t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}Ai.encodeBase64=I5});var Fm=P(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.EventPayload=void 0;var R5=Jn(),$f=class{filter;emitter;#e;constructor(e,t,n){this.#e=t,(0,R5.defineProperties)(this,{emitter:e,filter:n})}async removeListener(){this.#e!=null&&await this.emitter.off(this.filter,this.#e)}};Uc.EventPayload=$f});var Fc=P(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.toUtf8CodePoints=zr.toUtf8String=zr.toUtf8Bytes=zr.Utf8ErrorFuncs=void 0;var L5=yr(),ea=qr();function M5(r,e,t,n,s){(0,ea.assertArgument)(!1,`invalid codepoint at offset ${e}; ${r}`,"bytes",t)}function Dm(r,e,t,n,s){if(r==="BAD_PREFIX"||r==="UNEXPECTED_CONTINUE"){let i=0;for(let o=e+1;o<t.length&&t[o]>>6===2;o++)i++;return i}return r==="OVERRUN"?t.length-e-1:0}function j5(r,e,t,n,s){return r==="OVERLONG"?((0,ea.assertArgument)(typeof s=="number","invalid bad code point for replacement","badCodepoint",s),n.push(s),0):(n.push(65533),Dm(r,e,t,n,s))}zr.Utf8ErrorFuncs=Object.freeze({error:M5,ignore:Dm,replace:j5});function Hm(r,e){e==null&&(e=zr.Utf8ErrorFuncs.error);let t=(0,L5.getBytes)(r,"bytes"),n=[],s=0;for(;s<t.length;){let i=t[s++];if(i>>7===0){n.push(i);continue}let o=null,a=null;if((i&224)===192)o=1,a=127;else if((i&240)===224)o=2,a=2047;else if((i&248)===240)o=3,a=65535;else{(i&192)===128?s+=e("UNEXPECTED_CONTINUE",s-1,t,n):s+=e("BAD_PREFIX",s-1,t,n);continue}if(s-1+o>=t.length){s+=e("OVERRUN",s-1,t,n);continue}let c=i&(1<<8-o-1)-1;for(let u=0;u<o;u++){let l=t[s];if((l&192)!=128){s+=e("MISSING_CONTINUE",s,t,n),c=null;break}c=c<<6|l&63,s++}if(c!==null){if(c>1114111){s+=e("OUT_OF_RANGE",s-1-o,t,n,c);continue}if(c>=55296&&c<=57343){s+=e("UTF16_SURROGATE",s-1-o,t,n,c);continue}if(c<=a){s+=e("OVERLONG",s-1-o,t,n,c);continue}n.push(c)}}return n}function qm(r,e){(0,ea.assertArgument)(typeof r=="string","invalid string value","str",r),e!=null&&((0,ea.assertNormalize)(e),r=r.normalize(e));let t=[];for(let n=0;n<r.length;n++){let s=r.charCodeAt(n);if(s<128)t.push(s);else if(s<2048)t.push(s>>6|192),t.push(s&63|128);else if((s&64512)==55296){n++;let i=r.charCodeAt(n);(0,ea.assertArgument)(n<r.length&&(i&64512)===56320,"invalid surrogate pair","str",r);let o=65536+((s&1023)<<10)+(i&1023);t.push(o>>18|240),t.push(o>>12&63|128),t.push(o>>6&63|128),t.push(o&63|128)}else t.push(s>>12|224),t.push(s>>6&63|128),t.push(s&63|128)}return new Uint8Array(t)}zr.toUtf8Bytes=qm;function U5(r){return r.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function F5(r,e){return U5(Hm(r,e))}zr.toUtf8String=F5;function D5(r,e){return Hm(qm(r,e))}zr.toUtf8CodePoints=D5});var zm=P(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.getUrl=Ei.createGetUrl=void 0;var ta=qr();function Gm(r){async function e(t,n){(0,ta.assert)(n==null||!n.cancelled,"request cancelled before sending","CANCELLED");let s=t.url.split(":")[0].toLowerCase();(0,ta.assert)(s==="http"||s==="https",`unsupported protocol ${s}`,"UNSUPPORTED_OPERATION",{info:{protocol:s},operation:"request"}),(0,ta.assert)(s==="https"||!t.credentials||t.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let i=null,o=new AbortController,a=setTimeout(()=>{i=(0,ta.makeError)("request timeout","TIMEOUT"),o.abort()},t.timeout);n&&n.addListener(()=>{i=(0,ta.makeError)("request cancelled","CANCELLED"),o.abort()});let c=Object.assign({},r,{method:t.method,headers:new Headers(Array.from(t)),body:t.body||void 0,signal:o.signal}),u;try{u=await fetch(t.url,c)}catch(g){throw clearTimeout(a),i||g}clearTimeout(a);let l={};u.headers.forEach((g,x)=>{l[x.toLowerCase()]=g});let f=await u.arrayBuffer(),h=f==null?null:new Uint8Array(f);return{statusCode:u.status,statusMessage:u.statusText,headers:l,body:h}}return e}Ei.createGetUrl=Gm;var H5=Gm({});async function q5(r,e){return H5(r,e)}Ei.getUrl=q5});var Xm=P(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.FetchResponse=Qn.FetchRequest=Qn.FetchCancelSignal=void 0;var $m=Vf(),Jm=yr(),wr=qr(),G5=Jn(),Pi=Fc(),Qm=zm(),z5=12,K5=250,Km=(0,Qm.createGetUrl)(),V5=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),$5=new RegExp("^ipfs://(ipfs/)?(.*)$","i"),Jf=!1;async function Wm(r,e){try{let t=r.match(V5);if(!t)throw new Error("invalid data");return new On(200,"OK",{"content-type":t[1]||"text/plain"},t[2]?(0,$m.decodeBase64)(t[3]):J5(t[3]))}catch{return new On(599,"BAD REQUEST (invalid data: URI)",{},null,new vi(r))}}function Ym(r){async function e(t,n){try{let s=t.match($5);if(!s)throw new Error("invalid link");return new vi(`${r}${s[2]}`)}catch{return new On(599,"BAD REQUEST (invalid IPFS URI)",{},null,new vi(t))}}return e}var Dc={data:Wm,ipfs:Ym("https://gateway.ipfs.io/ipfs/")},Zm=new WeakMap,qc=class{#e;#t;constructor(e){this.#e=[],this.#t=!1,Zm.set(e,()=>{if(!this.#t){this.#t=!0;for(let t of this.#e)setTimeout(()=>{t()},0);this.#e=[]}})}addListener(e){(0,wr.assert)(!this.#t,"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),this.#e.push(e)}get cancelled(){return this.#t}checkSignal(){(0,wr.assert)(!this.cancelled,"cancelled","CANCELLED",{})}};Qn.FetchCancelSignal=qc;function Hc(r){if(r==null)throw new Error("missing signal; should not happen");return r.checkSignal(),r}var vi=class r{#e;#t;#r;#n;#s;#o;#i;#a;#f;#u;#p;#g;#c;#l;#d;get url(){return this.#o}set url(e){this.#o=String(e)}get body(){return this.#i==null?null:new Uint8Array(this.#i)}set body(e){if(e==null)this.#i=void 0,this.#a=void 0;else if(typeof e=="string")this.#i=(0,Pi.toUtf8Bytes)(e),this.#a="text/plain";else if(e instanceof Uint8Array)this.#i=e,this.#a="application/octet-stream";else if(typeof e=="object")this.#i=(0,Pi.toUtf8Bytes)(JSON.stringify(e)),this.#a="application/json";else throw new Error("invalid body")}hasBody(){return this.#i!=null}get method(){return this.#n?this.#n:this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),this.#n=String(e).toUpperCase()}get headers(){let e=Object.assign({},this.#r);return this.#f&&(e.authorization=`Basic ${(0,$m.encodeBase64)((0,Pi.toUtf8Bytes)(this.#f))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&this.#a&&(e["content-type"]=this.#a),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,t){this.#r[String(e).toLowerCase()]=String(t)}clearHeaders(){this.#r={}}[Symbol.iterator](){let e=this.headers,t=Object.keys(e),n=0;return{next:()=>{if(n<t.length){let s=t[n++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return this.#f||null}setCredentials(e,t){(0,wr.assertArgument)(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),this.#f=`${e}:${t}`}get allowGzip(){return this.#t}set allowGzip(e){this.#t=!!e}get allowInsecureAuthentication(){return!!this.#e}set allowInsecureAuthentication(e){this.#e=!!e}get timeout(){return this.#s}set timeout(e){(0,wr.assertArgument)(e>=0,"timeout must be non-zero","timeout",e),this.#s=e}get preflightFunc(){return this.#u||null}set preflightFunc(e){this.#u=e}get processFunc(){return this.#p||null}set processFunc(e){this.#p=e}get retryFunc(){return this.#g||null}set retryFunc(e){this.#g=e}get getUrlFunc(){return this.#d||Km}set getUrlFunc(e){this.#d=e}constructor(e){this.#o=String(e),this.#e=!1,this.#t=!0,this.#r={},this.#n="",this.#s=3e5,this.#l={slotInterval:K5,maxAttempts:z5},this.#d=null}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${this.#i?(0,Jm.hexlify)(this.#i):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(this.#l.slotInterval=e.slotInterval),e.maxAttempts!=null&&(this.#l.maxAttempts=e.maxAttempts)}async#h(e,t,n,s,i){if(e>=this.#l.maxAttempts)return i.makeServerError("exceeded maximum retry limit");(0,wr.assert)(Vm()<=t,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:s}),n>0&&await Q5(n);let o=this.clone(),a=(o.url.split(":")[0]||"").toLowerCase();if(a in Dc){let l=await Dc[a](o.url,Hc(s.#c));if(l instanceof On){let f=l;if(this.processFunc){Hc(s.#c);try{f=await this.processFunc(o,f)}catch(h){(h.throttle==null||typeof h.stall!="number")&&f.makeServerError("error in post-processing function",h).assertOk()}}return f}o=l}this.preflightFunc&&(o=await this.preflightFunc(o));let c=await this.getUrlFunc(o,Hc(s.#c)),u=new On(c.statusCode,c.statusMessage,c.headers,c.body,s);if(u.statusCode===301||u.statusCode===302){try{let l=u.headers.location||"";return o.redirect(l).#h(e+1,t,0,s,u)}catch{}return u}else if(u.statusCode===429&&(this.retryFunc==null||await this.retryFunc(o,u,e))){let l=u.headers["retry-after"],f=this.#l.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof l=="string"&&l.match(/^[1-9][0-9]*$/)&&(f=parseInt(l)),o.clone().#h(e+1,t,f,s,u)}if(this.processFunc){Hc(s.#c);try{u=await this.processFunc(o,u)}catch(l){(l.throttle==null||typeof l.stall!="number")&&u.makeServerError("error in post-processing function",l).assertOk();let f=this.#l.slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return l.stall>=0&&(f=l.stall),o.clone().#h(e+1,t,f,s,u)}}return u}send(){return(0,wr.assert)(this.#c==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),this.#c=new qc(this),this.#h(0,Vm()+this.timeout,0,this,new On(0,"",{},null,this))}cancel(){(0,wr.assert)(this.#c!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});let e=Zm.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){let t=this.url.split(":")[0].toLowerCase(),n=e.split(":")[0].toLowerCase();(0,wr.assert)(this.method==="GET"&&(t!=="https"||n!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});let s=new r(e);return s.method="GET",s.allowGzip=this.allowGzip,s.timeout=this.timeout,s.#r=Object.assign({},this.#r),this.#i&&(s.#i=new Uint8Array(this.#i)),s.#a=this.#a,s}clone(){let e=new r(this.url);return e.#n=this.#n,this.#i&&(e.#i=this.#i),e.#a=this.#a,e.#r=Object.assign({},this.#r),e.#f=this.#f,this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),e.#u=this.#u,e.#p=this.#p,e.#g=this.#g,e.#l=Object.assign({},this.#l),e.#d=this.#d,e}static lockConfig(){Jf=!0}static getGateway(e){return Dc[e.toLowerCase()]||null}static registerGateway(e,t){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(Jf)throw new Error("gateways locked");Dc[e]=t}static registerGetUrl(e){if(Jf)throw new Error("gateways locked");Km=e}static createGetUrlFunc(e){return(0,Qm.createGetUrl)(e)}static createDataGateway(){return Wm}static createIpfsGatewayFunc(e){return Ym(e)}};Qn.FetchRequest=vi;var On=class r{#e;#t;#r;#n;#s;#o;toString(){return`<FetchResponse status=${this.statusCode} body=${this.#n?(0,Jm.hexlify)(this.#n):"null"}>`}get statusCode(){return this.#e}get statusMessage(){return this.#t}get headers(){return Object.assign({},this.#r)}get body(){return this.#n==null?null:new Uint8Array(this.#n)}get bodyText(){try{return this.#n==null?"":(0,Pi.toUtf8String)(this.#n)}catch{(0,wr.assert)(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch{(0,wr.assert)(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){let e=this.headers,t=Object.keys(e),n=0;return{next:()=>{if(n<t.length){let s=t[n++];return{value:[s,e[s]],done:!1}}return{value:void 0,done:!0}}}}constructor(e,t,n,s,i){this.#e=e,this.#t=t,this.#r=Object.keys(n).reduce((o,a)=>(o[a.toLowerCase()]=String(n[a]),o),{}),this.#n=s==null?null:new Uint8Array(s),this.#s=i||null,this.#o={message:""}}makeServerError(e,t){let n;e?n=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:(e=`${this.statusCode} ${this.statusMessage}`,n=`CLIENT ESCALATED SERVER ERROR (${e})`);let s=new r(599,n,this.headers,this.body,this.#s||void 0);return s.#o={message:e,error:t},s}throwThrottleError(e,t){t==null?t=-1:(0,wr.assertArgument)(Number.isInteger(t)&&t>=0,"invalid stall timeout","stall",t);let n=new Error(e||"throttling requests");throw(0,G5.defineProperties)(n,{stall:t,throttle:!0}),n}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return this.#n!=null}get request(){return this.#s}ok(){return this.#o.message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:t}=this.#o;e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let n=null;this.request&&(n=this.request.url);let s=null;try{this.#n&&(s=(0,Pi.toUtf8String)(this.#n))}catch{}(0,wr.assert)(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:t,info:{requestUrl:n,responseBody:s,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};Qn.FetchResponse=On;function Vm(){return new Date().getTime()}function J5(r){return(0,Pi.toUtf8Bytes)(r.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))}function Q5(r){return new Promise(e=>setTimeout(e,r))}});var Yf=P(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});Gc.FixedNumber=void 0;var W5=yr(),Ht=qr(),Wn=yi(),Y5=Jn(),Z5=BigInt(-1),Kr=BigInt(0),ki=BigInt(1),X5=BigInt(5),_i={},Ti="0000";for(;Ti.length<80;)Ti+=Ti;function Cs(r){let e=Ti;for(;e.length<r;)e+=e;return BigInt("1"+e.substring(0,r))}function ra(r,e,t){let n=BigInt(e.width);if(e.signed){let s=ki<<n-ki;(0,Ht.assert)(t==null||r>=-s&&r<s,"overflow","NUMERIC_FAULT",{operation:t,fault:"overflow",value:r}),r>Kr?r=(0,Wn.fromTwos)((0,Wn.mask)(r,n),n):r=-(0,Wn.fromTwos)((0,Wn.mask)(-r,n),n)}else{let s=ki<<n;(0,Ht.assert)(t==null||r>=0&&r<s,"overflow","NUMERIC_FAULT",{operation:t,fault:"overflow",value:r}),r=(r%s+s)%s&s-ki}return r}function Qf(r){typeof r=="number"&&(r=`fixed128x${r}`);let e=!0,t=128,n=18;if(typeof r=="string"){if(r!=="fixed")if(r==="ufixed")e=!1;else{let i=r.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);(0,Ht.assertArgument)(i,"invalid fixed format","format",r),e=i[1]!=="u",t=parseInt(i[2]),n=parseInt(i[3])}}else if(r){let i=r,o=(a,c,u)=>i[a]==null?u:((0,Ht.assertArgument)(typeof i[a]===c,"invalid fixed format ("+a+" not "+c+")","format."+a,i[a]),i[a]);e=o("signed","boolean",e),t=o("width","number",t),n=o("decimals","number",n)}(0,Ht.assertArgument)(t%8===0,"invalid FixedNumber width (not byte aligned)","format.width",t),(0,Ht.assertArgument)(n<=80,"invalid FixedNumber decimals (too large)","format.decimals",n);let s=(e?"":"u")+"fixed"+String(t)+"x"+String(n);return{signed:e,width:t,decimals:n,name:s}}function eE(r,e){let t="";r<Kr&&(t="-",r*=Z5);let n=r.toString();if(e===0)return t+n;for(;n.length<=e;)n=Ti+n;let s=n.length-e;for(n=n.substring(0,s)+"."+n.substring(s);n[0]==="0"&&n[1]!==".";)n=n.substring(1);for(;n[n.length-1]==="0"&&n[n.length-2]!==".";)n=n.substring(0,n.length-1);return t+n}var Wf=class r{format;#e;#t;#r;_value;constructor(e,t,n){(0,Ht.assertPrivate)(e,_i,"FixedNumber"),this.#t=t,this.#e=n;let s=eE(t,n.decimals);(0,Y5.defineProperties)(this,{format:n.name,_value:s}),this.#r=Cs(n.decimals)}get signed(){return this.#e.signed}get width(){return this.#e.width}get decimals(){return this.#e.decimals}get value(){return this.#t}#n(e){(0,Ht.assertArgument)(this.format===e.format,"incompatible format; use fixedNumber.toFormat","other",e)}#s(e,t){return e=ra(e,this.#e,t),new r(_i,e,this.#e)}#o(e,t){return this.#n(e),this.#s(this.#t+e.#t,t)}addUnsafe(e){return this.#o(e)}add(e){return this.#o(e,"add")}#i(e,t){return this.#n(e),this.#s(this.#t-e.#t,t)}subUnsafe(e){return this.#i(e)}sub(e){return this.#i(e,"sub")}#a(e,t){return this.#n(e),this.#s(this.#t*e.#t/this.#r,t)}mulUnsafe(e){return this.#a(e)}mul(e){return this.#a(e,"mul")}mulSignal(e){this.#n(e);let t=this.#t*e.#t;return(0,Ht.assert)(t%this.#r===Kr,"precision lost during signalling mul","NUMERIC_FAULT",{operation:"mulSignal",fault:"underflow",value:this}),this.#s(t/this.#r,"mulSignal")}#f(e,t){return(0,Ht.assert)(e.#t!==Kr,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#n(e),this.#s(this.#t*this.#r/e.#t,t)}divUnsafe(e){return this.#f(e)}div(e){return this.#f(e,"div")}divSignal(e){(0,Ht.assert)(e.#t!==Kr,"division by zero","NUMERIC_FAULT",{operation:"div",fault:"divide-by-zero",value:this}),this.#n(e);let t=this.#t*this.#r;return(0,Ht.assert)(t%e.#t===Kr,"precision lost during signalling div","NUMERIC_FAULT",{operation:"divSignal",fault:"underflow",value:this}),this.#s(t/e.#t,"divSignal")}cmp(e){let t=this.value,n=e.value,s=this.decimals-e.decimals;return s>0?n*=Cs(s):s<0&&(t*=Cs(-s)),t<n?-1:t>n?1:0}eq(e){return this.cmp(e)===0}lt(e){return this.cmp(e)<0}lte(e){return this.cmp(e)<=0}gt(e){return this.cmp(e)>0}gte(e){return this.cmp(e)>=0}floor(){let e=this.#t;return this.#t<Kr&&(e-=this.#r-ki),e=this.#t/this.#r*this.#r,this.#s(e,"floor")}ceiling(){let e=this.#t;return this.#t>Kr&&(e+=this.#r-ki),e=this.#t/this.#r*this.#r,this.#s(e,"ceiling")}round(e){if(e==null&&(e=0),e>=this.decimals)return this;let t=this.decimals-e,n=X5*Cs(t-1),s=this.value+n,i=Cs(t);return s=s/i*i,ra(s,this.#e,"round"),new r(_i,s,this.#e)}isZero(){return this.#t===Kr}isNegative(){return this.#t<Kr}toString(){return this._value}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return r.fromString(this.toString(),e)}static fromValue(e,t,n){let s=t==null?0:(0,Wn.getNumber)(t),i=Qf(n),o=(0,Wn.getBigInt)(e,"value"),a=s-i.decimals;if(a>0){let c=Cs(a);(0,Ht.assert)(o%c===Kr,"value loses precision for format","NUMERIC_FAULT",{operation:"fromValue",fault:"underflow",value:e}),o/=c}else a<0&&(o*=Cs(-a));return ra(o,i,"fromValue"),new r(_i,o,i)}static fromString(e,t){let n=e.match(/^(-?)([0-9]*)\.?([0-9]*)$/);(0,Ht.assertArgument)(n&&n[2].length+n[3].length>0,"invalid FixedNumber string value","value",e);let s=Qf(t),i=n[2]||"0",o=n[3]||"";for(;o.length<s.decimals;)o+=Ti;(0,Ht.assert)(o.substring(s.decimals).match(/^0*$/),"too many decimals for format","NUMERIC_FAULT",{operation:"fromString",fault:"underflow",value:e}),o=o.substring(0,s.decimals);let a=BigInt(n[1]+i+o);return ra(a,s,"fromString"),new r(_i,a,s)}static fromBytes(e,t){let n=(0,Wn.toBigInt)((0,W5.getBytes)(e,"value")),s=Qf(t);return s.signed&&(n=(0,Wn.fromTwos)(n,s.width)),ra(n,s,"fromBytes"),new r(_i,n,s)}};Gc.FixedNumber=Wf});var sy=P(Kc=>{"use strict";Object.defineProperty(Kc,"__esModule",{value:!0});Kc.decodeRlp=void 0;var ey=yr(),zc=qr(),tE=yr();function rE(r){let e=r.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function ty(r,e,t){let n=0;for(let s=0;s<t;s++)n=n*256+r[e+s];return n}function ry(r,e,t,n){let s=[];for(;t<e+1+n;){let i=ny(r,t);s.push(i.result),t+=i.consumed,(0,zc.assert)(t<=e+1+n,"child data too short","BUFFER_OVERRUN",{buffer:r,length:n,offset:e})}return{consumed:1+n,result:s}}function ny(r,e){(0,zc.assert)(r.length!==0,"data too short","BUFFER_OVERRUN",{buffer:r,length:0,offset:1});let t=n=>{(0,zc.assert)(n<=r.length,"data short segment too short","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n})};if(r[e]>=248){let n=r[e]-247;t(e+1+n);let s=ty(r,e+1,n);return t(e+1+n+s),ry(r,e,e+1+n,n+s)}else if(r[e]>=192){let n=r[e]-192;return t(e+1+n),ry(r,e,e+1,n)}else if(r[e]>=184){let n=r[e]-183;t(e+1+n);let s=ty(r,e+1,n);t(e+1+n+s);let i=(0,ey.hexlify)(r.slice(e+1+n,e+1+n+s));return{consumed:1+n+s,result:i}}else if(r[e]>=128){let n=r[e]-128;t(e+1+n);let s=(0,ey.hexlify)(r.slice(e+1,e+1+n));return{consumed:1+n,result:s}}return{consumed:1,result:rE(r[e])}}function nE(r){let e=(0,tE.getBytes)(r,"data"),t=ny(e,0);return(0,zc.assertArgument)(t.consumed===e.length,"unexpected junk after rlp payload","data",r),t.result}Kc.decodeRlp=nE});var cy=P(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.encodeRlp=void 0;var sE=yr();function iy(r){let e=[];for(;r;)e.unshift(r&255),r>>=8;return e}function ay(r){if(Array.isArray(r)){let n=[];if(r.forEach(function(i){n=n.concat(ay(i))}),n.length<=55)return n.unshift(192+n.length),n;let s=iy(n.length);return s.unshift(247+s.length),s.concat(n)}let e=Array.prototype.slice.call((0,sE.getBytes)(r,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;let t=iy(e.length);return t.unshift(183+t.length),t.concat(e)}var oy="0123456789abcdef";function iE(r){let e="0x";for(let t of ay(r))e+=oy[t>>4],e+=oy[t&15];return e}Vc.encodeRlp=iE});var py=P(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.parseEther=ln.formatEther=ln.parseUnits=ln.formatUnits=void 0;var Zf=qr(),uy=Yf(),ly=yi(),fy=["wei","kwei","mwei","gwei","szabo","finney","ether"];function dy(r,e){let t=18;if(typeof e=="string"){let n=fy.indexOf(e);(0,Zf.assertArgument)(n>=0,"invalid unit","unit",e),t=3*n}else e!=null&&(t=(0,ly.getNumber)(e,"unit"));return uy.FixedNumber.fromValue(r,t,{decimals:t,width:512}).toString()}ln.formatUnits=dy;function hy(r,e){(0,Zf.assertArgument)(typeof r=="string","value must be a string","value",r);let t=18;if(typeof e=="string"){let n=fy.indexOf(e);(0,Zf.assertArgument)(n>=0,"invalid unit","unit",e),t=3*n}else e!=null&&(t=(0,ly.getNumber)(e,"unit"));return uy.FixedNumber.fromString(r,{decimals:t,width:512}).value}ln.parseUnits=hy;function oE(r){return dy(r,18)}ln.formatEther=oE;function aE(r){return hy(r,18)}ln.parseEther=aE});var by=P($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.uuidV4=void 0;var gy=yr();function cE(r){let e=(0,gy.getBytes)(r,"randomBytes");e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t=(0,gy.hexlify)(e);return[t.substring(2,10),t.substring(10,14),t.substring(14,18),t.substring(18,22),t.substring(22,34)].join("-")}$c.uuidV4=cE});var $=P(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.toUtf8String=U.toUtf8CodePoints=U.toUtf8Bytes=U.parseUnits=U.formatUnits=U.parseEther=U.formatEther=U.encodeRlp=U.decodeRlp=U.defineProperties=U.resolveProperties=U.toQuantity=U.toBeArray=U.toBeHex=U.toNumber=U.toBigInt=U.getUint=U.getNumber=U.getBigInt=U.mask=U.toTwos=U.fromTwos=U.FixedNumber=U.FetchCancelSignal=U.FetchResponse=U.FetchRequest=U.EventPayload=U.makeError=U.assertNormalize=U.assertPrivate=U.assertArgumentCount=U.assertArgument=U.assert=U.isError=U.isCallException=U.zeroPadBytes=U.zeroPadValue=U.stripZerosLeft=U.dataSlice=U.dataLength=U.concat=U.hexlify=U.isBytesLike=U.isHexString=U.getBytesCopy=U.getBytes=U.encodeBase64=U.decodeBase64=U.encodeBase58=U.decodeBase58=void 0;U.uuidV4=U.Utf8ErrorFuncs=void 0;var xy=jm();Object.defineProperty(U,"decodeBase58",{enumerable:!0,get:function(){return xy.decodeBase58}});Object.defineProperty(U,"encodeBase58",{enumerable:!0,get:function(){return xy.encodeBase58}});var my=Vf();Object.defineProperty(U,"decodeBase64",{enumerable:!0,get:function(){return my.decodeBase64}});Object.defineProperty(U,"encodeBase64",{enumerable:!0,get:function(){return my.encodeBase64}});var Vr=yr();Object.defineProperty(U,"getBytes",{enumerable:!0,get:function(){return Vr.getBytes}});Object.defineProperty(U,"getBytesCopy",{enumerable:!0,get:function(){return Vr.getBytesCopy}});Object.defineProperty(U,"isHexString",{enumerable:!0,get:function(){return Vr.isHexString}});Object.defineProperty(U,"isBytesLike",{enumerable:!0,get:function(){return Vr.isBytesLike}});Object.defineProperty(U,"hexlify",{enumerable:!0,get:function(){return Vr.hexlify}});Object.defineProperty(U,"concat",{enumerable:!0,get:function(){return Vr.concat}});Object.defineProperty(U,"dataLength",{enumerable:!0,get:function(){return Vr.dataLength}});Object.defineProperty(U,"dataSlice",{enumerable:!0,get:function(){return Vr.dataSlice}});Object.defineProperty(U,"stripZerosLeft",{enumerable:!0,get:function(){return Vr.stripZerosLeft}});Object.defineProperty(U,"zeroPadValue",{enumerable:!0,get:function(){return Vr.zeroPadValue}});Object.defineProperty(U,"zeroPadBytes",{enumerable:!0,get:function(){return Vr.zeroPadBytes}});var Yn=qr();Object.defineProperty(U,"isCallException",{enumerable:!0,get:function(){return Yn.isCallException}});Object.defineProperty(U,"isError",{enumerable:!0,get:function(){return Yn.isError}});Object.defineProperty(U,"assert",{enumerable:!0,get:function(){return Yn.assert}});Object.defineProperty(U,"assertArgument",{enumerable:!0,get:function(){return Yn.assertArgument}});Object.defineProperty(U,"assertArgumentCount",{enumerable:!0,get:function(){return Yn.assertArgumentCount}});Object.defineProperty(U,"assertPrivate",{enumerable:!0,get:function(){return Yn.assertPrivate}});Object.defineProperty(U,"assertNormalize",{enumerable:!0,get:function(){return Yn.assertNormalize}});Object.defineProperty(U,"makeError",{enumerable:!0,get:function(){return Yn.makeError}});var uE=Fm();Object.defineProperty(U,"EventPayload",{enumerable:!0,get:function(){return uE.EventPayload}});var Xf=Xm();Object.defineProperty(U,"FetchRequest",{enumerable:!0,get:function(){return Xf.FetchRequest}});Object.defineProperty(U,"FetchResponse",{enumerable:!0,get:function(){return Xf.FetchResponse}});Object.defineProperty(U,"FetchCancelSignal",{enumerable:!0,get:function(){return Xf.FetchCancelSignal}});var lE=Yf();Object.defineProperty(U,"FixedNumber",{enumerable:!0,get:function(){return lE.FixedNumber}});var $r=yi();Object.defineProperty(U,"fromTwos",{enumerable:!0,get:function(){return $r.fromTwos}});Object.defineProperty(U,"toTwos",{enumerable:!0,get:function(){return $r.toTwos}});Object.defineProperty(U,"mask",{enumerable:!0,get:function(){return $r.mask}});Object.defineProperty(U,"getBigInt",{enumerable:!0,get:function(){return $r.getBigInt}});Object.defineProperty(U,"getNumber",{enumerable:!0,get:function(){return $r.getNumber}});Object.defineProperty(U,"getUint",{enumerable:!0,get:function(){return $r.getUint}});Object.defineProperty(U,"toBigInt",{enumerable:!0,get:function(){return $r.toBigInt}});Object.defineProperty(U,"toNumber",{enumerable:!0,get:function(){return $r.toNumber}});Object.defineProperty(U,"toBeHex",{enumerable:!0,get:function(){return $r.toBeHex}});Object.defineProperty(U,"toBeArray",{enumerable:!0,get:function(){return $r.toBeArray}});Object.defineProperty(U,"toQuantity",{enumerable:!0,get:function(){return $r.toQuantity}});var yy=Jn();Object.defineProperty(U,"resolveProperties",{enumerable:!0,get:function(){return yy.resolveProperties}});Object.defineProperty(U,"defineProperties",{enumerable:!0,get:function(){return yy.defineProperties}});var fE=sy();Object.defineProperty(U,"decodeRlp",{enumerable:!0,get:function(){return fE.decodeRlp}});var dE=cy();Object.defineProperty(U,"encodeRlp",{enumerable:!0,get:function(){return dE.encodeRlp}});var Jc=py();Object.defineProperty(U,"formatEther",{enumerable:!0,get:function(){return Jc.formatEther}});Object.defineProperty(U,"parseEther",{enumerable:!0,get:function(){return Jc.parseEther}});Object.defineProperty(U,"formatUnits",{enumerable:!0,get:function(){return Jc.formatUnits}});Object.defineProperty(U,"parseUnits",{enumerable:!0,get:function(){return Jc.parseUnits}});var Qc=Fc();Object.defineProperty(U,"toUtf8Bytes",{enumerable:!0,get:function(){return Qc.toUtf8Bytes}});Object.defineProperty(U,"toUtf8CodePoints",{enumerable:!0,get:function(){return Qc.toUtf8CodePoints}});Object.defineProperty(U,"toUtf8String",{enumerable:!0,get:function(){return Qc.toUtf8String}});Object.defineProperty(U,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return Qc.Utf8ErrorFuncs}});var hE=by();Object.defineProperty(U,"uuidV4",{enumerable:!0,get:function(){return hE.uuidV4}})});var Ar=P(Ye=>{"use strict";Object.defineProperty(Ye,"__esModule",{value:!0});Ye.Reader=Ye.Writer=Ye.Coder=Ye.checkResultErrors=Ye.Result=Ye.WordSize=void 0;var ut=$();Ye.WordSize=32;var ed=new Uint8Array(Ye.WordSize),pE=["then"],Wc={},Ey=new WeakMap;function Ns(r){return Ey.get(r)}function wy(r,e){Ey.set(r,e)}function na(r,e){let t=new Error(`deferred error during ABI decoding triggered accessing ${r}`);throw t.error=e,t}function td(r,e,t){return r.indexOf(null)>=0?e.map((n,s)=>n instanceof sa?td(Ns(n),n,t):n):r.reduce((n,s,i)=>{let o=e.getValue(s);return s in n||(t&&o instanceof sa&&(o=td(Ns(o),o,t)),n[s]=o),n},{})}var sa=class r extends Array{#e;constructor(...e){let t=e[0],n=e[1],s=(e[2]||[]).slice(),i=!0;t!==Wc&&(n=e,s=[],i=!1),super(n.length),n.forEach((c,u)=>{this[u]=c});let o=s.reduce((c,u)=>(typeof u=="string"&&c.set(u,(c.get(u)||0)+1),c),new Map);if(wy(this,Object.freeze(n.map((c,u)=>{let l=s[u];return l!=null&&o.get(l)===1?l:null}))),this.#e=[],this.#e==null&&this.#e,!i)return;Object.freeze(this);let a=new Proxy(this,{get:(c,u,l)=>{if(typeof u=="string"){if(u.match(/^[0-9]+$/)){let h=(0,ut.getNumber)(u,"%index");if(h<0||h>=this.length)throw new RangeError("out of result range");let g=c[h];return g instanceof Error&&na(`index ${h}`,g),g}if(pE.indexOf(u)>=0)return Reflect.get(c,u,l);let f=c[u];if(f instanceof Function)return function(...h){return f.apply(this===l?c:this,h)};if(!(u in c))return c.getValue.apply(this===l?c:this,[u])}return Reflect.get(c,u,l)}});return wy(a,Ns(this)),a}toArray(e){let t=[];return this.forEach((n,s)=>{n instanceof Error&&na(`index ${s}`,n),e&&n instanceof r&&(n=n.toArray(e)),t.push(n)}),t}toObject(e){let t=Ns(this);return t.reduce((n,s,i)=>((0,ut.assert)(s!=null,`value at index ${i} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),td(t,this,e)),{})}slice(e,t){e==null&&(e=0),e<0&&(e+=this.length,e<0&&(e=0)),t==null&&(t=this.length),t<0&&(t+=this.length,t<0&&(t=0)),t>this.length&&(t=this.length);let n=Ns(this),s=[],i=[];for(let o=e;o<t;o++)s.push(this[o]),i.push(n[o]);return new r(Wc,s,i)}filter(e,t){let n=Ns(this),s=[],i=[];for(let o=0;o<this.length;o++){let a=this[o];a instanceof Error&&na(`index ${o}`,a),e.call(t,a,o,this)&&(s.push(a),i.push(n[o]))}return new r(Wc,s,i)}map(e,t){let n=[];for(let s=0;s<this.length;s++){let i=this[s];i instanceof Error&&na(`index ${s}`,i),n.push(e.call(t,i,s,this))}return n}getValue(e){let t=Ns(this).indexOf(e);if(t===-1)return;let n=this[t];return n instanceof Error&&na(`property ${JSON.stringify(e)}`,n.error),n}static fromItems(e,t){return new r(Wc,e,t)}};Ye.Result=sa;function gE(r){let e=[],t=function(n,s){if(Array.isArray(s))for(let i in s){let o=n.slice();o.push(i);try{t(o,s[i])}catch(a){e.push({path:o,error:a})}}};return t([],r),e}Ye.checkResultErrors=gE;function Ay(r){let e=(0,ut.toBeArray)(r);return(0,ut.assert)(e.length<=Ye.WordSize,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:Ye.WordSize,offset:e.length}),e.length!==Ye.WordSize&&(e=(0,ut.getBytesCopy)((0,ut.concat)([ed.slice(e.length%Ye.WordSize),e]))),e}var rd=class{name;type;localName;dynamic;constructor(e,t,n,s){(0,ut.defineProperties)(this,{name:e,type:t,localName:n,dynamic:s},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,t){(0,ut.assertArgument)(!1,e,this.localName,t)}};Ye.Coder=rd;var nd=class{#e;#t;constructor(){this.#e=[],this.#t=0}get data(){return(0,ut.concat)(this.#e)}get length(){return this.#t}#r(e){return this.#e.push(e),this.#t+=e.length,e.length}appendWriter(e){return this.#r((0,ut.getBytesCopy)(e.data))}writeBytes(e){let t=(0,ut.getBytesCopy)(e),n=t.length%Ye.WordSize;return n&&(t=(0,ut.getBytesCopy)((0,ut.concat)([t,ed.slice(n)]))),this.#r(t)}writeValue(e){return this.#r(Ay(e))}writeUpdatableValue(){let e=this.#e.length;return this.#e.push(ed),this.#t+=Ye.WordSize,t=>{this.#e[e]=Ay(t)}}};Ye.Writer=nd;var sd=class r{allowLoose;#e;#t;#r;#n;#s;constructor(e,t,n){(0,ut.defineProperties)(this,{allowLoose:!!t}),this.#e=(0,ut.getBytesCopy)(e),this.#r=0,this.#n=null,this.#s=n??1024,this.#t=0}get data(){return(0,ut.hexlify)(this.#e)}get dataLength(){return this.#e.length}get consumed(){return this.#t}get bytes(){return new Uint8Array(this.#e)}#o(e){if(this.#n)return this.#n.#o(e);this.#r+=e,(0,ut.assert)(this.#s<1||this.#r<=this.#s*this.dataLength,`compressed ABI data exceeds inflation ratio of ${this.#s} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:(0,ut.getBytesCopy)(this.#e),offset:this.#t,length:e,info:{bytesRead:this.#r,dataLength:this.dataLength}})}#i(e,t,n){let s=Math.ceil(t/Ye.WordSize)*Ye.WordSize;return this.#t+s>this.#e.length&&(this.allowLoose&&n&&this.#t+t<=this.#e.length?s=t:(0,ut.assert)(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:(0,ut.getBytesCopy)(this.#e),length:this.#e.length,offset:this.#t+s})),this.#e.slice(this.#t,this.#t+s)}subReader(e){let t=new r(this.#e.slice(this.#t+e),this.allowLoose,this.#s);return t.#n=this,t}readBytes(e,t){let n=this.#i(0,e,!!t);return this.#o(e),this.#t+=n.length,n.slice(0,e)}readValue(){return(0,ut.toBigInt)(this.readBytes(Ye.WordSize))}readIndex(){return(0,ut.toNumber)(this.readBytes(Ye.WordSize))}};Ye.Reader=sd});var Bi=P(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.output=qt.exists=qt.hash=qt.bytes=qt.bool=qt.number=void 0;function Yc(r){if(!Number.isSafeInteger(r)||r<0)throw new Error(`Wrong positive integer: ${r}`)}qt.number=Yc;function Py(r){if(typeof r!="boolean")throw new Error(`Expected boolean, not ${r}`)}qt.bool=Py;function id(r,...e){if(!(r instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(r.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${r.length}`)}qt.bytes=id;function vy(r){if(typeof r!="function"||typeof r.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Yc(r.outputLen),Yc(r.blockLen)}qt.hash=vy;function _y(r,e=!0){if(r.destroyed)throw new Error("Hash instance has been destroyed");if(e&&r.finished)throw new Error("Hash#digest() has already been called")}qt.exists=_y;function ky(r,e){id(r);let t=e.outputLen;if(r.length<t)throw new Error(`digestInto() expects output buffer of length at least ${t}`)}qt.output=ky;var bE={number:Yc,bool:Py,bytes:id,hash:vy,exists:_y,output:ky};qt.default=bE});var Ty=P(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.crypto=void 0;Zc.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});var Jr=P(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.randomBytes=me.wrapXOFConstructorWithOpts=me.wrapConstructorWithOpts=me.wrapConstructor=me.checkOpts=me.Hash=me.concatBytes=me.toBytes=me.utf8ToBytes=me.asyncLoop=me.nextTick=me.hexToBytes=me.bytesToHex=me.isLE=me.rotr=me.createView=me.u32=me.u8=void 0;var od=Ty(),cd=r=>r instanceof Uint8Array,xE=r=>new Uint8Array(r.buffer,r.byteOffset,r.byteLength);me.u8=xE;var mE=r=>new Uint32Array(r.buffer,r.byteOffset,Math.floor(r.byteLength/4));me.u32=mE;var yE=r=>new DataView(r.buffer,r.byteOffset,r.byteLength);me.createView=yE;var wE=(r,e)=>r<<32-e|r>>>e;me.rotr=wE;me.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!me.isLE)throw new Error("Non little-endian hardware is not supported");var AE=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function EE(r){if(!cd(r))throw new Error("Uint8Array expected");let e="";for(let t=0;t<r.length;t++)e+=AE[r[t]];return e}me.bytesToHex=EE;function PE(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let e=r.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let t=new Uint8Array(e/2);for(let n=0;n<t.length;n++){let s=n*2,i=r.slice(s,s+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[n]=o}return t}me.hexToBytes=PE;var vE=async()=>{};me.nextTick=vE;async function _E(r,e,t){let n=Date.now();for(let s=0;s<r;s++){t(s);let i=Date.now()-n;i>=0&&i<e||(await(0,me.nextTick)(),n+=i)}}me.asyncLoop=_E;function By(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}me.utf8ToBytes=By;function Xc(r){if(typeof r=="string"&&(r=By(r)),!cd(r))throw new Error(`expected Uint8Array, got ${typeof r}`);return r}me.toBytes=Xc;function kE(...r){let e=new Uint8Array(r.reduce((n,s)=>n+s.length,0)),t=0;return r.forEach(n=>{if(!cd(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}me.concatBytes=kE;var ad=class{clone(){return this._cloneInto()}};me.Hash=ad;var TE={}.toString;function BE(r,e){if(e!==void 0&&TE.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(r,e)}me.checkOpts=BE;function OE(r){let e=n=>r().update(Xc(n)).digest(),t=r();return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=()=>r(),e}me.wrapConstructor=OE;function SE(r){let e=(n,s)=>r(s).update(Xc(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}me.wrapConstructorWithOpts=SE;function CE(r){let e=(n,s)=>r(s).update(Xc(n)).digest(),t=r({});return e.outputLen=t.outputLen,e.blockLen=t.blockLen,e.create=n=>r(n),e}me.wrapXOFConstructorWithOpts=CE;function NE(r=32){if(od.crypto&&typeof od.crypto.getRandomValues=="function")return od.crypto.getRandomValues(new Uint8Array(r));throw new Error("crypto.getRandomValues must be defined")}me.randomBytes=NE});var tu=P(Is=>{"use strict";Object.defineProperty(Is,"__esModule",{value:!0});Is.hmac=Is.HMAC=void 0;var eu=Bi(),Oy=Jr(),ia=class extends Oy.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,eu.hash)(e);let n=(0,Oy.toBytes)(t);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let s=this.blockLen,i=new Uint8Array(s);i.set(n.length>s?e.create().update(n).digest():n);for(let o=0;o<i.length;o++)i[o]^=54;this.iHash.update(i),this.oHash=e.create();for(let o=0;o<i.length;o++)i[o]^=106;this.oHash.update(i),i.fill(0)}update(e){return(0,eu.exists)(this),this.iHash.update(e),this}digestInto(e){(0,eu.exists)(this),(0,eu.bytes)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{oHash:t,iHash:n,finished:s,destroyed:i,blockLen:o,outputLen:a}=this;return e=e,e.finished=s,e.destroyed=i,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=n._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};Is.HMAC=ia;var IE=(r,e,t)=>new ia(r,e).update(t).digest();Is.hmac=IE;Is.hmac.create=(r,e)=>new ia(r,e)});var ud=P(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.pbkdf2Async=Si.pbkdf2=void 0;var ru=Bi(),RE=tu(),Oi=Jr();function Sy(r,e,t,n){(0,ru.hash)(r);let s=(0,Oi.checkOpts)({dkLen:32,asyncTick:10},n),{c:i,dkLen:o,asyncTick:a}=s;if((0,ru.number)(i),(0,ru.number)(o),(0,ru.number)(a),i<1)throw new Error("PBKDF2: iterations (c) should be >= 1");let c=(0,Oi.toBytes)(e),u=(0,Oi.toBytes)(t),l=new Uint8Array(o),f=RE.hmac.create(r,c),h=f._cloneInto().update(u);return{c:i,dkLen:o,asyncTick:a,DK:l,PRF:f,PRFSalt:h}}function Cy(r,e,t,n,s){return r.destroy(),e.destroy(),n&&n.destroy(),s.fill(0),t}function LE(r,e,t,n){let{c:s,dkLen:i,DK:o,PRF:a,PRFSalt:c}=Sy(r,e,t,n),u,l=new Uint8Array(4),f=(0,Oi.createView)(l),h=new Uint8Array(a.outputLen);for(let g=1,x=0;x<i;g++,x+=a.outputLen){let b=o.subarray(x,x+a.outputLen);f.setInt32(0,g,!1),(u=c._cloneInto(u)).update(l).digestInto(h),b.set(h.subarray(0,b.length));for(let y=1;y<s;y++){a._cloneInto(u).update(h).digestInto(h);for(let m=0;m<b.length;m++)b[m]^=h[m]}}return Cy(a,c,o,u,h)}Si.pbkdf2=LE;async function ME(r,e,t,n){let{c:s,dkLen:i,asyncTick:o,DK:a,PRF:c,PRFSalt:u}=Sy(r,e,t,n),l,f=new Uint8Array(4),h=(0,Oi.createView)(f),g=new Uint8Array(c.outputLen);for(let x=1,b=0;b<i;x++,b+=c.outputLen){let y=a.subarray(b,b+c.outputLen);h.setInt32(0,x,!1),(l=u._cloneInto(l)).update(f).digestInto(g),y.set(g.subarray(0,y.length)),await(0,Oi.asyncLoop)(s-1,o,()=>{c._cloneInto(l).update(g).digestInto(g);for(let m=0;m<y.length;m++)y[m]^=g[m]})}return Cy(c,u,a,l,g)}Si.pbkdf2Async=ME});var su=P(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.SHA2=void 0;var ld=Bi(),oa=Jr();function jE(r,e,t,n){if(typeof r.setBigUint64=="function")return r.setBigUint64(e,t,n);let s=BigInt(32),i=BigInt(4294967295),o=Number(t>>s&i),a=Number(t&i),c=n?4:0,u=n?0:4;r.setUint32(e+c,o,n),r.setUint32(e+u,a,n)}var fd=class extends oa.Hash{constructor(e,t,n,s){super(),this.blockLen=e,this.outputLen=t,this.padOffset=n,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,oa.createView)(this.buffer)}update(e){(0,ld.exists)(this);let{view:t,buffer:n,blockLen:s}=this;e=(0,oa.toBytes)(e);let i=e.length;for(let o=0;o<i;){let a=Math.min(s-this.pos,i-o);if(a===s){let c=(0,oa.createView)(e);for(;s<=i-o;o+=s)this.process(c,o);continue}n.set(e.subarray(o,o+a),this.pos),this.pos+=a,o+=a,this.pos===s&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,ld.exists)(this),(0,ld.output)(e,this),this.finished=!0;let{buffer:t,view:n,blockLen:s,isLE:i}=this,{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>s-o&&(this.process(n,0),o=0);for(let f=o;f<s;f++)t[f]=0;jE(n,s-8,BigInt(this.length*8),i),this.process(n,0);let a=(0,oa.createView)(e),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let u=c/4,l=this.get();if(u>l.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)a.setUint32(4*f,l[f],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let n=e.slice(0,t);return this.destroy(),n}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:n,length:s,finished:i,destroyed:o,pos:a}=this;return e.length=s,e.pos=a,e.finished=i,e.destroyed=o,s%t&&e.buffer.set(n),e}};nu.SHA2=fd});var ou=P(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.sha224=Ci.sha256=void 0;var UE=su(),Er=Jr(),FE=(r,e,t)=>r&e^~r&t,DE=(r,e,t)=>r&e^r&t^e&t,HE=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Zn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Xn=new Uint32Array(64),iu=class extends UE.SHA2{constructor(){super(64,32,8,!1),this.A=Zn[0]|0,this.B=Zn[1]|0,this.C=Zn[2]|0,this.D=Zn[3]|0,this.E=Zn[4]|0,this.F=Zn[5]|0,this.G=Zn[6]|0,this.H=Zn[7]|0}get(){let{A:e,B:t,C:n,D:s,E:i,F:o,G:a,H:c}=this;return[e,t,n,s,i,o,a,c]}set(e,t,n,s,i,o,a,c){this.A=e|0,this.B=t|0,this.C=n|0,this.D=s|0,this.E=i|0,this.F=o|0,this.G=a|0,this.H=c|0}process(e,t){for(let f=0;f<16;f++,t+=4)Xn[f]=e.getUint32(t,!1);for(let f=16;f<64;f++){let h=Xn[f-15],g=Xn[f-2],x=(0,Er.rotr)(h,7)^(0,Er.rotr)(h,18)^h>>>3,b=(0,Er.rotr)(g,17)^(0,Er.rotr)(g,19)^g>>>10;Xn[f]=b+Xn[f-7]+x+Xn[f-16]|0}let{A:n,B:s,C:i,D:o,E:a,F:c,G:u,H:l}=this;for(let f=0;f<64;f++){let h=(0,Er.rotr)(a,6)^(0,Er.rotr)(a,11)^(0,Er.rotr)(a,25),g=l+h+FE(a,c,u)+HE[f]+Xn[f]|0,b=((0,Er.rotr)(n,2)^(0,Er.rotr)(n,13)^(0,Er.rotr)(n,22))+DE(n,s,i)|0;l=u,u=c,c=a,a=o+g|0,o=i,i=s,s=n,n=g+b|0}n=n+this.A|0,s=s+this.B|0,i=i+this.C|0,o=o+this.D|0,a=a+this.E|0,c=c+this.F|0,u=u+this.G|0,l=l+this.H|0,this.set(n,s,i,o,a,c,u,l)}roundClean(){Xn.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}},dd=class extends iu{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}};Ci.sha256=(0,Er.wrapConstructor)(()=>new iu);Ci.sha224=(0,Er.wrapConstructor)(()=>new dd)});var gd=P(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.add5L=ue.add5H=ue.add4H=ue.add4L=ue.add3H=ue.add3L=ue.add=ue.rotlBL=ue.rotlBH=ue.rotlSL=ue.rotlSH=ue.rotr32L=ue.rotr32H=ue.rotrBL=ue.rotrBH=ue.rotrSL=ue.rotrSH=ue.shrSL=ue.shrSH=ue.toBig=ue.split=ue.fromBig=void 0;var au=BigInt(2**32-1),hd=BigInt(32);function pd(r,e=!1){return e?{h:Number(r&au),l:Number(r>>hd&au)}:{h:Number(r>>hd&au)|0,l:Number(r&au)|0}}ue.fromBig=pd;function Ny(r,e=!1){let t=new Uint32Array(r.length),n=new Uint32Array(r.length);for(let s=0;s<r.length;s++){let{h:i,l:o}=pd(r[s],e);[t[s],n[s]]=[i,o]}return[t,n]}ue.split=Ny;var Iy=(r,e)=>BigInt(r>>>0)<<hd|BigInt(e>>>0);ue.toBig=Iy;var Ry=(r,e,t)=>r>>>t;ue.shrSH=Ry;var Ly=(r,e,t)=>r<<32-t|e>>>t;ue.shrSL=Ly;var My=(r,e,t)=>r>>>t|e<<32-t;ue.rotrSH=My;var jy=(r,e,t)=>r<<32-t|e>>>t;ue.rotrSL=jy;var Uy=(r,e,t)=>r<<64-t|e>>>t-32;ue.rotrBH=Uy;var Fy=(r,e,t)=>r>>>t-32|e<<64-t;ue.rotrBL=Fy;var Dy=(r,e)=>e;ue.rotr32H=Dy;var Hy=(r,e)=>r;ue.rotr32L=Hy;var qy=(r,e,t)=>r<<t|e>>>32-t;ue.rotlSH=qy;var Gy=(r,e,t)=>e<<t|r>>>32-t;ue.rotlSL=Gy;var zy=(r,e,t)=>e<<t-32|r>>>64-t;ue.rotlBH=zy;var Ky=(r,e,t)=>r<<t-32|e>>>64-t;ue.rotlBL=Ky;function Vy(r,e,t,n){let s=(e>>>0)+(n>>>0);return{h:r+t+(s/2**32|0)|0,l:s|0}}ue.add=Vy;var $y=(r,e,t)=>(r>>>0)+(e>>>0)+(t>>>0);ue.add3L=$y;var Jy=(r,e,t,n)=>e+t+n+(r/2**32|0)|0;ue.add3H=Jy;var Qy=(r,e,t,n)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0);ue.add4L=Qy;var Wy=(r,e,t,n,s)=>e+t+n+s+(r/2**32|0)|0;ue.add4H=Wy;var Yy=(r,e,t,n,s)=>(r>>>0)+(e>>>0)+(t>>>0)+(n>>>0)+(s>>>0);ue.add5L=Yy;var Zy=(r,e,t,n,s,i)=>e+t+n+s+i+(r/2**32|0)|0;ue.add5H=Zy;var qE={fromBig:pd,split:Ny,toBig:Iy,shrSH:Ry,shrSL:Ly,rotrSH:My,rotrSL:jy,rotrBH:Uy,rotrBL:Fy,rotr32H:Dy,rotr32L:Hy,rotlSH:qy,rotlSL:Gy,rotlBH:zy,rotlBL:Ky,add:Vy,add3L:$y,add3H:Jy,add4L:Qy,add4H:Wy,add5H:Zy,add5L:Yy};ue.default=qE});var Xy=P(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.sha384=Pr.sha512_256=Pr.sha512_224=Pr.sha512=Pr.SHA512=void 0;var GE=su(),ye=gd(),cu=Jr(),[zE,KE]=ye.default.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(r=>BigInt(r))),es=new Uint32Array(80),ts=new Uint32Array(80),Rs=class extends GE.SHA2{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){let{Ah:e,Al:t,Bh:n,Bl:s,Ch:i,Cl:o,Dh:a,Dl:c,Eh:u,El:l,Fh:f,Fl:h,Gh:g,Gl:x,Hh:b,Hl:y}=this;return[e,t,n,s,i,o,a,c,u,l,f,h,g,x,b,y]}set(e,t,n,s,i,o,a,c,u,l,f,h,g,x,b,y){this.Ah=e|0,this.Al=t|0,this.Bh=n|0,this.Bl=s|0,this.Ch=i|0,this.Cl=o|0,this.Dh=a|0,this.Dl=c|0,this.Eh=u|0,this.El=l|0,this.Fh=f|0,this.Fl=h|0,this.Gh=g|0,this.Gl=x|0,this.Hh=b|0,this.Hl=y|0}process(e,t){for(let _=0;_<16;_++,t+=4)es[_]=e.getUint32(t),ts[_]=e.getUint32(t+=4);for(let _=16;_<80;_++){let C=es[_-15]|0,L=ts[_-15]|0,A=ye.default.rotrSH(C,L,1)^ye.default.rotrSH(C,L,8)^ye.default.shrSH(C,L,7),O=ye.default.rotrSL(C,L,1)^ye.default.rotrSL(C,L,8)^ye.default.shrSL(C,L,7),j=es[_-2]|0,X=ts[_-2]|0,oe=ye.default.rotrSH(j,X,19)^ye.default.rotrBH(j,X,61)^ye.default.shrSH(j,X,6),de=ye.default.rotrSL(j,X,19)^ye.default.rotrBL(j,X,61)^ye.default.shrSL(j,X,6),Le=ye.default.add4L(O,de,ts[_-7],ts[_-16]),Se=ye.default.add4H(Le,A,oe,es[_-7],es[_-16]);es[_]=Se|0,ts[_]=Le|0}let{Ah:n,Al:s,Bh:i,Bl:o,Ch:a,Cl:c,Dh:u,Dl:l,Eh:f,El:h,Fh:g,Fl:x,Gh:b,Gl:y,Hh:m,Hl:E}=this;for(let _=0;_<80;_++){let C=ye.default.rotrSH(f,h,14)^ye.default.rotrSH(f,h,18)^ye.default.rotrBH(f,h,41),L=ye.default.rotrSL(f,h,14)^ye.default.rotrSL(f,h,18)^ye.default.rotrBL(f,h,41),A=f&g^~f&b,O=h&x^~h&y,j=ye.default.add5L(E,L,O,KE[_],ts[_]),X=ye.default.add5H(j,m,C,A,zE[_],es[_]),oe=j|0,de=ye.default.rotrSH(n,s,28)^ye.default.rotrBH(n,s,34)^ye.default.rotrBH(n,s,39),Le=ye.default.rotrSL(n,s,28)^ye.default.rotrBL(n,s,34)^ye.default.rotrBL(n,s,39),Se=n&i^n&a^i&a,nt=s&o^s&c^o&c;m=b|0,E=y|0,b=g|0,y=x|0,g=f|0,x=h|0,{h:f,l:h}=ye.default.add(u|0,l|0,X|0,oe|0),u=a|0,l=c|0,a=i|0,c=o|0,i=n|0,o=s|0;let H=ye.default.add3L(oe,Le,nt);n=ye.default.add3H(H,X,de,Se),s=H|0}({h:n,l:s}=ye.default.add(this.Ah|0,this.Al|0,n|0,s|0)),{h:i,l:o}=ye.default.add(this.Bh|0,this.Bl|0,i|0,o|0),{h:a,l:c}=ye.default.add(this.Ch|0,this.Cl|0,a|0,c|0),{h:u,l}=ye.default.add(this.Dh|0,this.Dl|0,u|0,l|0),{h:f,l:h}=ye.default.add(this.Eh|0,this.El|0,f|0,h|0),{h:g,l:x}=ye.default.add(this.Fh|0,this.Fl|0,g|0,x|0),{h:b,l:y}=ye.default.add(this.Gh|0,this.Gl|0,b|0,y|0),{h:m,l:E}=ye.default.add(this.Hh|0,this.Hl|0,m|0,E|0),this.set(n,s,i,o,a,c,u,l,f,h,g,x,b,y,m,E)}roundClean(){es.fill(0),ts.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};Pr.SHA512=Rs;var bd=class extends Rs{constructor(){super(),this.Ah=-1942145080,this.Al=424955298,this.Bh=1944164710,this.Bl=-1982016298,this.Ch=502970286,this.Cl=855612546,this.Dh=1738396948,this.Dl=1479516111,this.Eh=258812777,this.El=2077511080,this.Fh=2011393907,this.Fl=79989058,this.Gh=1067287976,this.Gl=1780299464,this.Hh=286451373,this.Hl=-1848208735,this.outputLen=28}},xd=class extends Rs{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}},md=class extends Rs{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}};Pr.sha512=(0,cu.wrapConstructor)(()=>new Rs);Pr.sha512_224=(0,cu.wrapConstructor)(()=>new bd);Pr.sha512_256=(0,cu.wrapConstructor)(()=>new xd);Pr.sha384=(0,cu.wrapConstructor)(()=>new md)});var ca=P(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.randomBytes=fn.pbkdf2Sync=fn.createHmac=fn.createHash=void 0;var VE=tu(),$E=ud(),yd=ou(),wd=Xy(),aa=$();function JE(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}var e1=JE(),t1=e1.crypto||e1.msCrypto;function QE(r){switch(r){case"sha256":return yd.sha256.create();case"sha512":return wd.sha512.create()}(0,aa.assertArgument)(!1,"invalid hashing algorithm name","algorithm",r)}fn.createHash=QE;function WE(r,e){let t={sha256:yd.sha256,sha512:wd.sha512}[r];return(0,aa.assertArgument)(t!=null,"invalid hmac algorithm","algorithm",r),VE.hmac.create(t,e)}fn.createHmac=WE;function YE(r,e,t,n,s){let i={sha256:yd.sha256,sha512:wd.sha512}[s];return(0,aa.assertArgument)(i!=null,"invalid pbkdf2 algorithm","algorithm",s),(0,$E.pbkdf2)(i,r,e,{c:t,dkLen:n})}fn.pbkdf2Sync=YE;function ZE(r){(0,aa.assert)(t1!=null,"platform does not support secure random numbers","UNSUPPORTED_OPERATION",{operation:"randomBytes"}),(0,aa.assertArgument)(Number.isInteger(r)&&r>0&&r<=1024,"invalid length","length",r);let e=new Uint8Array(r);return t1.getRandomValues(e),e}fn.randomBytes=ZE});var i1=P(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.computeHmac=void 0;var XE=ca(),Ad=$(),r1=!1,n1=function(r,e,t){return(0,XE.createHmac)(r,e).update(t).digest()},s1=n1;function ua(r,e,t){let n=(0,Ad.getBytes)(e,"key"),s=(0,Ad.getBytes)(t,"data");return(0,Ad.hexlify)(s1(r,n,s))}uu.computeHmac=ua;ua._=n1;ua.lock=function(){r1=!0};ua.register=function(r){if(r1)throw new Error("computeHmac is locked");s1=r};Object.freeze(ua)});var h1=P(Ve=>{"use strict";Object.defineProperty(Ve,"__esModule",{value:!0});Ve.shake256=Ve.shake128=Ve.keccak_512=Ve.keccak_384=Ve.keccak_256=Ve.keccak_224=Ve.sha3_512=Ve.sha3_384=Ve.sha3_256=Ve.sha3_224=Ve.Keccak=Ve.keccakP=void 0;var Ni=Bi(),da=gd(),fa=Jr(),[c1,u1,l1]=[[],[],[]],eP=BigInt(0),la=BigInt(1),tP=BigInt(2),rP=BigInt(7),nP=BigInt(256),sP=BigInt(113);for(let r=0,e=la,t=1,n=0;r<24;r++){[t,n]=[n,(2*t+3*n)%5],c1.push(2*(5*n+t)),u1.push((r+1)*(r+2)/2%64);let s=eP;for(let i=0;i<7;i++)e=(e<<la^(e>>rP)*sP)%nP,e&tP&&(s^=la<<(la<<BigInt(i))-la);l1.push(s)}var[iP,oP]=(0,da.split)(l1,!0),o1=(r,e,t)=>t>32?(0,da.rotlBH)(r,e,t):(0,da.rotlSH)(r,e,t),a1=(r,e,t)=>t>32?(0,da.rotlBL)(r,e,t):(0,da.rotlSL)(r,e,t);function f1(r,e=24){let t=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let o=0;o<10;o++)t[o]=r[o]^r[o+10]^r[o+20]^r[o+30]^r[o+40];for(let o=0;o<10;o+=2){let a=(o+8)%10,c=(o+2)%10,u=t[c],l=t[c+1],f=o1(u,l,1)^t[a],h=a1(u,l,1)^t[a+1];for(let g=0;g<50;g+=10)r[o+g]^=f,r[o+g+1]^=h}let s=r[2],i=r[3];for(let o=0;o<24;o++){let a=u1[o],c=o1(s,i,a),u=a1(s,i,a),l=c1[o];s=r[l],i=r[l+1],r[l]=c,r[l+1]=u}for(let o=0;o<50;o+=10){for(let a=0;a<10;a++)t[a]=r[o+a];for(let a=0;a<10;a++)r[o+a]^=~t[(a+2)%10]&t[(a+4)%10]}r[0]^=iP[n],r[1]^=oP[n]}t.fill(0)}Ve.keccakP=f1;var ha=class r extends fa.Hash{constructor(e,t,n,s=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=n,this.enableXOF=s,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,Ni.number)(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,fa.u32)(this.state)}keccak(){f1(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){(0,Ni.exists)(this);let{blockLen:t,state:n}=this;e=(0,fa.toBytes)(e);let s=e.length;for(let i=0;i<s;){let o=Math.min(t-this.pos,s-i);for(let a=0;a<o;a++)n[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:s}=this;e[n]^=t,(t&128)!==0&&n===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){(0,Ni.exists)(this,!1),(0,Ni.bytes)(e),this.finish();let t=this.state,{blockLen:n}=this;for(let s=0,i=e.length;s<i;){this.posOut>=n&&this.keccak();let o=Math.min(n-this.posOut,i-s);e.set(t.subarray(this.posOut,this.posOut+o),s),this.posOut+=o,s+=o}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,Ni.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,Ni.output)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:n,outputLen:s,rounds:i,enableXOF:o}=this;return e||(e=new r(t,n,s,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=n,e.outputLen=s,e.enableXOF=o,e.destroyed=this.destroyed,e}};Ve.Keccak=ha;var rs=(r,e,t)=>(0,fa.wrapConstructor)(()=>new ha(e,r,t));Ve.sha3_224=rs(6,144,224/8);Ve.sha3_256=rs(6,136,256/8);Ve.sha3_384=rs(6,104,384/8);Ve.sha3_512=rs(6,72,512/8);Ve.keccak_224=rs(1,144,224/8);Ve.keccak_256=rs(1,136,256/8);Ve.keccak_384=rs(1,104,384/8);Ve.keccak_512=rs(1,72,512/8);var d1=(r,e,t)=>(0,fa.wrapXOFConstructorWithOpts)((n={})=>new ha(e,r,n.dkLen===void 0?t:n.dkLen,!0));Ve.shake128=d1(31,168,128/8);Ve.shake256=d1(31,136,256/8)});var m1=P(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.keccak256=void 0;var aP=h1(),p1=$(),g1=!1,b1=function(r){return(0,aP.keccak_256)(r)},x1=b1;function pa(r){let e=(0,p1.getBytes)(r,"data");return(0,p1.hexlify)(x1(e))}lu.keccak256=pa;pa._=b1;pa.lock=function(){g1=!0};pa.register=function(r){if(g1)throw new TypeError("keccak256 is locked");x1=r};Object.freeze(pa)});var E1=P(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.ripemd160=Ii.RIPEMD160=void 0;var cP=su(),uP=Jr(),lP=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),w1=Uint8Array.from({length:16},(r,e)=>e),fP=w1.map(r=>(9*r+5)%16),Ed=[w1],Pd=[fP];for(let r=0;r<4;r++)for(let e of[Ed,Pd])e.push(e[r].map(t=>lP[t]));var A1=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(r=>new Uint8Array(r)),dP=Ed.map((r,e)=>r.map(t=>A1[e][t])),hP=Pd.map((r,e)=>r.map(t=>A1[e][t])),pP=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),gP=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),fu=(r,e)=>r<<e|r>>>32-e;function y1(r,e,t,n){return r===0?e^t^n:r===1?e&t|~e&n:r===2?(e|~t)^n:r===3?e&n|t&~n:e^(t|~n)}var du=new Uint32Array(16),hu=class extends cP.SHA2{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){let{h0:e,h1:t,h2:n,h3:s,h4:i}=this;return[e,t,n,s,i]}set(e,t,n,s,i){this.h0=e|0,this.h1=t|0,this.h2=n|0,this.h3=s|0,this.h4=i|0}process(e,t){for(let g=0;g<16;g++,t+=4)du[g]=e.getUint32(t,!0);let n=this.h0|0,s=n,i=this.h1|0,o=i,a=this.h2|0,c=a,u=this.h3|0,l=u,f=this.h4|0,h=f;for(let g=0;g<5;g++){let x=4-g,b=pP[g],y=gP[g],m=Ed[g],E=Pd[g],_=dP[g],C=hP[g];for(let L=0;L<16;L++){let A=fu(n+y1(g,i,a,u)+du[m[L]]+b,_[L])+f|0;n=f,f=u,u=fu(a,10)|0,a=i,i=A}for(let L=0;L<16;L++){let A=fu(s+y1(x,o,c,l)+du[E[L]]+y,C[L])+h|0;s=h,h=l,l=fu(c,10)|0,c=o,o=A}}this.set(this.h1+a+l|0,this.h2+u+h|0,this.h3+f+s|0,this.h4+n+o|0,this.h0+i+c|0)}roundClean(){du.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}};Ii.RIPEMD160=hu;Ii.ripemd160=(0,uP.wrapConstructor)(()=>new hu)});var T1=P(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.ripemd160=void 0;var bP=E1(),P1=$(),v1=!1,_1=function(r){return(0,bP.ripemd160)(r)},k1=_1;function ga(r){let e=(0,P1.getBytes)(r,"data");return(0,P1.hexlify)(k1(e))}pu.ripemd160=ga;ga._=_1;ga.lock=function(){v1=!0};ga.register=function(r){if(v1)throw new TypeError("ripemd160 is locked");k1=r};Object.freeze(ga)});var C1=P(gu=>{"use strict";Object.defineProperty(gu,"__esModule",{value:!0});gu.pbkdf2=void 0;var xP=ca(),vd=$(),B1=!1,O1=function(r,e,t,n,s){return(0,xP.pbkdf2Sync)(r,e,t,n,s)},S1=O1;function ba(r,e,t,n,s){let i=(0,vd.getBytes)(r,"password"),o=(0,vd.getBytes)(e,"salt");return(0,vd.hexlify)(S1(i,o,t,n,s))}gu.pbkdf2=ba;ba._=O1;ba.lock=function(){B1=!0};ba.register=function(r){if(B1)throw new Error("pbkdf2 is locked");S1=r};Object.freeze(ba)});var L1=P(bu=>{"use strict";Object.defineProperty(bu,"__esModule",{value:!0});bu.randomBytes=void 0;var mP=ca(),N1=!1,I1=function(r){return new Uint8Array((0,mP.randomBytes)(r))},R1=I1;function xa(r){return R1(r)}bu.randomBytes=xa;xa._=I1;xa.lock=function(){N1=!0};xa.register=function(r){if(N1)throw new Error("randomBytes is locked");R1=r};Object.freeze(xa)});var H1=P(ji=>{"use strict";Object.defineProperty(ji,"__esModule",{value:!0});ji.scryptAsync=ji.scrypt=void 0;var Ri=Bi(),j1=ou(),U1=ud(),Li=Jr(),Ce=(r,e)=>r<<e|r>>>32-e;function M1(r,e,t,n,s,i){let o=r[e++]^t[n++],a=r[e++]^t[n++],c=r[e++]^t[n++],u=r[e++]^t[n++],l=r[e++]^t[n++],f=r[e++]^t[n++],h=r[e++]^t[n++],g=r[e++]^t[n++],x=r[e++]^t[n++],b=r[e++]^t[n++],y=r[e++]^t[n++],m=r[e++]^t[n++],E=r[e++]^t[n++],_=r[e++]^t[n++],C=r[e++]^t[n++],L=r[e++]^t[n++],A=o,O=a,j=c,X=u,oe=l,de=f,Le=h,Se=g,nt=x,H=b,V=y,ae=m,ve=E,Ae=_,Me=C,Qe=L;for(let et=0;et<8;et+=2)oe^=Ce(A+ve|0,7),nt^=Ce(oe+A|0,9),ve^=Ce(nt+oe|0,13),A^=Ce(ve+nt|0,18),H^=Ce(de+O|0,7),Ae^=Ce(H+de|0,9),O^=Ce(Ae+H|0,13),de^=Ce(O+Ae|0,18),Me^=Ce(V+Le|0,7),j^=Ce(Me+V|0,9),Le^=Ce(j+Me|0,13),V^=Ce(Le+j|0,18),X^=Ce(Qe+ae|0,7),Se^=Ce(X+Qe|0,9),ae^=Ce(Se+X|0,13),Qe^=Ce(ae+Se|0,18),O^=Ce(A+X|0,7),j^=Ce(O+A|0,9),X^=Ce(j+O|0,13),A^=Ce(X+j|0,18),Le^=Ce(de+oe|0,7),Se^=Ce(Le+de|0,9),oe^=Ce(Se+Le|0,13),de^=Ce(oe+Se|0,18),ae^=Ce(V+H|0,7),nt^=Ce(ae+V|0,9),H^=Ce(nt+ae|0,13),V^=Ce(H+nt|0,18),ve^=Ce(Qe+Me|0,7),Ae^=Ce(ve+Qe|0,9),Me^=Ce(Ae+ve|0,13),Qe^=Ce(Me+Ae|0,18);s[i++]=o+A|0,s[i++]=a+O|0,s[i++]=c+j|0,s[i++]=u+X|0,s[i++]=l+oe|0,s[i++]=f+de|0,s[i++]=h+Le|0,s[i++]=g+Se|0,s[i++]=x+nt|0,s[i++]=b+H|0,s[i++]=y+V|0,s[i++]=m+ae|0,s[i++]=E+ve|0,s[i++]=_+Ae|0,s[i++]=C+Me|0,s[i++]=L+Qe|0}function Mi(r,e,t,n,s){let i=n+0,o=n+16*s;for(let a=0;a<16;a++)t[o+a]=r[e+(2*s-1)*16+a];for(let a=0;a<s;a++,i+=16,e+=16)M1(t,o,r,e,t,i),a>0&&(o+=16),M1(t,i,r,e+=16,t,o)}function F1(r,e,t){let n=(0,Li.checkOpts)({dkLen:32,asyncTick:10,maxmem:1073742848},t),{N:s,r:i,p:o,dkLen:a,asyncTick:c,maxmem:u,onProgress:l}=n;if((0,Ri.number)(s),(0,Ri.number)(i),(0,Ri.number)(o),(0,Ri.number)(a),(0,Ri.number)(c),(0,Ri.number)(u),l!==void 0&&typeof l!="function")throw new Error("progressCb should be function");let f=128*i,h=f/4;if(s<=1||(s&s-1)!==0||s>=2**(f/8)||s>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(o<0||o>(2**32-1)*32/f)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(a<0||a>(2**32-1)*32)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");let g=f*(s+o);if(g>u)throw new Error(`Scrypt: parameters too large, ${g} (128 * r * (N + p)) > ${u} (maxmem)`);let x=(0,U1.pbkdf2)(j1.sha256,r,e,{c:1,dkLen:f*o}),b=(0,Li.u32)(x),y=(0,Li.u32)(new Uint8Array(f*s)),m=(0,Li.u32)(new Uint8Array(f)),E=()=>{};if(l){let _=2*s*o,C=Math.max(Math.floor(_/1e4),1),L=0;E=()=>{L++,l&&(!(L%C)||L===_)&&l(L/_)}}return{N:s,r:i,p:o,dkLen:a,blockSize32:h,V:y,B32:b,B:x,tmp:m,blockMixCb:E,asyncTick:c}}function D1(r,e,t,n,s){let i=(0,U1.pbkdf2)(j1.sha256,r,t,{c:1,dkLen:e});return t.fill(0),n.fill(0),s.fill(0),i}function yP(r,e,t){let{N:n,r:s,p:i,dkLen:o,blockSize32:a,V:c,B32:u,B:l,tmp:f,blockMixCb:h}=F1(r,e,t);for(let g=0;g<i;g++){let x=a*g;for(let b=0;b<a;b++)c[b]=u[x+b];for(let b=0,y=0;b<n-1;b++)Mi(c,y,c,y+=a,s),h();Mi(c,(n-1)*a,u,x,s),h();for(let b=0;b<n;b++){let y=u[x+a-16]%n;for(let m=0;m<a;m++)f[m]=u[x+m]^c[y*a+m];Mi(f,0,u,x,s),h()}}return D1(r,o,l,c,f)}ji.scrypt=yP;async function wP(r,e,t){let{N:n,r:s,p:i,dkLen:o,blockSize32:a,V:c,B32:u,B:l,tmp:f,blockMixCb:h,asyncTick:g}=F1(r,e,t);for(let x=0;x<i;x++){let b=a*x;for(let m=0;m<a;m++)c[m]=u[b+m];let y=0;await(0,Li.asyncLoop)(n-1,g,()=>{Mi(c,y,c,y+=a,s),h()}),Mi(c,(n-1)*a,u,b,s),h(),await(0,Li.asyncLoop)(n,g,()=>{let m=u[b+a-16]%n;for(let E=0;E<a;E++)f[E]=u[b+E]^c[m*a+E];Mi(f,0,u,b,s),h()})}return D1(r,o,l,c,f)}ji.scryptAsync=wP});var Q1=P(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.scryptSync=Fi.scrypt=void 0;var q1=H1(),Ui=$(),G1=!1,z1=!1,K1=async function(r,e,t,n,s,i,o){return await(0,q1.scryptAsync)(r,e,{N:t,r:n,p:s,dkLen:i,onProgress:o})},V1=function(r,e,t,n,s,i){return(0,q1.scrypt)(r,e,{N:t,r:n,p:s,dkLen:i})},$1=K1,J1=V1;async function ma(r,e,t,n,s,i,o){let a=(0,Ui.getBytes)(r,"passwd"),c=(0,Ui.getBytes)(e,"salt");return(0,Ui.hexlify)(await $1(a,c,t,n,s,i,o))}Fi.scrypt=ma;ma._=K1;ma.lock=function(){z1=!0};ma.register=function(r){if(z1)throw new Error("scrypt is locked");$1=r};Object.freeze(ma);function ya(r,e,t,n,s,i){let o=(0,Ui.getBytes)(r,"passwd"),a=(0,Ui.getBytes)(e,"salt");return(0,Ui.hexlify)(J1(o,a,t,n,s,i))}Fi.scryptSync=ya;ya._=V1;ya.lock=function(){G1=!0};ya.register=function(r){if(G1)throw new Error("scryptSync is locked");J1=r};Object.freeze(ya)});var n2=P(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.sha512=Di.sha256=void 0;var W1=ca(),xu=$(),Y1=function(r){return(0,W1.createHash)("sha256").update(r).digest()},Z1=function(r){return(0,W1.createHash)("sha512").update(r).digest()},X1=Y1,e2=Z1,t2=!1,r2=!1;function Hi(r){let e=(0,xu.getBytes)(r,"data");return(0,xu.hexlify)(X1(e))}Di.sha256=Hi;Hi._=Y1;Hi.lock=function(){t2=!0};Hi.register=function(r){if(t2)throw new Error("sha256 is locked");X1=r};Object.freeze(Hi);function mu(r){let e=(0,xu.getBytes)(r,"data");return(0,xu.hexlify)(e2(e))}Di.sha512=mu;mu._=Z1;mu.lock=function(){r2=!0};mu.register=function(r){if(r2)throw new Error("sha512 is locked");e2=r};Object.freeze(Hi)});var Ls=P(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.validateObject=we.createHmacDrbg=we.bitMask=we.bitSet=we.bitGet=we.bitLen=we.utf8ToBytes=we.equalBytes=we.concatBytes=we.ensureBytes=we.numberToVarBytesBE=we.numberToBytesLE=we.numberToBytesBE=we.bytesToNumberLE=we.bytesToNumberBE=we.hexToBytes=we.hexToNumber=we.numberToHexUnpadded=we.bytesToHex=void 0;var i2=BigInt(0),yu=BigInt(1),AP=BigInt(2),wu=r=>r instanceof Uint8Array,EP=Array.from({length:256},(r,e)=>e.toString(16).padStart(2,"0"));function kd(r){if(!wu(r))throw new Error("Uint8Array expected");let e="";for(let t=0;t<r.length;t++)e+=EP[r[t]];return e}we.bytesToHex=kd;function o2(r){let e=r.toString(16);return e.length&1?`0${e}`:e}we.numberToHexUnpadded=o2;function Td(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);return BigInt(r===""?"0":`0x${r}`)}we.hexToNumber=Td;function Au(r){if(typeof r!="string")throw new Error("hex string expected, got "+typeof r);let e=r.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);let t=new Uint8Array(e/2);for(let n=0;n<t.length;n++){let s=n*2,i=r.slice(s,s+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[n]=o}return t}we.hexToBytes=Au;function PP(r){return Td(kd(r))}we.bytesToNumberBE=PP;function vP(r){if(!wu(r))throw new Error("Uint8Array expected");return Td(kd(Uint8Array.from(r).reverse()))}we.bytesToNumberLE=vP;function a2(r,e){return Au(r.toString(16).padStart(e*2,"0"))}we.numberToBytesBE=a2;function _P(r,e){return a2(r,e).reverse()}we.numberToBytesLE=_P;function kP(r){return Au(o2(r))}we.numberToVarBytesBE=kP;function TP(r,e,t){let n;if(typeof e=="string")try{n=Au(e)}catch(i){throw new Error(`${r} must be valid hex string, got "${e}". Cause: ${i}`)}else if(wu(e))n=Uint8Array.from(e);else throw new Error(`${r} must be hex string or Uint8Array`);let s=n.length;if(typeof t=="number"&&s!==t)throw new Error(`${r} expected ${t} bytes, got ${s}`);return n}we.ensureBytes=TP;function c2(...r){let e=new Uint8Array(r.reduce((n,s)=>n+s.length,0)),t=0;return r.forEach(n=>{if(!wu(n))throw new Error("Uint8Array expected");e.set(n,t),t+=n.length}),e}we.concatBytes=c2;function BP(r,e){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(r[t]!==e[t])return!1;return!0}we.equalBytes=BP;function OP(r){if(typeof r!="string")throw new Error(`utf8ToBytes expected string, got ${typeof r}`);return new Uint8Array(new TextEncoder().encode(r))}we.utf8ToBytes=OP;function SP(r){let e;for(e=0;r>i2;r>>=yu,e+=1);return e}we.bitLen=SP;function CP(r,e){return r>>BigInt(e)&yu}we.bitGet=CP;var NP=(r,e,t)=>r|(t?yu:i2)<<BigInt(e);we.bitSet=NP;var IP=r=>(AP<<BigInt(r-1))-yu;we.bitMask=IP;var _d=r=>new Uint8Array(r),s2=r=>Uint8Array.from(r);function RP(r,e,t){if(typeof r!="number"||r<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof t!="function")throw new Error("hmacFn must be a function");let n=_d(r),s=_d(r),i=0,o=()=>{n.fill(1),s.fill(0),i=0},a=(...f)=>t(s,n,...f),c=(f=_d())=>{s=a(s2([0]),f),n=a(),f.length!==0&&(s=a(s2([1]),f),n=a())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let f=0,h=[];for(;f<e;){n=a();let g=n.slice();h.push(g),f+=n.length}return c2(...h)};return(f,h)=>{o(),c(f);let g;for(;!(g=h(u()));)c();return o(),g}}we.createHmacDrbg=RP;var LP={bigint:r=>typeof r=="bigint",function:r=>typeof r=="function",boolean:r=>typeof r=="boolean",string:r=>typeof r=="string",stringOrUint8Array:r=>typeof r=="string"||r instanceof Uint8Array,isSafeInteger:r=>Number.isSafeInteger(r),array:r=>Array.isArray(r),field:(r,e)=>e.Fp.isValid(r),hash:r=>typeof r=="function"&&Number.isSafeInteger(r.outputLen)};function MP(r,e,t={}){let n=(s,i,o)=>{let a=LP[i];if(typeof a!="function")throw new Error(`Invalid validator "${i}", expected function`);let c=r[s];if(!(o&&c===void 0)&&!a(c,r))throw new Error(`Invalid param ${String(s)}=${c} (${typeof c}), expected ${i}`)};for(let[s,i]of Object.entries(e))n(s,i,!1);for(let[s,i]of Object.entries(t))n(s,i,!0);return r}we.validateObject=MP});var wa=P(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.mapHashToField=be.getMinHashLength=be.getFieldBytesLength=be.hashToPrivateScalar=be.FpSqrtEven=be.FpSqrtOdd=be.Field=be.nLength=be.FpIsSquare=be.FpDiv=be.FpInvertBatch=be.FpPow=be.validateField=be.isNegativeLE=be.FpSqrt=be.tonelliShanks=be.invert=be.pow2=be.pow=be.mod=void 0;var dr=Ls(),vt=BigInt(0),ze=BigInt(1),ns=BigInt(2),jP=BigInt(3),Bd=BigInt(4),u2=BigInt(5),l2=BigInt(8),UP=BigInt(9),FP=BigInt(16);function fr(r,e){let t=r%e;return t>=vt?t:e+t}be.mod=fr;function f2(r,e,t){if(t<=vt||e<vt)throw new Error("Expected power/modulo > 0");if(t===ze)return vt;let n=ze;for(;e>vt;)e&ze&&(n=n*r%t),r=r*r%t,e>>=ze;return n}be.pow=f2;function DP(r,e,t){let n=r;for(;e-- >vt;)n*=n,n%=t;return n}be.pow2=DP;function Eu(r,e){if(r===vt||e<=vt)throw new Error(`invert: expected positive integers, got n=${r} mod=${e}`);let t=fr(r,e),n=e,s=vt,i=ze,o=ze,a=vt;for(;t!==vt;){let u=n/t,l=n%t,f=s-o*u,h=i-a*u;n=t,t=l,s=o,i=a,o=f,a=h}if(n!==ze)throw new Error("invert: does not exist");return fr(s,e)}be.invert=Eu;function d2(r){let e=(r-ze)/ns,t,n,s;for(t=r-ze,n=0;t%ns===vt;t/=ns,n++);for(s=ns;s<r&&f2(s,e,r)!==r-ze;s++);if(n===1){let o=(r+ze)/Bd;return function(c,u){let l=c.pow(u,o);if(!c.eql(c.sqr(l),u))throw new Error("Cannot find square root");return l}}let i=(t+ze)/ns;return function(a,c){if(a.pow(c,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let u=n,l=a.pow(a.mul(a.ONE,s),t),f=a.pow(c,i),h=a.pow(c,t);for(;!a.eql(h,a.ONE);){if(a.eql(h,a.ZERO))return a.ZERO;let g=1;for(let b=a.sqr(h);g<u&&!a.eql(b,a.ONE);g++)b=a.sqr(b);let x=a.pow(l,ze<<BigInt(u-g-1));l=a.sqr(x),f=a.mul(f,x),h=a.mul(h,l),u=g}return f}}be.tonelliShanks=d2;function h2(r){if(r%Bd===jP){let e=(r+ze)/Bd;return function(n,s){let i=n.pow(s,e);if(!n.eql(n.sqr(i),s))throw new Error("Cannot find square root");return i}}if(r%l2===u2){let e=(r-u2)/l2;return function(n,s){let i=n.mul(s,ns),o=n.pow(i,e),a=n.mul(s,o),c=n.mul(n.mul(a,ns),o),u=n.mul(a,n.sub(c,n.ONE));if(!n.eql(n.sqr(u),s))throw new Error("Cannot find square root");return u}}return r%FP,d2(r)}be.FpSqrt=h2;var HP=(r,e)=>(fr(r,e)&ze)===ze;be.isNegativeLE=HP;var qP=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function GP(r){let e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},t=qP.reduce((n,s)=>(n[s]="function",n),e);return(0,dr.validateObject)(r,t)}be.validateField=GP;function p2(r,e,t){if(t<vt)throw new Error("Expected power > 0");if(t===vt)return r.ONE;if(t===ze)return e;let n=r.ONE,s=e;for(;t>vt;)t&ze&&(n=r.mul(n,s)),s=r.sqr(s),t>>=ze;return n}be.FpPow=p2;function g2(r,e){let t=new Array(e.length),n=e.reduce((i,o,a)=>r.is0(o)?i:(t[a]=i,r.mul(i,o)),r.ONE),s=r.inv(n);return e.reduceRight((i,o,a)=>r.is0(o)?i:(t[a]=r.mul(i,t[a]),r.mul(i,o)),s),t}be.FpInvertBatch=g2;function zP(r,e,t){return r.mul(e,typeof t=="bigint"?Eu(t,r.ORDER):r.inv(t))}be.FpDiv=zP;function KP(r){let e=(r.ORDER-ze)/ns;return t=>{let n=r.pow(t,e);return r.eql(n,r.ZERO)||r.eql(n,r.ONE)}}be.FpIsSquare=KP;function Od(r,e){let t=e!==void 0?e:r.toString(2).length,n=Math.ceil(t/8);return{nBitLength:t,nByteLength:n}}be.nLength=Od;function VP(r,e,t=!1,n={}){if(r<=vt)throw new Error(`Expected Field ORDER > 0, got ${r}`);let{nBitLength:s,nByteLength:i}=Od(r,e);if(i>2048)throw new Error("Field lengths over 2048 bytes are not supported");let o=h2(r),a=Object.freeze({ORDER:r,BITS:s,BYTES:i,MASK:(0,dr.bitMask)(s),ZERO:vt,ONE:ze,create:c=>fr(c,r),isValid:c=>{if(typeof c!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);return vt<=c&&c<r},is0:c=>c===vt,isOdd:c=>(c&ze)===ze,neg:c=>fr(-c,r),eql:(c,u)=>c===u,sqr:c=>fr(c*c,r),add:(c,u)=>fr(c+u,r),sub:(c,u)=>fr(c-u,r),mul:(c,u)=>fr(c*u,r),pow:(c,u)=>p2(a,c,u),div:(c,u)=>fr(c*Eu(u,r),r),sqrN:c=>c*c,addN:(c,u)=>c+u,subN:(c,u)=>c-u,mulN:(c,u)=>c*u,inv:c=>Eu(c,r),sqrt:n.sqrt||(c=>o(a,c)),invertBatch:c=>g2(a,c),cmov:(c,u,l)=>l?u:c,toBytes:c=>t?(0,dr.numberToBytesLE)(c,i):(0,dr.numberToBytesBE)(c,i),fromBytes:c=>{if(c.length!==i)throw new Error(`Fp.fromBytes: expected ${i}, got ${c.length}`);return t?(0,dr.bytesToNumberLE)(c):(0,dr.bytesToNumberBE)(c)}});return Object.freeze(a)}be.Field=VP;function $P(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");let t=r.sqrt(e);return r.isOdd(t)?t:r.neg(t)}be.FpSqrtOdd=$P;function JP(r,e){if(!r.isOdd)throw new Error("Field doesn't have isOdd");let t=r.sqrt(e);return r.isOdd(t)?r.neg(t):t}be.FpSqrtEven=JP;function QP(r,e,t=!1){r=(0,dr.ensureBytes)("privateHash",r);let n=r.length,s=Od(e).nByteLength+8;if(s<24||n<s||n>1024)throw new Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${n}`);let i=t?(0,dr.bytesToNumberLE)(r):(0,dr.bytesToNumberBE)(r);return fr(i,e-ze)+ze}be.hashToPrivateScalar=QP;function Sd(r){if(typeof r!="bigint")throw new Error("field order must be bigint");let e=r.toString(2).length;return Math.ceil(e/8)}be.getFieldBytesLength=Sd;function b2(r){let e=Sd(r);return e+Math.ceil(e/2)}be.getMinHashLength=b2;function WP(r,e,t=!1){let n=r.length,s=Sd(e),i=b2(e);if(n<16||n<i||n>1024)throw new Error(`expected ${i}-1024 bytes of input, got ${n}`);let o=t?(0,dr.bytesToNumberBE)(r):(0,dr.bytesToNumberLE)(r),a=fr(o,e-ze)+ze;return t?(0,dr.numberToBytesLE)(a,s):(0,dr.numberToBytesBE)(a,s)}be.mapHashToField=WP});var m2=P(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.validateBasic=qi.wNAF=void 0;var x2=wa(),YP=Ls(),ZP=BigInt(0),Cd=BigInt(1);function XP(r,e){let t=(s,i)=>{let o=i.negate();return s?o:i},n=s=>{let i=Math.ceil(e/s)+1,o=2**(s-1);return{windows:i,windowSize:o}};return{constTimeNegate:t,unsafeLadder(s,i){let o=r.ZERO,a=s;for(;i>ZP;)i&Cd&&(o=o.add(a)),a=a.double(),i>>=Cd;return o},precomputeWindow(s,i){let{windows:o,windowSize:a}=n(i),c=[],u=s,l=u;for(let f=0;f<o;f++){l=u,c.push(l);for(let h=1;h<a;h++)l=l.add(u),c.push(l);u=l.double()}return c},wNAF(s,i,o){let{windows:a,windowSize:c}=n(s),u=r.ZERO,l=r.BASE,f=BigInt(2**s-1),h=2**s,g=BigInt(s);for(let x=0;x<a;x++){let b=x*c,y=Number(o&f);o>>=g,y>c&&(y-=h,o+=Cd);let m=b,E=b+Math.abs(y)-1,_=x%2!==0,C=y<0;y===0?l=l.add(t(_,i[m])):u=u.add(t(C,i[E]))}return{p:u,f:l}},wNAFCached(s,i,o,a){let c=s._WINDOW_SIZE||1,u=i.get(s);return u||(u=this.precomputeWindow(s,c),c!==1&&i.set(s,a(u))),this.wNAF(c,u,o)}}}qi.wNAF=XP;function e7(r){return(0,x2.validateField)(r.Fp),(0,YP.validateObject)(r,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,x2.nLength)(r.n,r.nBitLength),...r,p:r.Fp.ORDER})}qi.validateBasic=e7});var Id=P(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.mapToCurveSimpleSWU=kt.SWUFpSqrtRatio=kt.weierstrass=kt.weierstrassPoints=kt.DER=void 0;var Gi=wa(),_t=Ls(),dn=Ls(),Nd=m2();function t7(r){let e=(0,Nd.validateBasic)(r);_t.validateObject(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:t,Fp:n,a:s}=e;if(t){if(!n.eql(s,n.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof t!="object"||typeof t.beta!="bigint"||typeof t.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}var{bytesToNumberBE:r7,hexToBytes:n7}=_t;kt.DER={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(r){let{Err:e}=kt.DER;if(r.length<2||r[0]!==2)throw new e("Invalid signature integer tag");let t=r[1],n=r.subarray(2,t+2);if(!t||n.length!==t)throw new e("Invalid signature integer: wrong length");if(n[0]&128)throw new e("Invalid signature integer: negative");if(n[0]===0&&!(n[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:r7(n),l:r.subarray(t+2)}},toSig(r){let{Err:e}=kt.DER,t=typeof r=="string"?n7(r):r;if(!(t instanceof Uint8Array))throw new Error("ui8a expected");let n=t.length;if(n<2||t[0]!=48)throw new e("Invalid signature tag");if(t[1]!==n-2)throw new e("Invalid signature: incorrect length");let{d:s,l:i}=kt.DER._parseInt(t.subarray(2)),{d:o,l:a}=kt.DER._parseInt(i);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:s,s:o}},hexFromSig(r){let e=u=>Number.parseInt(u[0],16)&8?"00"+u:u,t=u=>{let l=u.toString(16);return l.length&1?`0${l}`:l},n=e(t(r.s)),s=e(t(r.r)),i=n.length/2,o=s.length/2,a=t(i),c=t(o);return`30${t(o+i+4)}02${c}${s}02${a}${n}`}};var Qr=BigInt(0),lt=BigInt(1),ss=BigInt(2),Pu=BigInt(3),y2=BigInt(4);function w2(r){let e=t7(r),{Fp:t}=e,n=e.toBytes||((x,b,y)=>{let m=b.toAffine();return _t.concatBytes(Uint8Array.from([4]),t.toBytes(m.x),t.toBytes(m.y))}),s=e.fromBytes||(x=>{let b=x.subarray(1),y=t.fromBytes(b.subarray(0,t.BYTES)),m=t.fromBytes(b.subarray(t.BYTES,2*t.BYTES));return{x:y,y:m}});function i(x){let{a:b,b:y}=e,m=t.sqr(x),E=t.mul(m,x);return t.add(t.add(E,t.mul(x,b)),y)}if(!t.eql(t.sqr(e.Gy),i(e.Gx)))throw new Error("bad generator point: equation left != right");function o(x){return typeof x=="bigint"&&Qr<x&&x<e.n}function a(x){if(!o(x))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function c(x){let{allowedPrivateKeyLengths:b,nByteLength:y,wrapPrivateKey:m,n:E}=e;if(b&&typeof x!="bigint"){if(x instanceof Uint8Array&&(x=_t.bytesToHex(x)),typeof x!="string"||!b.includes(x.length))throw new Error("Invalid key");x=x.padStart(y*2,"0")}let _;try{_=typeof x=="bigint"?x:_t.bytesToNumberBE((0,dn.ensureBytes)("private key",x,y))}catch{throw new Error(`private key must be ${y} bytes, hex or bigint, not ${typeof x}`)}return m&&(_=Gi.mod(_,E)),a(_),_}let u=new Map;function l(x){if(!(x instanceof f))throw new Error("ProjectivePoint expected")}class f{constructor(b,y,m){if(this.px=b,this.py=y,this.pz=m,b==null||!t.isValid(b))throw new Error("x required");if(y==null||!t.isValid(y))throw new Error("y required");if(m==null||!t.isValid(m))throw new Error("z required")}static fromAffine(b){let{x:y,y:m}=b||{};if(!b||!t.isValid(y)||!t.isValid(m))throw new Error("invalid affine point");if(b instanceof f)throw new Error("projective point not allowed");let E=_=>t.eql(_,t.ZERO);return E(y)&&E(m)?f.ZERO:new f(y,m,t.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(b){let y=t.invertBatch(b.map(m=>m.pz));return b.map((m,E)=>m.toAffine(y[E])).map(f.fromAffine)}static fromHex(b){let y=f.fromAffine(s((0,dn.ensureBytes)("pointHex",b)));return y.assertValidity(),y}static fromPrivateKey(b){return f.BASE.multiply(c(b))}_setWindowSize(b){this._WINDOW_SIZE=b,u.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!t.is0(this.py))return;throw new Error("bad point: ZERO")}let{x:b,y}=this.toAffine();if(!t.isValid(b)||!t.isValid(y))throw new Error("bad point: x or y not FE");let m=t.sqr(y),E=i(b);if(!t.eql(m,E))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:b}=this.toAffine();if(t.isOdd)return!t.isOdd(b);throw new Error("Field doesn't support isOdd")}equals(b){l(b);let{px:y,py:m,pz:E}=this,{px:_,py:C,pz:L}=b,A=t.eql(t.mul(y,L),t.mul(_,E)),O=t.eql(t.mul(m,L),t.mul(C,E));return A&&O}negate(){return new f(this.px,t.neg(this.py),this.pz)}double(){let{a:b,b:y}=e,m=t.mul(y,Pu),{px:E,py:_,pz:C}=this,L=t.ZERO,A=t.ZERO,O=t.ZERO,j=t.mul(E,E),X=t.mul(_,_),oe=t.mul(C,C),de=t.mul(E,_);return de=t.add(de,de),O=t.mul(E,C),O=t.add(O,O),L=t.mul(b,O),A=t.mul(m,oe),A=t.add(L,A),L=t.sub(X,A),A=t.add(X,A),A=t.mul(L,A),L=t.mul(de,L),O=t.mul(m,O),oe=t.mul(b,oe),de=t.sub(j,oe),de=t.mul(b,de),de=t.add(de,O),O=t.add(j,j),j=t.add(O,j),j=t.add(j,oe),j=t.mul(j,de),A=t.add(A,j),oe=t.mul(_,C),oe=t.add(oe,oe),j=t.mul(oe,de),L=t.sub(L,j),O=t.mul(oe,X),O=t.add(O,O),O=t.add(O,O),new f(L,A,O)}add(b){l(b);let{px:y,py:m,pz:E}=this,{px:_,py:C,pz:L}=b,A=t.ZERO,O=t.ZERO,j=t.ZERO,X=e.a,oe=t.mul(e.b,Pu),de=t.mul(y,_),Le=t.mul(m,C),Se=t.mul(E,L),nt=t.add(y,m),H=t.add(_,C);nt=t.mul(nt,H),H=t.add(de,Le),nt=t.sub(nt,H),H=t.add(y,E);let V=t.add(_,L);return H=t.mul(H,V),V=t.add(de,Se),H=t.sub(H,V),V=t.add(m,E),A=t.add(C,L),V=t.mul(V,A),A=t.add(Le,Se),V=t.sub(V,A),j=t.mul(X,H),A=t.mul(oe,Se),j=t.add(A,j),A=t.sub(Le,j),j=t.add(Le,j),O=t.mul(A,j),Le=t.add(de,de),Le=t.add(Le,de),Se=t.mul(X,Se),H=t.mul(oe,H),Le=t.add(Le,Se),Se=t.sub(de,Se),Se=t.mul(X,Se),H=t.add(H,Se),de=t.mul(Le,H),O=t.add(O,de),de=t.mul(V,H),A=t.mul(nt,A),A=t.sub(A,de),de=t.mul(nt,Le),j=t.mul(V,j),j=t.add(j,de),new f(A,O,j)}subtract(b){return this.add(b.negate())}is0(){return this.equals(f.ZERO)}wNAF(b){return g.wNAFCached(this,u,b,y=>{let m=t.invertBatch(y.map(E=>E.pz));return y.map((E,_)=>E.toAffine(m[_])).map(f.fromAffine)})}multiplyUnsafe(b){let y=f.ZERO;if(b===Qr)return y;if(a(b),b===lt)return this;let{endo:m}=e;if(!m)return g.unsafeLadder(this,b);let{k1neg:E,k1:_,k2neg:C,k2:L}=m.splitScalar(b),A=y,O=y,j=this;for(;_>Qr||L>Qr;)_<&&(A=A.add(j)),L<&&(O=O.add(j)),j=j.double(),_>>=lt,L>>=lt;return E&&(A=A.negate()),C&&(O=O.negate()),O=new f(t.mul(O.px,m.beta),O.py,O.pz),A.add(O)}multiply(b){a(b);let y=b,m,E,{endo:_}=e;if(_){let{k1neg:C,k1:L,k2neg:A,k2:O}=_.splitScalar(y),{p:j,f:X}=this.wNAF(L),{p:oe,f:de}=this.wNAF(O);j=g.constTimeNegate(C,j),oe=g.constTimeNegate(A,oe),oe=new f(t.mul(oe.px,_.beta),oe.py,oe.pz),m=j.add(oe),E=X.add(de)}else{let{p:C,f:L}=this.wNAF(y);m=C,E=L}return f.normalizeZ([m,E])[0]}multiplyAndAddUnsafe(b,y,m){let E=f.BASE,_=(L,A)=>A===Qr||A===lt||!L.equals(E)?L.multiplyUnsafe(A):L.multiply(A),C=_(this,y).add(_(b,m));return C.is0()?void 0:C}toAffine(b){let{px:y,py:m,pz:E}=this,_=this.is0();b==null&&(b=_?t.ONE:t.inv(E));let C=t.mul(y,b),L=t.mul(m,b),A=t.mul(E,b);if(_)return{x:t.ZERO,y:t.ZERO};if(!t.eql(A,t.ONE))throw new Error("invZ was invalid");return{x:C,y:L}}isTorsionFree(){let{h:b,isTorsionFree:y}=e;if(b===lt)return!0;if(y)return y(f,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:b,clearCofactor:y}=e;return b===lt?this:y?y(f,this):this.multiplyUnsafe(e.h)}toRawBytes(b=!0){return this.assertValidity(),n(f,this,b)}toHex(b=!0){return _t.bytesToHex(this.toRawBytes(b))}}f.BASE=new f(e.Gx,e.Gy,t.ONE),f.ZERO=new f(t.ZERO,t.ONE,t.ZERO);let h=e.nBitLength,g=(0,Nd.wNAF)(f,e.endo?Math.ceil(h/2):h);return{CURVE:e,ProjectivePoint:f,normPrivateKeyToScalar:c,weierstrassEquation:i,isWithinCurveOrder:o}}kt.weierstrassPoints=w2;function s7(r){let e=(0,Nd.validateBasic)(r);return _t.validateObject(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function i7(r){let e=s7(r),{Fp:t,n}=e,s=t.BYTES+1,i=2*t.BYTES+1;function o(H){return Qr<H&&H<t.ORDER}function a(H){return Gi.mod(H,n)}function c(H){return Gi.invert(H,n)}let{ProjectivePoint:u,normPrivateKeyToScalar:l,weierstrassEquation:f,isWithinCurveOrder:h}=w2({...e,toBytes(H,V,ae){let ve=V.toAffine(),Ae=t.toBytes(ve.x),Me=_t.concatBytes;return ae?Me(Uint8Array.from([V.hasEvenY()?2:3]),Ae):Me(Uint8Array.from([4]),Ae,t.toBytes(ve.y))},fromBytes(H){let V=H.length,ae=H[0],ve=H.subarray(1);if(V===s&&(ae===2||ae===3)){let Ae=_t.bytesToNumberBE(ve);if(!o(Ae))throw new Error("Point is not on curve");let Me=f(Ae),Qe=t.sqrt(Me),et=(Qe<)===lt;return(ae&1)===1!==et&&(Qe=t.neg(Qe)),{x:Ae,y:Qe}}else if(V===i&&ae===4){let Ae=t.fromBytes(ve.subarray(0,t.BYTES)),Me=t.fromBytes(ve.subarray(t.BYTES,2*t.BYTES));return{x:Ae,y:Me}}else throw new Error(`Point of length ${V} was invalid. Expected ${s} compressed bytes or ${i} uncompressed bytes`)}}),g=H=>_t.bytesToHex(_t.numberToBytesBE(H,e.nByteLength));function x(H){let V=n>>lt;return H>V}function b(H){return x(H)?a(-H):H}let y=(H,V,ae)=>_t.bytesToNumberBE(H.slice(V,ae));class m{constructor(V,ae,ve){this.r=V,this.s=ae,this.recovery=ve,this.assertValidity()}static fromCompact(V){let ae=e.nByteLength;return V=(0,dn.ensureBytes)("compactSignature",V,ae*2),new m(y(V,0,ae),y(V,ae,2*ae))}static fromDER(V){let{r:ae,s:ve}=kt.DER.toSig((0,dn.ensureBytes)("DER",V));return new m(ae,ve)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(V){return new m(this.r,this.s,V)}recoverPublicKey(V){let{r:ae,s:ve,recovery:Ae}=this,Me=O((0,dn.ensureBytes)("msgHash",V));if(Ae==null||![0,1,2,3].includes(Ae))throw new Error("recovery id invalid");let Qe=Ae===2||Ae===3?ae+e.n:ae;if(Qe>=t.ORDER)throw new Error("recovery id 2 or 3 invalid");let et=(Ae&1)===0?"02":"03",ar=u.fromHex(et+g(Qe)),cr=c(Qe),nn=a(-Me*cr),sn=a(ve*cr),ur=u.BASE.multiplyAndAddUnsafe(ar,nn,sn);if(!ur)throw new Error("point at infinify");return ur.assertValidity(),ur}hasHighS(){return x(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return _t.hexToBytes(this.toDERHex())}toDERHex(){return kt.DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return _t.hexToBytes(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}let E={isValidPrivateKey(H){try{return l(H),!0}catch{return!1}},normPrivateKeyToScalar:l,randomPrivateKey:()=>{let H=Gi.getMinHashLength(e.n);return Gi.mapHashToField(e.randomBytes(H),e.n)},precompute(H=8,V=u.BASE){return V._setWindowSize(H),V.multiply(BigInt(3)),V}};function _(H,V=!0){return u.fromPrivateKey(H).toRawBytes(V)}function C(H){let V=H instanceof Uint8Array,ae=typeof H=="string",ve=(V||ae)&&H.length;return V?ve===s||ve===i:ae?ve===2*s||ve===2*i:H instanceof u}function L(H,V,ae=!0){if(C(H))throw new Error("first arg must be private key");if(!C(V))throw new Error("second arg must be public key");return u.fromHex(V).multiply(l(H)).toRawBytes(ae)}let A=e.bits2int||function(H){let V=_t.bytesToNumberBE(H),ae=H.length*8-e.nBitLength;return ae>0?V>>BigInt(ae):V},O=e.bits2int_modN||function(H){return a(A(H))},j=_t.bitMask(e.nBitLength);function X(H){if(typeof H!="bigint")throw new Error("bigint expected");if(!(Qr<=H&&H<j))throw new Error(`bigint expected < 2^${e.nBitLength}`);return _t.numberToBytesBE(H,e.nByteLength)}function oe(H,V,ae=de){if(["recovered","canonical"].some(T=>T in ae))throw new Error("sign() legacy options not supported");let{hash:ve,randomBytes:Ae}=e,{lowS:Me,prehash:Qe,extraEntropy:et}=ae;Me==null&&(Me=!0),H=(0,dn.ensureBytes)("msgHash",H),Qe&&(H=(0,dn.ensureBytes)("prehashed msgHash",ve(H)));let ar=O(H),cr=l(V),nn=[X(cr),X(ar)];if(et!=null){let T=et===!0?Ae(t.BYTES):et;nn.push((0,dn.ensureBytes)("extraEntropy",T))}let sn=_t.concatBytes(...nn),ur=ar;function B(T){let S=A(T);if(!h(S))return;let F=c(S),J=u.BASE.multiply(S).toAffine(),W=a(J.x);if(W===Qr)return;let re=a(F*a(ur+W*cr));if(re===Qr)return;let Fe=(J.x===W?0:2)|Number(J.y<),je=re;return Me&&x(re)&&(je=b(re),Fe^=1),new m(W,je,Fe)}return{seed:sn,k2sig:B}}let de={lowS:e.lowS,prehash:!1},Le={lowS:e.lowS,prehash:!1};function Se(H,V,ae=de){let{seed:ve,k2sig:Ae}=oe(H,V,ae),Me=e;return _t.createHmacDrbg(Me.hash.outputLen,Me.nByteLength,Me.hmac)(ve,Ae)}u.BASE._setWindowSize(8);function nt(H,V,ae,ve=Le){let Ae=H;if(V=(0,dn.ensureBytes)("msgHash",V),ae=(0,dn.ensureBytes)("publicKey",ae),"strict"in ve)throw new Error("options.strict was renamed to lowS");let{lowS:Me,prehash:Qe}=ve,et,ar;try{if(typeof Ae=="string"||Ae instanceof Uint8Array)try{et=m.fromDER(Ae)}catch(J){if(!(J instanceof kt.DER.Err))throw J;et=m.fromCompact(Ae)}else if(typeof Ae=="object"&&typeof Ae.r=="bigint"&&typeof Ae.s=="bigint"){let{r:J,s:W}=Ae;et=new m(J,W)}else throw new Error("PARSE");ar=u.fromHex(ae)}catch(J){if(J.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(Me&&et.hasHighS())return!1;Qe&&(V=e.hash(V));let{r:cr,s:nn}=et,sn=O(V),ur=c(nn),B=a(sn*ur),T=a(cr*ur),S=u.BASE.multiplyAndAddUnsafe(ar,B,T)?.toAffine();return S?a(S.x)===cr:!1}return{CURVE:e,getPublicKey:_,getSharedSecret:L,sign:Se,verify:nt,ProjectivePoint:u,Signature:m,utils:E}}kt.weierstrass=i7;function A2(r,e){let t=r.ORDER,n=Qr;for(let x=t-lt;x%ss===Qr;x/=ss)n+=lt;let s=n,i=ss<<s-lt-lt,o=i*ss,a=(t-lt)/o,c=(a-lt)/ss,u=o-lt,l=i,f=r.pow(e,a),h=r.pow(e,(a+lt)/ss),g=(x,b)=>{let y=f,m=r.pow(b,u),E=r.sqr(m);E=r.mul(E,b);let _=r.mul(x,E);_=r.pow(_,c),_=r.mul(_,m),m=r.mul(_,b),E=r.mul(_,x);let C=r.mul(E,m);_=r.pow(C,l);let L=r.eql(_,r.ONE);m=r.mul(E,h),_=r.mul(C,y),E=r.cmov(m,E,L),C=r.cmov(_,C,L);for(let A=s;A>lt;A--){let O=A-ss;O=ss<<O-lt;let j=r.pow(C,O),X=r.eql(j,r.ONE);m=r.mul(E,y),y=r.mul(y,y),j=r.mul(C,y),E=r.cmov(m,E,X),C=r.cmov(j,C,X)}return{isValid:L,value:E}};if(r.ORDER%y2===Pu){let x=(r.ORDER-Pu)/y2,b=r.sqrt(r.neg(e));g=(y,m)=>{let E=r.sqr(m),_=r.mul(y,m);E=r.mul(E,_);let C=r.pow(E,x);C=r.mul(C,_);let L=r.mul(C,b),A=r.mul(r.sqr(C),m),O=r.eql(A,y),j=r.cmov(L,C,O);return{isValid:O,value:j}}}return g}kt.SWUFpSqrtRatio=A2;function o7(r,e){if(Gi.validateField(r),!r.isValid(e.A)||!r.isValid(e.B)||!r.isValid(e.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");let t=A2(r,e.Z);if(!r.isOdd)throw new Error("Fp.isOdd is not implemented!");return n=>{let s,i,o,a,c,u,l,f;s=r.sqr(n),s=r.mul(s,e.Z),i=r.sqr(s),i=r.add(i,s),o=r.add(i,r.ONE),o=r.mul(o,e.B),a=r.cmov(e.Z,r.neg(i),!r.eql(i,r.ZERO)),a=r.mul(a,e.A),i=r.sqr(o),u=r.sqr(a),c=r.mul(u,e.A),i=r.add(i,c),i=r.mul(i,o),u=r.mul(u,a),c=r.mul(u,e.B),i=r.add(i,c),l=r.mul(s,o);let{isValid:h,value:g}=t(i,u);f=r.mul(s,n),f=r.mul(f,g),l=r.cmov(l,o,h),f=r.cmov(f,g,h);let x=r.isOdd(n)===r.isOdd(f);return f=r.cmov(r.neg(f),f,x),l=r.div(l,a),{x:l,y:f}}}kt.mapToCurveSimpleSWU=o7});var v2=P(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.createHasher=vr.isogenyMap=vr.hash_to_field=vr.expand_message_xof=vr.expand_message_xmd=void 0;var a7=wa(),Wr=Ls();function c7(r){if(r instanceof Uint8Array)return r;if(typeof r=="string")return(0,Wr.utf8ToBytes)(r);throw new Error("DST must be Uint8Array or string")}var u7=Wr.bytesToNumberBE;function is(r,e){if(r<0||r>=1<<8*e)throw new Error(`bad I2OSP call: value=${r} length=${e}`);let t=Array.from({length:e}).fill(0);for(let n=e-1;n>=0;n--)t[n]=r&255,r>>>=8;return new Uint8Array(t)}function l7(r,e){let t=new Uint8Array(r.length);for(let n=0;n<r.length;n++)t[n]=r[n]^e[n];return t}function Aa(r){if(!(r instanceof Uint8Array))throw new Error("Uint8Array expected")}function Ld(r){if(!Number.isSafeInteger(r))throw new Error("number expected")}function E2(r,e,t,n){Aa(r),Aa(e),Ld(t),e.length>255&&(e=n((0,Wr.concatBytes)((0,Wr.utf8ToBytes)("H2C-OVERSIZE-DST-"),e)));let{outputLen:s,blockLen:i}=n,o=Math.ceil(t/s);if(o>255)throw new Error("Invalid xmd length");let a=(0,Wr.concatBytes)(e,is(e.length,1)),c=is(0,i),u=is(t,2),l=new Array(o),f=n((0,Wr.concatBytes)(c,r,u,is(0,1),a));l[0]=n((0,Wr.concatBytes)(f,is(1,1),a));for(let g=1;g<=o;g++){let x=[l7(f,l[g-1]),is(g+1,1),a];l[g]=n((0,Wr.concatBytes)(...x))}return(0,Wr.concatBytes)(...l).slice(0,t)}vr.expand_message_xmd=E2;function P2(r,e,t,n,s){if(Aa(r),Aa(e),Ld(t),e.length>255){let i=Math.ceil(2*n/8);e=s.create({dkLen:i}).update((0,Wr.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(e).digest()}if(t>65535||e.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return s.create({dkLen:t}).update(r).update(is(t,2)).update(e).update(is(e.length,1)).digest()}vr.expand_message_xof=P2;function Rd(r,e,t){(0,Wr.validateObject)(t,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:n,k:s,m:i,hash:o,expand:a,DST:c}=t;Aa(r),Ld(e);let u=c7(c),l=n.toString(2).length,f=Math.ceil((l+s)/8),h=e*i*f,g;if(a==="xmd")g=E2(r,u,h,o);else if(a==="xof")g=P2(r,u,h,s,o);else if(a==="_internal_pass")g=r;else throw new Error('expand must be "xmd" or "xof"');let x=new Array(e);for(let b=0;b<e;b++){let y=new Array(i);for(let m=0;m<i;m++){let E=f*(m+b*i),_=g.subarray(E,E+f);y[m]=(0,a7.mod)(u7(_),n)}x[b]=y}return x}vr.hash_to_field=Rd;function f7(r,e){let t=e.map(n=>Array.from(n).reverse());return(n,s)=>{let[i,o,a,c]=t.map(u=>u.reduce((l,f)=>r.add(r.mul(l,n),f)));return n=r.div(i,o),s=r.mul(s,r.div(a,c)),{x:n,y:s}}}vr.isogenyMap=f7;function d7(r,e,t){if(typeof e!="function")throw new Error("mapToCurve() must be defined");return{hashToCurve(n,s){let i=Rd(n,2,{...t,DST:t.DST,...s}),o=r.fromAffine(e(i[0])),a=r.fromAffine(e(i[1])),c=o.add(a).clearCofactor();return c.assertValidity(),c},encodeToCurve(n,s){let i=Rd(n,1,{...t,DST:t.encodeDST,...s}),o=r.fromAffine(e(i[0])).clearCofactor();return o.assertValidity(),o}}}vr.createHasher=d7});var T2=P(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.createCurve=zi.getHash=void 0;var h7=tu(),_2=Jr(),p7=Id();function k2(r){return{hash:r,hmac:(e,...t)=>(0,h7.hmac)(r,e,(0,_2.concatBytes)(...t)),randomBytes:_2.randomBytes}}zi.getHash=k2;function g7(r,e){let t=n=>(0,p7.weierstrass)({...r,...k2(n)});return Object.freeze({...t(e),create:t})}zi.createCurve=g7});var U2=P(er=>{"use strict";Object.defineProperty(er,"__esModule",{value:!0});er.encodeToCurve=er.hashToCurve=er.schnorr=er.secp256k1=void 0;var vu=ou(),b7=Jr(),Ct=wa(),x7=Id(),Mt=Ls(),S2=v2(),m7=T2(),Bu=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),_u=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),C2=BigInt(1),ku=BigInt(2),B2=(r,e)=>(r+e/ku)/e;function N2(r){let e=Bu,t=BigInt(3),n=BigInt(6),s=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),c=BigInt(88),u=r*r*r%e,l=u*u*r%e,f=(0,Ct.pow2)(l,t,e)*l%e,h=(0,Ct.pow2)(f,t,e)*l%e,g=(0,Ct.pow2)(h,ku,e)*u%e,x=(0,Ct.pow2)(g,s,e)*g%e,b=(0,Ct.pow2)(x,i,e)*x%e,y=(0,Ct.pow2)(b,a,e)*b%e,m=(0,Ct.pow2)(y,c,e)*y%e,E=(0,Ct.pow2)(m,a,e)*b%e,_=(0,Ct.pow2)(E,t,e)*l%e,C=(0,Ct.pow2)(_,o,e)*x%e,L=(0,Ct.pow2)(C,n,e)*u%e,A=(0,Ct.pow2)(L,ku,e);if(!os.eql(os.sqr(A),r))throw new Error("Cannot find square root");return A}var os=(0,Ct.Field)(Bu,void 0,void 0,{sqrt:N2});er.secp256k1=(0,m7.createCurve)({a:BigInt(0),b:BigInt(7),Fp:os,n:_u,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:r=>{let e=_u,t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-C2*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=t,o=BigInt("0x100000000000000000000000000000000"),a=B2(i*r,e),c=B2(-n*r,e),u=(0,Ct.mod)(r-a*t-c*s,e),l=(0,Ct.mod)(-a*n-c*i,e),f=u>o,h=l>o;if(f&&(u=e-u),h&&(l=e-l),u>o||l>o)throw new Error("splitScalar: Endomorphism failed, k="+r);return{k1neg:f,k1:u,k2neg:h,k2:l}}}},vu.sha256);var Ou=BigInt(0),I2=r=>typeof r=="bigint"&&Ou<r&&r<Bu,y7=r=>typeof r=="bigint"&&Ou<r&&r<_u,O2={};function Tu(r,...e){let t=O2[r];if(t===void 0){let n=(0,vu.sha256)(Uint8Array.from(r,s=>s.charCodeAt(0)));t=(0,Mt.concatBytes)(n,n),O2[r]=t}return(0,vu.sha256)((0,Mt.concatBytes)(t,...e))}var Fd=r=>r.toRawBytes(!0).slice(1),jd=r=>(0,Mt.numberToBytesBE)(r,32),Md=r=>(0,Ct.mod)(r,Bu),Ea=r=>(0,Ct.mod)(r,_u),Dd=er.secp256k1.ProjectivePoint,w7=(r,e,t)=>Dd.BASE.multiplyAndAddUnsafe(r,e,t);function Ud(r){let e=er.secp256k1.utils.normPrivateKeyToScalar(r),t=Dd.fromPrivateKey(e);return{scalar:t.hasEvenY()?e:Ea(-e),bytes:Fd(t)}}function R2(r){if(!I2(r))throw new Error("bad x: need 0 < x < p");let e=Md(r*r),t=Md(e*r+BigInt(7)),n=N2(t);n%ku!==Ou&&(n=Md(-n));let s=new Dd(r,n,C2);return s.assertValidity(),s}function L2(...r){return Ea((0,Mt.bytesToNumberBE)(Tu("BIP0340/challenge",...r)))}function A7(r){return Ud(r).bytes}function E7(r,e,t=(0,b7.randomBytes)(32)){let n=(0,Mt.ensureBytes)("message",r),{bytes:s,scalar:i}=Ud(e),o=(0,Mt.ensureBytes)("auxRand",t,32),a=jd(i^(0,Mt.bytesToNumberBE)(Tu("BIP0340/aux",o))),c=Tu("BIP0340/nonce",a,s,n),u=Ea((0,Mt.bytesToNumberBE)(c));if(u===Ou)throw new Error("sign failed: k is zero");let{bytes:l,scalar:f}=Ud(u),h=L2(l,s,n),g=new Uint8Array(64);if(g.set(l,0),g.set(jd(Ea(f+h*i)),32),!M2(g,n,s))throw new Error("sign: Invalid signature produced");return g}function M2(r,e,t){let n=(0,Mt.ensureBytes)("signature",r,64),s=(0,Mt.ensureBytes)("message",e),i=(0,Mt.ensureBytes)("publicKey",t,32);try{let o=R2((0,Mt.bytesToNumberBE)(i)),a=(0,Mt.bytesToNumberBE)(n.subarray(0,32));if(!I2(a))return!1;let c=(0,Mt.bytesToNumberBE)(n.subarray(32,64));if(!y7(c))return!1;let u=L2(jd(a),Fd(o),s),l=w7(o,c,Ea(-u));return!(!l||!l.hasEvenY()||l.toAffine().x!==a)}catch{return!1}}er.schnorr={getPublicKey:A7,sign:E7,verify:M2,utils:{randomPrivateKey:er.secp256k1.utils.randomPrivateKey,lift_x:R2,pointToBytes:Fd,numberToBytesBE:Mt.numberToBytesBE,bytesToNumberBE:Mt.bytesToNumberBE,taggedHash:Tu,mod:Ct.mod}};var P7=(0,S2.isogenyMap)(os,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(r=>r.map(e=>BigInt(e)))),v7=(0,x7.mapToCurveSimpleSWU)(os,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:os.create(BigInt("-11"))}),j2=(0,S2.createHasher)(er.secp256k1.ProjectivePoint,r=>{let{x:e,y:t}=v7(os.create(r[0]));return P7(e,t)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:os.ORDER,m:1,k:128,expand:"xmd",hash:vu.sha256});er.hashToCurve=j2.hashToCurve;er.encodeToCurve=j2.encodeToCurve});var Hd=P(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.ZeroAddress=void 0;Su.ZeroAddress="0x0000000000000000000000000000000000000000"});var F2=P(Cu=>{"use strict";Object.defineProperty(Cu,"__esModule",{value:!0});Cu.ZeroHash=void 0;Cu.ZeroHash="0x0000000000000000000000000000000000000000000000000000000000000000"});var D2=P(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.MaxInt256=_r.MinInt256=_r.MaxUint256=_r.WeiPerEther=_r.N=void 0;_r.N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141");_r.WeiPerEther=BigInt("1000000000000000000");_r.MaxUint256=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");_r.MinInt256=BigInt("0x8000000000000000000000000000000000000000000000000000000000000000")*BigInt(-1);_r.MaxInt256=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")});var H2=P(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.MessagePrefix=Ki.EtherSymbol=void 0;Ki.EtherSymbol="\u039E";Ki.MessagePrefix=`Ethereum Signed Message:
|
|
536
|
+
`});var Vi=P(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.MessagePrefix=bt.EtherSymbol=bt.MaxInt256=bt.MinInt256=bt.MaxUint256=bt.WeiPerEther=bt.N=bt.ZeroHash=bt.ZeroAddress=void 0;var _7=Hd();Object.defineProperty(bt,"ZeroAddress",{enumerable:!0,get:function(){return _7.ZeroAddress}});var k7=F2();Object.defineProperty(bt,"ZeroHash",{enumerable:!0,get:function(){return k7.ZeroHash}});var Pa=D2();Object.defineProperty(bt,"N",{enumerable:!0,get:function(){return Pa.N}});Object.defineProperty(bt,"WeiPerEther",{enumerable:!0,get:function(){return Pa.WeiPerEther}});Object.defineProperty(bt,"MaxUint256",{enumerable:!0,get:function(){return Pa.MaxUint256}});Object.defineProperty(bt,"MinInt256",{enumerable:!0,get:function(){return Pa.MinInt256}});Object.defineProperty(bt,"MaxInt256",{enumerable:!0,get:function(){return Pa.MaxInt256}});var q2=H2();Object.defineProperty(bt,"EtherSymbol",{enumerable:!0,get:function(){return q2.EtherSymbol}});Object.defineProperty(bt,"MessagePrefix",{enumerable:!0,get:function(){return q2.MessagePrefix}})});var Gd=P(Iu=>{"use strict";Object.defineProperty(Iu,"__esModule",{value:!0});Iu.Signature=void 0;var G2=Vi(),Te=$(),z2=BigInt(0),K2=BigInt(1),V2=BigInt(2),$2=BigInt(27),J2=BigInt(28),Nu=BigInt(35),$i={};function Q2(r){return(0,Te.zeroPadValue)((0,Te.toBeArray)(r),32)}var qd=class r{#e;#t;#r;#n;get r(){return this.#e}set r(e){(0,Te.assertArgument)((0,Te.dataLength)(e)===32,"invalid r","value",e),this.#e=(0,Te.hexlify)(e)}get s(){return(0,Te.assertArgument)(parseInt(this.#t.substring(0,3))<8,"non-canonical s; use ._s","s",this.#t),this.#t}set s(e){(0,Te.assertArgument)((0,Te.dataLength)(e)===32,"invalid s","value",e),this.#t=(0,Te.hexlify)(e)}get _s(){return this.#t}isValid(){return parseInt(this.#t.substring(0,3))<8}get v(){return this.#r}set v(e){let t=(0,Te.getNumber)(e,"value");(0,Te.assertArgument)(t===27||t===28,"invalid v","v",e),this.#r=t}get networkV(){return this.#n}get legacyChainId(){let e=this.networkV;return e==null?null:r.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){let e=(0,Te.getBytes)(this.s);return this.yParity&&(e[0]|=128),(0,Te.hexlify)(e)}get compactSerialized(){return(0,Te.concat)([this.r,this.yParityAndS])}get serialized(){return(0,Te.concat)([this.r,this.s,this.yParity?"0x1c":"0x1b"])}constructor(e,t,n,s){(0,Te.assertPrivate)(e,$i,"Signature"),this.#e=t,this.#t=n,this.#r=s,this.#n=null}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this._s}"${this.isValid()?"":', valid: "false"'}, yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){let e=new r($i,this.r,this._s,this.v);return this.networkV&&(e.#n=this.networkV),e}toJSON(){let e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this._s,v:this.v}}static getChainId(e){let t=(0,Te.getBigInt)(e,"v");return t==$2||t==J2?z2:((0,Te.assertArgument)(t>=Nu,"invalid EIP-155 v","v",e),(t-Nu)/V2)}static getChainIdV(e,t){return(0,Te.getBigInt)(e)*V2+BigInt(35+t-27)}static getNormalizedV(e){let t=(0,Te.getBigInt)(e);return t===z2||t===$2?27:t===K2||t===J2?28:((0,Te.assertArgument)(t>=Nu,"invalid v","v",e),t&K2?27:28)}static from(e){function t(u,l){(0,Te.assertArgument)(u,l,"signature",e)}if(e==null)return new r($i,G2.ZeroHash,G2.ZeroHash,27);if(typeof e=="string"){let u=(0,Te.getBytes)(e,"signature");if(u.length===64){let l=(0,Te.hexlify)(u.slice(0,32)),f=u.slice(32,64),h=f[0]&128?28:27;return f[0]&=127,new r($i,l,(0,Te.hexlify)(f),h)}if(u.length===65){let l=(0,Te.hexlify)(u.slice(0,32)),f=(0,Te.hexlify)(u.slice(32,64)),h=r.getNormalizedV(u[64]);return new r($i,l,f,h)}t(!1,"invalid raw signature length")}if(e instanceof r)return e.clone();let n=e.r;t(n!=null,"missing r");let s=Q2(n),i=function(u,l){if(u!=null)return Q2(u);if(l!=null){t((0,Te.isHexString)(l,32),"invalid yParityAndS");let f=(0,Te.getBytes)(l);return f[0]&=127,(0,Te.hexlify)(f)}t(!1,"missing s")}(e.s,e.yParityAndS),{networkV:o,v:a}=function(u,l,f){if(u!=null){let h=(0,Te.getBigInt)(u);return{networkV:h>=Nu?h:void 0,v:r.getNormalizedV(h)}}if(l!=null)return t((0,Te.isHexString)(l,32),"invalid yParityAndS"),{v:(0,Te.getBytes)(l)[0]&128?28:27};if(f!=null){switch((0,Te.getNumber)(f,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}t(!1,"invalid yParity")}t(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),c=new r($i,s,i,a);return o&&(c.#n=o),t(e.yParity==null||(0,Te.getNumber)(e.yParity,"sig.yParity")===c.yParity,"yParity mismatch"),t(e.yParityAndS==null||e.yParityAndS===c.yParityAndS,"yParityAndS mismatch"),c}};Iu.Signature=qd});var Y2=P(Ru=>{"use strict";Object.defineProperty(Ru,"__esModule",{value:!0});Ru.SigningKey=void 0;var Ms=U2(),dt=$(),W2=Gd(),zd=class r{#e;constructor(e){(0,dt.assertArgument)((0,dt.dataLength)(e)===32,"invalid private key","privateKey","[REDACTED]"),this.#e=(0,dt.hexlify)(e)}get privateKey(){return this.#e}get publicKey(){return r.computePublicKey(this.#e)}get compressedPublicKey(){return r.computePublicKey(this.#e,!0)}sign(e){(0,dt.assertArgument)((0,dt.dataLength)(e)===32,"invalid digest length","digest",e);let t=Ms.secp256k1.sign((0,dt.getBytesCopy)(e),(0,dt.getBytesCopy)(this.#e),{lowS:!0});return W2.Signature.from({r:(0,dt.toBeHex)(t.r,32),s:(0,dt.toBeHex)(t.s,32),v:t.recovery?28:27})}computeSharedSecret(e){let t=r.computePublicKey(e);return(0,dt.hexlify)(Ms.secp256k1.getSharedSecret((0,dt.getBytesCopy)(this.#e),(0,dt.getBytes)(t),!1))}static computePublicKey(e,t){let n=(0,dt.getBytes)(e,"key");if(n.length===32){let i=Ms.secp256k1.getPublicKey(n,!!t);return(0,dt.hexlify)(i)}if(n.length===64){let i=new Uint8Array(65);i[0]=4,i.set(n,1),n=i}let s=Ms.secp256k1.ProjectivePoint.fromHex(n);return(0,dt.hexlify)(s.toRawBytes(t))}static recoverPublicKey(e,t){(0,dt.assertArgument)((0,dt.dataLength)(e)===32,"invalid digest length","digest",e);let n=W2.Signature.from(t),s=Ms.secp256k1.Signature.fromCompact((0,dt.getBytesCopy)((0,dt.concat)([n.r,n.s])));s=s.addRecoveryBit(n.yParity);let i=s.recoverPublicKey((0,dt.getBytesCopy)(e));return(0,dt.assertArgument)(i!=null,"invalid signature for digest","signature",t),"0x"+i.toHex(!1)}static addPoints(e,t,n){let s=Ms.secp256k1.ProjectivePoint.fromHex(r.computePublicKey(e).substring(2)),i=Ms.secp256k1.ProjectivePoint.fromHex(r.computePublicKey(t).substring(2));return"0x"+s.add(i).toHex(!!n)}};Ru.SigningKey=zd});var xt=P($e=>{"use strict";Object.defineProperty($e,"__esModule",{value:!0});$e.lock=$e.Signature=$e.SigningKey=$e.scryptSync=$e.scrypt=$e.pbkdf2=$e.sha512=$e.sha256=$e.ripemd160=$e.keccak256=$e.randomBytes=$e.computeHmac=void 0;var Z2=i1();Object.defineProperty($e,"computeHmac",{enumerable:!0,get:function(){return Z2.computeHmac}});var X2=m1();Object.defineProperty($e,"keccak256",{enumerable:!0,get:function(){return X2.keccak256}});var ew=T1();Object.defineProperty($e,"ripemd160",{enumerable:!0,get:function(){return ew.ripemd160}});var tw=C1();Object.defineProperty($e,"pbkdf2",{enumerable:!0,get:function(){return tw.pbkdf2}});var Kd=L1();Object.defineProperty($e,"randomBytes",{enumerable:!0,get:function(){return Kd.randomBytes}});var Lu=Q1();Object.defineProperty($e,"scrypt",{enumerable:!0,get:function(){return Lu.scrypt}});Object.defineProperty($e,"scryptSync",{enumerable:!0,get:function(){return Lu.scryptSync}});var Mu=n2();Object.defineProperty($e,"sha256",{enumerable:!0,get:function(){return Mu.sha256}});Object.defineProperty($e,"sha512",{enumerable:!0,get:function(){return Mu.sha512}});var T7=Y2();Object.defineProperty($e,"SigningKey",{enumerable:!0,get:function(){return T7.SigningKey}});var B7=Gd();Object.defineProperty($e,"Signature",{enumerable:!0,get:function(){return B7.Signature}});function O7(){Z2.computeHmac.lock(),X2.keccak256.lock(),tw.pbkdf2.lock(),Kd.randomBytes.lock(),ew.ripemd160.lock(),Lu.scrypt.lock(),Lu.scryptSync.lock(),Mu.sha256.lock(),Mu.sha512.lock(),Kd.randomBytes.lock()}$e.lock=O7});var ju=P(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.getIcapAddress=Ji.getAddress=void 0;var S7=xt(),va=$(),C7=BigInt(0),N7=BigInt(36);function rw(r){r=r.toLowerCase();let e=r.substring(2).split(""),t=new Uint8Array(40);for(let s=0;s<40;s++)t[s]=e[s].charCodeAt(0);let n=(0,va.getBytes)((0,S7.keccak256)(t));for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&(e[s]=e[s].toUpperCase()),(n[s>>1]&15)>=8&&(e[s+1]=e[s+1].toUpperCase());return"0x"+e.join("")}var Vd={};for(let r=0;r<10;r++)Vd[String(r)]=String(r);for(let r=0;r<26;r++)Vd[String.fromCharCode(65+r)]=String(10+r);var nw=15;function sw(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(n=>Vd[n]).join("");for(;e.length>=nw;){let n=e.substring(0,nw);e=parseInt(n,10)%97+e.substring(n.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}var I7=function(){let r={};for(let e=0;e<36;e++){let t="0123456789abcdefghijklmnopqrstuvwxyz"[e];r[t]=BigInt(e)}return r}();function R7(r){r=r.toLowerCase();let e=C7;for(let t=0;t<r.length;t++)e=e*N7+I7[r[t]];return e}function iw(r){if((0,va.assertArgument)(typeof r=="string","invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/)){r.startsWith("0x")||(r="0x"+r);let e=rw(r);return(0,va.assertArgument)(!r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===r,"bad address checksum","address",r),e}if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){(0,va.assertArgument)(r.substring(2,4)===sw(r),"bad icap checksum","address",r);let e=R7(r.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return rw("0x"+e)}(0,va.assertArgument)(!1,"invalid address","address",r)}Ji.getAddress=iw;function L7(r){let e=BigInt(iw(r)).toString(36).toUpperCase();for(;e.length<30;)e="0"+e;return"XE"+sw("XE00"+e)+e}Ji.getIcapAddress=L7});var aw=P(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.getCreate2Address=Qi.getCreateAddress=void 0;var ow=xt(),Sn=$(),Uu=ju();function M7(r){let e=(0,Uu.getAddress)(r.from),n=(0,Sn.getBigInt)(r.nonce,"tx.nonce").toString(16);return n==="0"?n="0x":n.length%2?n="0x0"+n:n="0x"+n,(0,Uu.getAddress)((0,Sn.dataSlice)((0,ow.keccak256)((0,Sn.encodeRlp)([e,n])),12))}Qi.getCreateAddress=M7;function j7(r,e,t){let n=(0,Uu.getAddress)(r),s=(0,Sn.getBytes)(e,"salt"),i=(0,Sn.getBytes)(t,"initCodeHash");return(0,Sn.assertArgument)(s.length===32,"salt must be 32 bytes","salt",e),(0,Sn.assertArgument)(i.length===32,"initCodeHash must be 32 bytes","initCodeHash",t),(0,Uu.getAddress)((0,Sn.dataSlice)((0,ow.keccak256)((0,Sn.concat)(["0xff",n,s,i])),12))}Qi.getCreate2Address=j7});var uw=P(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.resolveAddress=as.isAddress=as.isAddressable=void 0;var Fu=$(),Jd=ju();function cw(r){return r&&typeof r.getAddress=="function"}as.isAddressable=cw;function U7(r){try{return(0,Jd.getAddress)(r),!0}catch{}return!1}as.isAddress=U7;async function $d(r,e){let t=await e;return(t==null||t==="0x0000000000000000000000000000000000000000")&&((0,Fu.assert)(typeof r!="string","unconfigured name","UNCONFIGURED_NAME",{value:r}),(0,Fu.assertArgument)(!1,"invalid AddressLike value; did not resolve to a value address","target",r)),(0,Jd.getAddress)(t)}function F7(r,e){if(typeof r=="string")return r.match(/^0x[0-9a-f]{40}$/i)?(0,Jd.getAddress)(r):((0,Fu.assert)(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),$d(r,e.resolveName(r)));if(cw(r))return $d(r,r.getAddress());if(r&&typeof r.then=="function")return $d(r,r);(0,Fu.assertArgument)(!1,"unsupported addressable value","target",r)}as.resolveAddress=F7});var ht=P(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.resolveAddress=jt.isAddress=jt.isAddressable=jt.getCreate2Address=jt.getCreateAddress=jt.getIcapAddress=jt.getAddress=void 0;var lw=ju();Object.defineProperty(jt,"getAddress",{enumerable:!0,get:function(){return lw.getAddress}});Object.defineProperty(jt,"getIcapAddress",{enumerable:!0,get:function(){return lw.getIcapAddress}});var fw=aw();Object.defineProperty(jt,"getCreateAddress",{enumerable:!0,get:function(){return fw.getCreateAddress}});Object.defineProperty(jt,"getCreate2Address",{enumerable:!0,get:function(){return fw.getCreate2Address}});var Qd=uw();Object.defineProperty(jt,"isAddressable",{enumerable:!0,get:function(){return Qd.isAddressable}});Object.defineProperty(jt,"isAddress",{enumerable:!0,get:function(){return Qd.isAddress}});Object.defineProperty(jt,"resolveAddress",{enumerable:!0,get:function(){return Qd.resolveAddress}})});var hn=P(Du=>{"use strict";Object.defineProperty(Du,"__esModule",{value:!0});Du.Typed=void 0;var dw=$(),Yr={};function Q(r,e){let t=!1;return e<0&&(t=!0,e*=-1),new _a(Yr,`${t?"":"u"}int${e}`,r,{signed:t,width:e})}function Ne(r,e){return new _a(Yr,`bytes${e||""}`,r,{size:e})}var hw=Symbol.for("_ethers_typed"),_a=class r{type;value;#e;_typedSymbol;constructor(e,t,n,s){s==null&&(s=null),(0,dw.assertPrivate)(Yr,e,"Typed"),(0,dw.defineProperties)(this,{_typedSymbol:hw,type:t,value:n}),this.#e=s,this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return this.#e}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return this.#e===!0?-1:this.#e===!1?this.value.length:null}static from(e,t){return new r(Yr,e,t)}static uint8(e){return Q(e,8)}static uint16(e){return Q(e,16)}static uint24(e){return Q(e,24)}static uint32(e){return Q(e,32)}static uint40(e){return Q(e,40)}static uint48(e){return Q(e,48)}static uint56(e){return Q(e,56)}static uint64(e){return Q(e,64)}static uint72(e){return Q(e,72)}static uint80(e){return Q(e,80)}static uint88(e){return Q(e,88)}static uint96(e){return Q(e,96)}static uint104(e){return Q(e,104)}static uint112(e){return Q(e,112)}static uint120(e){return Q(e,120)}static uint128(e){return Q(e,128)}static uint136(e){return Q(e,136)}static uint144(e){return Q(e,144)}static uint152(e){return Q(e,152)}static uint160(e){return Q(e,160)}static uint168(e){return Q(e,168)}static uint176(e){return Q(e,176)}static uint184(e){return Q(e,184)}static uint192(e){return Q(e,192)}static uint200(e){return Q(e,200)}static uint208(e){return Q(e,208)}static uint216(e){return Q(e,216)}static uint224(e){return Q(e,224)}static uint232(e){return Q(e,232)}static uint240(e){return Q(e,240)}static uint248(e){return Q(e,248)}static uint256(e){return Q(e,256)}static uint(e){return Q(e,256)}static int8(e){return Q(e,-8)}static int16(e){return Q(e,-16)}static int24(e){return Q(e,-24)}static int32(e){return Q(e,-32)}static int40(e){return Q(e,-40)}static int48(e){return Q(e,-48)}static int56(e){return Q(e,-56)}static int64(e){return Q(e,-64)}static int72(e){return Q(e,-72)}static int80(e){return Q(e,-80)}static int88(e){return Q(e,-88)}static int96(e){return Q(e,-96)}static int104(e){return Q(e,-104)}static int112(e){return Q(e,-112)}static int120(e){return Q(e,-120)}static int128(e){return Q(e,-128)}static int136(e){return Q(e,-136)}static int144(e){return Q(e,-144)}static int152(e){return Q(e,-152)}static int160(e){return Q(e,-160)}static int168(e){return Q(e,-168)}static int176(e){return Q(e,-176)}static int184(e){return Q(e,-184)}static int192(e){return Q(e,-192)}static int200(e){return Q(e,-200)}static int208(e){return Q(e,-208)}static int216(e){return Q(e,-216)}static int224(e){return Q(e,-224)}static int232(e){return Q(e,-232)}static int240(e){return Q(e,-240)}static int248(e){return Q(e,-248)}static int256(e){return Q(e,-256)}static int(e){return Q(e,-256)}static bytes1(e){return Ne(e,1)}static bytes2(e){return Ne(e,2)}static bytes3(e){return Ne(e,3)}static bytes4(e){return Ne(e,4)}static bytes5(e){return Ne(e,5)}static bytes6(e){return Ne(e,6)}static bytes7(e){return Ne(e,7)}static bytes8(e){return Ne(e,8)}static bytes9(e){return Ne(e,9)}static bytes10(e){return Ne(e,10)}static bytes11(e){return Ne(e,11)}static bytes12(e){return Ne(e,12)}static bytes13(e){return Ne(e,13)}static bytes14(e){return Ne(e,14)}static bytes15(e){return Ne(e,15)}static bytes16(e){return Ne(e,16)}static bytes17(e){return Ne(e,17)}static bytes18(e){return Ne(e,18)}static bytes19(e){return Ne(e,19)}static bytes20(e){return Ne(e,20)}static bytes21(e){return Ne(e,21)}static bytes22(e){return Ne(e,22)}static bytes23(e){return Ne(e,23)}static bytes24(e){return Ne(e,24)}static bytes25(e){return Ne(e,25)}static bytes26(e){return Ne(e,26)}static bytes27(e){return Ne(e,27)}static bytes28(e){return Ne(e,28)}static bytes29(e){return Ne(e,29)}static bytes30(e){return Ne(e,30)}static bytes31(e){return Ne(e,31)}static bytes32(e){return Ne(e,32)}static address(e){return new r(Yr,"address",e)}static bool(e){return new r(Yr,"bool",!!e)}static bytes(e){return new r(Yr,"bytes",e)}static string(e){return new r(Yr,"string",e)}static array(e,t){throw new Error("not implemented yet")}static tuple(e,t){throw new Error("not implemented yet")}static overrides(e){return new r(Yr,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===hw}static dereference(e,t){if(r.isTyped(e)){if(e.type!==t)throw new Error(`invalid type: expecetd ${t}, got ${e.type}`);return e.value}return e}};Du.Typed=_a});var gw=P(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.AddressCoder=void 0;var pw=ht(),D7=yi(),H7=hn(),q7=Ar(),Wd=class extends q7.Coder{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){let n=H7.Typed.dereference(t,"string");try{n=(0,pw.getAddress)(n)}catch(s){return this._throwError(s.message,t)}return e.writeValue(n)}decode(e){return(0,pw.getAddress)((0,D7.toBeHex)(e.readValue(),20))}};Hu.AddressCoder=Wd});var bw=P(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.AnonymousCoder=void 0;var G7=Ar(),Yd=class extends G7.Coder{coder;constructor(e){super(e.name,e.type,"_",e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}};qu.AnonymousCoder=Yd});var Xd=P(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.ArrayCoder=cs.unpack=cs.pack=void 0;var Cn=$(),z7=hn(),Wi=Ar(),K7=bw();function xw(r,e,t){let n=[];if(Array.isArray(t))n=t;else if(t&&typeof t=="object"){let c={};n=e.map(u=>{let l=u.localName;return(0,Cn.assert)(l,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:t}),(0,Cn.assert)(!c[l],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:u},value:t}),c[l]=!0,t[l]})}else(0,Cn.assertArgument)(!1,"invalid tuple value","tuple",t);(0,Cn.assertArgument)(e.length===n.length,"types/value length mismatch","tuple",t);let s=new Wi.Writer,i=new Wi.Writer,o=[];e.forEach((c,u)=>{let l=n[u];if(c.dynamic){let f=i.length;c.encode(i,l);let h=s.writeUpdatableValue();o.push(g=>{h(g+f)})}else c.encode(s,l)}),o.forEach(c=>{c(s.length)});let a=r.appendWriter(s);return a+=r.appendWriter(i),a}cs.pack=xw;function mw(r,e){let t=[],n=[],s=r.subReader(0);return e.forEach(i=>{let o=null;if(i.dynamic){let a=r.readIndex(),c=s.subReader(a);try{o=i.decode(c)}catch(u){if((0,Cn.isError)(u,"BUFFER_OVERRUN"))throw u;o=u,o.baseType=i.name,o.name=i.localName,o.type=i.type}}else try{o=i.decode(r)}catch(a){if((0,Cn.isError)(a,"BUFFER_OVERRUN"))throw a;o=a,o.baseType=i.name,o.name=i.localName,o.type=i.type}if(o==null)throw new Error("investigate");t.push(o),n.push(i.localName||null)}),Wi.Result.fromItems(t,n)}cs.unpack=mw;var Zd=class extends Wi.Coder{coder;length;constructor(e,t,n){let s=e.type+"["+(t>=0?t:"")+"]",i=t===-1||e.dynamic;super("array",s,n,i),(0,Cn.defineProperties)(this,{coder:e,length:t})}defaultValue(){let e=this.coder.defaultValue(),t=[];for(let n=0;n<this.length;n++)t.push(e);return t}encode(e,t){let n=z7.Typed.dereference(t,"array");Array.isArray(n)||this._throwError("expected array value",n);let s=this.length;s===-1&&(s=n.length,e.writeValue(n.length)),(0,Cn.assertArgumentCount)(n.length,s,"coder array"+(this.localName?" "+this.localName:""));let i=[];for(let o=0;o<n.length;o++)i.push(this.coder);return xw(e,i,n)}decode(e){let t=this.length;t===-1&&(t=e.readIndex(),(0,Cn.assert)(t*Wi.WordSize<=e.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:e.bytes,offset:t*Wi.WordSize,length:e.dataLength}));let n=[];for(let s=0;s<t;s++)n.push(new K7.AnonymousCoder(this.coder));return mw(e,n)}};cs.ArrayCoder=Zd});var yw=P(Gu=>{"use strict";Object.defineProperty(Gu,"__esModule",{value:!0});Gu.BooleanCoder=void 0;var V7=hn(),$7=Ar(),eh=class extends $7.Coder{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){let n=V7.Typed.dereference(t,"bool");return e.writeValue(n?1:0)}decode(e){return!!e.readValue()}};Gu.BooleanCoder=eh});var rh=P(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.BytesCoder=Yi.DynamicBytesCoder=void 0;var ww=$(),J7=Ar(),zu=class extends J7.Coder{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=(0,ww.getBytesCopy)(t);let n=e.writeValue(t.length);return n+=e.writeBytes(t),n}decode(e){return e.readBytes(e.readIndex(),!0)}};Yi.DynamicBytesCoder=zu;var th=class extends zu{constructor(e){super("bytes",e)}decode(e){return(0,ww.hexlify)(super.decode(e))}};Yi.BytesCoder=th});var Aw=P(Ku=>{"use strict";Object.defineProperty(Ku,"__esModule",{value:!0});Ku.FixedBytesCoder=void 0;var nh=$(),Q7=hn(),W7=Ar(),sh=class extends W7.Coder{size;constructor(e,t){let n="bytes"+String(e);super(n,n,t,!1),(0,nh.defineProperties)(this,{size:e},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(e,t){let n=(0,nh.getBytesCopy)(Q7.Typed.dereference(t,this.type));return n.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(n)}decode(e){return(0,nh.hexlify)(e.readBytes(this.size))}};Ku.FixedBytesCoder=sh});var Ew=P(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});Vu.NullCoder=void 0;var Y7=Ar(),Z7=new Uint8Array([]),ih=class extends Y7.Coder{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return t!=null&&this._throwError("not null",t),e.writeBytes(Z7)}decode(e){return e.readBytes(0),null}};Vu.NullCoder=ih});var Pw=P($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.NumberCoder=void 0;var us=$(),X7=hn(),oh=Ar(),ev=BigInt(0),tv=BigInt(1),rv=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),ah=class extends oh.Coder{size;signed;constructor(e,t,n){let s=(t?"int":"uint")+e*8;super(s,s,n,!1),(0,us.defineProperties)(this,{size:e,signed:t},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(e,t){let n=(0,us.getBigInt)(X7.Typed.dereference(t,this.type)),s=(0,us.mask)(rv,oh.WordSize*8);if(this.signed){let i=(0,us.mask)(s,this.size*8-1);(n>i||n<-(i+tv))&&this._throwError("value out-of-bounds",t),n=(0,us.toTwos)(n,8*oh.WordSize)}else(n<ev||n>(0,us.mask)(s,this.size*8))&&this._throwError("value out-of-bounds",t);return e.writeValue(n)}decode(e){let t=(0,us.mask)(e.readValue(),this.size*8);return this.signed&&(t=(0,us.fromTwos)(t,this.size*8)),t}};$u.NumberCoder=ah});var _w=P(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.StringCoder=void 0;var vw=Fc(),nv=hn(),sv=rh(),ch=class extends sv.DynamicBytesCoder{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,(0,vw.toUtf8Bytes)(nv.Typed.dereference(t,"string")))}decode(e){return(0,vw.toUtf8String)(super.decode(e))}};Ju.StringCoder=ch});var Tw=P(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.TupleCoder=void 0;var iv=Jn(),ov=hn(),av=Ar(),kw=Xd(),uh=class extends av.Coder{coders;constructor(e,t){let n=!1,s=[];e.forEach(o=>{o.dynamic&&(n=!0),s.push(o.type)});let i="tuple("+s.join(",")+")";super("tuple",i,t,n),(0,iv.defineProperties)(this,{coders:Object.freeze(e.slice())})}defaultValue(){let e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});let t=this.coders.reduce((n,s)=>{let i=s.localName;return i&&(n[i]||(n[i]=0),n[i]++),n},{});return this.coders.forEach((n,s)=>{let i=n.localName;!i||t[i]!==1||(i==="length"&&(i="_length"),e[i]==null&&(e[i]=e[s]))}),Object.freeze(e)}encode(e,t){let n=ov.Typed.dereference(t,"tuple");return(0,kw.pack)(e,this.coders,n)}decode(e){return(0,kw.unpack)(e,this.coders)}};Qu.TupleCoder=uh});var fh=P(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.accessListify=void 0;var cv=ht(),ka=$();function lh(r,e){return{address:(0,cv.getAddress)(r),storageKeys:e.map((t,n)=>((0,ka.assertArgument)((0,ka.isHexString)(t,32),"invalid slot",`storageKeys[${n}]`,t),t.toLowerCase()))}}function uv(r){if(Array.isArray(r))return r.map((t,n)=>Array.isArray(t)?((0,ka.assertArgument)(t.length===2,"invalid slot set",`value[${n}]`,t),lh(t[0],t[1])):((0,ka.assertArgument)(t!=null&&typeof t=="object","invalid address-slot set","value",r),lh(t.address,t.storageKeys)));(0,ka.assertArgument)(r!=null&&typeof r=="object","invalid access list","value",r);let e=Object.keys(r).map(t=>{let n=r[t].reduce((s,i)=>(s[i]=!0,s),{});return lh(t,Object.keys(n).sort())});return e.sort((t,n)=>t.address.localeCompare(n.address)),e}Wu.accessListify=uv});var dh=P(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});Yu.authorizationify=void 0;var lv=ht(),fv=xt(),Bw=$();function dv(r){return{address:(0,lv.getAddress)(r.address),nonce:(0,Bw.getBigInt)(r.nonce!=null?r.nonce:0),chainId:(0,Bw.getBigInt)(r.chainId!=null?r.chainId:0),signature:fv.Signature.from(r.signature)}}Yu.authorizationify=dv});var ph=P(Zi=>{"use strict";Object.defineProperty(Zi,"__esModule",{value:!0});Zi.recoverAddress=Zi.computeAddress=void 0;var hv=ht(),hh=xt();function Ow(r){let e;return typeof r=="string"?e=hh.SigningKey.computePublicKey(r,!1):e=r.publicKey,(0,hv.getAddress)((0,hh.keccak256)("0x"+e.substring(4)).substring(26))}Zi.computeAddress=Ow;function pv(r,e){return Ow(hh.SigningKey.recoverPublicKey(r,e))}Zi.recoverAddress=pv});var Iw=P(tl=>{"use strict";Object.defineProperty(tl,"__esModule",{value:!0});tl.Transaction=void 0;var Cw=ht(),Nw=Hd(),pn=xt(),R=$(),xh=fh(),gv=dh(),bv=ph(),Nt=BigInt(0),xv=BigInt(2),mv=BigInt(27),yv=BigInt(28),wv=BigInt(35),Av=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),gh=4096*32;function Ev(r){return{blobToKzgCommitment:n=>{if("computeBlobProof"in r){if("blobToKzgCommitment"in r&&typeof r.blobToKzgCommitment=="function")return(0,R.getBytes)(r.blobToKzgCommitment((0,R.hexlify)(n)))}else if("blobToKzgCommitment"in r&&typeof r.blobToKzgCommitment=="function")return(0,R.getBytes)(r.blobToKzgCommitment(n));if("blobToKZGCommitment"in r&&typeof r.blobToKZGCommitment=="function")return(0,R.getBytes)(r.blobToKZGCommitment((0,R.hexlify)(n)));(0,R.assertArgument)(!1,"unsupported KZG library","kzg",r)},computeBlobKzgProof:(n,s)=>{if("computeBlobProof"in r&&typeof r.computeBlobProof=="function")return(0,R.getBytes)(r.computeBlobProof((0,R.hexlify)(n),(0,R.hexlify)(s)));if("computeBlobKzgProof"in r&&typeof r.computeBlobKzgProof=="function")return r.computeBlobKzgProof(n,s);if("computeBlobKZGProof"in r&&typeof r.computeBlobKZGProof=="function")return(0,R.getBytes)(r.computeBlobKZGProof((0,R.hexlify)(n),(0,R.hexlify)(s)));(0,R.assertArgument)(!1,"unsupported KZG library","kzg",r)}}}function Sw(r,e){let t=r.toString(16);for(;t.length<2;)t="0"+t;return t+=(0,pn.sha256)(e).substring(4),"0x"+t}function Xi(r){return r==="0x"?null:(0,Cw.getAddress)(r)}function Zu(r,e){try{return(0,xh.accessListify)(r)}catch(t){(0,R.assertArgument)(!1,t.message,e,r)}}function Pv(r,e){try{if(!Array.isArray(r))throw new Error("authorizationList: invalid array");let t=[];for(let n=0;n<r.length;n++){let s=r[n];if(!Array.isArray(s))throw new Error(`authorization[${n}]: invalid array`);if(s.length!==6)throw new Error(`authorization[${n}]: wrong length`);if(!s[1])throw new Error(`authorization[${n}]: null address`);t.push({address:Xi(s[1]),nonce:qe(s[2],"nonce"),chainId:qe(s[0],"chainId"),signature:pn.Signature.from({yParity:js(s[3],"yParity"),r:(0,R.zeroPadValue)(s[4],32),s:(0,R.zeroPadValue)(s[5],32)})})}return t}catch(t){(0,R.assertArgument)(!1,t.message,e,r)}}function js(r,e){return r==="0x"?0:(0,R.getNumber)(r,e)}function qe(r,e){if(r==="0x")return Nt;let t=(0,R.getBigInt)(r,e);return(0,R.assertArgument)(t<=Av,"value exceeds uint size",e,t),t}function Be(r,e){let t=(0,R.getBigInt)(r,"value"),n=(0,R.toBeArray)(t);return(0,R.assertArgument)(n.length<=32,"value too large",`tx.${e}`,t),n}function Xu(r){return(0,xh.accessListify)(r).map(e=>[e.address,e.storageKeys])}function vv(r){return r.map(e=>[Be(e.chainId,"chainId"),e.address,Be(e.nonce,"nonce"),Be(e.signature.yParity,"yParity"),(0,R.toBeArray)(e.signature.r),(0,R.toBeArray)(e.signature.s)])}function _v(r,e){(0,R.assertArgument)(Array.isArray(r),`invalid ${e}`,"value",r);for(let t=0;t<r.length;t++)(0,R.assertArgument)((0,R.isHexString)(r[t],32),"invalid ${ param } hash",`value[${t}]`,r[t]);return r}function kv(r){let e=(0,R.decodeRlp)(r);(0,R.assertArgument)(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",r);let t={type:0,nonce:js(e[0],"nonce"),gasPrice:qe(e[1],"gasPrice"),gasLimit:qe(e[2],"gasLimit"),to:Xi(e[3]),value:qe(e[4],"value"),data:(0,R.hexlify)(e[5]),chainId:Nt};if(e.length===6)return t;let n=qe(e[6],"v"),s=qe(e[7],"r"),i=qe(e[8],"s");if(s===Nt&&i===Nt)t.chainId=n;else{let o=(n-wv)/xv;o<Nt&&(o=Nt),t.chainId=o,(0,R.assertArgument)(o!==Nt||n===mv||n===yv,"non-canonical legacy v","v",e[6]),t.signature=pn.Signature.from({r:(0,R.zeroPadValue)(e[7],32),s:(0,R.zeroPadValue)(e[8],32),v:n})}return t}function Tv(r,e){let t=[Be(r.nonce,"nonce"),Be(r.gasPrice||0,"gasPrice"),Be(r.gasLimit,"gasLimit"),r.to||"0x",Be(r.value,"value"),r.data],n=Nt;if(r.chainId!=Nt)n=(0,R.getBigInt)(r.chainId,"tx.chainId"),(0,R.assertArgument)(!e||e.networkV==null||e.legacyChainId===n,"tx.chainId/sig.v mismatch","sig",e);else if(r.signature){let i=r.signature.legacyChainId;i!=null&&(n=i)}if(!e)return n!==Nt&&(t.push((0,R.toBeArray)(n)),t.push("0x"),t.push("0x")),(0,R.encodeRlp)(t);let s=BigInt(27+e.yParity);return n!==Nt?s=pn.Signature.getChainIdV(n,e.v):BigInt(e.v)!==s&&(0,R.assertArgument)(!1,"tx.chainId/sig.v mismatch","sig",e),t.push((0,R.toBeArray)(s)),t.push((0,R.toBeArray)(e.r)),t.push((0,R.toBeArray)(e.s)),(0,R.encodeRlp)(t)}function el(r,e){let t;try{if(t=js(e[0],"yParity"),t!==0&&t!==1)throw new Error("bad yParity")}catch{(0,R.assertArgument)(!1,"invalid yParity","yParity",e[0])}let n=(0,R.zeroPadValue)(e[1],32),s=(0,R.zeroPadValue)(e[2],32),i=pn.Signature.from({r:n,s,yParity:t});r.signature=i}function Bv(r){let e=(0,R.decodeRlp)((0,R.getBytes)(r).slice(1));(0,R.assertArgument)(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",(0,R.hexlify)(r));let t={type:2,chainId:qe(e[0],"chainId"),nonce:js(e[1],"nonce"),maxPriorityFeePerGas:qe(e[2],"maxPriorityFeePerGas"),maxFeePerGas:qe(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:qe(e[4],"gasLimit"),to:Xi(e[5]),value:qe(e[6],"value"),data:(0,R.hexlify)(e[7]),accessList:Zu(e[8],"accessList")};return e.length===9||el(t,e.slice(9)),t}function Ov(r,e){let t=[Be(r.chainId,"chainId"),Be(r.nonce,"nonce"),Be(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Be(r.maxFeePerGas||0,"maxFeePerGas"),Be(r.gasLimit,"gasLimit"),r.to||"0x",Be(r.value,"value"),r.data,Xu(r.accessList||[])];return e&&(t.push(Be(e.yParity,"yParity")),t.push((0,R.toBeArray)(e.r)),t.push((0,R.toBeArray)(e.s))),(0,R.concat)(["0x02",(0,R.encodeRlp)(t)])}function Sv(r){let e=(0,R.decodeRlp)((0,R.getBytes)(r).slice(1));(0,R.assertArgument)(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",(0,R.hexlify)(r));let t={type:1,chainId:qe(e[0],"chainId"),nonce:js(e[1],"nonce"),gasPrice:qe(e[2],"gasPrice"),gasLimit:qe(e[3],"gasLimit"),to:Xi(e[4]),value:qe(e[5],"value"),data:(0,R.hexlify)(e[6]),accessList:Zu(e[7],"accessList")};return e.length===8||el(t,e.slice(8)),t}function Cv(r,e){let t=[Be(r.chainId,"chainId"),Be(r.nonce,"nonce"),Be(r.gasPrice||0,"gasPrice"),Be(r.gasLimit,"gasLimit"),r.to||"0x",Be(r.value,"value"),r.data,Xu(r.accessList||[])];return e&&(t.push(Be(e.yParity,"recoveryParam")),t.push((0,R.toBeArray)(e.r)),t.push((0,R.toBeArray)(e.s))),(0,R.concat)(["0x01",(0,R.encodeRlp)(t)])}function Nv(r){let e=(0,R.decodeRlp)((0,R.getBytes)(r).slice(1)),t="3",n=null;if(e.length===4&&Array.isArray(e[0])){t="3 (network format)";let i=e[1],o=e[2],a=e[3];(0,R.assertArgument)(Array.isArray(i),"invalid network format: blobs not an array","fields[1]",i),(0,R.assertArgument)(Array.isArray(o),"invalid network format: commitments not an array","fields[2]",o),(0,R.assertArgument)(Array.isArray(a),"invalid network format: proofs not an array","fields[3]",a),(0,R.assertArgument)(i.length===o.length,"invalid network format: blobs/commitments length mismatch","fields",e),(0,R.assertArgument)(i.length===a.length,"invalid network format: blobs/proofs length mismatch","fields",e),n=[];for(let c=0;c<e[1].length;c++)n.push({data:i[c],commitment:o[c],proof:a[c]});e=e[0]}(0,R.assertArgument)(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${t}`,"data",(0,R.hexlify)(r));let s={type:3,chainId:qe(e[0],"chainId"),nonce:js(e[1],"nonce"),maxPriorityFeePerGas:qe(e[2],"maxPriorityFeePerGas"),maxFeePerGas:qe(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:qe(e[4],"gasLimit"),to:Xi(e[5]),value:qe(e[6],"value"),data:(0,R.hexlify)(e[7]),accessList:Zu(e[8],"accessList"),maxFeePerBlobGas:qe(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10]};n&&(s.blobs=n),(0,R.assertArgument)(s.to!=null,`invalid address for transaction type: ${t}`,"data",r),(0,R.assertArgument)(Array.isArray(s.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",r);for(let i=0;i<s.blobVersionedHashes.length;i++)(0,R.assertArgument)((0,R.isHexString)(s.blobVersionedHashes[i],32),`invalid blobVersionedHash at index ${i}: must be length 32`,"data",r);return e.length===11||el(s,e.slice(11)),s}function Iv(r,e,t){let n=[Be(r.chainId,"chainId"),Be(r.nonce,"nonce"),Be(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Be(r.maxFeePerGas||0,"maxFeePerGas"),Be(r.gasLimit,"gasLimit"),r.to||Nw.ZeroAddress,Be(r.value,"value"),r.data,Xu(r.accessList||[]),Be(r.maxFeePerBlobGas||0,"maxFeePerBlobGas"),_v(r.blobVersionedHashes||[],"blobVersionedHashes")];return e&&(n.push(Be(e.yParity,"yParity")),n.push((0,R.toBeArray)(e.r)),n.push((0,R.toBeArray)(e.s)),t)?(0,R.concat)(["0x03",(0,R.encodeRlp)([n,t.map(s=>s.data),t.map(s=>s.commitment),t.map(s=>s.proof)])]):(0,R.concat)(["0x03",(0,R.encodeRlp)(n)])}function Rv(r){let e=(0,R.decodeRlp)((0,R.getBytes)(r).slice(1));(0,R.assertArgument)(Array.isArray(e)&&(e.length===10||e.length===13),"invalid field count for transaction type: 4","data",(0,R.hexlify)(r));let t={type:4,chainId:qe(e[0],"chainId"),nonce:js(e[1],"nonce"),maxPriorityFeePerGas:qe(e[2],"maxPriorityFeePerGas"),maxFeePerGas:qe(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:qe(e[4],"gasLimit"),to:Xi(e[5]),value:qe(e[6],"value"),data:(0,R.hexlify)(e[7]),accessList:Zu(e[8],"accessList"),authorizationList:Pv(e[9],"authorizationList")};return e.length===10||el(t,e.slice(10)),t}function Lv(r,e){let t=[Be(r.chainId,"chainId"),Be(r.nonce,"nonce"),Be(r.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Be(r.maxFeePerGas||0,"maxFeePerGas"),Be(r.gasLimit,"gasLimit"),r.to||"0x",Be(r.value,"value"),r.data,Xu(r.accessList||[]),vv(r.authorizationList||[])];return e&&(t.push(Be(e.yParity,"yParity")),t.push((0,R.toBeArray)(e.r)),t.push((0,R.toBeArray)(e.s))),(0,R.concat)(["0x04",(0,R.encodeRlp)(t)])}var bh=class r{#e;#t;#r;#n;#s;#o;#i;#a;#f;#u;#p;#g;#c;#l;#d;#h;#x;get type(){return this.#e}set type(e){switch(e){case null:this.#e=null;break;case 0:case"legacy":this.#e=0;break;case 1:case"berlin":case"eip-2930":this.#e=1;break;case 2:case"london":case"eip-1559":this.#e=2;break;case 3:case"cancun":case"eip-4844":this.#e=3;break;case 4:case"pectra":case"eip-7702":this.#e=4;break;default:(0,R.assertArgument)(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){let e=this.#t;return e==null&&this.type===3?Nw.ZeroAddress:e}set to(e){this.#t=e==null?null:(0,Cw.getAddress)(e)}get nonce(){return this.#n}set nonce(e){this.#n=(0,R.getNumber)(e,"value")}get gasLimit(){return this.#s}set gasLimit(e){this.#s=(0,R.getBigInt)(e)}get gasPrice(){let e=this.#o;return e==null&&(this.type===0||this.type===1)?Nt:e}set gasPrice(e){this.#o=e==null?null:(0,R.getBigInt)(e,"gasPrice")}get maxPriorityFeePerGas(){let e=this.#i;return e??(this.type===2||this.type===3?Nt:null)}set maxPriorityFeePerGas(e){this.#i=e==null?null:(0,R.getBigInt)(e,"maxPriorityFeePerGas")}get maxFeePerGas(){let e=this.#a;return e??(this.type===2||this.type===3?Nt:null)}set maxFeePerGas(e){this.#a=e==null?null:(0,R.getBigInt)(e,"maxFeePerGas")}get data(){return this.#r}set data(e){this.#r=(0,R.hexlify)(e)}get value(){return this.#f}set value(e){this.#f=(0,R.getBigInt)(e,"value")}get chainId(){return this.#u}set chainId(e){this.#u=(0,R.getBigInt)(e)}get signature(){return this.#p||null}set signature(e){this.#p=e==null?null:pn.Signature.from(e)}get accessList(){let e=this.#g||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){this.#g=e==null?null:(0,xh.accessListify)(e)}get authorizationList(){let e=this.#x||null;return e==null&&this.type===4?[]:e}set authorizationList(e){this.#x=e==null?null:e.map(t=>(0,gv.authorizationify)(t))}get maxFeePerBlobGas(){let e=this.#c;return e==null&&this.type===3?Nt:e}set maxFeePerBlobGas(e){this.#c=e==null?null:(0,R.getBigInt)(e,"maxFeePerBlobGas")}get blobVersionedHashes(){let e=this.#l;return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){(0,R.assertArgument)(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let t=0;t<e.length;t++)(0,R.assertArgument)((0,R.isHexString)(e[t],32),"invalid blobVersionedHash",`value[${t}]`,e[t])}this.#l=e}get blobs(){return this.#h==null?null:this.#h.map(e=>Object.assign({},e))}set blobs(e){if(e==null){this.#h=null;return}let t=[],n=[];for(let s=0;s<e.length;s++){let i=e[s];if((0,R.isBytesLike)(i)){(0,R.assert)(this.#d,"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let o=(0,R.getBytes)(i);if((0,R.assertArgument)(o.length<=gh,"blob is too large",`blobs[${s}]`,i),o.length!==gh){let u=new Uint8Array(gh);u.set(o),o=u}let a=this.#d.blobToKzgCommitment(o),c=(0,R.hexlify)(this.#d.computeBlobKzgProof(o,a));t.push({data:(0,R.hexlify)(o),commitment:(0,R.hexlify)(a),proof:c}),n.push(Sw(1,a))}else{let o=(0,R.hexlify)(i.commitment);t.push({data:(0,R.hexlify)(i.data),commitment:o,proof:(0,R.hexlify)(i.proof)}),n.push(Sw(1,o))}}this.#h=t,this.#l=n}get kzg(){return this.#d}set kzg(e){e==null?this.#d=null:this.#d=Ev(e)}constructor(){this.#e=null,this.#t=null,this.#n=0,this.#s=Nt,this.#o=null,this.#i=null,this.#a=null,this.#r="0x",this.#f=Nt,this.#u=Nt,this.#p=null,this.#g=null,this.#c=null,this.#l=null,this.#d=null,this.#h=null,this.#x=null}get hash(){return this.signature==null?null:(0,pn.keccak256)(this.#b(!0,!1))}get unsignedHash(){return(0,pn.keccak256)(this.unsignedSerialized)}get from(){return this.signature==null?null:(0,bv.recoverAddress)(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:pn.SigningKey.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}#b(e,t){(0,R.assert)(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});let n=e?this.signature:null;switch(this.inferType()){case 0:return Tv(this,n);case 1:return Cv(this,n);case 2:return Ov(this,n);case 3:return Iv(this,n,t?this.blobs:null);case 4:return Lv(this,n)}(0,R.assert)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})}get serialized(){return this.#b(!0,!0)}get unsignedSerialized(){return this.#b(!1,!1)}inferType(){let e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){let e=this.gasPrice!=null,t=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,s=this.#c!=null||this.#l;this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&(0,R.assert)(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),(0,R.assert)(!t||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),(0,R.assert)(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});let i=[];return this.type!=null?i.push(this.type):this.authorizationList&&this.authorizationList.length?i.push(4):t?i.push(2):e?(i.push(1),n||i.push(0)):n?(i.push(1),i.push(2)):(s&&this.to||(i.push(0),i.push(1),i.push(2)),i.push(3)),i.sort(),i}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return r.from(this)}toJSON(){let e=t=>t==null?null:t.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new r;if(typeof e=="string"){let n=(0,R.getBytes)(e);if(n[0]>=127)return r.from(kv(n));switch(n[0]){case 1:return r.from(Sv(n));case 2:return r.from(Bv(n));case 3:return r.from(Nv(n));case 4:return r.from(Rv(n))}(0,R.assert)(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}let t=new r;return e.type!=null&&(t.type=e.type),e.to!=null&&(t.to=e.to),e.nonce!=null&&(t.nonce=e.nonce),e.gasLimit!=null&&(t.gasLimit=e.gasLimit),e.gasPrice!=null&&(t.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(t.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(t.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(t.data=e.data),e.value!=null&&(t.value=e.value),e.chainId!=null&&(t.chainId=e.chainId),e.signature!=null&&(t.signature=pn.Signature.from(e.signature)),e.accessList!=null&&(t.accessList=e.accessList),e.authorizationList!=null&&(t.authorizationList=e.authorizationList),e.blobVersionedHashes!=null&&(t.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(t.kzg=e.kzg),e.blobs!=null&&(t.blobs=e.blobs),e.hash!=null&&((0,R.assertArgument)(t.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),(0,R.assertArgument)(t.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&((0,R.assertArgument)(t.isSigned(),"unsigned transaction cannot define '.from'","tx",e),(0,R.assertArgument)(t.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),t}};tl.Transaction=bh});var Gt=P(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.Transaction=kr.recoverAddress=kr.computeAddress=kr.authorizationify=kr.accessListify=void 0;var Mv=fh();Object.defineProperty(kr,"accessListify",{enumerable:!0,get:function(){return Mv.accessListify}});var jv=dh();Object.defineProperty(kr,"authorizationify",{enumerable:!0,get:function(){return jv.authorizationify}});var Rw=ph();Object.defineProperty(kr,"computeAddress",{enumerable:!0,get:function(){return Rw.computeAddress}});Object.defineProperty(kr,"recoverAddress",{enumerable:!0,get:function(){return Rw.recoverAddress}});var Uv=Iw();Object.defineProperty(kr,"Transaction",{enumerable:!0,get:function(){return Uv.Transaction}})});var Mw=P(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.verifyAuthorization=eo.hashAuthorization=void 0;var Fv=ht(),Dv=xt(),Hv=Gt(),Ta=$();function Lw(r){return(0,Ta.assertArgument)(typeof r.address=="string","invalid address for hashAuthorization","auth.address",r),(0,Dv.keccak256)((0,Ta.concat)(["0x05",(0,Ta.encodeRlp)([r.chainId!=null?(0,Ta.toBeArray)(r.chainId):"0x",(0,Fv.getAddress)(r.address),r.nonce!=null?(0,Ta.toBeArray)(r.nonce):"0x"])]))}eo.hashAuthorization=Lw;function qv(r,e){return(0,Hv.recoverAddress)(Lw(r),e)}eo.verifyAuthorization=qv});var mh=P(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:!0});rl.id=void 0;var Gv=xt(),zv=$();function Kv(r){return(0,Gv.keccak256)((0,zv.toUtf8Bytes)(r))}rl.id=Kv});var dA=P(Tr=>{"use strict";var Vv="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI",jw=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),Uw=4;function $v(r){let e=0;function t(){return r[e++]<<8|r[e++]}let n=t(),s=1,i=[0,1];for(let L=1;L<n;L++)i.push(s+=t());let o=t(),a=e;e+=o;let c=0,u=0;function l(){return c==0&&(u=u<<8|r[e++],c=8),u>>--c&1}let f=31,h=2**f,g=h>>>1,x=g>>1,b=h-1,y=0;for(let L=0;L<f;L++)y=y<<1|l();let m=[],E=0,_=h;for(;;){let L=Math.floor(((y-E+1)*s-1)/_),A=0,O=n;for(;O-A>1;){let oe=A+O>>>1;L<i[oe]?O=oe:A=oe}if(A==0)break;m.push(A);let j=E+Math.floor(_*i[A]/s),X=E+Math.floor(_*i[A+1]/s)-1;for(;((j^X)&g)==0;)y=y<<1&b|l(),j=j<<1&b,X=X<<1&b|1;for(;j&~X&x;)y=y&g|y<<1&b>>>1|l(),j=j<<1^g,X=(X^g)<<1|g|1;E=j,_=1+X-j}let C=n-4;return m.map(L=>{switch(L-C){case 3:return C+65792+(r[a++]<<16|r[a++]<<8|r[a++]);case 2:return C+256+(r[a++]<<8|r[a++]);case 1:return C+r[a++];default:return L-1}})}function Jv(r){let e=0;return()=>r[e++]}function Gw(r){return Jv($v(Qv(r)))}function Qv(r){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((s,i)=>e[s.charCodeAt(0)]=i);let t=r.length,n=new Uint8Array(6*t>>3);for(let s=0,i=0,o=0,a=0;s<t;s++)a=a<<6|e[r.charCodeAt(s)],o+=6,o>=8&&(n[i++]=a>>(o-=8));return n}function Wv(r){return r&1?~r>>1:r>>1}function Yv(r,e){let t=Array(r);for(let n=0,s=0;n<r;n++)t[n]=s+=Wv(e());return t}function Ca(r,e=0){let t=[];for(;;){let n=r(),s=r();if(!s)break;e+=n;for(let i=0;i<s;i++)t.push(e+i);e+=s+1}return t}function zw(r){return Na(()=>{let e=Ca(r);if(e.length)return e})}function Kw(r){let e=[];for(;;){let t=r();if(t==0)break;e.push(Zv(t,r))}for(;;){let t=r()-1;if(t<0)break;e.push(Xv(t,r))}return e.flat()}function Na(r){let e=[];for(;;){let t=r(e.length);if(!t)break;e.push(t)}return e}function Vw(r,e,t){let n=Array(r).fill().map(()=>[]);for(let s=0;s<e;s++)Yv(r,t).forEach((i,o)=>n[o].push(i));return n}function Zv(r,e){let t=1+e(),n=e(),s=Na(e);return Vw(s.length,1+r,e).flatMap((o,a)=>{let[c,...u]=o;return Array(s[a]).fill().map((l,f)=>{let h=f*n;return[c+f*t,u.map(g=>g+h)]})})}function Xv(r,e){let t=1+e();return Vw(t,1+r,e).map(s=>[s[0],s.slice(1)])}function e9(r){let e=[],t=Ca(r);return s(n([]),[]),e;function n(i){let o=r(),a=Na(()=>{let c=Ca(r).map(u=>t[u]);if(c.length)return n(c)});return{S:o,B:a,Q:i}}function s({S:i,B:o},a,c){if(!(i&4&&c===a[a.length-1])){i&2&&(c=a[a.length-1]),i&1&&e.push(a);for(let u of o)for(let l of u.Q)s(u,[...a,l],c)}}}function t9(r){return r.toString(16).toUpperCase().padStart(2,"0")}function $w(r){return`{${t9(r)}}`}function Bh(r){let e=[];for(let t=0,n=r.length;t<n;){let s=r.codePointAt(t);t+=s<65536?1:2,e.push(s)}return e}function fs(r){let t=r.length;if(t<4096)return String.fromCodePoint(...r);let n=[];for(let s=0;s<t;)n.push(String.fromCodePoint(...r.slice(s,s+=4096)));return n.join("")}function Jw(r,e){let t=r.length,n=t-e.length;for(let s=0;n==0&&s<t;s++)n=r[s]-e[s];return n}var r9="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g",Ia=44032,sl=4352,il=4449,ol=4519,Qw=19,Ww=21,no=28,al=Ww*no,n9=Qw*al,s9=Ia+n9,i9=sl+Qw,o9=il+Ww,a9=ol+no;function Ba(r){return r>>24&255}function Yw(r){return r&16777215}var Eh,Fw,Ph,nl;function c9(){let r=Gw(r9);Eh=new Map(zw(r).flatMap((e,t)=>e.map(n=>[n,t+1<<24]))),Fw=new Set(Ca(r)),Ph=new Map,nl=new Map;for(let[e,t]of Kw(r)){if(!Fw.has(e)&&t.length==2){let[n,s]=t,i=nl.get(n);i||(i=new Map,nl.set(n,i)),i.set(s,e)}Ph.set(e,t.reverse())}}function Zw(r){return r>=Ia&&r<s9}function u9(r,e){if(r>=sl&&r<i9&&e>=il&&e<o9)return Ia+(r-sl)*al+(e-il)*no;if(Zw(r)&&e>ol&&e<a9&&(r-Ia)%no==0)return r+(e-ol);{let t=nl.get(r);return t&&(t=t.get(e),t)?t:-1}}function Xw(r){Eh||c9();let e=[],t=[],n=!1;function s(i){let o=Eh.get(i);o&&(n=!0,i|=o),e.push(i)}for(let i of r)for(;;){if(i<128)e.push(i);else if(Zw(i)){let o=i-Ia,a=o/al|0,c=o%al/no|0,u=o%no;s(sl+a),s(il+c),u>0&&s(ol+u)}else{let o=Ph.get(i);o?t.push(...o):s(i)}if(!t.length)break;i=t.pop()}if(n&&e.length>1){let i=Ba(e[0]);for(let o=1;o<e.length;o++){let a=Ba(e[o]);if(a==0||i<=a){i=a;continue}let c=o-1;for(;;){let u=e[c+1];if(e[c+1]=e[c],e[c]=u,!c||(i=Ba(e[--c]),i<=a))break}i=Ba(e[o])}}return e}function l9(r){let e=[],t=[],n=-1,s=0;for(let i of r){let o=Ba(i),a=Yw(i);if(n==-1)o==0?n=a:e.push(a);else if(s>0&&s>=o)o==0?(e.push(n,...t),t.length=0,n=a):t.push(a),s=o;else{let c=u9(n,a);c>=0?n=c:s==0&&o==0?(e.push(n),n=a):(t.push(a),s=o)}}return n>=0&&e.push(n,...t),e}function fl(r){return Xw(r).map(Yw)}function so(r){return l9(Xw(r))}var Dw=45,f9=46,cl=".",eA=65039,tA=1,ul=r=>Array.from(r);function Ra(r,e){return r.P.has(e)||r.Q.has(e)}var vh=class extends Array{get is_emoji(){return!0}},ll,Oh,Us,_h,rA,nA,ro,yh,to,ls,kh,Th;function io(){if(ll)return;let r=Gw(Vv),e=()=>Ca(r),t=()=>new Set(e()),n=(l,f)=>f.forEach(h=>l.add(h));ll=new Map(Kw(r)),Oh=t(),Us=e(),_h=new Set(e().map(l=>Us[l])),Us=new Set(Us),rA=t(),nA=t();let s=zw(r),i=r(),o=()=>{let l=new Set;return e().forEach(f=>n(l,s[f])),n(l,e()),l};ro=Na(l=>{let f=Na(r).map(h=>h+96);if(f.length){let h=l>=i;f[0]-=32,f=fs(f),h&&(f=`Restricted[${f}]`);let g=o(),x=o(),b=!r();return{N:f,P:g,Q:x,M:b,R:h}}}),yh=t(),to=new Map;let a=e().concat(ul(yh)).sort((l,f)=>l-f);a.forEach((l,f)=>{let h=r(),g=a[f]=h?a[f-h]:{V:[],M:new Map};g.V.push(l),yh.has(l)||to.set(l,g)});for(let{V:l,M:f}of new Set(to.values())){let h=[];for(let x of l){let b=ro.filter(m=>Ra(m,x)),y=h.find(({G:m})=>b.some(E=>m.has(E)));y||(y={G:new Set,V:[]},h.push(y)),y.V.push(x),n(y.G,b)}let g=h.flatMap(x=>ul(x.G));for(let{G:x,V:b}of h){let y=new Set(g.filter(m=>!x.has(m)));for(let m of b)f.set(m,y)}}ls=new Set;let c=new Set,u=l=>ls.has(l)?c.add(l):ls.add(l);for(let l of ro){for(let f of l.P)u(f);for(let f of l.Q)u(f)}for(let l of ls)!to.has(l)&&!c.has(l)&&to.set(l,tA);n(ls,fl(ls)),kh=e9(r).map(l=>vh.from(l)).sort(Jw),Th=new Map;for(let l of kh){let f=[Th];for(let h of l){let g=f.map(x=>{let b=x.get(h);return b||(b=new Map,x.set(h,b)),b});h===eA?f.push(...g):f=g}for(let h of f)h.V=l}}function Sh(r){return(Nh(r)?"":`${Ch(La([r]))} `)+$w(r)}function Ch(r){return`"${r}"\u200E`}function d9(r){if(r.length>=4&&r[2]==Dw&&r[3]==Dw)throw new Error(`invalid label extension: "${fs(r.slice(0,4))}"`)}function h9(r){for(let t=r.lastIndexOf(95);t>0;)if(r[--t]!==95)throw new Error("underscore allowed only at start")}function p9(r){let e=r[0],t=jw.get(e);if(t)throw Oa(`leading ${t}`);let n=r.length,s=-1;for(let i=1;i<n;i++){e=r[i];let o=jw.get(e);if(o){if(s==i)throw Oa(`${t} + ${o}`);s=i+1,t=o}}if(s==n)throw Oa(`trailing ${t}`)}function La(r,e=1/0,t=$w){let n=[];sA(r[0])&&n.push("\u25CC"),r.length>e&&(e>>=1,r=[...r.slice(0,e),8230,...r.slice(-e)]);let s=0,i=r.length;for(let o=0;o<i;o++){let a=r[o];Nh(a)&&(n.push(fs(r.slice(s,o))),n.push(t(a)),s=o+1)}return n.push(fs(r.slice(s,i))),n.join("")}function sA(r){return io(),Us.has(r)}function Nh(r){return io(),rA.has(r)}function g9(){return io(),kh.map(r=>r.slice())}function b9(r,e){io();let t=e?fl:so;return r.split(cl).map(n=>fs(cA(Bh(n),t,dl).flat())).join(cl)}function x9(r){return iA(Ih(r,so,dl))}function m9(r){let e=Ih(r,so,t=>t);for(let{type:t,output:n,error:s}of e){if(s)break;t!=="Greek"&&y9(n,958,926)}return iA(e)}function y9(r,e,t){let n=0;for(;;){let s=r.indexOf(e,n);if(s<0)break;r[s]=t,n=s+1}}function w9(r,e){return Ih(r,so,e?t=>t.slice():dl)}function Ih(r,e,t){if(!r)return[];io();let n=0;return r.split(cl).map(s=>{let i=Bh(s),o={input:i,offset:n};n+=i.length+1;try{let a=o.tokens=cA(i,e,t),c=a.length,u;if(!c)throw new Error("empty label");let l=o.output=a.flat();if(h9(l),!(o.emoji=c>1||a[0].is_emoji)&&l.every(h=>h<128))d9(l),u="ASCII";else{let h=a.flatMap(g=>g.is_emoji?[]:g);if(!h.length)u="Emoji";else{if(Us.has(l[0]))throw Oa("leading combining mark");for(let b=1;b<c;b++){let y=a[b];if(!y.is_emoji&&Us.has(y[0]))throw Oa(`emoji + combining mark: "${fs(a[b-1])} + ${La([y[0]])}"`)}p9(l);let g=ul(new Set(h)),[x]=E9(g);P9(x,h),A9(x,g),u=x.N}}o.type=u}catch(a){o.error=a}return o})}function A9(r,e){let t,n=[];for(let s of e){let i=to.get(s);if(i===tA)return;if(i){let o=i.M.get(s);if(t=t?t.filter(a=>o.has(a)):ul(o),!t.length)return}else n.push(s)}if(t){for(let s of t)if(n.every(i=>Ra(s,i)))throw new Error(`whole-script confusable: ${r.N}/${s.N}`)}}function E9(r){let e=ro;for(let t of r){let n=e.filter(s=>Ra(s,t));if(!n.length)throw ro.some(s=>Ra(s,t))?aA(e[0],t):oA(t);if(e=n,n.length==1)break}return e}function iA(r){return r.map(({input:e,error:t,output:n})=>{if(t){let s=t.message;throw new Error(r.length==1?s:`Invalid label ${Ch(La(e,63))}: ${s}`)}return fs(n)}).join(cl)}function oA(r){return new Error(`disallowed character: ${Sh(r)}`)}function aA(r,e){let t=Sh(e),n=ro.find(s=>s.P.has(e));return n&&(t=`${n.N} ${t}`),new Error(`illegal mixture: ${r.N} + ${t}`)}function Oa(r){return new Error(`illegal placement: ${r}`)}function P9(r,e){for(let t of e)if(!Ra(r,t))throw aA(r,t);if(r.M){let t=fl(e);for(let n=1,s=t.length;n<s;n++)if(_h.has(t[n])){let i=n+1;for(let o;i<s&&_h.has(o=t[i]);i++)for(let a=n;a<i;a++)if(t[a]==o)throw new Error(`duplicate non-spacing marks: ${Sh(o)}`);if(i-n>Uw)throw new Error(`excessive non-spacing marks: ${Ch(La(t.slice(n-1,i)))} (${i-n}/${Uw})`);n=i}}}function cA(r,e,t){let n=[],s=[];for(r=r.slice().reverse();r.length;){let i=uA(r);if(i)s.length&&(n.push(e(s)),s=[]),n.push(t(i));else{let o=r.pop();if(ls.has(o))s.push(o);else{let a=ll.get(o);if(a)s.push(...a);else if(!Oh.has(o))throw oA(o)}}}return s.length&&n.push(e(s)),n}function dl(r){return r.filter(e=>e!=eA)}function uA(r,e){let t=Th,n,s=r.length;for(;s&&(t=t.get(r[--s]),!!t);){let{V:i}=t;i&&(n=i,e&&e.push(...r.slice(s).reverse()),r.length=s)}return n}var Sa="valid",lA="mapped",wh="ignored",v9="disallowed",_9="emoji",k9="nfc",T9="stop";function fA(r,{nf:e=!0}={}){io();let t=Bh(r).reverse(),n=[],s=[];for(;t.length;){let i=uA(t,n);if(i)s.push({type:_9,emoji:i.slice(),input:n,cps:dl(i)}),n=[];else{let o=t.pop();if(o==f9)s.push({type:T9,cp:o});else if(ls.has(o))s.push({type:Sa,cps:[o]});else if(Oh.has(o))s.push({type:wh,cp:o});else{let a=ll.get(o);a?s.push({type:lA,cp:o,cps:a.slice()}):s.push({type:v9,cp:o})}}}if(e)for(let i=0,o=-1;i<s.length;i++){let a=s[i];if(Ah(a.type))if(Hw(a.cps)){let c=i+1;for(let h=c;h<s.length;h++){let{type:g,cps:x}=s[h];if(Ah(g)){if(!Hw(x))break;c=h+1}else if(g!==wh)break}o<0&&(o=i);let u=s.slice(o,c),l=u.flatMap(h=>Ah(h.type)?h.cps:[]),f=so(l);Jw(f,l)?(s.splice(o,c-o,{type:k9,input:l,cps:f,tokens0:qw(u),tokens:fA(fs(f),{nf:!1})}),i=o):i=c-1,o=-1}else o=i;else a.type!==wh&&(o=-1)}return qw(s)}function Ah(r){return r==Sa||r==lA}function Hw(r){return r.some(e=>nA.has(e))}function qw(r){for(let e=0;e<r.length;e++)if(r[e].type==Sa){let t=e+1;for(;t<r.length&&r[t].type==Sa;)t++;r.splice(e,t-e,{type:Sa,cps:r.slice(e,t).flatMap(n=>n.cps)})}return r}Tr.ens_beautify=m9;Tr.ens_emoji=g9;Tr.ens_normalize=x9;Tr.ens_normalize_fragment=b9;Tr.ens_split=w9;Tr.ens_tokenize=fA;Tr.is_combining_mark=sA;Tr.nfc=so;Tr.nfd=fl;Tr.safe_str_from_cps=La;Tr.should_escape=Nh});var xA=P(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.dnsEncode=gn.namehash=gn.isValidName=gn.ensNormalize=void 0;var hA=xt(),Br=$(),B9=dA(),gA=new Uint8Array(32);gA.fill(0);function pA(r){return(0,Br.assertArgument)(r.length!==0,"invalid ENS name; empty component","comp",r),r}function Rh(r){let e=(0,Br.toUtf8Bytes)(bA(r)),t=[];if(r.length===0)return t;let n=0;for(let s=0;s<e.length;s++)e[s]===46&&(t.push(pA(e.slice(n,s))),n=s+1);return(0,Br.assertArgument)(n<e.length,"invalid ENS name; empty component","name",r),t.push(pA(e.slice(n))),t}function bA(r){try{if(r.length===0)throw new Error("empty label");return(0,B9.ens_normalize)(r)}catch(e){(0,Br.assertArgument)(!1,`invalid ENS name (${e.message})`,"name",r)}}gn.ensNormalize=bA;function O9(r){try{return Rh(r).length!==0}catch{}return!1}gn.isValidName=O9;function S9(r){(0,Br.assertArgument)(typeof r=="string","invalid ENS name; not a string","name",r),(0,Br.assertArgument)(r.length,"invalid ENS name (empty label)","name",r);let e=gA,t=Rh(r);for(;t.length;)e=(0,hA.keccak256)((0,Br.concat)([e,(0,hA.keccak256)(t.pop())]));return(0,Br.hexlify)(e)}gn.namehash=S9;function C9(r,e){let t=e??63;return(0,Br.assertArgument)(t<=255,"DNS encoded label cannot exceed 255","length",t),(0,Br.hexlify)((0,Br.concat)(Rh(r).map(n=>{(0,Br.assertArgument)(n.length<=t,`label ${JSON.stringify(r)} exceeds ${t} bytes`,"name",r);let s=new Uint8Array(n.length+1);return s.set(n,1),s[0]=s.length-1,s})))+"00"}gn.dnsEncode=C9});var yA=P(oo=>{"use strict";Object.defineProperty(oo,"__esModule",{value:!0});oo.verifyMessage=oo.hashMessage=void 0;var N9=xt(),I9=Vi(),R9=Gt(),hl=$();function mA(r){return typeof r=="string"&&(r=(0,hl.toUtf8Bytes)(r)),(0,N9.keccak256)((0,hl.concat)([(0,hl.toUtf8Bytes)(I9.MessagePrefix),(0,hl.toUtf8Bytes)(String(r.length)),r]))}oo.hashMessage=mA;function L9(r,e){let t=mA(r);return(0,R9.recoverAddress)(t,e)}oo.verifyMessage=L9});var EA=P(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.solidityPackedSha256=ds.solidityPackedKeccak256=ds.solidityPacked=void 0;var M9=ht(),wA=xt(),Ze=$(),j9=new RegExp("^bytes([0-9]+)$"),U9=new RegExp("^(u?int)([0-9]*)$"),F9=new RegExp("^(.*)\\[([0-9]*)\\]$");function AA(r,e,t){switch(r){case"address":return t?(0,Ze.getBytes)((0,Ze.zeroPadValue)(e,32)):(0,Ze.getBytes)((0,M9.getAddress)(e));case"string":return(0,Ze.toUtf8Bytes)(e);case"bytes":return(0,Ze.getBytes)(e);case"bool":return e=e?"0x01":"0x00",t?(0,Ze.getBytes)((0,Ze.zeroPadValue)(e,32)):(0,Ze.getBytes)(e)}let n=r.match(U9);if(n){let s=n[1]==="int",i=parseInt(n[2]||"256");return(0,Ze.assertArgument)((!n[2]||n[2]===String(i))&&i%8===0&&i!==0&&i<=256,"invalid number type","type",r),t&&(i=256),s&&(e=(0,Ze.toTwos)(e,i)),(0,Ze.getBytes)((0,Ze.zeroPadValue)((0,Ze.toBeArray)(e),i/8))}if(n=r.match(j9),n){let s=parseInt(n[1]);return(0,Ze.assertArgument)(String(s)===n[1]&&s!==0&&s<=32,"invalid bytes type","type",r),(0,Ze.assertArgument)((0,Ze.dataLength)(e)===s,`invalid value for ${r}`,"value",e),t?(0,Ze.getBytes)((0,Ze.zeroPadBytes)(e,32)):e}if(n=r.match(F9),n&&Array.isArray(e)){let s=n[1],i=parseInt(n[2]||String(e.length));(0,Ze.assertArgument)(i===e.length,`invalid array length for ${r}`,"value",e);let o=[];return e.forEach(function(a){o.push(AA(s,a,!0))}),(0,Ze.getBytes)((0,Ze.concat)(o))}(0,Ze.assertArgument)(!1,"invalid type","type",r)}function Lh(r,e){(0,Ze.assertArgument)(r.length===e.length,"wrong number of values; expected ${ types.length }","values",e);let t=[];return r.forEach(function(n,s){t.push(AA(n,e[s]))}),(0,Ze.hexlify)((0,Ze.concat)(t))}ds.solidityPacked=Lh;function D9(r,e){return(0,wA.keccak256)(Lh(r,e))}ds.solidityPackedKeccak256=D9;function H9(r,e){return(0,wA.sha256)(Lh(r,e))}ds.solidityPackedSha256=H9});var CA=P(co=>{"use strict";Object.defineProperty(co,"__esModule",{value:!0});co.verifyTypedData=co.TypedDataEncoder=void 0;var kA=ht(),ao=xt(),q9=Gt(),le=$(),TA=mh(),BA=new Uint8Array(32);BA.fill(0);var G9=BigInt(-1),OA=BigInt(0),SA=BigInt(1),z9=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function K9(r){let e=(0,le.getBytes)(r),t=e.length%32;return t?(0,le.concat)([e,BA.slice(t)]):(0,le.hexlify)(e)}var V9=(0,le.toBeHex)(SA,32),$9=(0,le.toBeHex)(OA,32),PA={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},Mh=["name","version","chainId","verifyingContract","salt"];function vA(r){return function(e){return(0,le.assertArgument)(typeof e=="string",`invalid domain value for ${JSON.stringify(r)}`,`domain.${r}`,e),e}}var J9={name:vA("name"),version:vA("version"),chainId:function(r){let e=(0,le.getBigInt)(r,"domain.chainId");return(0,le.assertArgument)(e>=0,"invalid chain ID","domain.chainId",r),Number.isSafeInteger(e)?Number(e):(0,le.toQuantity)(e)},verifyingContract:function(r){try{return(0,kA.getAddress)(r).toLowerCase()}catch{}(0,le.assertArgument)(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",r)},salt:function(r){let e=(0,le.getBytes)(r,"domain.salt");return(0,le.assertArgument)(e.length===32,'invalid domain value "salt"',"domain.salt",r),(0,le.hexlify)(e)}};function jh(r){{let e=r.match(/^(u?)int(\d+)$/);if(e){let t=e[1]==="",n=parseInt(e[2]);(0,le.assertArgument)(n%8===0&&n!==0&&n<=256&&e[2]===String(n),"invalid numeric width","type",r);let s=(0,le.mask)(z9,t?n-1:n),i=t?(s+SA)*G9:OA;return function(o){let a=(0,le.getBigInt)(o,"value");return(0,le.assertArgument)(a>=i&&a<=s,`value out-of-bounds for ${r}`,"value",a),(0,le.toBeHex)(t?(0,le.toTwos)(a,256):a,32)}}}{let e=r.match(/^bytes(\d+)$/);if(e){let t=parseInt(e[1]);return(0,le.assertArgument)(t!==0&&t<=32&&e[1]===String(t),"invalid bytes width","type",r),function(n){let s=(0,le.getBytes)(n);return(0,le.assertArgument)(s.length===t,`invalid length for ${r}`,"value",n),K9(n)}}}switch(r){case"address":return function(e){return(0,le.zeroPadValue)((0,kA.getAddress)(e),32)};case"bool":return function(e){return e?V9:$9};case"bytes":return function(e){return(0,ao.keccak256)(e)};case"string":return function(e){return(0,TA.id)(e)}}return null}function _A(r,e){return`${r}(${e.map(({name:t,type:n})=>n+" "+t).join(",")})`}function pl(r){let e=r.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:r}}var gl=class r{primaryType;#e;get types(){return JSON.parse(this.#e)}#t;#r;constructor(e){this.#t=new Map,this.#r=new Map;let t=new Map,n=new Map,s=new Map,i={};Object.keys(e).forEach(c=>{i[c]=e[c].map(({name:u,type:l})=>{let{base:f,index:h}=pl(l);return f==="int"&&!e.int&&(f="int256"),f==="uint"&&!e.uint&&(f="uint256"),{name:u,type:f+(h||"")}}),t.set(c,new Set),n.set(c,[]),s.set(c,new Set)}),this.#e=JSON.stringify(i);for(let c in i){let u=new Set;for(let l of i[c]){(0,le.assertArgument)(!u.has(l.name),`duplicate variable name ${JSON.stringify(l.name)} in ${JSON.stringify(c)}`,"types",e),u.add(l.name);let f=pl(l.type).base;(0,le.assertArgument)(f!==c,`circular type reference to ${JSON.stringify(f)}`,"types",e),!jh(f)&&((0,le.assertArgument)(n.has(f),`unknown type ${JSON.stringify(f)}`,"types",e),n.get(f).push(c),t.get(c).add(f))}}let o=Array.from(n.keys()).filter(c=>n.get(c).length===0);(0,le.assertArgument)(o.length!==0,"missing primary type","types",e),(0,le.assertArgument)(o.length===1,`ambiguous primary types or unused types: ${o.map(c=>JSON.stringify(c)).join(", ")}`,"types",e),(0,le.defineProperties)(this,{primaryType:o[0]});function a(c,u){(0,le.assertArgument)(!u.has(c),`circular type reference to ${JSON.stringify(c)}`,"types",e),u.add(c);for(let l of t.get(c))if(n.has(l)){a(l,u);for(let f of u)s.get(f).add(l)}u.delete(c)}a(this.primaryType,new Set);for(let[c,u]of s){let l=Array.from(u);l.sort(),this.#t.set(c,_A(c,i[c])+l.map(f=>_A(f,i[f])).join(""))}}getEncoder(e){let t=this.#r.get(e);return t||(t=this.#n(e),this.#r.set(e,t)),t}#n(e){{let s=jh(e);if(s)return s}let t=pl(e).array;if(t){let s=t.prefix,i=this.getEncoder(s);return o=>{(0,le.assertArgument)(t.count===-1||t.count===o.length,`array length mismatch; expected length ${t.count}`,"value",o);let a=o.map(i);return this.#t.has(s)&&(a=a.map(ao.keccak256)),(0,ao.keccak256)((0,le.concat)(a))}}let n=this.types[e];if(n){let s=(0,TA.id)(this.#t.get(e));return i=>{let o=n.map(({name:a,type:c})=>{let u=this.getEncoder(c)(i[a]);return this.#t.has(c)?(0,ao.keccak256)(u):u});return o.unshift(s),(0,le.concat)(o)}}(0,le.assertArgument)(!1,`unknown type: ${e}`,"type",e)}encodeType(e){let t=this.#t.get(e);return(0,le.assertArgument)(t,`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return(0,ao.keccak256)(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,n){if(jh(e))return n(e,t);let s=pl(e).array;if(s)return(0,le.assertArgument)(s.count===-1||s.count===t.length,`array length mismatch; expected length ${s.count}`,"value",t),t.map(o=>this._visit(s.prefix,o,n));let i=this.types[e];if(i)return i.reduce((o,{name:a,type:c})=>(o[a]=this._visit(c,t[a],n),o),{});(0,le.assertArgument)(!1,`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new r(e)}static getPrimaryType(e){return r.from(e).primaryType}static hashStruct(e,t,n){return r.from(t).hashStruct(e,n)}static hashDomain(e){let t=[];for(let n in e){if(e[n]==null)continue;let s=PA[n];(0,le.assertArgument)(s,`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),t.push({name:n,type:s})}return t.sort((n,s)=>Mh.indexOf(n.name)-Mh.indexOf(s.name)),r.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,n){return(0,le.concat)(["0x1901",r.hashDomain(e),r.from(t).hash(n)])}static hash(e,t,n){return(0,ao.keccak256)(r.encode(e,t,n))}static async resolveNames(e,t,n,s){e=Object.assign({},e);for(let a in e)e[a]==null&&delete e[a];let i={};e.verifyingContract&&!(0,le.isHexString)(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");let o=r.from(t);o.visit(n,(a,c)=>(a==="address"&&!(0,le.isHexString)(c,20)&&(i[c]="0x"),c));for(let a in i)i[a]=await s(a);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),n=o.visit(n,(a,c)=>a==="address"&&i[c]?i[c]:c),{domain:e,value:n}}static getPayload(e,t,n){r.hashDomain(e);let s={},i=[];Mh.forEach(c=>{let u=e[c];u!=null&&(s[c]=J9[c](u),i.push({name:c,type:PA[c]}))});let o=r.from(t);t=o.types;let a=Object.assign({},t);return(0,le.assertArgument)(a.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",t),a.EIP712Domain=i,o.encode(n),{types:a,domain:s,primaryType:o.primaryType,message:o.visit(n,(c,u)=>{if(c.match(/^bytes(\d*)/))return(0,le.hexlify)((0,le.getBytes)(u));if(c.match(/^u?int/))return(0,le.getBigInt)(u).toString();switch(c){case"address":return u.toLowerCase();case"bool":return!!u;case"string":return(0,le.assertArgument)(typeof u=="string","invalid string","value",u),u}(0,le.assertArgument)(!1,"unsupported type","type",c)})}}};co.TypedDataEncoder=gl;function Q9(r,e,t,n){return(0,q9.recoverAddress)(gl.hash(r,e,t),n)}co.verifyTypedData=Q9});var bn=P(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.verifyTypedData=De.TypedDataEncoder=De.solidityPackedSha256=De.solidityPackedKeccak256=De.solidityPacked=De.verifyMessage=De.hashMessage=De.dnsEncode=De.namehash=De.isValidName=De.ensNormalize=De.id=De.verifyAuthorization=De.hashAuthorization=void 0;var NA=Mw();Object.defineProperty(De,"hashAuthorization",{enumerable:!0,get:function(){return NA.hashAuthorization}});Object.defineProperty(De,"verifyAuthorization",{enumerable:!0,get:function(){return NA.verifyAuthorization}});var W9=mh();Object.defineProperty(De,"id",{enumerable:!0,get:function(){return W9.id}});var bl=xA();Object.defineProperty(De,"ensNormalize",{enumerable:!0,get:function(){return bl.ensNormalize}});Object.defineProperty(De,"isValidName",{enumerable:!0,get:function(){return bl.isValidName}});Object.defineProperty(De,"namehash",{enumerable:!0,get:function(){return bl.namehash}});Object.defineProperty(De,"dnsEncode",{enumerable:!0,get:function(){return bl.dnsEncode}});var IA=yA();Object.defineProperty(De,"hashMessage",{enumerable:!0,get:function(){return IA.hashMessage}});Object.defineProperty(De,"verifyMessage",{enumerable:!0,get:function(){return IA.verifyMessage}});var Uh=EA();Object.defineProperty(De,"solidityPacked",{enumerable:!0,get:function(){return Uh.solidityPacked}});Object.defineProperty(De,"solidityPackedKeccak256",{enumerable:!0,get:function(){return Uh.solidityPackedKeccak256}});Object.defineProperty(De,"solidityPackedSha256",{enumerable:!0,get:function(){return Uh.solidityPackedSha256}});var RA=CA();Object.defineProperty(De,"TypedDataEncoder",{enumerable:!0,get:function(){return RA.TypedDataEncoder}});Object.defineProperty(De,"verifyTypedData",{enumerable:!0,get:function(){return RA.verifyTypedData}})});var ml=P(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.StructFragment=mt.FunctionFragment=mt.FallbackFragment=mt.ConstructorFragment=mt.EventFragment=mt.ErrorFragment=mt.NamedFragment=mt.Fragment=mt.ParamType=void 0;var Ie=$(),Fh=bn();function zt(r){let e=new Set;return r.forEach(t=>e.add(t)),Object.freeze(e)}var Y9="external public payable override",Z9=zt(Y9.split(" ")),zA="constant external internal payable private public pure view override",X9=zt(zA.split(" ")),KA="constructor error event fallback function receive struct",VA=zt(KA.split(" ")),$A="calldata memory storage payable indexed",e_=zt($A.split(" ")),t_="tuple returns",r_=[KA,$A,t_,zA].join(" "),n_=zt(r_.split(" ")),s_={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},i_=new RegExp("^(\\s*)"),o_=new RegExp("^([0-9]+)"),a_=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),JA=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),QA=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"),Zr=class r{#e;#t;get offset(){return this.#e}get length(){return this.#t.length-this.#e}constructor(e){this.#e=0,this.#t=e.slice()}clone(){return new r(this.#t)}reset(){this.#e=0}#r(e=0,t=0){return new r(this.#t.slice(e,t).map(n=>Object.freeze(Object.assign({},n,{match:n.match-e,linkBack:n.linkBack-e,linkNext:n.linkNext-e}))))}popKeyword(e){let t=this.peek();if(t.type!=="KEYWORD"||!e.has(t.text))throw new Error(`expected keyword ${t.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){let t=this.peek();throw new Error(`expected ${e}; got ${t.type} ${JSON.stringify(t.text)}`)}return this.pop().text}popParen(){let e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");let t=this.#r(this.#e+1,e.match+1);return this.#e=e.match+1,t}popParams(){let e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");let t=[];for(;this.#e<e.match-1;){let n=this.peek().linkNext;t.push(this.#r(this.#e+1,n)),this.#e=n}return this.#e=e.match+1,t}peek(){if(this.#e>=this.#t.length)throw new Error("out-of-bounds");return this.#t[this.#e]}peekKeyword(e){let t=this.peekType("KEYWORD");return t!=null&&e.has(t)?t:null}peekType(e){if(this.length===0)return null;let t=this.peek();return t.type===e?t.text:null}pop(){let e=this.peek();return this.#e++,e}toString(){let e=[];for(let t=this.#e;t<this.#t.length;t++){let n=this.#t[t];e.push(`${n.type}:${n.text}`)}return`<TokenString ${e.join(" ")}>`}};function hs(r){let e=[],t=o=>{let a=i<r.length?JSON.stringify(r[i]):"$EOI";throw new Error(`invalid token ${a} at ${i}: ${o}`)},n=[],s=[],i=0;for(;i<r.length;){let o=r.substring(i),a=o.match(i_);a&&(i+=a[1].length,o=r.substring(i));let c={depth:n.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:i,value:-1};e.push(c);let u=s_[o[0]]||"";if(u){if(c.type=u,c.text=o[0],i++,u==="OPEN_PAREN")n.push(e.length-1),s.push(e.length-1);else if(u=="CLOSE_PAREN")n.length===0&&t("no matching open bracket"),c.match=n.pop(),e[c.match].match=e.length-1,c.depth--,c.linkBack=s.pop(),e[c.linkBack].linkNext=e.length-1;else if(u==="COMMA")c.linkBack=s.pop(),e[c.linkBack].linkNext=e.length-1,s.push(e.length-1);else if(u==="OPEN_BRACKET")c.type="BRACKET";else if(u==="CLOSE_BRACKET"){let l=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){let f=e.pop().text;l=f+l,e[e.length-1].value=(0,Ie.getNumber)(f)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=l}continue}if(a=o.match(a_),a){if(c.text=a[1],i+=c.text.length,n_.has(c.text)){c.type="KEYWORD";continue}if(c.text.match(QA)){c.type="TYPE";continue}c.type="ID";continue}if(a=o.match(o_),a){c.text=a[1],c.type="NUMBER",i+=c.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(o[0])} at position ${i}`)}return new Zr(e.map(o=>Object.freeze(o)))}function LA(r,e){let t=[];for(let n in e.keys())r.has(n)&&t.push(n);if(t.length>1)throw new Error(`conflicting types: ${t.join(", ")}`)}function xl(r,e){if(e.peekKeyword(VA)){let t=e.pop().text;if(t!==r)throw new Error(`expected ${r}, got ${t}`)}return e.popType("ID")}function In(r,e){let t=new Set;for(;;){let n=r.peekType("KEYWORD");if(n==null||e&&!e.has(n))break;if(r.pop(),t.has(n))throw new Error(`duplicate keywords: ${JSON.stringify(n)}`);t.add(n)}return Object.freeze(t)}function WA(r){let e=In(r,X9);return LA(e,zt("constant payable nonpayable".split(" "))),LA(e,zt("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function Nn(r,e){return r.popParams().map(t=>tr.from(t,e))}function YA(r){if(r.peekType("AT")){if(r.pop(),r.peekType("NUMBER"))return(0,Ie.getBigInt)(r.pop().text);throw new Error("invalid gas")}return null}function Fs(r){if(r.length)throw new Error(`unexpected tokens at offset ${r.offset}: ${r.toString()}`)}var c_=new RegExp(/^(.*)\[([0-9]*)\]$/);function MA(r){let e=r.match(QA);if((0,Ie.assertArgument)(e,"invalid type","type",r),r==="uint")return"uint256";if(r==="int")return"int256";if(e[2]){let t=parseInt(e[2]);(0,Ie.assertArgument)(t!==0&&t<=32,"invalid bytes length","type",r)}else if(e[3]){let t=parseInt(e[3]);(0,Ie.assertArgument)(t!==0&&t<=256&&t%8===0,"invalid numeric width","type",r)}return r}var it={},rr=Symbol.for("_ethers_internal"),jA="_ParamTypeInternal",UA="_ErrorInternal",FA="_EventInternal",DA="_ConstructorInternal",HA="_FallbackInternal",qA="_FunctionInternal",GA="_StructInternal",tr=class r{name;type;baseType;indexed;components;arrayLength;arrayChildren;constructor(e,t,n,s,i,o,a,c){if((0,Ie.assertPrivate)(e,it,"ParamType"),Object.defineProperty(this,rr,{value:jA}),o&&(o=Object.freeze(o.slice())),s==="array"){if(a==null||c==null)throw new Error("")}else if(a!=null||c!=null)throw new Error("");if(s==="tuple"){if(o==null)throw new Error("")}else if(o!=null)throw new Error("");(0,Ie.defineProperties)(this,{name:t,type:n,baseType:s,indexed:i,components:o,arrayLength:a,arrayChildren:c})}format(e){if(e==null&&(e="sighash"),e==="json"){let n=this.name||"";if(this.isArray()){let i=JSON.parse(this.arrayChildren.format("json"));return i.name=n,i.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(i)}let s={type:this.baseType==="tuple"?"tuple":this.type,name:n};return typeof this.indexed=="boolean"&&(s.indexed=this.indexed),this.isTuple()&&(s.components=this.components.map(i=>JSON.parse(i.format(e)))),JSON.stringify(s)}let t="";return this.isArray()?(t+=this.arrayChildren.format(e),t+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?t+="("+this.components.map(n=>n.format(e)).join(e==="full"?", ":",")+")":t+=this.type,e!=="sighash"&&(this.indexed===!0&&(t+=" indexed"),e==="full"&&this.name&&(t+=" "+this.name)),t}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,t){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");let n=this;return e.map(s=>n.arrayChildren.walk(s,t))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");let n=this;return e.map((s,i)=>n.components[i].walk(s,t))}return t(this.type,e)}#e(e,t,n,s){if(this.isArray()){if(!Array.isArray(t))throw new Error("invalid array value");if(this.arrayLength!==-1&&t.length!==this.arrayLength)throw new Error("array is wrong length");let o=this.arrayChildren,a=t.slice();a.forEach((c,u)=>{o.#e(e,c,n,l=>{a[u]=l})}),s(a);return}if(this.isTuple()){let o=this.components,a;if(Array.isArray(t))a=t.slice();else{if(t==null||typeof t!="object")throw new Error("invalid tuple value");a=o.map(c=>{if(!c.name)throw new Error("cannot use object value with unnamed components");if(!(c.name in t))throw new Error(`missing value for component ${c.name}`);return t[c.name]})}if(a.length!==this.components.length)throw new Error("array is wrong length");a.forEach((c,u)=>{o[u].#e(e,c,n,l=>{a[u]=l})}),s(a);return}let i=n(this.type,t);i.then?e.push(async function(){s(await i)}()):s(i)}async walkAsync(e,t){let n=[],s=[e];return this.#e(n,e,t,i=>{s[0]=i}),n.length&&await Promise.all(n),s[0]}static from(e,t){if(r.isParamType(e))return e;if(typeof e=="string")try{return r.from(hs(e),t)}catch{(0,Ie.assertArgument)(!1,"invalid param type","obj",e)}else if(e instanceof Zr){let a="",c="",u=null;In(e,zt(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(c="tuple",u=e.popParams().map(b=>r.from(b)),a=`tuple(${u.map(b=>b.format()).join(",")})`):(a=MA(e.popType("TYPE")),c=a);let l=null,f=null;for(;e.length&&e.peekType("BRACKET");){let b=e.pop();l=new r(it,"",a,c,null,u,f,l),f=b.value,a+=b.text,c="array",u=null}let h=null;if(In(e,e_).has("indexed")){if(!t)throw new Error("");h=!0}let x=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new r(it,x,a,c,h,u,f,l)}let n=e.name;(0,Ie.assertArgument)(!n||typeof n=="string"&&n.match(JA),"invalid name","obj.name",n);let s=e.indexed;s!=null&&((0,Ie.assertArgument)(t,"parameter cannot be indexed","obj.indexed",e.indexed),s=!!s);let i=e.type,o=i.match(c_);if(o){let a=parseInt(o[2]||"-1"),c=r.from({type:o[1],components:e.components});return new r(it,n||"",i,"array",s,null,a,c)}if(i==="tuple"||i.startsWith("tuple(")||i.startsWith("(")){let a=e.components!=null?e.components.map(u=>r.from(u)):null;return new r(it,n||"",i,"tuple",s,a,null,null)}return i=MA(e.type),new r(it,n||"",i,i,s,null,null,null)}static isParamType(e){return e&&e[rr]===jA}};mt.ParamType=tr;var go=class r{type;inputs;constructor(e,t,n){(0,Ie.assertPrivate)(e,it,"Fragment"),n=Object.freeze(n.slice()),(0,Ie.defineProperties)(this,{type:t,inputs:n})}static from(e){if(typeof e=="string"){try{r.from(JSON.parse(e))}catch{}return r.from(hs(e))}if(e instanceof Zr)switch(e.peekKeyword(VA)){case"constructor":return fo.from(e);case"error":return uo.from(e);case"event":return lo.from(e);case"fallback":case"receive":return ja.from(e);case"function":return ho.from(e);case"struct":return po.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return fo.from(e);case"error":return uo.from(e);case"event":return lo.from(e);case"fallback":case"receive":return ja.from(e);case"function":return ho.from(e);case"struct":return po.from(e)}(0,Ie.assert)(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}(0,Ie.assertArgument)(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return fo.isFragment(e)}static isError(e){return uo.isFragment(e)}static isEvent(e){return lo.isFragment(e)}static isFunction(e){return ho.isFragment(e)}static isStruct(e){return po.isFragment(e)}};mt.Fragment=go;var Ds=class extends go{name;constructor(e,t,n,s){super(e,t,s),(0,Ie.assertArgument)(typeof n=="string"&&n.match(JA),"invalid identifier","name",n),s=Object.freeze(s.slice()),(0,Ie.defineProperties)(this,{name:n})}};mt.NamedFragment=Ds;function Ma(r,e){return"("+e.map(t=>t.format(r)).join(r==="full"?", ":",")+")"}var uo=class r extends Ds{constructor(e,t,n){super(e,"error",t,n),Object.defineProperty(this,rr,{value:UA})}get selector(){return(0,Fh.id)(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let t=[];return e!=="sighash"&&t.push("error"),t.push(this.name+Ma(e,this.inputs)),t.join(" ")}static from(e){if(r.isFragment(e))return e;if(typeof e=="string")return r.from(hs(e));if(e instanceof Zr){let t=xl("error",e),n=Nn(e);return Fs(e),new r(it,t,n)}return new r(it,e.name,e.inputs?e.inputs.map(tr.from):[])}static isFragment(e){return e&&e[rr]===UA}};mt.ErrorFragment=uo;var lo=class r extends Ds{anonymous;constructor(e,t,n,s){super(e,"event",t,n),Object.defineProperty(this,rr,{value:FA}),(0,Ie.defineProperties)(this,{anonymous:s})}get topicHash(){return(0,Fh.id)(this.format("sighash"))}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let t=[];return e!=="sighash"&&t.push("event"),t.push(this.name+Ma(e,this.inputs)),e!=="sighash"&&this.anonymous&&t.push("anonymous"),t.join(" ")}static getTopicHash(e,t){return t=(t||[]).map(s=>tr.from(s)),new r(it,e,t,!1).topicHash}static from(e){if(r.isFragment(e))return e;if(typeof e=="string")try{return r.from(hs(e))}catch{(0,Ie.assertArgument)(!1,"invalid event fragment","obj",e)}else if(e instanceof Zr){let t=xl("event",e),n=Nn(e,!0),s=!!In(e,zt(["anonymous"])).has("anonymous");return Fs(e),new r(it,t,n,s)}return new r(it,e.name,e.inputs?e.inputs.map(t=>tr.from(t,!0)):[],!!e.anonymous)}static isFragment(e){return e&&e[rr]===FA}};mt.EventFragment=lo;var fo=class r extends go{payable;gas;constructor(e,t,n,s,i){super(e,t,n),Object.defineProperty(this,rr,{value:DA}),(0,Ie.defineProperties)(this,{payable:s,gas:i})}format(e){if((0,Ie.assert)(e!=null&&e!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),e==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let t=[`constructor${Ma(e,this.inputs)}`];return this.payable&&t.push("payable"),this.gas!=null&&t.push(`@${this.gas.toString()}`),t.join(" ")}static from(e){if(r.isFragment(e))return e;if(typeof e=="string")try{return r.from(hs(e))}catch{(0,Ie.assertArgument)(!1,"invalid constuctor fragment","obj",e)}else if(e instanceof Zr){In(e,zt(["constructor"]));let t=Nn(e),n=!!In(e,Z9).has("payable"),s=YA(e);return Fs(e),new r(it,"constructor",t,n,s)}return new r(it,"constructor",e.inputs?e.inputs.map(tr.from):[],!!e.payable,e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[rr]===DA}};mt.ConstructorFragment=fo;var ja=class r extends go{payable;constructor(e,t,n){super(e,"fallback",t),Object.defineProperty(this,rr,{value:HA}),(0,Ie.defineProperties)(this,{payable:n})}format(e){let t=this.inputs.length===0?"receive":"fallback";if(e==="json"){let n=this.payable?"payable":"nonpayable";return JSON.stringify({type:t,stateMutability:n})}return`${t}()${this.payable?" payable":""}`}static from(e){if(r.isFragment(e))return e;if(typeof e=="string")try{return r.from(hs(e))}catch{(0,Ie.assertArgument)(!1,"invalid fallback fragment","obj",e)}else if(e instanceof Zr){let t=e.toString(),n=e.peekKeyword(zt(["fallback","receive"]));if((0,Ie.assertArgument)(n,"type must be fallback or receive","obj",t),e.popKeyword(zt(["fallback","receive"]))==="receive"){let a=Nn(e);return(0,Ie.assertArgument)(a.length===0,"receive cannot have arguments","obj.inputs",a),In(e,zt(["payable"])),Fs(e),new r(it,[],!0)}let i=Nn(e);i.length?(0,Ie.assertArgument)(i.length===1&&i[0].type==="bytes","invalid fallback inputs","obj.inputs",i.map(a=>a.format("minimal")).join(", ")):i=[tr.from("bytes")];let o=WA(e);if((0,Ie.assertArgument)(o==="nonpayable"||o==="payable","fallback cannot be constants","obj.stateMutability",o),In(e,zt(["returns"])).has("returns")){let a=Nn(e);(0,Ie.assertArgument)(a.length===1&&a[0].type==="bytes","invalid fallback outputs","obj.outputs",a.map(c=>c.format("minimal")).join(", "))}return Fs(e),new r(it,i,o==="payable")}if(e.type==="receive")return new r(it,[],!0);if(e.type==="fallback"){let t=[tr.from("bytes")],n=e.stateMutability==="payable";return new r(it,t,n)}(0,Ie.assertArgument)(!1,"invalid fallback description","obj",e)}static isFragment(e){return e&&e[rr]===HA}};mt.FallbackFragment=ja;var ho=class r extends Ds{constant;outputs;stateMutability;payable;gas;constructor(e,t,n,s,i,o){super(e,"function",t,s),Object.defineProperty(this,rr,{value:qA}),i=Object.freeze(i.slice());let a=n==="view"||n==="pure",c=n==="payable";(0,Ie.defineProperties)(this,{constant:a,gas:o,outputs:i,payable:c,stateMutability:n})}get selector(){return(0,Fh.id)(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let t=[];return e!=="sighash"&&t.push("function"),t.push(this.name+Ma(e,this.inputs)),e!=="sighash"&&(this.stateMutability!=="nonpayable"&&t.push(this.stateMutability),this.outputs&&this.outputs.length&&(t.push("returns"),t.push(Ma(e,this.outputs))),this.gas!=null&&t.push(`@${this.gas.toString()}`)),t.join(" ")}static getSelector(e,t){return t=(t||[]).map(s=>tr.from(s)),new r(it,e,"view",t,[],null).selector}static from(e){if(r.isFragment(e))return e;if(typeof e=="string")try{return r.from(hs(e))}catch{(0,Ie.assertArgument)(!1,"invalid function fragment","obj",e)}else if(e instanceof Zr){let n=xl("function",e),s=Nn(e),i=WA(e),o=[];In(e,zt(["returns"])).has("returns")&&(o=Nn(e));let a=YA(e);return Fs(e),new r(it,n,i,s,o,a)}let t=e.stateMutability;return t==null&&(t="payable",typeof e.constant=="boolean"?(t="view",e.constant||(t="payable",typeof e.payable=="boolean"&&!e.payable&&(t="nonpayable"))):typeof e.payable=="boolean"&&!e.payable&&(t="nonpayable")),new r(it,e.name,t,e.inputs?e.inputs.map(tr.from):[],e.outputs?e.outputs.map(tr.from):[],e.gas!=null?e.gas:null)}static isFragment(e){return e&&e[rr]===qA}};mt.FunctionFragment=ho;var po=class r extends Ds{constructor(e,t,n){super(e,"struct",t,n),Object.defineProperty(this,rr,{value:GA})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return r.from(hs(e))}catch{(0,Ie.assertArgument)(!1,"invalid struct fragment","obj",e)}else if(e instanceof Zr){let t=xl("struct",e),n=Nn(e);return Fs(e),new r(it,t,n)}return new r(it,e.name,e.inputs?e.inputs.map(tr.from):[])}static isFragment(e){return e&&e[rr]===GA}};mt.StructFragment=po});var Gh=P(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});wl.AbiCoder=void 0;var Ua=$(),ZA=Ar(),u_=gw(),l_=Xd(),f_=yw(),d_=rh(),h_=Aw(),p_=Ew(),g_=Pw(),b_=_w(),yl=Tw(),Dh=ml(),XA=ht(),Fa=$(),Xr=new Map;Xr.set(0,"GENERIC_PANIC");Xr.set(1,"ASSERT_FALSE");Xr.set(17,"OVERFLOW");Xr.set(18,"DIVIDE_BY_ZERO");Xr.set(33,"ENUM_RANGE_ERROR");Xr.set(34,"BAD_STORAGE_DATA");Xr.set(49,"STACK_UNDERFLOW");Xr.set(50,"ARRAY_RANGE_ERROR");Xr.set(65,"OUT_OF_MEMORY");Xr.set(81,"UNINITIALIZED_FUNCTION_CALL");var x_=new RegExp(/^bytes([0-9]*)$/),m_=new RegExp(/^(u?int)([0-9]*)$/),Hh=null,e3=1024;function y_(r,e,t,n){let s="missing revert data",i=null,o=null,a=null;if(t){s="execution reverted";let u=(0,Fa.getBytes)(t);if(t=(0,Fa.hexlify)(t),u.length===0)s+=" (no data present; likely require(false) occurred",i="require(false)";else if(u.length%32!==4)s+=" (could not decode reason; invalid data length)";else if((0,Fa.hexlify)(u.slice(0,4))==="0x08c379a0")try{i=n.decode(["string"],u.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[i]},s+=`: ${JSON.stringify(i)}`}catch{s+=" (could not decode reason; invalid string data)"}else if((0,Fa.hexlify)(u.slice(0,4))==="0x4e487b71")try{let l=Number(n.decode(["uint256"],u.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[l]},i=`Panic due to ${Xr.get(l)||"UNKNOWN"}(${l})`,s+=`: ${i}`}catch{s+=" (could not decode panic code)"}else s+=" (unknown custom error)"}let c={to:e.to?(0,XA.getAddress)(e.to):null,data:e.data||"0x"};return e.from&&(c.from=(0,XA.getAddress)(e.from)),(0,Fa.makeError)(s,"CALL_EXCEPTION",{action:r,data:t,reason:i,transaction:c,invocation:o,revert:a})}var qh=class r{#e(e){if(e.isArray())return new l_.ArrayCoder(this.#e(e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new yl.TupleCoder(e.components.map(n=>this.#e(n)),e.name);switch(e.baseType){case"address":return new u_.AddressCoder(e.name);case"bool":return new f_.BooleanCoder(e.name);case"string":return new b_.StringCoder(e.name);case"bytes":return new d_.BytesCoder(e.name);case"":return new p_.NullCoder(e.name)}let t=e.type.match(m_);if(t){let n=parseInt(t[2]||"256");return(0,Ua.assertArgument)(n!==0&&n<=256&&n%8===0,"invalid "+t[1]+" bit length","param",e),new g_.NumberCoder(n/8,t[1]==="int",e.name)}if(t=e.type.match(x_),t){let n=parseInt(t[1]);return(0,Ua.assertArgument)(n!==0&&n<=32,"invalid bytes length","param",e),new h_.FixedBytesCoder(n,e.name)}(0,Ua.assertArgument)(!1,"invalid type","type",e.type)}getDefaultValue(e){let t=e.map(s=>this.#e(Dh.ParamType.from(s)));return new yl.TupleCoder(t,"_").defaultValue()}encode(e,t){(0,Ua.assertArgumentCount)(t.length,e.length,"types/values length mismatch");let n=e.map(o=>this.#e(Dh.ParamType.from(o))),s=new yl.TupleCoder(n,"_"),i=new ZA.Writer;return s.encode(i,t),i.data}decode(e,t,n){let s=e.map(o=>this.#e(Dh.ParamType.from(o)));return new yl.TupleCoder(s,"_").decode(new ZA.Reader(t,n,e3))}static _setDefaultMaxInflation(e){(0,Ua.assertArgument)(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),e3=e}static defaultAbiCoder(){return Hh==null&&(Hh=new r),Hh}static getBuiltinCallException(e,t,n){return y_(e,t,n,r.defaultAbiCoder())}};wl.AbiCoder=qh});var t3=P(bo=>{"use strict";Object.defineProperty(bo,"__esModule",{value:!0});bo.decodeBytes32String=bo.encodeBytes32String=void 0;var Al=$();function w_(r){let e=(0,Al.toUtf8Bytes)(r);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,Al.zeroPadBytes)(e,32)}bo.encodeBytes32String=w_;function A_(r){let e=(0,Al.getBytes)(r,"bytes");if(e.length!==32)throw new Error("invalid bytes32 - not 32 bytes long");if(e[31]!==0)throw new Error("invalid bytes32 string - no null terminator");let t=31;for(;e[t-1]===0;)t--;return(0,Al.toUtf8String)(e.slice(0,t))}bo.decodeBytes32String=A_});var a3=P(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.Interface=Ut.Indexed=Ut.ErrorDescription=Ut.TransactionDescription=Ut.LogDescription=Ut.Result=Ut.checkResultErrors=void 0;var r3=xt(),n3=bn(),Z=$(),s3=Gh(),Vh=Ar();Object.defineProperty(Ut,"checkResultErrors",{enumerable:!0,get:function(){return Vh.checkResultErrors}});Object.defineProperty(Ut,"Result",{enumerable:!0,get:function(){return Vh.Result}});var en=ml(),zh=hn(),El=class{fragment;name;signature;topic;args;constructor(e,t,n){let s=e.name,i=e.format();(0,Z.defineProperties)(this,{fragment:e,name:s,signature:i,topic:t,args:n})}};Ut.LogDescription=El;var Pl=class{fragment;name;args;signature;selector;value;constructor(e,t,n,s){let i=e.name,o=e.format();(0,Z.defineProperties)(this,{fragment:e,name:i,args:n,signature:o,selector:t,value:s})}};Ut.TransactionDescription=Pl;var vl=class{fragment;name;args;signature;selector;constructor(e,t,n){let s=e.name,i=e.format();(0,Z.defineProperties)(this,{fragment:e,name:s,args:n,signature:i,selector:t})}};Ut.ErrorDescription=vl;var Da=class{hash;_isIndexed;static isIndexed(e){return!!(e&&e._isIndexed)}constructor(e){(0,Z.defineProperties)(this,{hash:e,_isIndexed:!0})}};Ut.Indexed=Da;var i3={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},o3={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:r=>`reverted with reason string ${JSON.stringify(r)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:r=>{let e="unknown panic code";return r>=0&&r<=255&&i3[r.toString()]&&(e=i3[r.toString()]),`reverted with panic code 0x${r.toString(16)} (${e})`}}},Kh=class r{fragments;deploy;fallback;receive;#e;#t;#r;#n;constructor(e){let t=[];typeof e=="string"?t=JSON.parse(e):t=e,this.#r=new Map,this.#e=new Map,this.#t=new Map;let n=[];for(let o of t)try{n.push(en.Fragment.from(o))}catch(a){console.log(`[Warning] Invalid Fragment ${JSON.stringify(o)}:`,a.message)}(0,Z.defineProperties)(this,{fragments:Object.freeze(n)});let s=null,i=!1;this.#n=this.getAbiCoder(),this.fragments.forEach((o,a)=>{let c;switch(o.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}(0,Z.defineProperties)(this,{deploy:o});return;case"fallback":o.inputs.length===0?i=!0:((0,Z.assertArgument)(!s||o.payable!==s.payable,"conflicting fallback fragments",`fragments[${a}]`,o),s=o,i=s.payable);return;case"function":c=this.#r;break;case"event":c=this.#t;break;case"error":c=this.#e;break;default:return}let u=o.format();c.has(u)||c.set(u,o)}),this.deploy||(0,Z.defineProperties)(this,{deploy:en.ConstructorFragment.from("constructor()")}),(0,Z.defineProperties)(this,{fallback:s,receive:i})}format(e){let t=e?"minimal":"full";return this.fragments.map(s=>s.format(t))}formatJson(){let e=this.fragments.map(t=>t.format("json"));return JSON.stringify(e.map(t=>JSON.parse(t)))}getAbiCoder(){return s3.AbiCoder.defaultAbiCoder()}#s(e,t,n){if((0,Z.isHexString)(e)){let i=e.toLowerCase();for(let o of this.#r.values())if(i===o.selector)return o;return null}if(e.indexOf("(")===-1){let i=[];for(let[o,a]of this.#r)o.split("(")[0]===e&&i.push(a);if(t){let o=t.length>0?t[t.length-1]:null,a=t.length,c=!0;zh.Typed.isTyped(o)&&o.type==="overrides"&&(c=!1,a--);for(let u=i.length-1;u>=0;u--){let l=i[u].inputs.length;l!==a&&(!c||l!==a-1)&&i.splice(u,1)}for(let u=i.length-1;u>=0;u--){let l=i[u].inputs;for(let f=0;f<t.length;f++)if(zh.Typed.isTyped(t[f])){if(f>=l.length){if(t[f].type==="overrides")continue;i.splice(u,1);break}if(t[f].type!==l[f].baseType){i.splice(u,1);break}}}}if(i.length===1&&t&&t.length!==i[0].inputs.length){let o=t[t.length-1];(o==null||Array.isArray(o)||typeof o!="object")&&i.splice(0,1)}if(i.length===0)return null;if(i.length>1&&n){let o=i.map(a=>JSON.stringify(a.format())).join(", ");(0,Z.assertArgument)(!1,`ambiguous function description (i.e. matches ${o})`,"key",e)}return i[0]}let s=this.#r.get(en.FunctionFragment.from(e).format());return s||null}getFunctionName(e){let t=this.#s(e,null,!1);return(0,Z.assertArgument)(t,"no matching function","key",e),t.name}hasFunction(e){return!!this.#s(e,null,!1)}getFunction(e,t){return this.#s(e,t||null,!0)}forEachFunction(e){let t=Array.from(this.#r.keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){let s=t[n];e(this.#r.get(s),n)}}#o(e,t,n){if((0,Z.isHexString)(e)){let i=e.toLowerCase();for(let o of this.#t.values())if(i===o.topicHash)return o;return null}if(e.indexOf("(")===-1){let i=[];for(let[o,a]of this.#t)o.split("(")[0]===e&&i.push(a);if(t){for(let o=i.length-1;o>=0;o--)i[o].inputs.length<t.length&&i.splice(o,1);for(let o=i.length-1;o>=0;o--){let a=i[o].inputs;for(let c=0;c<t.length;c++)if(zh.Typed.isTyped(t[c])&&t[c].type!==a[c].baseType){i.splice(o,1);break}}}if(i.length===0)return null;if(i.length>1&&n){let o=i.map(a=>JSON.stringify(a.format())).join(", ");(0,Z.assertArgument)(!1,`ambiguous event description (i.e. matches ${o})`,"key",e)}return i[0]}let s=this.#t.get(en.EventFragment.from(e).format());return s||null}getEventName(e){let t=this.#o(e,null,!1);return(0,Z.assertArgument)(t,"no matching event","key",e),t.name}hasEvent(e){return!!this.#o(e,null,!1)}getEvent(e,t){return this.#o(e,t||null,!0)}forEachEvent(e){let t=Array.from(this.#t.keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){let s=t[n];e(this.#t.get(s),n)}}getError(e,t){if((0,Z.isHexString)(e)){let s=e.toLowerCase();if(o3[s])return en.ErrorFragment.from(o3[s].signature);for(let i of this.#e.values())if(s===i.selector)return i;return null}if(e.indexOf("(")===-1){let s=[];for(let[i,o]of this.#e)i.split("(")[0]===e&&s.push(o);if(s.length===0)return e==="Error"?en.ErrorFragment.from("error Error(string)"):e==="Panic"?en.ErrorFragment.from("error Panic(uint256)"):null;if(s.length>1){let i=s.map(o=>JSON.stringify(o.format())).join(", ");(0,Z.assertArgument)(!1,`ambiguous error description (i.e. ${i})`,"name",e)}return s[0]}if(e=en.ErrorFragment.from(e).format(),e==="Error(string)")return en.ErrorFragment.from("error Error(string)");if(e==="Panic(uint256)")return en.ErrorFragment.from("error Panic(uint256)");let n=this.#e.get(e);return n||null}forEachError(e){let t=Array.from(this.#e.keys());t.sort((n,s)=>n.localeCompare(s));for(let n=0;n<t.length;n++){let s=t[n];e(this.#e.get(s),n)}}_decodeParams(e,t){return this.#n.decode(e,t)}_encodeParams(e,t){return this.#n.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){if(typeof e=="string"){let n=this.getError(e);(0,Z.assertArgument)(n,"unknown error","fragment",e),e=n}return(0,Z.assertArgument)((0,Z.dataSlice)(t,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",t),this._decodeParams(e.inputs,(0,Z.dataSlice)(t,4))}encodeErrorResult(e,t){if(typeof e=="string"){let n=this.getError(e);(0,Z.assertArgument)(n,"unknown error","fragment",e),e=n}return(0,Z.concat)([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionData(e,t){if(typeof e=="string"){let n=this.getFunction(e);(0,Z.assertArgument)(n,"unknown function","fragment",e),e=n}return(0,Z.assertArgument)((0,Z.dataSlice)(t,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",t),this._decodeParams(e.inputs,(0,Z.dataSlice)(t,4))}encodeFunctionData(e,t){if(typeof e=="string"){let n=this.getFunction(e);(0,Z.assertArgument)(n,"unknown function","fragment",e),e=n}return(0,Z.concat)([e.selector,this._encodeParams(e.inputs,t||[])])}decodeFunctionResult(e,t){if(typeof e=="string"){let i=this.getFunction(e);(0,Z.assertArgument)(i,"unknown function","fragment",e),e=i}let n="invalid length for result data",s=(0,Z.getBytesCopy)(t);if(s.length%32===0)try{return this.#n.decode(e.outputs,s)}catch{n="could not decode result data"}(0,Z.assert)(!1,n,"BAD_DATA",{value:(0,Z.hexlify)(s),info:{method:e.name,signature:e.format()}})}makeError(e,t){let n=(0,Z.getBytes)(e,"data"),s=s3.AbiCoder.getBuiltinCallException("call",t,n);if(s.message.startsWith("execution reverted (unknown custom error)")){let a=(0,Z.hexlify)(n.slice(0,4)),c=this.getError(a);if(c)try{let u=this.#n.decode(c.inputs,n.slice(4));s.revert={name:c.name,signature:c.format(),args:u},s.reason=s.revert.signature,s.message=`execution reverted: ${s.reason}`}catch{s.message="execution reverted (coult not decode custom error)"}}let o=this.parseTransaction(t);return o&&(s.invocation={method:o.name,signature:o.signature,args:o.args}),s}encodeFunctionResult(e,t){if(typeof e=="string"){let n=this.getFunction(e);(0,Z.assertArgument)(n,"unknown function","fragment",e),e=n}return(0,Z.hexlify)(this.#n.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){if(typeof e=="string"){let i=this.getEvent(e);(0,Z.assertArgument)(i,"unknown event","eventFragment",e),e=i}(0,Z.assert)(t.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:t.length,expectedCount:e.inputs.length});let n=[];e.anonymous||n.push(e.topicHash);let s=(i,o)=>i.type==="string"?(0,n3.id)(o):i.type==="bytes"?(0,r3.keccak256)((0,Z.hexlify)(o)):(i.type==="bool"&&typeof o=="boolean"?o=o?"0x01":"0x00":i.type.match(/^u?int/)?o=(0,Z.toBeHex)(o):i.type.match(/^bytes/)?o=(0,Z.zeroPadBytes)(o,32):i.type==="address"&&this.#n.encode(["address"],[o]),(0,Z.zeroPadValue)((0,Z.hexlify)(o),32));for(t.forEach((i,o)=>{let a=e.inputs[o];if(!a.indexed){(0,Z.assertArgument)(i==null,"cannot filter non-indexed parameters; must be null","contract."+a.name,i);return}i==null?n.push(null):a.baseType==="array"||a.baseType==="tuple"?(0,Z.assertArgument)(!1,"filtering with tuples or arrays not supported","contract."+a.name,i):Array.isArray(i)?n.push(i.map(c=>s(a,c))):n.push(s(a,i))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,t){if(typeof e=="string"){let o=this.getEvent(e);(0,Z.assertArgument)(o,"unknown event","eventFragment",e),e=o}let n=[],s=[],i=[];return e.anonymous||n.push(e.topicHash),(0,Z.assertArgument)(t.length===e.inputs.length,"event arguments/values mismatch","values",t),e.inputs.forEach((o,a)=>{let c=t[a];if(o.indexed)if(o.type==="string")n.push((0,n3.id)(c));else if(o.type==="bytes")n.push((0,r3.keccak256)(c));else{if(o.baseType==="tuple"||o.baseType==="array")throw new Error("not implemented");n.push(this.#n.encode([o.type],[c]))}else s.push(o),i.push(c)}),{data:this.#n.encode(s,i),topics:n}}decodeEventLog(e,t,n){if(typeof e=="string"){let g=this.getEvent(e);(0,Z.assertArgument)(g,"unknown event","eventFragment",e),e=g}if(n!=null&&!e.anonymous){let g=e.topicHash;(0,Z.assertArgument)((0,Z.isHexString)(n[0],32)&&n[0].toLowerCase()===g,"fragment/topic mismatch","topics[0]",n[0]),n=n.slice(1)}let s=[],i=[],o=[];e.inputs.forEach((g,x)=>{g.indexed?g.type==="string"||g.type==="bytes"||g.baseType==="tuple"||g.baseType==="array"?(s.push(en.ParamType.from({type:"bytes32",name:g.name})),o.push(!0)):(s.push(g),o.push(!1)):(i.push(g),o.push(!1))});let a=n!=null?this.#n.decode(s,(0,Z.concat)(n)):null,c=this.#n.decode(i,t,!0),u=[],l=[],f=0,h=0;return e.inputs.forEach((g,x)=>{let b=null;if(g.indexed)if(a==null)b=new Da(null);else if(o[x])b=new Da(a[h++]);else try{b=a[h++]}catch(y){b=y}else try{b=c[f++]}catch(y){b=y}u.push(b),l.push(g.name||null)}),Vh.Result.fromItems(u,l)}parseTransaction(e){let t=(0,Z.getBytes)(e.data,"tx.data"),n=(0,Z.getBigInt)(e.value!=null?e.value:0,"tx.value"),s=this.getFunction((0,Z.hexlify)(t.slice(0,4)));if(!s)return null;let i=this.#n.decode(s.inputs,t.slice(4));return new Pl(s,s.selector,i,n)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new El(t,t.topicHash,this.decodeEventLog(t,e.data,e.topics))}parseError(e){let t=(0,Z.hexlify)(e),n=this.getError((0,Z.dataSlice)(t,0,4));if(!n)return null;let s=this.#n.decode(n.inputs,(0,Z.dataSlice)(t,4));return new vl(n,n.selector,s)}static from(e){return e instanceof r?e:typeof e=="string"?new r(JSON.parse(e)):typeof e.formatJson=="function"?new r(e.formatJson()):typeof e.format=="function"?new r(e.format("json")):new r(e)}};Ut.Interface=Kh});var xo=P(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.Typed=xe.Result=xe.TransactionDescription=xe.LogDescription=xe.ErrorDescription=xe.Interface=xe.Indexed=xe.checkResultErrors=xe.StructFragment=xe.ParamType=xe.NamedFragment=xe.FunctionFragment=xe.Fragment=xe.FallbackFragment=xe.EventFragment=xe.ErrorFragment=xe.ConstructorFragment=xe.encodeBytes32String=xe.decodeBytes32String=xe.AbiCoder=void 0;var E_=Gh();Object.defineProperty(xe,"AbiCoder",{enumerable:!0,get:function(){return E_.AbiCoder}});var c3=t3();Object.defineProperty(xe,"decodeBytes32String",{enumerable:!0,get:function(){return c3.decodeBytes32String}});Object.defineProperty(xe,"encodeBytes32String",{enumerable:!0,get:function(){return c3.encodeBytes32String}});var Rn=ml();Object.defineProperty(xe,"ConstructorFragment",{enumerable:!0,get:function(){return Rn.ConstructorFragment}});Object.defineProperty(xe,"ErrorFragment",{enumerable:!0,get:function(){return Rn.ErrorFragment}});Object.defineProperty(xe,"EventFragment",{enumerable:!0,get:function(){return Rn.EventFragment}});Object.defineProperty(xe,"FallbackFragment",{enumerable:!0,get:function(){return Rn.FallbackFragment}});Object.defineProperty(xe,"Fragment",{enumerable:!0,get:function(){return Rn.Fragment}});Object.defineProperty(xe,"FunctionFragment",{enumerable:!0,get:function(){return Rn.FunctionFragment}});Object.defineProperty(xe,"NamedFragment",{enumerable:!0,get:function(){return Rn.NamedFragment}});Object.defineProperty(xe,"ParamType",{enumerable:!0,get:function(){return Rn.ParamType}});Object.defineProperty(xe,"StructFragment",{enumerable:!0,get:function(){return Rn.StructFragment}});var Hs=a3();Object.defineProperty(xe,"checkResultErrors",{enumerable:!0,get:function(){return Hs.checkResultErrors}});Object.defineProperty(xe,"Indexed",{enumerable:!0,get:function(){return Hs.Indexed}});Object.defineProperty(xe,"Interface",{enumerable:!0,get:function(){return Hs.Interface}});Object.defineProperty(xe,"ErrorDescription",{enumerable:!0,get:function(){return Hs.ErrorDescription}});Object.defineProperty(xe,"LogDescription",{enumerable:!0,get:function(){return Hs.LogDescription}});Object.defineProperty(xe,"TransactionDescription",{enumerable:!0,get:function(){return Hs.TransactionDescription}});Object.defineProperty(xe,"Result",{enumerable:!0,get:function(){return Hs.Result}});var P_=hn();Object.defineProperty(xe,"Typed",{enumerable:!0,get:function(){return P_.Typed}})});var yo=P(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.TransactionResponse=nr.TransactionReceipt=nr.Log=nr.Block=nr.copyRequest=nr.FeeData=void 0;var Xe=$(),v_=Gt(),u3=BigInt(0);function mo(r){return r??null}function pt(r){return r==null?null:r.toString()}var $h=class{gasPrice;maxFeePerGas;maxPriorityFeePerGas;constructor(e,t,n){(0,Xe.defineProperties)(this,{gasPrice:mo(e),maxFeePerGas:mo(t),maxPriorityFeePerGas:mo(n)})}toJSON(){let{gasPrice:e,maxFeePerGas:t,maxPriorityFeePerGas:n}=this;return{_type:"FeeData",gasPrice:pt(e),maxFeePerGas:pt(t),maxPriorityFeePerGas:pt(n)}}};nr.FeeData=$h;function __(r){let e={};r.to&&(e.to=r.to),r.from&&(e.from=r.from),r.data&&(e.data=(0,Xe.hexlify)(r.data));let t="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(let s of t)!(s in r)||r[s]==null||(e[s]=(0,Xe.getBigInt)(r[s],`request.${s}`));let n="type,nonce".split(/,/);for(let s of n)!(s in r)||r[s]==null||(e[s]=(0,Xe.getNumber)(r[s],`request.${s}`));return r.accessList&&(e.accessList=(0,v_.accessListify)(r.accessList)),r.authorizationList&&(e.authorizationList=r.authorizationList.slice()),"blockTag"in r&&(e.blockTag=r.blockTag),"enableCcipRead"in r&&(e.enableCcipRead=!!r.enableCcipRead),"customData"in r&&(e.customData=r.customData),"blobVersionedHashes"in r&&r.blobVersionedHashes&&(e.blobVersionedHashes=r.blobVersionedHashes.slice()),"kzg"in r&&(e.kzg=r.kzg),"blobs"in r&&r.blobs&&(e.blobs=r.blobs.map(s=>(0,Xe.isBytesLike)(s)?(0,Xe.hexlify)(s):Object.assign({},s))),e}nr.copyRequest=__;var Jh=class{provider;number;hash;timestamp;parentHash;parentBeaconBlockRoot;nonce;difficulty;gasLimit;gasUsed;stateRoot;receiptsRoot;blobGasUsed;excessBlobGas;miner;prevRandao;extraData;baseFeePerGas;#e;constructor(e,t){this.#e=e.transactions.map(n=>typeof n!="string"?new kl(n,t):n),(0,Xe.defineProperties)(this,{provider:t,hash:mo(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:mo(e.prevRandao),extraData:e.extraData,baseFeePerGas:mo(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return this.#e.map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){let e=this.#e.slice();return e.length===0?[]:((0,Xe.assert)(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){let{baseFeePerGas:e,difficulty:t,extraData:n,gasLimit:s,gasUsed:i,hash:o,miner:a,prevRandao:c,nonce:u,number:l,parentHash:f,parentBeaconBlockRoot:h,stateRoot:g,receiptsRoot:x,timestamp:b,transactions:y}=this;return{_type:"Block",baseFeePerGas:pt(e),difficulty:pt(t),extraData:n,gasLimit:pt(s),gasUsed:pt(i),blobGasUsed:pt(this.blobGasUsed),excessBlobGas:pt(this.excessBlobGas),hash:o,miner:a,prevRandao:c,nonce:u,number:l,parentHash:f,timestamp:b,parentBeaconBlockRoot:h,stateRoot:g,receiptsRoot:x,transactions:y}}[Symbol.iterator](){let e=0,t=this.transactions;return{next:()=>e<this.length?{value:t[e++],done:!1}:{value:void 0,done:!0}}}get length(){return this.#e.length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let t;if(typeof e=="number")t=this.#e[e];else{let n=e.toLowerCase();for(let s of this.#e)if(typeof s=="string"){if(s!==n)continue;t=s;break}else{if(s.hash!==n)continue;t=s;break}}if(t==null)throw new Error("no such tx");return typeof t=="string"?await this.provider.getTransaction(t):t}getPrefetchedTransaction(e){let t=this.prefetchedTransactions;if(typeof e=="number")return t[e];e=e.toLowerCase();for(let n of t)if(n.hash===e)return n;(0,Xe.assertArgument)(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return k_(this)}};nr.Block=Jh;var _l=class{provider;transactionHash;blockHash;blockNumber;removed;address;data;topics;index;transactionIndex;constructor(e,t){this.provider=t;let n=Object.freeze(e.topics.slice());(0,Xe.defineProperties)(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:n,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){let{address:e,blockHash:t,blockNumber:n,data:s,index:i,removed:o,topics:a,transactionHash:c,transactionIndex:u}=this;return{_type:"log",address:e,blockHash:t,blockNumber:n,data:s,index:i,removed:o,topics:a,transactionHash:c,transactionIndex:u}}async getBlock(){let e=await this.provider.getBlock(this.blockHash);return(0,Xe.assert)(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){let e=await this.provider.getTransaction(this.transactionHash);return(0,Xe.assert)(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){let e=await this.provider.getTransactionReceipt(this.transactionHash);return(0,Xe.assert)(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return T_(this)}};nr.Log=_l;var Qh=class{provider;to;from;contractAddress;hash;index;blockHash;blockNumber;logsBloom;gasUsed;blobGasUsed;cumulativeGasUsed;gasPrice;blobGasPrice;type;status;root;#e;constructor(e,t){this.#e=Object.freeze(e.logs.map(s=>new _l(s,t)));let n=u3;e.effectiveGasPrice!=null?n=e.effectiveGasPrice:e.gasPrice!=null&&(n=e.gasPrice),(0,Xe.defineProperties)(this,{provider:t,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:n,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return this.#e}toJSON(){let{to:e,from:t,contractAddress:n,hash:s,index:i,blockHash:o,blockNumber:a,logsBloom:c,logs:u,status:l,root:f}=this;return{_type:"TransactionReceipt",blockHash:o,blockNumber:a,contractAddress:n,cumulativeGasUsed:pt(this.cumulativeGasUsed),from:t,gasPrice:pt(this.gasPrice),blobGasUsed:pt(this.blobGasUsed),blobGasPrice:pt(this.blobGasPrice),gasUsed:pt(this.gasUsed),hash:s,index:i,logs:u,logsBloom:c,root:f,status:l,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){let e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){let e=await this.provider.getTransaction(this.hash);if(e==null)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return f3(this)}reorderedEvent(e){return(0,Xe.assert)(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),l3(this,e)}};nr.TransactionReceipt=Qh;var kl=class r{provider;blockNumber;blockHash;index;hash;type;to;from;nonce;gasLimit;gasPrice;maxPriorityFeePerGas;maxFeePerGas;maxFeePerBlobGas;data;value;chainId;signature;accessList;blobVersionedHashes;authorizationList;#e;constructor(e,t){this.provider=t,this.blockNumber=e.blockNumber!=null?e.blockNumber:null,this.blockHash=e.blockHash!=null?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=e.maxPriorityFeePerGas!=null?e.maxPriorityFeePerGas:null,this.maxFeePerGas=e.maxFeePerGas!=null?e.maxFeePerGas:null,this.maxFeePerBlobGas=e.maxFeePerBlobGas!=null?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,this.blobVersionedHashes=e.blobVersionedHashes!=null?e.blobVersionedHashes:null,this.authorizationList=e.authorizationList!=null?e.authorizationList:null,this.#e=-1}toJSON(){let{blockNumber:e,blockHash:t,index:n,hash:s,type:i,to:o,from:a,nonce:c,data:u,signature:l,accessList:f,blobVersionedHashes:h}=this;return{_type:"TransactionResponse",accessList:f,blockNumber:e,blockHash:t,blobVersionedHashes:h,chainId:pt(this.chainId),data:u,from:a,gasLimit:pt(this.gasLimit),gasPrice:pt(this.gasPrice),hash:s,maxFeePerGas:pt(this.maxFeePerGas),maxPriorityFeePerGas:pt(this.maxPriorityFeePerGas),maxFeePerBlobGas:pt(this.maxFeePerBlobGas),nonce:c,signature:l,to:o,index:n,type:i,value:pt(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){let n=await this.getTransaction();n&&(e=n.blockNumber)}if(e==null)return null;let t=this.provider.getBlock(e);if(t==null)throw new Error("TODO");return t}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){let{tx:t,blockNumber:n}=await(0,Xe.resolveProperties)({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return t==null||t.blockNumber==null?0:n-t.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,t){let n=e??1,s=t??0,i=this.#e,o=-1,a=i===-1,c=async()=>{if(a)return null;let{blockNumber:h,nonce:g}=await(0,Xe.resolveProperties)({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(g<this.nonce){i=h;return}if(a)return null;let x=await this.getTransaction();if(!(x&&x.blockNumber!=null))for(o===-1&&(o=i-3,o<this.#e&&(o=this.#e));o<=h;){if(a)return null;let b=await this.provider.getBlock(o,!0);if(b==null)return;for(let y of b)if(y===this.hash)return;for(let y=0;y<b.length;y++){let m=await b.getTransaction(y);if(m.from===this.from&&m.nonce===this.nonce){if(a)return null;let E=await this.provider.getTransactionReceipt(m.hash);if(E==null||h-E.blockNumber+1<n)return;let _="replaced";m.data===this.data&&m.to===this.to&&m.value===this.value?_="repriced":m.data==="0x"&&m.from===m.to&&m.value===u3&&(_="cancelled"),(0,Xe.assert)(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:_==="replaced"||_==="cancelled",reason:_,replacement:m.replaceableTransaction(i),hash:m.hash,receipt:E})}}o++}},u=h=>{if(h==null||h.status!==0)return h;(0,Xe.assert)(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:h.to,from:h.from,data:""},receipt:h})},l=await this.provider.getTransactionReceipt(this.hash);if(n===0)return u(l);if(l){if(n===1||await l.confirmations()>=n)return u(l)}else if(await c(),n===0)return null;return await new Promise((h,g)=>{let x=[],b=()=>{x.forEach(m=>m())};if(x.push(()=>{a=!0}),s>0){let m=setTimeout(()=>{b(),g((0,Xe.makeError)("wait for transaction timeout","TIMEOUT"))},s);x.push(()=>{clearTimeout(m)})}let y=async m=>{if(await m.confirmations()>=n){b();try{h(u(m))}catch(E){g(E)}}};if(x.push(()=>{this.provider.off(this.hash,y)}),this.provider.on(this.hash,y),i>=0){let m=async()=>{try{await c()}catch(E){if((0,Xe.isError)(E,"TRANSACTION_REPLACED")){b(),g(E);return}}a||this.provider.once("block",m)};x.push(()=>{this.provider.off("block",m)}),this.provider.once("block",m)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return(0,Xe.assert)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),f3(this)}reorderedEvent(e){return(0,Xe.assert)(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),(0,Xe.assert)(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),l3(this,e)}replaceableTransaction(e){(0,Xe.assertArgument)(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);let t=new r(this,this.provider);return t.#e=e,t}};nr.TransactionResponse=kl;function k_(r){return{orphan:"drop-block",hash:r.hash,number:r.number}}function l3(r,e){return{orphan:"reorder-transaction",tx:r,other:e}}function f3(r){return{orphan:"drop-transaction",tx:r}}function T_(r){return{orphan:"drop-log",log:{transactionHash:r.transactionHash,blockHash:r.blockHash,blockNumber:r.blockNumber,address:r.address,data:r.data,topics:Object.freeze(r.topics.slice()),index:r.index}}}});var Zh=P(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.ContractEventPayload=sr.ContractUnknownEventPayload=sr.ContractTransactionResponse=sr.ContractTransactionReceipt=sr.UndecodedEventLog=sr.EventLog=void 0;var Sl=yo(),Ha=$(),qa=class extends Sl.Log{interface;fragment;args;constructor(e,t,n){super(e,e.provider);let s=t.decodeEventLog(n,e.data,e.topics);(0,Ha.defineProperties)(this,{args:s,fragment:n,interface:t})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}};sr.EventLog=qa;var Tl=class extends Sl.Log{error;constructor(e,t){super(e,e.provider),(0,Ha.defineProperties)(this,{error:t})}};sr.UndecodedEventLog=Tl;var Bl=class extends Sl.TransactionReceipt{#e;constructor(e,t,n){super(n,t),this.#e=e}get logs(){return super.logs.map(e=>{let t=e.topics.length?this.#e.getEvent(e.topics[0]):null;if(t)try{return new qa(e,this.#e,t)}catch(n){return new Tl(e,n)}return e})}};sr.ContractTransactionReceipt=Bl;var Wh=class extends Sl.TransactionResponse{#e;constructor(e,t,n){super(n,t),this.#e=e}async wait(e,t){let n=await super.wait(e,t);return n==null?null:new Bl(this.#e,this.provider,n)}};sr.ContractTransactionResponse=Wh;var Ol=class extends Ha.EventPayload{log;constructor(e,t,n,s){super(e,t,n),(0,Ha.defineProperties)(this,{log:s})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}};sr.ContractUnknownEventPayload=Ol;var Yh=class extends Ol{constructor(e,t,n,s,i){super(e,t,n,new qa(i,e.interface,s));let o=e.interface.decodeEventLog(s,this.log.data,this.log.topics);(0,Ha.defineProperties)(this,{args:o,fragment:s})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}};sr.ContractEventPayload=Yh});var op=P(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.Contract=xn.BaseContract=xn.resolveArgs=xn.copyOverrides=void 0;var np=xo(),wo=ht(),p3=yo(),ge=$(),Gs=Zh(),d3=BigInt(0);function g3(r){return r&&typeof r.call=="function"}function b3(r){return r&&typeof r.estimateGas=="function"}function Rl(r){return r&&typeof r.resolveName=="function"}function x3(r){return r&&typeof r.sendTransaction=="function"}function m3(r){if(r!=null){if(Rl(r))return r;if(r.provider)return r.provider}}var Xh=class{#e;fragment;constructor(e,t,n){if((0,ge.defineProperties)(this,{fragment:t}),t.inputs.length<n.length)throw new Error("too many arguments");let s=zs(e.runner,"resolveName"),i=Rl(s)?s:null;this.#e=async function(){let o=await Promise.all(t.inputs.map((a,c)=>n[c]==null?null:a.walkAsync(n[c],(l,f)=>l==="address"?Array.isArray(f)?Promise.all(f.map(h=>(0,wo.resolveAddress)(h,i))):(0,wo.resolveAddress)(f,i):f)));return e.interface.encodeFilterTopics(t,o)}()}getTopicFilter(){return this.#e}};function zs(r,e){return r==null?null:typeof r[e]=="function"?r:r.provider&&typeof r.provider[e]=="function"?r.provider:null}function qs(r){return r==null?null:r.provider||null}async function sp(r,e){let t=np.Typed.dereference(r,"overrides");(0,ge.assertArgument)(typeof t=="object","invalid overrides parameter","overrides",r);let n=(0,p3.copyRequest)(t);return(0,ge.assertArgument)(n.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",n.to),(0,ge.assertArgument)(n.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",n.data),n.from&&(n.from=n.from),n}xn.copyOverrides=sp;async function y3(r,e,t){let n=zs(r,"resolveName"),s=Rl(n)?n:null;return await Promise.all(e.map((i,o)=>i.walkAsync(t[o],(a,c)=>(c=np.Typed.dereference(c,a),a==="address"?(0,wo.resolveAddress)(c,s):c))))}xn.resolveArgs=y3;function B_(r){let e=async function(o){let a=await sp(o,["data"]);a.to=await r.getAddress(),a.from&&(a.from=await(0,wo.resolveAddress)(a.from,m3(r.runner)));let c=r.interface,u=(0,ge.getBigInt)(a.value||d3,"overrides.value")===d3,l=(a.data||"0x")==="0x";c.fallback&&!c.fallback.payable&&c.receive&&!l&&!u&&(0,ge.assertArgument)(!1,"cannot send data to receive or send value to non-payable fallback","overrides",o),(0,ge.assertArgument)(c.fallback||l,"cannot send data to receive-only contract","overrides.data",a.data);let f=c.receive||c.fallback&&c.fallback.payable;return(0,ge.assertArgument)(f||u,"cannot send value to non-payable fallback","overrides.value",a.value),(0,ge.assertArgument)(c.fallback||l,"cannot send data to receive-only contract","overrides.data",a.data),a},t=async function(o){let a=zs(r.runner,"call");(0,ge.assert)(g3(a),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});let c=await e(o);try{return await a.call(c)}catch(u){throw(0,ge.isCallException)(u)&&u.data?r.interface.makeError(u.data,c):u}},n=async function(o){let a=r.runner;(0,ge.assert)(x3(a),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let c=await a.sendTransaction(await e(o)),u=qs(r.runner);return new Gs.ContractTransactionResponse(r.interface,u,c)},s=async function(o){let a=zs(r.runner,"estimateGas");return(0,ge.assert)(b3(a),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await a.estimateGas(await e(o))},i=async o=>await n(o);return(0,ge.defineProperties)(i,{_contract:r,estimateGas:s,populateTransaction:e,send:n,staticCall:t}),i}function O_(r,e){let t=function(...u){let l=r.interface.getFunction(e,u);return(0,ge.assert)(l,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:u}}),l},n=async function(...u){let l=t(...u),f={};if(l.inputs.length+1===u.length&&(f=await sp(u.pop()),f.from&&(f.from=await(0,wo.resolveAddress)(f.from,m3(r.runner)))),l.inputs.length!==u.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");let h=await y3(r.runner,l.inputs,u);return Object.assign({},f,await(0,ge.resolveProperties)({to:r.getAddress(),data:r.interface.encodeFunctionData(l,h)}))},s=async function(...u){let l=await a(...u);return l.length===1?l[0]:l},i=async function(...u){let l=r.runner;(0,ge.assert)(x3(l),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let f=await l.sendTransaction(await n(...u)),h=qs(r.runner);return new Gs.ContractTransactionResponse(r.interface,h,f)},o=async function(...u){let l=zs(r.runner,"estimateGas");return(0,ge.assert)(b3(l),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await l.estimateGas(await n(...u))},a=async function(...u){let l=zs(r.runner,"call");(0,ge.assert)(g3(l),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});let f=await n(...u),h="0x";try{h=await l.call(f)}catch(x){throw(0,ge.isCallException)(x)&&x.data?r.interface.makeError(x.data,f):x}let g=t(...u);return r.interface.decodeFunctionResult(g,h)},c=async(...u)=>t(...u).constant?await s(...u):await i(...u);return(0,ge.defineProperties)(c,{name:r.interface.getFunctionName(e),_contract:r,_key:e,getFragment:t,estimateGas:o,populateTransaction:n,send:i,staticCall:s,staticCallResult:a}),Object.defineProperty(c,"fragment",{configurable:!1,enumerable:!0,get:()=>{let u=r.interface.getFunction(e);return(0,ge.assert)(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),u}}),c}function S_(r,e){let t=function(...s){let i=r.interface.getEvent(e,s);return(0,ge.assert)(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:s}}),i},n=function(...s){return new Xh(r,t(...s),s)};return(0,ge.defineProperties)(n,{name:r.interface.getEventName(e),_contract:r,_key:e,getFragment:t}),Object.defineProperty(n,"fragment",{configurable:!1,enumerable:!0,get:()=>{let s=r.interface.getEvent(e);return(0,ge.assert)(s,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),s}}),n}var Nl=Symbol.for("_ethersInternal_contract"),w3=new WeakMap;function C_(r,e){w3.set(r[Nl],e)}function hr(r){return w3.get(r[Nl])}function N_(r){return r&&typeof r=="object"&&"getTopicFilter"in r&&typeof r.getTopicFilter=="function"&&r.fragment}async function ip(r,e){let t,n=null;if(Array.isArray(e)){let i=function(o){if((0,ge.isHexString)(o,32))return o;let a=r.interface.getEvent(o);return(0,ge.assertArgument)(a,"unknown fragment","name",o),a.topicHash};t=e.map(o=>o==null?null:Array.isArray(o)?o.map(i):i(o))}else e==="*"?t=[null]:typeof e=="string"?(0,ge.isHexString)(e,32)?t=[e]:(n=r.interface.getEvent(e),(0,ge.assertArgument)(n,"unknown fragment","event",e),t=[n.topicHash]):N_(e)?t=await e.getTopicFilter():"fragment"in e?(n=e.fragment,t=[n.topicHash]):(0,ge.assertArgument)(!1,"unknown event name","event",e);t=t.map(i=>{if(i==null)return null;if(Array.isArray(i)){let o=Array.from(new Set(i.map(a=>a.toLowerCase())).values());return o.length===1?o[0]:(o.sort(),o)}return i.toLowerCase()});let s=t.map(i=>i==null?"null":Array.isArray(i)?i.join("|"):i).join("&");return{fragment:n,tag:s,topics:t}}async function Ga(r,e){let{subs:t}=hr(r);return t.get((await ip(r,e)).tag)||null}async function h3(r,e,t){let n=qs(r.runner);(0,ge.assert)(n,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});let{fragment:s,tag:i,topics:o}=await ip(r,t),{addr:a,subs:c}=hr(r),u=c.get(i);if(!u){let f={address:a||r,topics:o},h=y=>{let m=s;if(m==null)try{m=r.interface.getEvent(y.topics[0])}catch{}if(m){let E=m,_=s?r.interface.decodeEventLog(s,y.data,y.topics):[];tp(r,t,_,C=>new Gs.ContractEventPayload(r,C,t,E,y))}else tp(r,t,[],E=>new Gs.ContractUnknownEventPayload(r,E,t,y))},g=[];u={tag:i,listeners:[],start:()=>{g.length||g.push(n.on(f,h))},stop:async()=>{if(g.length==0)return;let y=g;g=[],await Promise.all(y),n.off(f,h)}},c.set(i,u)}return u}var ep=Promise.resolve();async function I_(r,e,t,n){await ep;let s=await Ga(r,e);if(!s)return!1;let i=s.listeners.length;return s.listeners=s.listeners.filter(({listener:o,once:a})=>{let c=Array.from(t);n&&c.push(n(a?null:o));try{o.call(r,...c)}catch{}return!a}),s.listeners.length===0&&(s.stop(),hr(r).subs.delete(s.tag)),i>0}async function tp(r,e,t,n){try{await ep}catch{}let s=I_(r,e,t,n);return ep=s,await s}var Cl=["then"],Il=class r{target;interface;runner;filters;[Nl];fallback;constructor(e,t,n,s){(0,ge.assertArgument)(typeof e=="string"||(0,wo.isAddressable)(e),"invalid value for Contract target","target",e),n==null&&(n=null);let i=np.Interface.from(t);(0,ge.defineProperties)(this,{target:e,runner:n,interface:i}),Object.defineProperty(this,Nl,{value:{}});let o,a=null,c=null;if(s){let f=qs(n);c=new Gs.ContractTransactionResponse(this.interface,f,s)}let u=new Map;if(typeof e=="string")if((0,ge.isHexString)(e))a=e,o=Promise.resolve(e);else{let f=zs(n,"resolveName");if(!Rl(f))throw(0,ge.makeError)("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});o=f.resolveName(e).then(h=>{if(h==null)throw(0,ge.makeError)("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return hr(this).addr=h,h})}else o=e.getAddress().then(f=>{if(f==null)throw new Error("TODO");return hr(this).addr=f,f});C_(this,{addrPromise:o,addr:a,deployTx:c,subs:u});let l=new Proxy({},{get:(f,h,g)=>{if(typeof h=="symbol"||Cl.indexOf(h)>=0)return Reflect.get(f,h,g);try{return this.getEvent(h)}catch(x){if(!(0,ge.isError)(x,"INVALID_ARGUMENT")||x.argument!=="key")throw x}},has:(f,h)=>Cl.indexOf(h)>=0?Reflect.has(f,h):Reflect.has(f,h)||this.interface.hasEvent(String(h))});return(0,ge.defineProperties)(this,{filters:l}),(0,ge.defineProperties)(this,{fallback:i.receive||i.fallback?B_(this):null}),new Proxy(this,{get:(f,h,g)=>{if(typeof h=="symbol"||h in f||Cl.indexOf(h)>=0)return Reflect.get(f,h,g);try{return f.getFunction(h)}catch(x){if(!(0,ge.isError)(x,"INVALID_ARGUMENT")||x.argument!=="key")throw x}},has:(f,h)=>typeof h=="symbol"||h in f||Cl.indexOf(h)>=0?Reflect.has(f,h):f.interface.hasFunction(h)})}connect(e){return new r(this.target,this.interface,e)}attach(e){return new r(e,this.interface,this.runner)}async getAddress(){return await hr(this).addrPromise}async getDeployedCode(){let e=qs(this.runner);(0,ge.assert)(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});let t=await e.getCode(await this.getAddress());return t==="0x"?null:t}async waitForDeployment(){let e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;let n=qs(this.runner);return(0,ge.assert)(n!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((s,i)=>{let o=async()=>{try{if(await this.getDeployedCode()!=null)return s(this);n.once("block",o)}catch(a){i(a)}};o()})}deploymentTransaction(){return hr(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),O_(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),S_(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,t,n){t==null&&(t=0),n==null&&(n="latest");let{addr:s,addrPromise:i}=hr(this),o=s||await i,{fragment:a,topics:c}=await ip(this,e),u={address:o,topics:c,fromBlock:t,toBlock:n},l=qs(this.runner);return(0,ge.assert)(l,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await l.getLogs(u)).map(f=>{let h=a;if(h==null)try{h=this.interface.getEvent(f.topics[0])}catch{}if(h)try{return new Gs.EventLog(f,this.interface,h)}catch(g){return new Gs.UndecodedEventLog(f,g)}return new p3.Log(f,l)})}async on(e,t){let n=await h3(this,"on",e);return n.listeners.push({listener:t,once:!1}),n.start(),this}async once(e,t){let n=await h3(this,"once",e);return n.listeners.push({listener:t,once:!0}),n.start(),this}async emit(e,...t){return await tp(this,e,t,null)}async listenerCount(e){if(e){let s=await Ga(this,e);return s?s.listeners.length:0}let{subs:t}=hr(this),n=0;for(let{listeners:s}of t.values())n+=s.length;return n}async listeners(e){if(e){let s=await Ga(this,e);return s?s.listeners.map(({listener:i})=>i):[]}let{subs:t}=hr(this),n=[];for(let{listeners:s}of t.values())n=n.concat(s.map(({listener:i})=>i));return n}async off(e,t){let n=await Ga(this,e);if(!n)return this;if(t){let s=n.listeners.map(({listener:i})=>i).indexOf(t);s>=0&&n.listeners.splice(s,1)}return(t==null||n.listeners.length===0)&&(n.stop(),hr(this).subs.delete(n.tag)),this}async removeAllListeners(e){if(e){let t=await Ga(this,e);if(!t)return this;t.stop(),hr(this).subs.delete(t.tag)}else{let{subs:t}=hr(this);for(let{tag:n,stop:s}of t.values())s(),t.delete(n)}return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return await this.off(e,t)}static buildClass(e){class t extends r{constructor(s,i=null){super(s,e,i)}}return t}static from(e,t,n){return n==null&&(n=null),new this(e,t,n)}};xn.BaseContract=Il;function R_(){return Il}var rp=class extends R_(){};xn.Contract=rp});var A3=P(Ml=>{"use strict";Object.defineProperty(Ml,"__esModule",{value:!0});Ml.ContractFactory=void 0;var L_=xo(),M_=ht(),ps=$(),Ll=op(),ap=class r{interface;bytecode;runner;constructor(e,t,n){let s=L_.Interface.from(e);t instanceof Uint8Array||(typeof t=="object"&&(t=t.object),t.startsWith("0x")||(t="0x"+t)),t=(0,ps.hexlify)((0,ps.getBytes)(t)),(0,ps.defineProperties)(this,{bytecode:t,interface:s,runner:n||null})}attach(e){return new Ll.BaseContract(e,this.interface,this.runner)}async getDeployTransaction(...e){let t={},n=this.interface.deploy;if(n.inputs.length+1===e.length&&(t=await(0,Ll.copyOverrides)(e.pop())),n.inputs.length!==e.length)throw new Error("incorrect number of arguments to constructor");let s=await(0,Ll.resolveArgs)(this.runner,n.inputs,e),i=(0,ps.concat)([this.bytecode,this.interface.encodeDeploy(s)]);return Object.assign({},t,{data:i})}async deploy(...e){let t=await this.getDeployTransaction(...e);(0,ps.assert)(this.runner&&typeof this.runner.sendTransaction=="function","factory runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});let n=await this.runner.sendTransaction(t),s=(0,M_.getCreateAddress)(n);return new Ll.BaseContract(s,this.interface,this.runner,n)}connect(e){return new r(this.interface,this.bytecode,e)}static fromSolidity(e,t){(0,ps.assertArgument)(e!=null,"bad compiler output","output",e),typeof e=="string"&&(e=JSON.parse(e));let n=e.abi,s="";return e.bytecode?s=e.bytecode:e.evm&&e.evm.bytecode&&(s=e.evm.bytecode),new this(n,s,t)}};Ml.ContractFactory=ap});var za=P(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.UndecodedEventLog=yt.EventLog=yt.ContractTransactionResponse=yt.ContractTransactionReceipt=yt.ContractUnknownEventPayload=yt.ContractEventPayload=yt.ContractFactory=yt.Contract=yt.BaseContract=void 0;var E3=op();Object.defineProperty(yt,"BaseContract",{enumerable:!0,get:function(){return E3.BaseContract}});Object.defineProperty(yt,"Contract",{enumerable:!0,get:function(){return E3.Contract}});var j_=A3();Object.defineProperty(yt,"ContractFactory",{enumerable:!0,get:function(){return j_.ContractFactory}});var Ao=Zh();Object.defineProperty(yt,"ContractEventPayload",{enumerable:!0,get:function(){return Ao.ContractEventPayload}});Object.defineProperty(yt,"ContractUnknownEventPayload",{enumerable:!0,get:function(){return Ao.ContractUnknownEventPayload}});Object.defineProperty(yt,"ContractTransactionReceipt",{enumerable:!0,get:function(){return Ao.ContractTransactionReceipt}});Object.defineProperty(yt,"ContractTransactionResponse",{enumerable:!0,get:function(){return Ao.ContractTransactionResponse}});Object.defineProperty(yt,"EventLog",{enumerable:!0,get:function(){return Ao.EventLog}});Object.defineProperty(yt,"UndecodedEventLog",{enumerable:!0,get:function(){return Ao.UndecodedEventLog}})});var hp=P(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.EnsResolver=gs.BasicMulticoinProviderPlugin=gs.MulticoinProviderPlugin=void 0;var U_=ht(),P3=Vi(),cp=za(),up=bn(),Kt=$();function lp(r){return r.match(/^ipfs:\/\/ipfs\//i)?r=r.substring(12):r.match(/^ipfs:\/\//i)?r=r.substring(7):(0,Kt.assertArgument)(!1,"unsupported IPFS format","link",r),`https://gateway.ipfs.io/ipfs/${r}`}var Ka=class{name;constructor(e){(0,Kt.defineProperties)(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,t){throw new Error("unsupported coin")}async decodeAddress(e,t){throw new Error("unsupported coin")}};gs.MulticoinProviderPlugin=Ka;var F_="org.ethers.plugins.provider.BasicMulticoin",fp=class extends Ka{constructor(){super(F_)}};gs.BasicMulticoinProviderPlugin=fp;var _3=new RegExp("^(ipfs)://(.*)$","i"),v3=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),_3,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")],dp=class r{provider;address;name;#e;#t;constructor(e,t,n){(0,Kt.defineProperties)(this,{provider:e,address:t,name:n}),this.#e=null,this.#t=new cp.Contract(t,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e)}async supportsWildcard(){return this.#e==null&&(this.#e=(async()=>{try{return await this.#t.supportsInterface("0x9061b923")}catch(e){if((0,Kt.isError)(e,"CALL_EXCEPTION"))return!1;throw this.#e=null,e}})()),await this.#e}async#r(e,t){t=(t||[]).slice();let n=this.#t.interface;t.unshift((0,up.namehash)(this.name));let s=null;await this.supportsWildcard()&&(s=n.getFunction(e),(0,Kt.assert)(s,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),t=[(0,up.dnsEncode)(this.name,255),n.encodeFunctionData(s,t)],e="resolve(bytes,bytes)"),t.push({enableCcipRead:!0});try{let i=await this.#t[e](...t);return s?n.decodeFunctionResult(s,i)[0]:i}catch(i){if(!(0,Kt.isError)(i,"CALL_EXCEPTION"))throw i}return null}async getAddress(e){if(e==null&&(e=60),e===60)try{let i=await this.#r("addr(bytes32)");return i==null||i===P3.ZeroAddress?null:i}catch(i){if((0,Kt.isError)(i,"CALL_EXCEPTION"))return null;throw i}if(e>=0&&e<2147483648){let i=e+2147483648,o=await this.#r("addr(bytes32,uint)",[i]);if((0,Kt.isHexString)(o,20))return(0,U_.getAddress)(o)}let t=null;for(let i of this.provider.plugins)if(i instanceof Ka&&i.supportsCoinType(e)){t=i;break}if(t==null)return null;let n=await this.#r("addr(bytes32,uint)",[e]);if(n==null||n==="0x")return null;let s=await t.decodeAddress(e,n);if(s!=null)return s;(0,Kt.assert)(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:n}})}async getText(e){let t=await this.#r("text(bytes32,string)",[e]);return t==null||t==="0x"?null:t}async getContentHash(){let e=await this.#r("contenthash(bytes32)");if(e==null||e==="0x")return null;let t=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){let s=t[1]==="e3010170"?"ipfs":"ipns",i=parseInt(t[4],16);if(t[5].length===i*2)return`${s}://${(0,Kt.encodeBase58)("0x"+t[2])}`}let n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(n&&n[1].length===64)return`bzz://${n[1]}`;(0,Kt.assert)(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){let e=[{type:"name",value:this.name}];try{let t=await this.getText("avatar");if(t==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:t});for(let n=0;n<v3.length;n++){let s=t.match(v3[n]);if(s==null)continue;let i=s[1].toLowerCase();switch(i){case"https":case"data":return e.push({type:"url",value:t}),{linkage:e,url:t};case"ipfs":{let o=lp(t);return e.push({type:"ipfs",value:t}),e.push({type:"url",value:o}),{linkage:e,url:o}}case"erc721":case"erc1155":{let o=i==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:i,value:t});let a=await this.getAddress();if(a==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};let c=(s[2]||"").split("/");if(c.length!==2)return e.push({type:`!${i}caip`,value:s[2]||""}),{url:null,linkage:e};let u=c[1],l=new cp.Contract(c[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(i==="erc721"){let b=await l.ownerOf(u);if(a!==b)return e.push({type:"!owner",value:b}),{url:null,linkage:e};e.push({type:"owner",value:b})}else if(i==="erc1155"){let b=await l.balanceOf(a,u);if(!b)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:b.toString()})}let f=await l[o](u);if(f==null||f==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:f}),i==="erc1155"&&(f=f.replace("{id}",(0,Kt.toBeHex)(u,32).substring(2)),e.push({type:"metadata-url-expanded",value:f})),f.match(/^ipfs:/i)&&(f=lp(f)),e.push({type:"metadata-url",value:f});let h={},g=await new Kt.FetchRequest(f).send();g.assertOk();try{h=g.bodyJson}catch{try{e.push({type:"!metadata",value:g.bodyText})}catch{let m=g.body;return m&&e.push({type:"!metadata",value:(0,Kt.hexlify)(m)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!h)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(h)});let x=h.image;if(typeof x!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!x.match(/^(https:\/\/|data:)/i)){if(x.match(_3)==null)return e.push({type:"!imageUrl-ipfs",value:x}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:x}),x=lp(x)}return e.push({type:"url",value:x}),{linkage:e,url:x}}}}}catch{}return{linkage:e,url:null}}static async getEnsAddress(e){let t=await e.getNetwork(),n=t.getPlugin("org.ethers.plugins.network.Ens");return(0,Kt.assert)(n,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:t}}),n.address}static async#n(e,t){let n=await r.getEnsAddress(e);try{let i=await new cp.Contract(n,["function resolver(bytes32) view returns (address)"],e).resolver((0,up.namehash)(t),{enableCcipRead:!0});return i===P3.ZeroAddress?null:i}catch(s){throw s}return null}static async fromName(e,t){let n=t;for(;;){if(n===""||n==="."||t!=="eth"&&n==="eth")return null;let s=await r.#n(e,n);if(s!=null){let i=new r(e,s,t);return n!==t&&!await i.supportsWildcard()?null:i}n=n.split(".").slice(1).join(".")}}};gs.EnsResolver=dp});var S3=P(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.formatTransactionResponse=Je.formatTransactionReceipt=Je.formatReceiptLog=Je.formatBlock=Je.formatLog=Je.formatUint256=Je.formatHash=Je.formatData=Je.formatBoolean=Je.object=Je.arrayOf=Je.allowNull=void 0;var tn=ht(),pp=xt(),D_=Gt(),ce=$(),k3=BigInt(0);function ke(r,e){return function(t){return t==null?e:r(t)}}Je.allowNull=ke;function Eo(r,e){return t=>{if(e&&t==null)return null;if(!Array.isArray(t))throw new Error("not an array");return t.map(n=>r(n))}}Je.arrayOf=Eo;function Po(r,e){return t=>{let n={};for(let s in r){let i=s;if(e&&s in e&&!(i in t)){for(let o of e[s])if(o in t){i=o;break}}try{let o=r[s](t[i]);o!==void 0&&(n[s]=o)}catch(o){let a=o instanceof Error?o.message:"not-an-error";(0,ce.assert)(!1,`invalid value for value.${s} (${a})`,"BAD_DATA",{value:t})}}return n}}Je.object=Po;function T3(r){switch(r){case!0:case"true":return!0;case!1:case"false":return!1}(0,ce.assertArgument)(!1,`invalid boolean; ${JSON.stringify(r)}`,"value",r)}Je.formatBoolean=T3;function Ks(r){return(0,ce.assertArgument)((0,ce.isHexString)(r,!0),"invalid data","value",r),r}Je.formatData=Ks;function It(r){return(0,ce.assertArgument)((0,ce.isHexString)(r,32),"invalid hash","value",r),r}Je.formatHash=It;function H_(r){if(!(0,ce.isHexString)(r))throw new Error("invalid uint256");return(0,ce.zeroPadValue)(r,32)}Je.formatUint256=H_;var q_=Po({address:tn.getAddress,blockHash:It,blockNumber:ce.getNumber,data:Ks,index:ce.getNumber,removed:ke(T3,!1),topics:Eo(It),transactionHash:It,transactionIndex:ce.getNumber},{index:["logIndex"]});function G_(r){return q_(r)}Je.formatLog=G_;var z_=Po({hash:ke(It),parentHash:It,parentBeaconBlockRoot:ke(It,null),number:ce.getNumber,timestamp:ce.getNumber,nonce:ke(Ks),difficulty:ce.getBigInt,gasLimit:ce.getBigInt,gasUsed:ce.getBigInt,stateRoot:ke(It,null),receiptsRoot:ke(It,null),blobGasUsed:ke(ce.getBigInt,null),excessBlobGas:ke(ce.getBigInt,null),miner:ke(tn.getAddress),prevRandao:ke(It,null),extraData:Ks,baseFeePerGas:ke(ce.getBigInt)},{prevRandao:["mixHash"]});function K_(r){let e=z_(r);return e.transactions=r.transactions.map(t=>typeof t=="string"?t:O3(t)),e}Je.formatBlock=K_;var V_=Po({transactionIndex:ce.getNumber,blockNumber:ce.getNumber,transactionHash:It,address:tn.getAddress,topics:Eo(It),data:Ks,index:ce.getNumber,blockHash:It},{index:["logIndex"]});function B3(r){return V_(r)}Je.formatReceiptLog=B3;var $_=Po({to:ke(tn.getAddress,null),from:ke(tn.getAddress,null),contractAddress:ke(tn.getAddress,null),index:ce.getNumber,root:ke(ce.hexlify),gasUsed:ce.getBigInt,blobGasUsed:ke(ce.getBigInt,null),logsBloom:ke(Ks),blockHash:It,hash:It,logs:Eo(B3),blockNumber:ce.getNumber,cumulativeGasUsed:ce.getBigInt,effectiveGasPrice:ke(ce.getBigInt),blobGasPrice:ke(ce.getBigInt,null),status:ke(ce.getNumber),type:ke(ce.getNumber,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function J_(r){return $_(r)}Je.formatTransactionReceipt=J_;function O3(r){r.to&&(0,ce.getBigInt)(r.to)===k3&&(r.to="0x0000000000000000000000000000000000000000");let e=Po({hash:It,index:ke(ce.getNumber,void 0),type:t=>t==="0x"||t==null?0:(0,ce.getNumber)(t),accessList:ke(D_.accessListify,null),blobVersionedHashes:ke(Eo(It,!0),null),authorizationList:ke(Eo(t=>{let n;if(t.signature)n=t.signature;else{let s=t.yParity;s==="0x1b"?s=0:s==="0x1c"&&(s=1),n=Object.assign({},t,{yParity:s})}return{address:(0,tn.getAddress)(t.address),chainId:(0,ce.getBigInt)(t.chainId),nonce:(0,ce.getBigInt)(t.nonce),signature:pp.Signature.from(n)}},!1),null),blockHash:ke(It,null),blockNumber:ke(ce.getNumber,null),transactionIndex:ke(ce.getNumber,null),from:tn.getAddress,gasPrice:ke(ce.getBigInt),maxPriorityFeePerGas:ke(ce.getBigInt),maxFeePerGas:ke(ce.getBigInt),maxFeePerBlobGas:ke(ce.getBigInt,null),gasLimit:ce.getBigInt,to:ke(tn.getAddress,null),value:ce.getBigInt,nonce:ce.getNumber,data:Ks,creates:ke(tn.getAddress,null),chainId:ke(ce.getBigInt,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(r);if(e.to==null&&e.creates==null&&(e.creates=(0,tn.getCreateAddress)(e)),(r.type===1||r.type===2)&&r.accessList==null&&(e.accessList=[]),r.signature?e.signature=pp.Signature.from(r.signature):e.signature=pp.Signature.from(r),e.chainId==null){let t=e.signature.legacyChainId;t!=null&&(e.chainId=t)}return e.blockHash&&(0,ce.getBigInt)(e.blockHash)===k3&&(e.blockHash=null),e}Je.formatTransactionResponse=O3});var jl=P(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.FetchUrlFeeDataNetworkPlugin=Or.FeeDataNetworkPlugin=Or.EnsPlugin=Or.GasCostPlugin=Or.NetworkPlugin=void 0;var yp=Jn(),Q_=$(),W_="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",Vs=class r{name;constructor(e){(0,yp.defineProperties)(this,{name:e})}clone(){return new r(this.name)}};Or.NetworkPlugin=Vs;var gp=class r extends Vs{effectiveBlock;txBase;txCreate;txDataZero;txDataNonzero;txAccessListStorageKey;txAccessListAddress;constructor(e,t){e==null&&(e=0),super(`org.ethers.network.plugins.GasCost#${e||0}`);let n={effectiveBlock:e};function s(i,o){let a=(t||{})[i];a==null&&(a=o),(0,Q_.assertArgument)(typeof a=="number",`invalud value for ${i}`,"costs",t),n[i]=a}s("txBase",21e3),s("txCreate",32e3),s("txDataZero",4),s("txDataNonzero",16),s("txAccessListStorageKey",1900),s("txAccessListAddress",2400),(0,yp.defineProperties)(this,n)}clone(){return new r(this.effectiveBlock,this)}};Or.GasCostPlugin=gp;var bp=class r extends Vs{address;targetNetwork;constructor(e,t){super("org.ethers.plugins.network.Ens"),(0,yp.defineProperties)(this,{address:e||W_,targetNetwork:t??1})}clone(){return new r(this.address,this.targetNetwork)}};Or.EnsPlugin=bp;var xp=class r extends Vs{#e;get feeDataFunc(){return this.#e}constructor(e){super("org.ethers.plugins.network.FeeData"),this.#e=e}async getFeeData(e){return await this.#e(e)}clone(){return new r(this.#e)}};Or.FeeDataNetworkPlugin=xp;var mp=class extends Vs{#e;#t;get url(){return this.#e}get processFunc(){return this.#t}constructor(e,t){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin"),this.#e=e,this.#t=t}clone(){return this}};Or.FetchUrlFeeDataNetworkPlugin=mp});var Vt=P(Ul=>{"use strict";Object.defineProperty(Ul,"__esModule",{value:!0});Ul.Network=void 0;var Y_=Gt(),mn=$(),Va=jl(),wp=new Map,$s=class r{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=(0,mn.getBigInt)(t),this.#r=new Map}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return this.#e}set name(e){this.#e=e}get chainId(){return this.#t}set chainId(e){this.#t=(0,mn.getBigInt)(e,"chainId")}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===(0,mn.getBigInt)(e)}catch{}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===(0,mn.getBigInt)(e)}catch{}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===(0,mn.getBigInt)(e.chainId)}catch{}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(this.#r.values())}attachPlugin(e){if(this.#r.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#r.set(e.name,e.clone()),this}getPlugin(e){return this.#r.get(e)||null}getPlugins(e){return this.plugins.filter(t=>t.name.split("#")[0]===e)}clone(){let e=new r(this.name,this.chainId);return this.plugins.forEach(t=>{e.attachPlugin(t.clone())}),e}computeIntrinsicGas(e){let t=this.getPlugin("org.ethers.plugins.network.GasCost")||new Va.GasCostPlugin,n=t.txBase;if(e.to==null&&(n+=t.txCreate),e.data)for(let s=2;s<e.data.length;s+=2)e.data.substring(s,s+2)==="00"?n+=t.txDataZero:n+=t.txDataNonzero;if(e.accessList){let s=(0,Y_.accessListify)(e.accessList);for(let i in s)n+=t.txAccessListAddress+t.txAccessListStorageKey*s[i].storageKeys.length}return n}static from(e){if(Z_(),e==null)return r.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){let t=wp.get(e);if(t)return t();if(typeof e=="bigint")return new r("unknown",e);(0,mn.assertArgument)(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){(0,mn.assertArgument)(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);let t=new r(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&t.attachPlugin(new Va.EnsPlugin(e.ensAddress,e.ensNetwork)),t}(0,mn.assertArgument)(!1,"invalid network","network",e)}static register(e,t){typeof e=="number"&&(e=BigInt(e));let n=wp.get(e);n&&(0,mn.assertArgument)(!1,`conflicting network for ${JSON.stringify(n.name)}`,"nameOrChainId",e),wp.set(e,t)}};Ul.Network=$s;function C3(r,e){let t=String(r);if(!t.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${r}`);let n=t.split(".");if(n.length===1&&n.push(""),n.length!==2)throw new Error(`invalid gwei value: ${r}`);for(;n[1].length<e;)n[1]+="0";if(n[1].length>9){let s=BigInt(n[1].substring(0,9));n[1].substring(9).match(/^0+$/)||s++,n[1]=s.toString()}return BigInt(n[0]+n[1])}function N3(r){return new Va.FetchUrlFeeDataNetworkPlugin(r,async(e,t,n)=>{n.setHeader("User-Agent","ethers");let s;try{let[i,o]=await Promise.all([n.send(),e()]);s=i;let a=s.bodyJson.standard;return{gasPrice:o.gasPrice,maxFeePerGas:C3(a.maxFee,9),maxPriorityFeePerGas:C3(a.maxPriorityFee,9)}}catch(i){(0,mn.assert)(!1,`error encountered with polygon gas station (${JSON.stringify(n.url)})`,"SERVER_ERROR",{request:n,response:s,error:i})}})}var I3=!1;function Z_(){if(I3)return;I3=!0;function r(e,t,n){let s=function(){let i=new $s(e,t);return n.ensNetwork!=null&&i.attachPlugin(new Va.EnsPlugin(null,n.ensNetwork)),i.attachPlugin(new Va.GasCostPlugin),(n.plugins||[]).forEach(o=>{i.attachPlugin(o)}),i};$s.register(e,s),$s.register(t,s),n.altNames&&n.altNames.forEach(i=>{$s.register(i,s)})}r("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),r("ropsten",3,{ensNetwork:3}),r("rinkeby",4,{ensNetwork:4}),r("goerli",5,{ensNetwork:5}),r("kovan",42,{ensNetwork:42}),r("sepolia",11155111,{ensNetwork:11155111}),r("holesky",17e3,{ensNetwork:17e3}),r("classic",61,{}),r("classicKotti",6,{}),r("arbitrum",42161,{ensNetwork:1}),r("arbitrum-goerli",421613,{}),r("arbitrum-sepolia",421614,{}),r("base",8453,{ensNetwork:1}),r("base-goerli",84531,{}),r("base-sepolia",84532,{}),r("bnb",56,{ensNetwork:1}),r("bnbt",97,{}),r("linea",59144,{ensNetwork:1}),r("linea-goerli",59140,{}),r("linea-sepolia",59141,{}),r("matic",137,{ensNetwork:1,plugins:[N3("https://gasstation.polygon.technology/v2")]}),r("matic-amoy",80002,{}),r("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[N3("https://gasstation-testnet.polygon.technology/v2")]}),r("optimism",10,{ensNetwork:1,plugins:[]}),r("optimism-goerli",420,{}),r("optimism-sepolia",11155420,{}),r("xdai",100,{ensNetwork:1})}});var Hl=P(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.PollingEventSubscriber=Ft.PollingTransactionSubscriber=Ft.PollingOrphanSubscriber=Ft.PollingBlockTagSubscriber=Ft.OnBlockSubscriber=Ft.PollingBlockSubscriber=Ft.getPollingSubscriber=void 0;var R3=$();function Ap(r){return JSON.parse(JSON.stringify(r))}function X_(r,e){if(e==="block")return new Fl(r);if((0,R3.isHexString)(e,32))return new Dl(r,e);(0,R3.assert)(!1,"unsupported polling event","UNSUPPORTED_OPERATION",{operation:"getPollingSubscriber",info:{event:e}})}Ft.getPollingSubscriber=X_;var Fl=class{#e;#t;#r;#n;constructor(e){this.#e=e,this.#t=null,this.#r=4e3,this.#n=-2}get pollingInterval(){return this.#r}set pollingInterval(e){this.#r=e}async#s(){try{let e=await this.#e.getBlockNumber();if(this.#n===-2){this.#n=e;return}if(e!==this.#n){for(let t=this.#n+1;t<=e;t++){if(this.#t==null)return;await this.#e.emit("block",t)}this.#n=e}}catch{}this.#t!=null&&(this.#t=this.#e._setTimeout(this.#s.bind(this),this.#r))}start(){this.#t||(this.#t=this.#e._setTimeout(this.#s.bind(this),this.#r),this.#s())}stop(){this.#t&&(this.#e._clearTimeout(this.#t),this.#t=null)}pause(e){this.stop(),e&&(this.#n=-2)}resume(){this.start()}};Ft.PollingBlockSubscriber=Fl;var vo=class{#e;#t;#r;constructor(e){this.#e=e,this.#r=!1,this.#t=t=>{this._poll(t,this.#e)}}async _poll(e,t){throw new Error("sub-classes must override this")}start(){this.#r||(this.#r=!0,this.#t(-2),this.#e.on("block",this.#t))}stop(){this.#r&&(this.#r=!1,this.#e.off("block",this.#t))}pause(e){this.stop()}resume(){this.start()}};Ft.OnBlockSubscriber=vo;var Ep=class extends vo{#e;#t;constructor(e,t){super(e),this.#e=t,this.#t=-2}pause(e){e&&(this.#t=-2),super.pause(e)}async _poll(e,t){let n=await t.getBlock(this.#e);n!=null&&(this.#t===-2?this.#t=n.number:n.number>this.#t&&(t.emit(this.#e,n.number),this.#t=n.number))}};Ft.PollingBlockTagSubscriber=Ep;var Pp=class extends vo{#e;constructor(e,t){super(e),this.#e=Ap(t)}async _poll(e,t){throw new Error("@TODO")}};Ft.PollingOrphanSubscriber=Pp;var Dl=class extends vo{#e;constructor(e,t){super(e),this.#e=t}async _poll(e,t){let n=await t.getTransactionReceipt(this.#e);n&&t.emit(this.#e,n)}};Ft.PollingTransactionSubscriber=Dl;var vp=class{#e;#t;#r;#n;#s;constructor(e,t){this.#e=e,this.#t=Ap(t),this.#r=this.#o.bind(this),this.#n=!1,this.#s=-2}async#o(e){if(this.#s===-2)return;let t=Ap(this.#t);t.fromBlock=this.#s+1,t.toBlock=e;let n=await this.#e.getLogs(t);if(n.length===0){this.#s<e-60&&(this.#s=e-60);return}for(let s of n)this.#e.emit(this.#t,s),this.#s=s.blockNumber}start(){this.#n||(this.#n=!0,this.#s===-2&&this.#e.getBlockNumber().then(e=>{this.#s=e}),this.#e.on("block",this.#r))}stop(){this.#n&&(this.#n=!1,this.#e.off("block",this.#r))}pause(e){this.stop(),e&&(this.#s=-2)}resume(){this.start()}};Ft.PollingEventSubscriber=vp});var ko=P(_o=>{"use strict";Object.defineProperty(_o,"__esModule",{value:!0});_o.AbstractProvider=_o.UnmanagedSubscriber=void 0;var Ja=ht(),ek=Vi(),L3=za(),tk=bn(),rk=Gt(),G=$(),M3=hp(),ql=S3(),nk=Vt(),bs=yo(),$a=Hl(),sk=BigInt(2),ik=10;function Gl(r){return r&&typeof r.then=="function"}function zl(r,e){return r+":"+JSON.stringify(e,(t,n)=>{if(n==null)return"null";if(typeof n=="bigint")return`bigint:${n.toString()}`;if(typeof n=="string")return n.toLowerCase();if(typeof n=="object"&&!Array.isArray(n)){let s=Object.keys(n);return s.sort(),s.reduce((i,o)=>(i[o]=n[o],i),{})}return n})}var Kl=class{name;constructor(e){(0,G.defineProperties)(this,{name:e})}start(){}stop(){}pause(e){}resume(){}};_o.UnmanagedSubscriber=Kl;function ok(r){return JSON.parse(JSON.stringify(r))}function Tp(r){return r=Array.from(new Set(r).values()),r.sort(),r}async function _p(r,e){if(r==null)throw new Error("invalid event");if(Array.isArray(r)&&(r={topics:r}),typeof r=="string")switch(r){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:r,tag:r}}if((0,G.isHexString)(r,32)){let t=r.toLowerCase();return{type:"transaction",tag:zl("tx",{hash:t}),hash:t}}if(r.orphan){let t=r;return{type:"orphan",tag:zl("orphan",t),filter:ok(t)}}if(r.address||r.topics){let t=r,n={topics:(t.topics||[]).map(s=>s==null?null:Array.isArray(s)?Tp(s.map(i=>i.toLowerCase())):s.toLowerCase())};if(t.address){let s=[],i=[],o=a=>{(0,G.isHexString)(a)?s.push(a):i.push((async()=>{s.push(await(0,Ja.resolveAddress)(a,e))})())};Array.isArray(t.address)?t.address.forEach(o):o(t.address),i.length&&await Promise.all(i),n.address=Tp(s.map(a=>a.toLowerCase()))}return{filter:n,tag:zl("event",n),type:"event"}}(0,G.assertArgument)(!1,"unknown ProviderEvent","event",r)}function kp(){return new Date().getTime()}var ak={cacheTimeout:250,pollingInterval:4e3},Bp=class{#e;#t;#r;#n;#s;#o;#i;#a;#f;#u;#p;#g;constructor(e,t){if(this.#g=Object.assign({},ak,t||{}),e==="any")this.#o=!0,this.#s=null;else if(e){let n=nk.Network.from(e);this.#o=!1,this.#s=Promise.resolve(n),setTimeout(()=>{this.emit("network",n,null)},0)}else this.#o=!1,this.#s=null;this.#a=-1,this.#i=new Map,this.#e=new Map,this.#t=new Map,this.#r=null,this.#n=!1,this.#f=1,this.#u=new Map,this.#p=!1}get pollingInterval(){return this.#g.pollingInterval}get provider(){return this}get plugins(){return Array.from(this.#t.values())}attachPlugin(e){if(this.#t.get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return this.#t.set(e.name,e.connect(this)),this}getPlugin(e){return this.#t.get(e)||null}get disableCcipRead(){return this.#p}set disableCcipRead(e){this.#p=!!e}async#c(e){let t=this.#g.cacheTimeout;if(t<0)return await this._perform(e);let n=zl(e.method,e),s=this.#i.get(n);return s||(s=this._perform(e),this.#i.set(n,s),setTimeout(()=>{this.#i.get(n)===s&&this.#i.delete(n)},t)),await s}async ccipReadFetch(e,t,n){if(this.disableCcipRead||n.length===0||e.to==null)return null;let s=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let a=0;a<n.length;a++){let c=n[a],u=c.replace("{sender}",s).replace("{data}",i),l=new G.FetchRequest(u);c.indexOf("{data}")===-1&&(l.body={data:i,sender:s}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:l,index:a,urls:n});let f="unknown error",h;try{h=await l.send()}catch(g){o.push(g.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:l,result:{error:g}});continue}try{let g=h.bodyJson;if(g.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:l,result:g}),g.data;g.message&&(f=g.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:l,result:g})}catch{}(0,G.assert)(h.statusCode<400||h.statusCode>=500,`response not found during CCIP fetch: ${f}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:c,errorMessage:f}}),o.push(f)}(0,G.assert)(!1,`error encountered during CCIP fetch: ${o.map(a=>JSON.stringify(a)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:n,errorMessages:o}})}_wrapBlock(e,t){return new bs.Block((0,ql.formatBlock)(e),this)}_wrapLog(e,t){return new bs.Log((0,ql.formatLog)(e),this)}_wrapTransactionReceipt(e,t){return new bs.TransactionReceipt((0,ql.formatTransactionReceipt)(e),this)}_wrapTransactionResponse(e,t){return new bs.TransactionResponse((0,ql.formatTransactionResponse)(e),this)}_detectNetwork(){(0,G.assert)(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){(0,G.assert)(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){let e=(0,G.getNumber)(await this.#c({method:"getBlockNumber"}),"%response");return this.#a>=0&&(this.#a=e),e}_getAddress(e){return(0,Ja.resolveAddress)(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if((0,G.isHexString)(e))return(0,G.isHexString)(e,32)?e:(0,G.toQuantity)(e);if(typeof e=="bigint"&&(e=(0,G.getNumber)(e,"blockTag")),typeof e=="number")return e>=0?(0,G.toQuantity)(e):this.#a>=0?(0,G.toQuantity)(this.#a+e):this.getBlockNumber().then(t=>(0,G.toQuantity)(t+e));(0,G.assertArgument)(!1,"invalid blockTag","blockTag",e)}_getFilter(e){let t=(e.topics||[]).map(c=>c==null?null:Array.isArray(c)?Tp(c.map(u=>u.toLowerCase())):c.toLowerCase()),n="blockHash"in e?e.blockHash:void 0,s=(c,u,l)=>{let f;switch(c.length){case 0:break;case 1:f=c[0];break;default:c.sort(),f=c}if(n&&(u!=null||l!=null))throw new Error("invalid filter");let h={};return f&&(h.address=f),t.length&&(h.topics=t),u&&(h.fromBlock=u),l&&(h.toBlock=l),n&&(h.blockHash=n),h},i=[];if(e.address)if(Array.isArray(e.address))for(let c of e.address)i.push(this._getAddress(c));else i.push(this._getAddress(e.address));let o;"fromBlock"in e&&(o=this._getBlockTag(e.fromBlock));let a;return"toBlock"in e&&(a=this._getBlockTag(e.toBlock)),i.filter(c=>typeof c!="string").length||o!=null&&typeof o!="string"||a!=null&&typeof a!="string"?Promise.all([Promise.all(i),o,a]).then(c=>s(c[0],c[1],c[2])):s(i,o,a)}_getTransactionRequest(e){let t=(0,bs.copyRequest)(e),n=[];if(["to","from"].forEach(s=>{if(t[s]==null)return;let i=(0,Ja.resolveAddress)(t[s],this);Gl(i)?n.push(async function(){t[s]=await i}()):t[s]=i}),t.blockTag!=null){let s=this._getBlockTag(t.blockTag);Gl(s)?n.push(async function(){t.blockTag=await s}()):t.blockTag=s}return n.length?async function(){return await Promise.all(n),t}():t}async getNetwork(){if(this.#s==null){let s=(async()=>{try{let i=await this._detectNetwork();return this.emit("network",i,null),i}catch(i){throw this.#s===s&&(this.#s=null),i}})();return this.#s=s,(await s).clone()}let e=this.#s,[t,n]=await Promise.all([e,this._detectNetwork()]);return t.chainId!==n.chainId&&(this.#o?(this.emit("network",n,t),this.#s===e&&(this.#s=Promise.resolve(n))):(0,G.assert)(!1,`network changed: ${t.chainId} => ${n.chainId} `,"NETWORK_ERROR",{event:"changed"})),t.clone()}async getFeeData(){let e=await this.getNetwork(),t=async()=>{let{_block:s,gasPrice:i,priorityFee:o}=await(0,G.resolveProperties)({_block:this.#x("latest",!1),gasPrice:(async()=>{try{let l=await this.#c({method:"getGasPrice"});return(0,G.getBigInt)(l,"%response")}catch{}return null})(),priorityFee:(async()=>{try{let l=await this.#c({method:"getPriorityFee"});return(0,G.getBigInt)(l,"%response")}catch{}return null})()}),a=null,c=null,u=this._wrapBlock(s,e);return u&&u.baseFeePerGas&&(c=o??BigInt("1000000000"),a=u.baseFeePerGas*sk+c),new bs.FeeData(i,a,c)},n=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(n){let s=new G.FetchRequest(n.url),i=await n.processFunc(t,this,s);return new bs.FeeData(i.gasPrice,i.maxFeePerGas,i.maxPriorityFeePerGas)}return await t()}async estimateGas(e){let t=this._getTransactionRequest(e);return Gl(t)&&(t=await t),(0,G.getBigInt)(await this.#c({method:"estimateGas",transaction:t}),"%response")}async#l(e,t,n){(0,G.assert)(n<ik,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:t,enableCcipRead:!0})});let s=(0,bs.copyRequest)(e);try{return(0,G.hexlify)(await this._perform({method:"call",transaction:s,blockTag:t}))}catch(i){if(!this.disableCcipRead&&(0,G.isCallException)(i)&&i.data&&n>=0&&t==="latest"&&s.to!=null&&(0,G.dataSlice)(i.data,0,4)==="0x556f1830"){let o=i.data,a=await(0,Ja.resolveAddress)(s.to,this),c;try{c=dk((0,G.dataSlice)(i.data,4))}catch(f){(0,G.assert)(!1,f.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:s,info:{data:o}})}(0,G.assert)(c.sender.toLowerCase()===a.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:o,reason:"OffchainLookup",transaction:s,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:c.errorArgs}});let u=await this.ccipReadFetch(s,c.calldata,c.urls);(0,G.assert)(u!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:s,info:{data:i.data,errorArgs:c.errorArgs}});let l={to:a,data:(0,G.concat)([c.selector,fk([u,c.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:l});try{let f=await this.#l(l,t,n+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},l),result:f}),f}catch(f){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},l),error:f}),f}}throw i}}async#d(e){let{value:t}=await(0,G.resolveProperties)({network:this.getNetwork(),value:e});return t}async call(e){let{tx:t,blockTag:n}=await(0,G.resolveProperties)({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await this.#d(this.#l(t,n,e.enableCcipRead?0:-1))}async#h(e,t,n){let s=this._getAddress(t),i=this._getBlockTag(n);return(typeof s!="string"||typeof i!="string")&&([s,i]=await Promise.all([s,i])),await this.#d(this.#c(Object.assign(e,{address:s,blockTag:i})))}async getBalance(e,t){return(0,G.getBigInt)(await this.#h({method:"getBalance"},e,t),"%response")}async getTransactionCount(e,t){return(0,G.getNumber)(await this.#h({method:"getTransactionCount"},e,t),"%response")}async getCode(e,t){return(0,G.hexlify)(await this.#h({method:"getCode"},e,t))}async getStorage(e,t,n){let s=(0,G.getBigInt)(t,"position");return(0,G.hexlify)(await this.#h({method:"getStorage",position:s},e,n))}async broadcastTransaction(e){let{blockNumber:t,hash:n,network:s}=await(0,G.resolveProperties)({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),i=rk.Transaction.from(e);if(i.hash!==n)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(i,s).replaceableTransaction(t)}async#x(e,t){if((0,G.isHexString)(e,32))return await this.#c({method:"getBlock",blockHash:e,includeTransactions:t});let n=this._getBlockTag(e);return typeof n!="string"&&(n=await n),await this.#c({method:"getBlock",blockTag:n,includeTransactions:t})}async getBlock(e,t){let{network:n,params:s}=await(0,G.resolveProperties)({network:this.getNetwork(),params:this.#x(e,!!t)});return s==null?null:this._wrapBlock(s,n)}async getTransaction(e){let{network:t,params:n}=await(0,G.resolveProperties)({network:this.getNetwork(),params:this.#c({method:"getTransaction",hash:e})});return n==null?null:this._wrapTransactionResponse(n,t)}async getTransactionReceipt(e){let{network:t,params:n}=await(0,G.resolveProperties)({network:this.getNetwork(),params:this.#c({method:"getTransactionReceipt",hash:e})});if(n==null)return null;if(n.gasPrice==null&&n.effectiveGasPrice==null){let s=await this.#c({method:"getTransaction",hash:e});if(s==null)throw new Error("report this; could not find tx or effectiveGasPrice");n.effectiveGasPrice=s.gasPrice}return this._wrapTransactionReceipt(n,t)}async getTransactionResult(e){let{result:t}=await(0,G.resolveProperties)({network:this.getNetwork(),result:this.#c({method:"getTransactionResult",hash:e})});return t==null?null:(0,G.hexlify)(t)}async getLogs(e){let t=this._getFilter(e);Gl(t)&&(t=await t);let{network:n,params:s}=await(0,G.resolveProperties)({network:this.getNetwork(),params:this.#c({method:"getLogs",filter:t})});return s.map(i=>this._wrapLog(i,n))}_getProvider(e){(0,G.assert)(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await M3.EnsResolver.fromName(this,e)}async getAvatar(e){let t=await this.getResolver(e);return t?await t.getAvatar():null}async resolveName(e){let t=await this.getResolver(e);return t?await t.getAddress():null}async lookupAddress(e){e=(0,Ja.getAddress)(e);let t=(0,tk.namehash)(e.substring(2).toLowerCase()+".addr.reverse");try{let n=await M3.EnsResolver.getEnsAddress(this),i=await new L3.Contract(n,["function resolver(bytes32) view returns (address)"],this).resolver(t);if(i==null||i===ek.ZeroAddress)return null;let a=await new L3.Contract(i,["function name(bytes32) view returns (string)"],this).name(t);return await this.resolveName(a)!==e?null:a}catch(n){if((0,G.isError)(n,"BAD_DATA")&&n.value==="0x"||(0,G.isError)(n,"CALL_EXCEPTION"))return null;throw n}return null}async waitForTransaction(e,t,n){let s=t??1;return s===0?this.getTransactionReceipt(e):new Promise(async(i,o)=>{let a=null,c=async u=>{try{let l=await this.getTransactionReceipt(e);if(l!=null&&u-l.blockNumber+1>=s){i(l),a&&(clearTimeout(a),a=null);return}}catch(l){console.log("EEE",l)}this.once("block",c)};n!=null&&(a=setTimeout(()=>{a!=null&&(a=null,this.off("block",c),o((0,G.makeError)("timeout","TIMEOUT",{reason:"timeout"})))},n)),c(await this.getBlockNumber())})}async waitForBlock(e){(0,G.assert)(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){let t=this.#u.get(e);t&&(t.timer&&clearTimeout(t.timer),this.#u.delete(e))}_setTimeout(e,t){t==null&&(t=0);let n=this.#f++,s=()=>{this.#u.delete(n),e()};if(this.paused)this.#u.set(n,{timer:null,func:s,time:t});else{let i=setTimeout(s,t);this.#u.set(n,{timer:i,func:s,time:kp()})}return n}_forEachSubscriber(e){for(let t of this.#e.values())e(t.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new Kl(e.type);case"block":{let t=new $a.PollingBlockSubscriber(this);return t.pollingInterval=this.pollingInterval,t}case"safe":case"finalized":return new $a.PollingBlockTagSubscriber(this,e.type);case"event":return new $a.PollingEventSubscriber(this,e.filter);case"transaction":return new $a.PollingTransactionSubscriber(this,e.hash);case"orphan":return new $a.PollingOrphanSubscriber(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,t){for(let n of this.#e.values())if(n.subscriber===e){n.started&&n.subscriber.stop(),n.subscriber=t,n.started&&t.start(),this.#r!=null&&t.pause(this.#r);break}}async#b(e,t){let n=await _p(e,this);return n.type==="event"&&t&&t.length>0&&t[0].removed===!0&&(n=await _p({orphan:"drop-log",log:t[0]},this)),this.#e.get(n.tag)||null}async#m(e){let t=await _p(e,this),n=t.tag,s=this.#e.get(n);return s||(s={subscriber:this._getSubscriber(t),tag:n,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},this.#e.set(n,s)),s}async on(e,t){let n=await this.#m(e);return n.listeners.push({listener:t,once:!1}),n.started||(n.subscriber.start(),n.started=!0,this.#r!=null&&n.subscriber.pause(this.#r)),this}async once(e,t){let n=await this.#m(e);return n.listeners.push({listener:t,once:!0}),n.started||(n.subscriber.start(),n.started=!0,this.#r!=null&&n.subscriber.pause(this.#r)),this}async emit(e,...t){let n=await this.#b(e,t);if(!n||n.listeners.length===0)return!1;let s=n.listeners.length;return n.listeners=n.listeners.filter(({listener:i,once:o})=>{let a=new G.EventPayload(this,o?null:i,e);try{i.call(this,...t,a)}catch{}return!o}),n.listeners.length===0&&(n.started&&n.subscriber.stop(),this.#e.delete(n.tag)),s>0}async listenerCount(e){if(e){let n=await this.#b(e);return n?n.listeners.length:0}let t=0;for(let{listeners:n}of this.#e.values())t+=n.length;return t}async listeners(e){if(e){let n=await this.#b(e);return n?n.listeners.map(({listener:s})=>s):[]}let t=[];for(let{listeners:n}of this.#e.values())t=t.concat(n.map(({listener:s})=>s));return t}async off(e,t){let n=await this.#b(e);if(!n)return this;if(t){let s=n.listeners.map(({listener:i})=>i).indexOf(t);s>=0&&n.listeners.splice(s,1)}return(!t||n.listeners.length===0)&&(n.started&&n.subscriber.stop(),this.#e.delete(n.tag)),this}async removeAllListeners(e){if(e){let{tag:t,started:n,subscriber:s}=await this.#m(e);n&&s.stop(),this.#e.delete(t)}else for(let[t,{started:n,subscriber:s}]of this.#e)n&&s.stop(),this.#e.delete(t);return this}async addListener(e,t){return await this.on(e,t)}async removeListener(e,t){return this.off(e,t)}get destroyed(){return this.#n}destroy(){this.removeAllListeners();for(let e of this.#u.keys())this._clearTimeout(e);this.#n=!0}get paused(){return this.#r!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(this.#a=-1,this.#r!=null){if(this.#r==!!e)return;(0,G.assert)(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(t=>t.pause(e)),this.#r=!!e;for(let t of this.#u.values())t.timer&&clearTimeout(t.timer),t.time=kp()-t.time}resume(){if(this.#r!=null){this._forEachSubscriber(e=>e.resume()),this.#r=null;for(let e of this.#u.values()){let t=e.time;t<0&&(t=0),e.time=kp(),setTimeout(e.func,t)}}}};_o.AbstractProvider=Bp;function ck(r,e){try{let t=Op(r,e);if(t)return(0,G.toUtf8String)(t)}catch{}return null}function Op(r,e){if(r==="0x")return null;try{let t=(0,G.getNumber)((0,G.dataSlice)(r,e,e+32)),n=(0,G.getNumber)((0,G.dataSlice)(r,t,t+32));return(0,G.dataSlice)(r,t+32,t+32+n)}catch{}return null}function j3(r){let e=(0,G.toBeArray)(r);if(e.length>32)throw new Error("internal; should not happen");let t=new Uint8Array(32);return t.set(e,32-e.length),t}function uk(r){if(r.length%32===0)return r;let e=new Uint8Array(Math.ceil(r.length/32)*32);return e.set(r),e}var lk=new Uint8Array([]);function fk(r){let e=[],t=0;for(let n=0;n<r.length;n++)e.push(lk),t+=32;for(let n=0;n<r.length;n++){let s=(0,G.getBytes)(r[n]);e[n]=j3(t),e.push(j3(s.length)),e.push(uk(s)),t+=32+Math.ceil(s.length/32)*32}return(0,G.concat)(e)}var U3="0x0000000000000000000000000000000000000000000000000000000000000000";function dk(r){let e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};(0,G.assert)((0,G.dataLength)(r)>=5*32,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});let t=(0,G.dataSlice)(r,0,32);(0,G.assert)((0,G.dataSlice)(t,0,12)===(0,G.dataSlice)(U3,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=(0,G.dataSlice)(t,12);try{let n=[],s=(0,G.getNumber)((0,G.dataSlice)(r,32,64)),i=(0,G.getNumber)((0,G.dataSlice)(r,s,s+32)),o=(0,G.dataSlice)(r,s+32);for(let a=0;a<i;a++){let c=ck(o,a*32);if(c==null)throw new Error("abort");n.push(c)}e.urls=n}catch{(0,G.assert)(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{let n=Op(r,64);if(n==null)throw new Error("abort");e.calldata=n}catch{(0,G.assert)(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}(0,G.assert)((0,G.dataSlice)(r,100,128)===(0,G.dataSlice)(U3,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=(0,G.dataSlice)(r,96,100);try{let n=Op(r,128);if(n==null)throw new Error("abort");e.extraData=n}catch{(0,G.assert)(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(n=>e[n]),e}});var $l=P(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});To.VoidSigner=To.AbstractSigner=void 0;var F3=ht(),hk=Gt(),$t=$(),pk=yo();function Js(r,e){if(r.provider)return r.provider;(0,$t.assert)(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function D3(r,e){let t=(0,pk.copyRequest)(e);if(t.to!=null&&(t.to=(0,F3.resolveAddress)(t.to,r)),t.from!=null){let n=t.from;t.from=Promise.all([r.getAddress(),(0,F3.resolveAddress)(n,r)]).then(([s,i])=>((0,$t.assertArgument)(s.toLowerCase()===i.toLowerCase(),"transaction from mismatch","tx.from",i),s))}else t.from=r.getAddress();return await(0,$t.resolveProperties)(t)}var Vl=class{provider;constructor(e){(0,$t.defineProperties)(this,{provider:e||null})}async getNonce(e){return Js(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await D3(this,e)}async populateTransaction(e){let t=Js(this,"populateTransaction"),n=await D3(this,e);n.nonce==null&&(n.nonce=await this.getNonce("pending")),n.gasLimit==null&&(n.gasLimit=await this.estimateGas(n));let s=await this.provider.getNetwork();if(n.chainId!=null){let o=(0,$t.getBigInt)(n.chainId);(0,$t.assertArgument)(o===s.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else n.chainId=s.chainId;let i=n.maxFeePerGas!=null||n.maxPriorityFeePerGas!=null;if(n.gasPrice!=null&&(n.type===2||i)?(0,$t.assertArgument)(!1,"eip-1559 transaction do not support gasPrice","tx",e):(n.type===0||n.type===1)&&i&&(0,$t.assertArgument)(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(n.type===2||n.type==null)&&n.maxFeePerGas!=null&&n.maxPriorityFeePerGas!=null)n.type=2;else if(n.type===0||n.type===1){let o=await t.getFeeData();(0,$t.assert)(o.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice)}else{let o=await t.getFeeData();if(n.type==null)if(o.maxFeePerGas!=null&&o.maxPriorityFeePerGas!=null)if(n.authorizationList&&n.authorizationList.length?n.type=4:n.type=2,n.gasPrice!=null){let a=n.gasPrice;delete n.gasPrice,n.maxFeePerGas=a,n.maxPriorityFeePerGas=a}else n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas);else o.gasPrice!=null?((0,$t.assert)(!i,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),n.gasPrice==null&&(n.gasPrice=o.gasPrice),n.type=0):(0,$t.assert)(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(n.type===2||n.type===3||n.type===4)&&(n.maxFeePerGas==null&&(n.maxFeePerGas=o.maxFeePerGas),n.maxPriorityFeePerGas==null&&(n.maxPriorityFeePerGas=o.maxPriorityFeePerGas))}return await(0,$t.resolveProperties)(n)}async populateAuthorization(e){let t=Object.assign({},e);return t.chainId==null&&(t.chainId=(await Js(this,"getNetwork").getNetwork()).chainId),t.nonce==null&&(t.nonce=await this.getNonce()),t}async estimateGas(e){return Js(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return Js(this,"call").call(await this.populateCall(e))}async resolveName(e){return await Js(this,"resolveName").resolveName(e)}async sendTransaction(e){let t=Js(this,"sendTransaction"),n=await this.populateTransaction(e);delete n.from;let s=hk.Transaction.from(n);return await t.broadcastTransaction(await this.signTransaction(s))}authorize(e){(0,$t.assert)(!1,"authorization not implemented for this signer","UNSUPPORTED_OPERATION",{operation:"authorize"})}};To.AbstractSigner=Vl;var Sp=class r extends Vl{address;constructor(e,t){super(t),(0,$t.defineProperties)(this,{address:e})}async getAddress(){return this.address}connect(e){return new r(this.address,e)}#e(e,t){(0,$t.assert)(!1,`VoidSigner cannot sign ${e}`,"UNSUPPORTED_OPERATION",{operation:t})}async signTransaction(e){this.#e("transactions","signTransaction")}async signMessage(e){this.#e("messages","signMessage")}async signTypedData(e,t,n){this.#e("typed-data","signTypedData")}};To.VoidSigner=Sp});var Ln=P(Jl=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});Jl.showThrottleMessage=void 0;var H3=new Set;function gk(r){H3.has(r)||(H3.add(r),console.log("========= NOTICE ========="),console.log(`Request-Rate Exceeded for ${r} (this message will not be repeated)`),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.org/api-keys/"),console.log("=========================="))}Jl.showThrottleMessage=gk});var q3=P(xs=>{"use strict";Object.defineProperty(xs,"__esModule",{value:!0});xs.FilterIdPendingSubscriber=xs.FilterIdEventSubscriber=xs.FilterIdSubscriber=void 0;var bk=$(),xk=Hl();function mk(r){return JSON.parse(JSON.stringify(r))}var Qa=class{#e;#t;#r;#n;#s;#o;constructor(e){this.#e=e,this.#t=null,this.#r=this.#i.bind(this),this.#n=!1,this.#s=null,this.#o=!1}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,t){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}async#i(e){try{this.#t==null&&(this.#t=this._subscribe(this.#e));let t=null;try{t=await this.#t}catch(i){if(!(0,bk.isError)(i,"UNSUPPORTED_OPERATION")||i.operation!=="eth_newFilter")throw i}if(t==null){this.#t=null,this.#e._recoverSubscriber(this,this._recover(this.#e));return}let n=await this.#e.getNetwork();if(this.#s||(this.#s=n),this.#s.chainId!==n.chainId)throw new Error("chaid changed");if(this.#o)return;let s=await this.#e.send("eth_getFilterChanges",[t]);await this._emitResults(this.#e,s)}catch(t){console.log("@TODO",t)}this.#e.once("block",this.#r)}#a(){let e=this.#t;e&&(this.#t=null,e.then(t=>{this.#e.destroyed||this.#e.send("eth_uninstallFilter",[t])}))}start(){this.#n||(this.#n=!0,this.#i(-2))}stop(){this.#n&&(this.#n=!1,this.#o=!0,this.#a(),this.#e.off("block",this.#r))}pause(e){e&&this.#a(),this.#e.off("block",this.#r)}resume(){this.start()}};xs.FilterIdSubscriber=Qa;var Cp=class extends Qa{#e;constructor(e,t){super(e),this.#e=mk(t)}_recover(e){return new xk.PollingEventSubscriber(e,this.#e)}async _subscribe(e){return await e.send("eth_newFilter",[this.#e])}async _emitResults(e,t){for(let n of t)e.emit(this.#e,e._wrapLog(n,e._network))}};xs.FilterIdEventSubscriber=Cp;var Np=class extends Qa{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,t){for(let n of t)e.emit("pending",n)}};xs.FilterIdPendingSubscriber=Np});var pr=P(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.JsonRpcProvider=yn.JsonRpcApiPollingProvider=yn.JsonRpcApiProvider=yn.JsonRpcSigner=void 0;var yk=xo(),Qs=ht(),G3=bn(),z3=Gt(),fe=$(),K3=ko(),wk=$l(),Ip=Vt(),V3=q3(),Ak=Hl(),Ek="bigint,boolean,function,number,string,symbol".split(/,/g);function Ql(r){if(r==null||Ek.indexOf(typeof r)>=0||typeof r.getAddress=="function")return r;if(Array.isArray(r))return r.map(Ql);if(typeof r=="object")return Object.keys(r).reduce((e,t)=>(e[t]=r[t],e),{});throw new Error(`should not happen: ${r} (${typeof r})`)}function Pk(r){return new Promise(e=>{setTimeout(e,r)})}function Bo(r){return r&&r.toLowerCase()}function $3(r){return r&&typeof r.pollingInterval=="number"}var J3={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3},Oo=class extends wk.AbstractSigner{address;constructor(e,t){super(e),t=(0,Qs.getAddress)(t),(0,fe.defineProperties)(this,{address:t})}connect(e){(0,fe.assert)(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(e){return await this.populateCall(e)}async sendUncheckedTransaction(e){let t=Ql(e),n=[];if(t.from){let i=t.from;n.push((async()=>{let o=await(0,Qs.resolveAddress)(i,this.provider);(0,fe.assertArgument)(o!=null&&o.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=o})())}else t.from=this.address;if(t.gasLimit==null&&n.push((async()=>{t.gasLimit=await this.provider.estimateGas({...t,from:this.address})})()),t.to!=null){let i=t.to;n.push((async()=>{t.to=await(0,Qs.resolveAddress)(i,this.provider)})())}n.length&&await Promise.all(n);let s=this.provider.getRpcTransaction(t);return this.provider.send("eth_sendTransaction",[s])}async sendTransaction(e){let t=await this.provider.getBlockNumber(),n=await this.sendUncheckedTransaction(e);return await new Promise((s,i)=>{let o=[1e3,100],a=0,c=async()=>{try{let u=await this.provider.getTransaction(n);if(u!=null){s(u.replaceableTransaction(t));return}}catch(u){if((0,fe.isError)(u,"CANCELLED")||(0,fe.isError)(u,"BAD_DATA")||(0,fe.isError)(u,"NETWORK_ERROR")||(0,fe.isError)(u,"UNSUPPORTED_OPERATION")){u.info==null&&(u.info={}),u.info.sendTransactionHash=n,i(u);return}if((0,fe.isError)(u,"INVALID_ARGUMENT")&&(a++,u.info==null&&(u.info={}),u.info.sendTransactionHash=n,a>10)){i(u);return}this.provider.emit("error",(0,fe.makeError)("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:u}))}this.provider._setTimeout(()=>{c()},o.pop()||4e3)};c()})}async signTransaction(e){let t=Ql(e);if(t.from){let s=await(0,Qs.resolveAddress)(t.from,this.provider);(0,fe.assertArgument)(s!=null&&s.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",e),t.from=s}else t.from=this.address;let n=this.provider.getRpcTransaction(t);return await this.provider.send("eth_signTransaction",[n])}async signMessage(e){let t=typeof e=="string"?(0,fe.toUtf8Bytes)(e):e;return await this.provider.send("personal_sign",[(0,fe.hexlify)(t),this.address.toLowerCase()])}async signTypedData(e,t,n){let s=Ql(n),i=await G3.TypedDataEncoder.resolveNames(e,t,s,async o=>{let a=await(0,Qs.resolveAddress)(o);return(0,fe.assertArgument)(a!=null,"TypedData does not support null address","value",o),a});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(G3.TypedDataEncoder.getPayload(i.domain,t,i.value))])}async unlock(e){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),e,null])}async _legacySignMessage(e){let t=typeof e=="string"?(0,fe.toUtf8Bytes)(e):e;return await this.provider.send("eth_sign",[this.address.toLowerCase(),(0,fe.hexlify)(t)])}};yn.JsonRpcSigner=Oo;var Wl=class extends K3.AbstractProvider{#e;#t;#r;#n;#s;#o;#i;#a(){if(this.#n)return;let e=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");this.#n=setTimeout(()=>{this.#n=null;let t=this.#r;for(this.#r=[];t.length;){let n=[t.shift()];for(;t.length&&n.length!==this.#e.batchMaxCount;)if(n.push(t.shift()),JSON.stringify(n.map(i=>i.payload)).length>this.#e.batchMaxSize){t.unshift(n.pop());break}(async()=>{let s=n.length===1?n[0].payload:n.map(i=>i.payload);this.emit("debug",{action:"sendRpcPayload",payload:s});try{let i=await this._send(s);this.emit("debug",{action:"receiveRpcResult",result:i});for(let{resolve:o,reject:a,payload:c}of n){if(this.destroyed){a((0,fe.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:c.method}));continue}let u=i.filter(l=>l.id===c.id)[0];if(u==null){let l=(0,fe.makeError)("missing response for request","BAD_DATA",{value:i,info:{payload:c}});this.emit("error",l),a(l);continue}if("error"in u){a(this.getRpcError(c,u));continue}o(u.result)}}catch(i){this.emit("debug",{action:"receiveRpcError",error:i});for(let{reject:o}of n)o(i)}})()}},e)}constructor(e,t){super(e,t),this.#t=1,this.#e=Object.assign({},J3,t||{}),this.#r=[],this.#n=null,this.#o=null,this.#i=null;{let s=null,i=new Promise(o=>{s=o});this.#s={promise:i,resolve:s}}let n=this._getOption("staticNetwork");typeof n=="boolean"?((0,fe.assertArgument)(!n||e!=="any","staticNetwork cannot be used on special network 'any'","options",t),n&&e!=null&&(this.#o=Ip.Network.from(e))):n&&((0,fe.assertArgument)(e==null||n.matches(e),"staticNetwork MUST match network object","options",t),this.#o=n)}_getOption(e){return this.#e[e]}get _network(){return(0,fe.assert)(this.#o,"network is not available yet","NETWORK_ERROR"),this.#o}async _perform(e){if(e.method==="call"||e.method==="estimateGas"){let n=e.transaction;if(n&&n.type!=null&&(0,fe.getBigInt)(n.type)&&n.maxFeePerGas==null&&n.maxPriorityFeePerGas==null){let s=await this.getFeeData();s.maxFeePerGas==null&&s.maxPriorityFeePerGas==null&&(e=Object.assign({},e,{transaction:Object.assign({},n,{type:void 0})}))}}let t=this.getRpcRequest(e);return t!=null?await this.send(t.method,t.args):super._perform(e)}async _detectNetwork(){let e=this._getOption("staticNetwork");if(e)if(e===!0){if(this.#o)return this.#o}else return e;return this.#i?await this.#i:this.ready?(this.#i=(async()=>{try{let t=Ip.Network.from((0,fe.getBigInt)(await this.send("eth_chainId",[])));return this.#i=null,t}catch(t){throw this.#i=null,t}})(),await this.#i):(this.#i=(async()=>{let t={id:this.#t++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:t});let n;try{n=(await this._send(t))[0],this.#i=null}catch(s){throw this.#i=null,this.emit("debug",{action:"receiveRpcError",error:s}),s}if(this.emit("debug",{action:"receiveRpcResult",result:n}),"result"in n)return Ip.Network.from((0,fe.getBigInt)(n.result));throw this.getRpcError(t,n)})(),await this.#i)}_start(){this.#s==null||this.#s.resolve==null||(this.#s.resolve(),this.#s=null,(async()=>{for(;this.#o==null&&!this.destroyed;)try{this.#o=await this._detectNetwork()}catch(e){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",(0,fe.makeError)("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:e}})),await Pk(1e3)}this.#a()})())}async _waitUntilReady(){if(this.#s!=null)return await this.#s.promise}_getSubscriber(e){return e.type==="pending"?new V3.FilterIdPendingSubscriber(this):e.type==="event"?this._getOption("polling")?new Ak.PollingEventSubscriber(this,e.filter):new V3.FilterIdEventSubscriber(this,e.filter):e.type==="orphan"&&e.filter.orphan==="drop-log"?new K3.UnmanagedSubscriber("orphan"):super._getSubscriber(e)}get ready(){return this.#s==null}getRpcTransaction(e){let t={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(n=>{if(e[n]==null)return;let s=n;n==="gasLimit"&&(s="gas"),t[s]=(0,fe.toQuantity)((0,fe.getBigInt)(e[n],`tx.${n}`))}),["from","to","data"].forEach(n=>{e[n]!=null&&(t[n]=(0,fe.hexlify)(e[n]))}),e.accessList&&(t.accessList=(0,z3.accessListify)(e.accessList)),e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes.map(n=>n.toLowerCase())),e.authorizationList&&(t.authorizationList=e.authorizationList.map(n=>{let s=(0,z3.authorizationify)(n);return{address:s.address,nonce:(0,fe.toQuantity)(s.nonce),chainId:(0,fe.toQuantity)(s.chainId),yParity:(0,fe.toQuantity)(s.signature.yParity),r:(0,fe.toQuantity)(s.signature.r),s:(0,fe.toQuantity)(s.signature.s)}})),t}getRpcRequest(e){switch(e.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[Bo(e.address),e.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[Bo(e.address),e.blockTag]};case"getCode":return{method:"eth_getCode",args:[Bo(e.address),e.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[Bo(e.address),"0x"+e.position.toString(16),e.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[e.signedTransaction]};case"getBlock":if("blockTag"in e)return{method:"eth_getBlockByNumber",args:[e.blockTag,!!e.includeTransactions]};if("blockHash"in e)return{method:"eth_getBlockByHash",args:[e.blockHash,!!e.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[e.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[e.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(e.transaction),e.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(e.transaction)]};case"getLogs":return e.filter&&e.filter.address!=null&&(Array.isArray(e.filter.address)?e.filter.address=e.filter.address.map(Bo):e.filter.address=Bo(e.filter.address)),{method:"eth_getLogs",args:[e.filter]}}return null}getRpcError(e,t){let{method:n}=e,{error:s}=t;if(n==="eth_estimateGas"&&s.message){let a=s.message;if(!a.match(/revert/i)&&a.match(/insufficient funds/i))return(0,fe.makeError)("insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.params[0],info:{payload:e,error:s}});if(a.match(/nonce/i)&&a.match(/too low/i))return(0,fe.makeError)("nonce has already been used","NONCE_EXPIRED",{transaction:e.params[0],info:{payload:e,error:s}})}if(n==="eth_call"||n==="eth_estimateGas"){let a=Lp(s),c=yk.AbiCoder.getBuiltinCallException(n==="eth_call"?"call":"estimateGas",e.params[0],a?a.data:null);return c.info={error:s,payload:e},c}let i=JSON.stringify(vk(s));if(typeof s.message=="string"&&s.message.match(/user denied|ethers-user-denied/i)){let a={eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"};return(0,fe.makeError)("user rejected action","ACTION_REJECTED",{action:a[n]||"unknown",reason:"rejected",info:{payload:e,error:s}})}if(n==="eth_sendRawTransaction"||n==="eth_sendTransaction"){let a=e.params[0];if(i.match(/insufficient funds|base fee exceeds gas limit/i))return(0,fe.makeError)("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:a,info:{error:s}});if(i.match(/nonce/i)&&i.match(/too low/i))return(0,fe.makeError)("nonce has already been used","NONCE_EXPIRED",{transaction:a,info:{error:s}});if(i.match(/replacement transaction/i)&&i.match(/underpriced/i))return(0,fe.makeError)("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:a,info:{error:s}});if(i.match(/only replay-protected/i))return(0,fe.makeError)("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:n,info:{transaction:a,info:{error:s}}})}let o=!!i.match(/the method .* does not exist/i);return o||s&&s.details&&s.details.startsWith("Unauthorized method:")&&(o=!0),o?(0,fe.makeError)("unsupported operation","UNSUPPORTED_OPERATION",{operation:e.method,info:{error:s,payload:e}}):(0,fe.makeError)("could not coalesce error","UNKNOWN_ERROR",{error:s,payload:e})}send(e,t){if(this.destroyed)return Promise.reject((0,fe.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e}));let n=this.#t++,s=new Promise((i,o)=>{this.#r.push({resolve:i,reject:o,payload:{method:e,params:t,id:n,jsonrpc:"2.0"}})});return this.#a(),s}async getSigner(e){e==null&&(e=0);let t=this.send("eth_accounts",[]);if(typeof e=="number"){let s=await t;if(e>=s.length)throw new Error("no such account");return new Oo(this,s[e])}let{accounts:n}=await(0,fe.resolveProperties)({network:this.getNetwork(),accounts:t});e=(0,Qs.getAddress)(e);for(let s of n)if((0,Qs.getAddress)(s)===e)return new Oo(this,e);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(t=>new Oo(this,t))}destroy(){this.#n&&(clearTimeout(this.#n),this.#n=null);for(let{payload:e,reject:t}of this.#r)t((0,fe.makeError)("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:e.method}));this.#r=[],super.destroy()}};yn.JsonRpcApiProvider=Wl;var Yl=class extends Wl{#e;constructor(e,t){super(e,t);let n=this._getOption("pollingInterval");n==null&&(n=J3.pollingInterval),this.#e=n}_getSubscriber(e){let t=super._getSubscriber(e);return $3(t)&&(t.pollingInterval=this.#e),t}get pollingInterval(){return this.#e}set pollingInterval(e){if(!Number.isInteger(e)||e<0)throw new Error("invalid interval");this.#e=e,this._forEachSubscriber(t=>{$3(t)&&(t.pollingInterval=this.#e)})}};yn.JsonRpcApiPollingProvider=Yl;var Rp=class extends Yl{#e;constructor(e,t,n){e==null&&(e="http://localhost:8545"),super(t,n),typeof e=="string"?this.#e=new fe.FetchRequest(e):this.#e=e.clone()}_getConnection(){return this.#e.clone()}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){let t=this._getConnection();t.body=JSON.stringify(e),t.setHeader("content-type","application/json");let n=await t.send();n.assertOk();let s=n.bodyJson;return Array.isArray(s)||(s=[s]),s}};yn.JsonRpcProvider=Rp;function Lp(r){if(r==null)return null;if(typeof r.message=="string"&&r.message.match(/revert/i)&&(0,fe.isHexString)(r.data))return{message:r.message,data:r.data};if(typeof r=="object"){for(let e in r){let t=Lp(r[e]);if(t)return t}return null}if(typeof r=="string")try{return Lp(JSON.parse(r))}catch{}return null}function Mp(r,e){if(r!=null){if(typeof r.message=="string"&&e.push(r.message),typeof r=="object")for(let t in r)Mp(r[t],e);if(typeof r=="string")try{return Mp(JSON.parse(r),e)}catch{}}}function vk(r){let e=[];return Mp(r,e),e}});var Fp=P(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.AnkrProvider=void 0;var jp=$(),_k=Ln(),kk=Vt(),Tk=pr(),Zl="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function Bk(r){switch(r){case"mainnet":return"rpc.ankr.com/eth";case"goerli":return"rpc.ankr.com/eth_goerli";case"sepolia":return"rpc.ankr.com/eth_sepolia";case"arbitrum":return"rpc.ankr.com/arbitrum";case"base":return"rpc.ankr.com/base";case"base-goerli":return"rpc.ankr.com/base_goerli";case"base-sepolia":return"rpc.ankr.com/base_sepolia";case"bnb":return"rpc.ankr.com/bsc";case"bnbt":return"rpc.ankr.com/bsc_testnet_chapel";case"matic":return"rpc.ankr.com/polygon";case"matic-mumbai":return"rpc.ankr.com/polygon_mumbai";case"optimism":return"rpc.ankr.com/optimism";case"optimism-goerli":return"rpc.ankr.com/optimism_testnet";case"optimism-sepolia":return"rpc.ankr.com/optimism_sepolia"}(0,jp.assertArgument)(!1,"unsupported network","network",r)}var Up=class r extends Tk.JsonRpcProvider{apiKey;constructor(e,t){e==null&&(e="mainnet");let n=kk.Network.from(e);t==null&&(t=Zl);let s={polling:!0,staticNetwork:n},i=r.getRequest(n,t);super(i,n,s),(0,jp.defineProperties)(this,{apiKey:t})}_getProvider(e){try{return new r(e,this.apiKey)}catch{}return super._getProvider(e)}static getRequest(e,t){t==null&&(t=Zl);let n=new jp.FetchRequest(`https://${Bk(e.name)}/${t}`);return n.allowGzip=!0,t===Zl&&(n.retryFunc=async(s,i,o)=>((0,_k.showThrottleMessage)("AnkrProvider"),!0)),n}getRpcError(e,t){return e.method==="eth_sendRawTransaction"&&t&&t.error&&t.error.message==="INTERNAL_ERROR: could not replace existing tx"&&(t.error.message="replacement transaction underpriced"),super.getRpcError(e,t)}isCommunityResource(){return this.apiKey===Zl}};Xl.AnkrProvider=Up});var Hp=P(t0=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});t0.AlchemyProvider=void 0;var So=$(),Ok=Ln(),Sk=Vt(),Ck=pr(),e0="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";function Nk(r){switch(r){case"mainnet":return"eth-mainnet.alchemyapi.io";case"goerli":return"eth-goerli.g.alchemy.com";case"sepolia":return"eth-sepolia.g.alchemy.com";case"arbitrum":return"arb-mainnet.g.alchemy.com";case"arbitrum-goerli":return"arb-goerli.g.alchemy.com";case"arbitrum-sepolia":return"arb-sepolia.g.alchemy.com";case"base":return"base-mainnet.g.alchemy.com";case"base-goerli":return"base-goerli.g.alchemy.com";case"base-sepolia":return"base-sepolia.g.alchemy.com";case"matic":return"polygon-mainnet.g.alchemy.com";case"matic-amoy":return"polygon-amoy.g.alchemy.com";case"matic-mumbai":return"polygon-mumbai.g.alchemy.com";case"optimism":return"opt-mainnet.g.alchemy.com";case"optimism-goerli":return"opt-goerli.g.alchemy.com";case"optimism-sepolia":return"opt-sepolia.g.alchemy.com"}(0,So.assertArgument)(!1,"unsupported network","network",r)}var Dp=class r extends Ck.JsonRpcProvider{apiKey;constructor(e,t){e==null&&(e="mainnet");let n=Sk.Network.from(e);t==null&&(t=e0);let s=r.getRequest(n,t);super(s,n,{staticNetwork:n}),(0,So.defineProperties)(this,{apiKey:t})}_getProvider(e){try{return new r(e,this.apiKey)}catch{}return super._getProvider(e)}async _perform(e){if(e.method==="getTransactionResult"){let{trace:t,tx:n}=await(0,So.resolveProperties)({trace:this.send("trace_transaction",[e.hash]),tx:this.getTransaction(e.hash)});if(t==null||n==null)return null;let s,i=!1;try{s=t[0].result.output,i=t[0].error==="Reverted"}catch{}if(s)return(0,So.assert)(!i,"an error occurred during transaction executions","CALL_EXCEPTION",{action:"getTransactionResult",data:s,reason:null,transaction:n,invocation:null,revert:null}),s;(0,So.assert)(!1,"could not parse trace result","BAD_DATA",{value:t})}return await super._perform(e)}isCommunityResource(){return this.apiKey===e0}static getRequest(e,t){t==null&&(t=e0);let n=new So.FetchRequest(`https://${Nk(e.name)}/v2/${t}`);return n.allowGzip=!0,t===e0&&(n.retryFunc=async(s,i,o)=>((0,Ok.showThrottleMessage)("alchemy"),!0)),n}};t0.AlchemyProvider=Dp});var Gp=P(s0=>{"use strict";Object.defineProperty(s0,"__esModule",{value:!0});s0.ChainstackProvider=void 0;var n0=$(),Ik=Ln(),Rk=Vt(),Lk=pr();function r0(r){switch(r){case"mainnet":return"39f1d67cedf8b7831010a665328c9197";case"arbitrum":return"0550c209db33c3abf4cc927e1e18cea1";case"bnb":return"98b5a77e531614387366f6fc5da097f8";case"matic":return"cd9d4d70377471aa7c142ec4a4205249"}(0,n0.assertArgument)(!1,"unsupported network","network",r)}function Mk(r){switch(r){case"mainnet":return"ethereum-mainnet.core.chainstack.com";case"arbitrum":return"arbitrum-mainnet.core.chainstack.com";case"bnb":return"bsc-mainnet.core.chainstack.com";case"matic":return"polygon-mainnet.core.chainstack.com"}(0,n0.assertArgument)(!1,"unsupported network","network",r)}var qp=class r extends Lk.JsonRpcProvider{apiKey;constructor(e,t){e==null&&(e="mainnet");let n=Rk.Network.from(e);t==null&&(t=r0(n.name));let s=r.getRequest(n,t);super(s,n,{staticNetwork:n}),(0,n0.defineProperties)(this,{apiKey:t})}_getProvider(e){try{return new r(e,this.apiKey)}catch{}return super._getProvider(e)}isCommunityResource(){return this.apiKey===r0(this._network.name)}static getRequest(e,t){t==null&&(t=r0(e.name));let n=new n0.FetchRequest(`https://${Mk(e.name)}/${t}`);return n.allowGzip=!0,t===r0(e.name)&&(n.retryFunc=async(s,i,o)=>((0,Ik.showThrottleMessage)("ChainstackProvider"),!0)),n}};s0.ChainstackProvider=qp});var Kp=P(i0=>{"use strict";Object.defineProperty(i0,"__esModule",{value:!0});i0.CloudflareProvider=void 0;var jk=$(),Uk=Vt(),Fk=pr(),zp=class extends Fk.JsonRpcProvider{constructor(e){e==null&&(e="mainnet");let t=Uk.Network.from(e);(0,jk.assertArgument)(t.name==="mainnet","unsupported network","network",e),super("https://cloudflare-eth.com/",t,{staticNetwork:t})}};i0.CloudflareProvider=zp});var Jp=P(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.EtherscanProvider=Co.EtherscanPlugin=void 0;var Dk=xo(),Hk=za(),Q3=Gt(),wt=$(),qk=ko(),Gk=Vt(),zk=jl(),Kk=Ln(),W3=2e3;function Vk(r){return r&&typeof r.then=="function"}var Y3="org.ethers.plugins.provider.Etherscan",Vp=class r extends zk.NetworkPlugin{baseUrl;constructor(e){super(Y3),(0,wt.defineProperties)(this,{baseUrl:e})}clone(){return new r(this.baseUrl)}};Co.EtherscanPlugin=Vp;var $k=["enableCcipRead"],Jk=1,$p=class extends qk.AbstractProvider{network;apiKey;#e;constructor(e,t){let n=t??null;super();let s=Gk.Network.from(e);this.#e=s.getPlugin(Y3),(0,wt.defineProperties)(this,{apiKey:n,network:s})}getBaseUrl(){if(this.#e)return this.#e.baseUrl;switch(this.network.name){case"mainnet":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"holesky":return"https://api-holesky.etherscan.io";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"base":return"https://api.basescan.org";case"base-sepolia":return"https://api-sepolia.basescan.org";case"bnb":return"https://api.bscscan.com";case"bnbt":return"https://api-testnet.bscscan.com";case"matic":return"https://api.polygonscan.com";case"matic-amoy":return"https://api-amoy.polygonscan.com";case"matic-mumbai":return"https://api-testnet.polygonscan.com";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io";default:}(0,wt.assertArgument)(!1,"unsupported network","network",this.network)}getUrl(e,t){let n=Object.keys(t).reduce((s,i)=>{let o=t[i];return o!=null&&(s+=`&${i}=${o}`),s},"");return this.apiKey&&(n+=`&apikey=${this.apiKey}`),`https://api.etherscan.io/v2/api?chainid=${this.network.chainId}&module=${e}${n}`}getPostUrl(){return`https://api.etherscan.io/v2/api?chainid=${this.network.chainId}`}getPostData(e,t){return t.module=e,t.apikey=this.apiKey,t.chainid=this.network.chainId,t}async detectNetwork(){return this.network}async fetch(e,t,n){let s=Jk++,i=n?this.getPostUrl():this.getUrl(e,t),o=n?this.getPostData(e,t):null;this.emit("debug",{action:"sendRequest",id:s,url:i,payload:o});let a=new wt.FetchRequest(i);a.setThrottleParams({slotInterval:1e3}),a.retryFunc=(l,f,h)=>(this.isCommunityResource()&&(0,Kk.showThrottleMessage)("Etherscan"),Promise.resolve(!0)),a.processFunc=async(l,f)=>{let h=f.hasBody()?JSON.parse((0,wt.toUtf8String)(f.body)):{},g=(typeof h.result=="string"?h.result:"").toLowerCase().indexOf("rate limit")>=0;return e==="proxy"?h&&h.status==0&&h.message=="NOTOK"&&g&&(this.emit("debug",{action:"receiveError",id:s,reason:"proxy-NOTOK",error:h}),f.throwThrottleError(h.result,W3)):g&&(this.emit("debug",{action:"receiveError",id:s,reason:"null result",error:h.result}),f.throwThrottleError(h.result,W3)),f},o&&(a.setHeader("content-type","application/x-www-form-urlencoded; charset=UTF-8"),a.body=Object.keys(o).map(l=>`${l}=${o[l]}`).join("&"));let c=await a.send();try{c.assertOk()}catch(l){this.emit("debug",{action:"receiveError",id:s,error:l,reason:"assertOk"}),(0,wt.assert)(!1,"response error","SERVER_ERROR",{request:a,response:c})}c.hasBody()||(this.emit("debug",{action:"receiveError",id:s,error:"missing body",reason:"null body"}),(0,wt.assert)(!1,"missing response","SERVER_ERROR",{request:a,response:c}));let u=JSON.parse((0,wt.toUtf8String)(c.body));return e==="proxy"?(u.jsonrpc!="2.0"&&(this.emit("debug",{action:"receiveError",id:s,result:u,reason:"invalid JSON-RPC"}),(0,wt.assert)(!1,"invalid JSON-RPC response (missing jsonrpc='2.0')","SERVER_ERROR",{request:a,response:c,info:{result:u}})),u.error&&(this.emit("debug",{action:"receiveError",id:s,result:u,reason:"JSON-RPC error"}),(0,wt.assert)(!1,"error response","SERVER_ERROR",{request:a,response:c,info:{result:u}})),this.emit("debug",{action:"receiveRequest",id:s,result:u}),u.result):u.status==0&&(u.message==="No records found"||u.message==="No transactions found")?(this.emit("debug",{action:"receiveRequest",id:s,result:u}),u.result):((u.status!=1||typeof u.message=="string"&&!u.message.match(/^OK/))&&(this.emit("debug",{action:"receiveError",id:s,result:u}),(0,wt.assert)(!1,"error response","SERVER_ERROR",{request:a,response:c,info:{result:u}})),this.emit("debug",{action:"receiveRequest",id:s,result:u}),u.result)}_getTransactionPostData(e){let t={};for(let n in e){if($k.indexOf(n)>=0||e[n]==null)continue;let s=e[n];if(!(n==="type"&&s===0)&&!(n==="blockTag"&&s==="latest")){if({type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[n])s=(0,wt.toQuantity)(s);else if(n==="accessList")s="["+(0,Q3.accessListify)(s).map(i=>`{address:"${i.address}",storageKeys:["${i.storageKeys.join('","')}"]}`).join(",")+"]";else if(n==="blobVersionedHashes"){if(s.length===0)continue;(0,wt.assert)(!1,"Etherscan API does not support blobVersionedHashes","UNSUPPORTED_OPERATION",{operation:"_getTransactionPostData",info:{transaction:e}})}else s=(0,wt.hexlify)(s);t[n]=s}}return t}_checkError(e,t,n){let s="";if((0,wt.isError)(t,"SERVER_ERROR")){try{s=t.info.result.error.message}catch{}if(!s)try{s=t.info.message}catch{}}if(e.method==="estimateGas"&&!s.match(/revert/i)&&s.match(/insufficient funds/i)&&(0,wt.assert)(!1,"insufficient funds","INSUFFICIENT_FUNDS",{transaction:e.transaction}),(e.method==="call"||e.method==="estimateGas")&&s.match(/execution reverted/i)){let i="";try{i=t.info.result.error.data}catch{}let o=Dk.AbiCoder.getBuiltinCallException(e.method,e.transaction,i);throw o.info={request:e,error:t},o}if(s&&e.method==="broadcastTransaction"){let i=Q3.Transaction.from(e.signedTransaction);s.match(/replacement/i)&&s.match(/underpriced/i)&&(0,wt.assert)(!1,"replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:i}),s.match(/insufficient funds/)&&(0,wt.assert)(!1,"insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:i}),s.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&(0,wt.assert)(!1,"nonce has already been used","NONCE_EXPIRED",{transaction:i})}throw t}async _detectNetwork(){return this.network}async _perform(e){switch(e.method){case"chainId":return this.network.chainId;case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getPriorityFee":if(this.network.name==="mainnet")return"1000000000";if(this.network.name==="optimism")return"1000000";throw new Error("fallback onto the AbstractProvider default");case"getBalance":return this.fetch("account",{action:"balance",address:e.address,tag:e.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:e.address,tag:e.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:e.address,tag:e.blockTag});case"getStorage":return this.fetch("proxy",{action:"eth_getStorageAt",address:e.address,position:e.position,tag:e.blockTag});case"broadcastTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:e.signedTransaction},!0).catch(t=>this._checkError(e,t,e.signedTransaction));case"getBlock":if("blockTag"in e)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:e.blockTag,boolean:e.includeTransactions?"true":"false"});(0,wt.assert)(!1,"getBlock by blockHash not supported by Etherscan","UNSUPPORTED_OPERATION",{operation:"getBlock(blockHash)"});case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:e.hash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:e.hash});case"call":{if(e.blockTag!=="latest")throw new Error("EtherscanProvider does not support blockTag for call");let t=this._getTransactionPostData(e.transaction);t.module="proxy",t.action="eth_call";try{return await this.fetch("proxy",t,!0)}catch(n){return this._checkError(e,n,e.transaction)}}case"estimateGas":{let t=this._getTransactionPostData(e.transaction);t.module="proxy",t.action="eth_estimateGas";try{return await this.fetch("proxy",t,!0)}catch(n){return this._checkError(e,n,e.transaction)}}default:break}return super._perform(e)}async getNetwork(){return this.network}async getEtherPrice(){return this.network.name!=="mainnet"?0:parseFloat((await this.fetch("stats",{action:"ethprice"})).ethusd)}async getContract(e){let t=this._getAddress(e);Vk(t)&&(t=await t);try{let n=await this.fetch("contract",{action:"getabi",address:t}),s=JSON.parse(n);return new Hk.Contract(t,s,this)}catch{return null}}isCommunityResource(){return this.apiKey==null}};Co.EtherscanProvider=$p});var Z3=P(o0=>{"use strict";Object.defineProperty(o0,"__esModule",{value:!0});o0.WebSocket=void 0;function Qk(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}var Wk=Qk().WebSocket;o0.WebSocket=Wk});var l0=P(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.SocketProvider=Sr.SocketEventSubscriber=Sr.SocketPendingSubscriber=Sr.SocketBlockSubscriber=Sr.SocketSubscriber=void 0;var X3=ko(),Wa=$(),Yk=pr(),No=class{#e;#t;get filter(){return JSON.parse(this.#t)}#r;#n;#s;constructor(e,t){this.#e=e,this.#t=JSON.stringify(t),this.#r=null,this.#n=null,this.#s=null}start(){this.#r=this.#e.send("eth_subscribe",this.filter).then(e=>(this.#e._register(e,this),e))}stop(){this.#r.then(e=>{this.#e.destroyed||this.#e.send("eth_unsubscribe",[e])}),this.#r=null}pause(e){(0,Wa.assert)(e,"preserve logs while paused not supported by SocketSubscriber yet","UNSUPPORTED_OPERATION",{operation:"pause(false)"}),this.#n=!!e}resume(){this.#n=null}_handleMessage(e){if(this.#r!=null&&this.#n===null){let t=this.#s;t==null?t=this._emit(this.#e,e):t=t.then(async()=>{await this._emit(this.#e,e)}),this.#s=t.then(()=>{this.#s===t&&(this.#s=null)})}}async _emit(e,t){throw new Error("sub-classes must implemente this; _emit")}};Sr.SocketSubscriber=No;var a0=class extends No{constructor(e){super(e,["newHeads"])}async _emit(e,t){e.emit("block",parseInt(t.number))}};Sr.SocketBlockSubscriber=a0;var c0=class extends No{constructor(e){super(e,["newPendingTransactions"])}async _emit(e,t){e.emit("pending",t)}};Sr.SocketPendingSubscriber=c0;var u0=class extends No{#e;get logFilter(){return JSON.parse(this.#e)}constructor(e,t){super(e,["logs",t]),this.#e=JSON.stringify(t)}async _emit(e,t){e.emit(this.logFilter,e._wrapLog(t,e._network))}};Sr.SocketEventSubscriber=u0;var Qp=class extends Yk.JsonRpcApiProvider{#e;#t;#r;constructor(e,t){let n=Object.assign({},t??{});(0,Wa.assertArgument)(n.batchMaxCount==null||n.batchMaxCount===1,"sockets-based providers do not support batches","options.batchMaxCount",t),n.batchMaxCount=1,n.staticNetwork==null&&(n.staticNetwork=!0),super(e,n),this.#e=new Map,this.#t=new Map,this.#r=new Map}_getSubscriber(e){switch(e.type){case"close":return new X3.UnmanagedSubscriber("close");case"block":return new a0(this);case"pending":return new c0(this);case"event":return new u0(this,e.filter);case"orphan":if(e.filter.orphan==="drop-log")return new X3.UnmanagedSubscriber("drop-log")}return super._getSubscriber(e)}_register(e,t){this.#t.set(e,t);let n=this.#r.get(e);if(n){for(let s of n)t._handleMessage(s);this.#r.delete(e)}}async _send(e){(0,Wa.assertArgument)(!Array.isArray(e),"WebSocket does not support batch send","payload",e);let t=new Promise((n,s)=>{this.#e.set(e.id,{payload:e,resolve:n,reject:s})});return await this._waitUntilReady(),await this._write(JSON.stringify(e)),[await t]}async _processMessage(e){let t=JSON.parse(e);if(t&&typeof t=="object"&&"id"in t){let n=this.#e.get(t.id);if(n==null){this.emit("error",(0,Wa.makeError)("received result for unknown id","UNKNOWN_ERROR",{reasonCode:"UNKNOWN_ID",result:t}));return}this.#e.delete(t.id),n.resolve(t)}else if(t&&t.method==="eth_subscription"){let n=t.params.subscription,s=this.#t.get(n);if(s)s._handleMessage(t.params.result);else{let i=this.#r.get(n);i==null&&(i=[],this.#r.set(n,i)),i.push(t.params.result)}}else{this.emit("error",(0,Wa.makeError)("received unexpected message","UNKNOWN_ERROR",{reasonCode:"UNEXPECTED_MESSAGE",result:t}));return}}async _write(e){throw new Error("sub-classes must override this")}};Sr.SocketProvider=Qp});var d0=P(f0=>{"use strict";Object.defineProperty(f0,"__esModule",{value:!0});f0.WebSocketProvider=void 0;var Zk=Z3(),Xk=l0(),Wp=class extends Xk.SocketProvider{#e;#t;get websocket(){if(this.#t==null)throw new Error("websocket closed");return this.#t}constructor(e,t,n){super(t,n),typeof e=="string"?(this.#e=()=>new Zk.WebSocket(e),this.#t=this.#e()):typeof e=="function"?(this.#e=e,this.#t=e()):(this.#e=null,this.#t=e),this.websocket.onopen=async()=>{try{await this._start(),this.resume()}catch(s){console.log("failed to start WebsocketProvider",s)}},this.websocket.onmessage=s=>{this._processMessage(s.data)}}async _write(e){this.websocket.send(e)}async destroy(){this.#t!=null&&(this.#t.close(),this.#t=null),super.destroy()}};f0.WebSocketProvider=Wp});var Yp=P(Io=>{"use strict";Object.defineProperty(Io,"__esModule",{value:!0});Io.InfuraProvider=Io.InfuraWebSocketProvider=void 0;var Za=$(),eT=Ln(),tT=Vt(),rT=pr(),nT=d0(),Ya="84842078b09946638c03157f83405213";function sT(r){switch(r){case"mainnet":return"mainnet.infura.io";case"goerli":return"goerli.infura.io";case"sepolia":return"sepolia.infura.io";case"arbitrum":return"arbitrum-mainnet.infura.io";case"arbitrum-goerli":return"arbitrum-goerli.infura.io";case"arbitrum-sepolia":return"arbitrum-sepolia.infura.io";case"base":return"base-mainnet.infura.io";case"base-goerlia":case"base-goerli":return"base-goerli.infura.io";case"base-sepolia":return"base-sepolia.infura.io";case"bnb":return"bsc-mainnet.infura.io";case"bnbt":return"bsc-testnet.infura.io";case"linea":return"linea-mainnet.infura.io";case"linea-goerli":return"linea-goerli.infura.io";case"linea-sepolia":return"linea-sepolia.infura.io";case"matic":return"polygon-mainnet.infura.io";case"matic-amoy":return"polygon-amoy.infura.io";case"matic-mumbai":return"polygon-mumbai.infura.io";case"optimism":return"optimism-mainnet.infura.io";case"optimism-goerli":return"optimism-goerli.infura.io";case"optimism-sepolia":return"optimism-sepolia.infura.io"}(0,Za.assertArgument)(!1,"unsupported network","network",r)}var h0=class extends nT.WebSocketProvider{projectId;projectSecret;constructor(e,t){let n=new p0(e,t),s=n._getConnection();(0,Za.assert)(!s.credentials,"INFURA WebSocket project secrets unsupported","UNSUPPORTED_OPERATION",{operation:"InfuraProvider.getWebSocketProvider()"});let i=s.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");super(i,n._network),(0,Za.defineProperties)(this,{projectId:n.projectId,projectSecret:n.projectSecret})}isCommunityResource(){return this.projectId===Ya}};Io.InfuraWebSocketProvider=h0;var p0=class r extends rT.JsonRpcProvider{projectId;projectSecret;constructor(e,t,n){e==null&&(e="mainnet");let s=tT.Network.from(e);t==null&&(t=Ya),n==null&&(n=null);let i=r.getRequest(s,t,n);super(i,s,{staticNetwork:s}),(0,Za.defineProperties)(this,{projectId:t,projectSecret:n})}_getProvider(e){try{return new r(e,this.projectId,this.projectSecret)}catch{}return super._getProvider(e)}isCommunityResource(){return this.projectId===Ya}static getWebSocketProvider(e,t){return new h0(e,t)}static getRequest(e,t,n){t==null&&(t=Ya),n==null&&(n=null);let s=new Za.FetchRequest(`https://${sT(e.name)}/v3/${t}`);return s.allowGzip=!0,n&&s.setCredentials("",n),t===Ya&&(s.retryFunc=async(i,o,a)=>((0,eT.showThrottleMessage)("InfuraProvider"),!0)),s}};Io.InfuraProvider=p0});var eg=P(b0=>{"use strict";Object.defineProperty(b0,"__esModule",{value:!0});b0.QuickNodeProvider=void 0;var Zp=$(),iT=Ln(),oT=Vt(),aT=pr(),g0="919b412a057b5e9c9b6dce193c5a60242d6efadb";function cT(r){switch(r){case"mainnet":return"ethers.quiknode.pro";case"goerli":return"ethers.ethereum-goerli.quiknode.pro";case"sepolia":return"ethers.ethereum-sepolia.quiknode.pro";case"holesky":return"ethers.ethereum-holesky.quiknode.pro";case"arbitrum":return"ethers.arbitrum-mainnet.quiknode.pro";case"arbitrum-goerli":return"ethers.arbitrum-goerli.quiknode.pro";case"arbitrum-sepolia":return"ethers.arbitrum-sepolia.quiknode.pro";case"base":return"ethers.base-mainnet.quiknode.pro";case"base-goerli":return"ethers.base-goerli.quiknode.pro";case"base-spolia":return"ethers.base-sepolia.quiknode.pro";case"bnb":return"ethers.bsc.quiknode.pro";case"bnbt":return"ethers.bsc-testnet.quiknode.pro";case"matic":return"ethers.matic.quiknode.pro";case"matic-mumbai":return"ethers.matic-testnet.quiknode.pro";case"optimism":return"ethers.optimism.quiknode.pro";case"optimism-goerli":return"ethers.optimism-goerli.quiknode.pro";case"optimism-sepolia":return"ethers.optimism-sepolia.quiknode.pro";case"xdai":return"ethers.xdai.quiknode.pro"}(0,Zp.assertArgument)(!1,"unsupported network","network",r)}var Xp=class r extends aT.JsonRpcProvider{token;constructor(e,t){e==null&&(e="mainnet");let n=oT.Network.from(e);t==null&&(t=g0);let s=r.getRequest(n,t);super(s,n,{staticNetwork:n}),(0,Zp.defineProperties)(this,{token:t})}_getProvider(e){try{return new r(e,this.token)}catch{}return super._getProvider(e)}isCommunityResource(){return this.token===g0}static getRequest(e,t){t==null&&(t=g0);let n=new Zp.FetchRequest(`https://${cT(e.name)}/${t}`);return n.allowGzip=!0,t===g0&&(n.retryFunc=async(s,i,o)=>((0,iT.showThrottleMessage)("QuickNodeProvider"),!0)),n}};b0.QuickNodeProvider=Xp});var ag=P(m0=>{"use strict";Object.defineProperty(m0,"__esModule",{value:!0});m0.FallbackProvider=void 0;var Cr=$(),e6=ko(),uT=Vt(),lT=BigInt("1"),fT=BigInt("2");function dT(r){for(let e=r.length-1;e>0;e--){let t=Math.floor(Math.random()*(e+1)),n=r[e];r[e]=r[t],r[t]=n}}function hT(r){return new Promise(e=>{setTimeout(e,r)})}function sg(){return new Date().getTime()}function tg(r){return JSON.stringify(r,(e,t)=>typeof t=="bigint"?{type:"bigint",value:t.toString()}:t)}var t6={stallTimeout:400,priority:1,weight:1},r6={blockNumber:-2,requests:0,lateResponses:0,errorResponses:0,outOfSync:-1,unsupportedEvents:0,rollingDuration:0,score:0,_network:null,_updateNumber:null,_totalTime:0,_lastFatalError:null,_lastFatalErrorTimestamp:0};async function pT(r,e){for(;(r.blockNumber<0||r.blockNumber<e)&&(r._updateNumber||(r._updateNumber=(async()=>{try{let t=await r.provider.getBlockNumber();t>r.blockNumber&&(r.blockNumber=t)}catch(t){r.blockNumber=-2,r._lastFatalError=t,r._lastFatalErrorTimestamp=sg()}r._updateNumber=null})()),await r._updateNumber,r.outOfSync++,!r._lastFatalError););}function Ro(r){if(r==null)return"null";if(Array.isArray(r))return"["+r.map(Ro).join(",")+"]";if(typeof r=="object"&&typeof r.toJSON=="function")return Ro(r.toJSON());switch(typeof r){case"boolean":case"symbol":return r.toString();case"bigint":case"number":return BigInt(r).toString();case"string":return JSON.stringify(r);case"object":{let e=Object.keys(r);return e.sort(),"{"+e.map(t=>`${JSON.stringify(t)}:${Ro(r[t])}`).join(",")+"}"}}throw console.log("Could not serialize",r),new Error("Hmm...")}function rg(r,e){if("error"in e){let n=e.error,s;return(0,Cr.isError)(n,"CALL_EXCEPTION")?s=Ro(Object.assign({},n,{shortMessage:void 0,reason:void 0,info:void 0})):s=Ro(n),{tag:s,value:n}}let t=e.result;return{tag:Ro(t),value:t}}function x0(r,e){let t=new Map;for(let{value:s,tag:i,weight:o}of e){let a=t.get(i)||{value:s,weight:0};a.weight+=o,t.set(i,a)}let n=null;for(let s of t.values())s.weight>=r&&(!n||s.weight>n.weight)&&(n=s);if(n)return n.value}function ig(r,e){let t=0,n=new Map,s=null,i=[];for(let{value:a,tag:c,weight:u}of e)if(a instanceof Error){let l=n.get(c)||{value:a,weight:0};l.weight+=u,n.set(c,l),(s==null||l.weight>s.weight)&&(s=l)}else i.push(BigInt(a)),t+=u;if(t<r)return s&&s.weight>=r?s.value:void 0;i.sort((a,c)=>a<c?-1:c>a?1:0);let o=Math.floor(i.length/2);return i.length%2?i[o]:(i[o-1]+i[o]+lT)/fT}function ng(r,e){let t=x0(r,e);if(t!==void 0)return t;for(let n of e)if(n.value)return n.value}function gT(r,e){if(r===1)return(0,Cr.getNumber)(ig(r,e),"%internal");let t=new Map,n=(o,a)=>{let c=t.get(o)||{result:o,weight:0};c.weight+=a,t.set(o,c)};for(let{weight:o,value:a}of e){let c=(0,Cr.getNumber)(a);n(c-1,o),n(c,o),n(c+1,o)}let s=0,i;for(let{weight:o,result:a}of t.values())o>=r&&(o>s||i!=null&&o===s&&a>i)&&(s=o,i=a);return i}var og=class extends e6.AbstractProvider{quorum;eventQuorum;eventWorkers;#e;#t;#r;constructor(e,t,n){super(t,n),this.#e=e.map(s=>s instanceof e6.AbstractProvider?Object.assign({provider:s},t6,r6):Object.assign({},t6,s,r6)),this.#t=-2,this.#r=null,n&&n.quorum!=null?this.quorum=n.quorum:this.quorum=Math.ceil(this.#e.reduce((s,i)=>(s+=i.weight,s),0)/2),this.eventQuorum=1,this.eventWorkers=1,(0,Cr.assertArgument)(this.quorum<=this.#e.reduce((s,i)=>s+i.weight,0),"quorum exceed provider weight","quorum",this.quorum)}get providerConfigs(){return this.#e.map(e=>{let t=Object.assign({},e);for(let n in t)n[0]==="_"&&delete t[n];return t})}async _detectNetwork(){return uT.Network.from((0,Cr.getBigInt)(await this._perform({method:"chainId"})))}async _translatePerform(e,t){switch(t.method){case"broadcastTransaction":return await e.broadcastTransaction(t.signedTransaction);case"call":return await e.call(Object.assign({},t.transaction,{blockTag:t.blockTag}));case"chainId":return(await e.getNetwork()).chainId;case"estimateGas":return await e.estimateGas(t.transaction);case"getBalance":return await e.getBalance(t.address,t.blockTag);case"getBlock":{let n="blockHash"in t?t.blockHash:t.blockTag;return await e.getBlock(n,t.includeTransactions)}case"getBlockNumber":return await e.getBlockNumber();case"getCode":return await e.getCode(t.address,t.blockTag);case"getGasPrice":return(await e.getFeeData()).gasPrice;case"getPriorityFee":return(await e.getFeeData()).maxPriorityFeePerGas;case"getLogs":return await e.getLogs(t.filter);case"getStorage":return await e.getStorage(t.address,t.position,t.blockTag);case"getTransaction":return await e.getTransaction(t.hash);case"getTransactionCount":return await e.getTransactionCount(t.address,t.blockTag);case"getTransactionReceipt":return await e.getTransactionReceipt(t.hash);case"getTransactionResult":return await e.getTransactionResult(t.hash)}}#n(e){let t=Array.from(e).map(s=>s.config),n=this.#e.slice();dT(n),n.sort((s,i)=>s.priority-i.priority);for(let s of n)if(!s._lastFatalError&&t.indexOf(s)===-1)return s;return null}#s(e,t){let n=this.#n(e);if(n==null)return null;let s={config:n,result:null,didBump:!1,perform:null,staller:null},i=sg();return s.perform=(async()=>{try{n.requests++;let a=await this._translatePerform(n.provider,t);s.result={result:a}}catch(a){n.errorResponses++,s.result={error:a}}let o=sg()-i;n._totalTime+=o,n.rollingDuration=.95*n.rollingDuration+.05*o,s.perform=null})(),s.staller=(async()=>{await hT(n.stallTimeout),s.staller=null})(),e.add(s),s}async#o(){let e=this.#r;if(!e){let t=[];this.#e.forEach(n=>{t.push((async()=>{await pT(n,0),n._lastFatalError||(n._network=await n.provider.getNetwork())})())}),this.#r=e=(async()=>{await Promise.all(t);let n=null;for(let s of this.#e){if(s._lastFatalError)continue;let i=s._network;n==null?n=i.chainId:i.chainId!==n&&(0,Cr.assert)(!1,"cannot mix providers on different networks","UNSUPPORTED_OPERATION",{operation:"new FallbackProvider"})}})()}await e}async#i(e,t){let n=[];for(let s of e)if(s.result!=null){let{tag:i,value:o}=rg(t.method,s.result);n.push({tag:i,value:o,weight:s.config.weight})}if(!(n.reduce((s,i)=>s+i.weight,0)<this.quorum)){switch(t.method){case"getBlockNumber":{this.#t===-2&&(this.#t=Math.ceil((0,Cr.getNumber)(ig(this.quorum,this.#e.filter(i=>!i._lastFatalError).map(i=>({value:i.blockNumber,tag:(0,Cr.getNumber)(i.blockNumber).toString(),weight:i.weight}))))));let s=gT(this.quorum,n);return s===void 0?void 0:(s>this.#t&&(this.#t=s),this.#t)}case"getGasPrice":case"getPriorityFee":case"estimateGas":return ig(this.quorum,n);case"getBlock":return"blockTag"in t&&t.blockTag==="pending"?ng(this.quorum,n):x0(this.quorum,n);case"call":case"chainId":case"getBalance":case"getTransactionCount":case"getCode":case"getStorage":case"getTransaction":case"getTransactionReceipt":case"getLogs":return x0(this.quorum,n);case"broadcastTransaction":return ng(this.quorum,n)}(0,Cr.assert)(!1,"unsupported method","UNSUPPORTED_OPERATION",{operation:`_perform(${tg(t.method)})`})}}async#a(e,t){if(e.size===0)throw new Error("no runners?!");let n=[],s=0;for(let o of e){if(o.perform&&n.push(o.perform),o.staller){n.push(o.staller);continue}o.didBump||(o.didBump=!0,s++)}let i=await this.#i(e,t);if(i!==void 0){if(i instanceof Error)throw i;return i}for(let o=0;o<s;o++)this.#s(e,t);return(0,Cr.assert)(n.length>0,"quorum not met","SERVER_ERROR",{request:"%sub-requests",info:{request:t,results:Array.from(e).map(o=>tg(o.result))}}),await Promise.race(n),await this.#a(e,t)}async _perform(e){if(e.method==="broadcastTransaction"){let i=this.#e.map(c=>null),o=this.#e.map(async({provider:c,weight:u},l)=>{try{let f=await c._perform(e);i[l]=Object.assign(rg(e.method,{result:f}),{weight:u})}catch(f){i[l]=Object.assign(rg(e.method,{error:f}),{weight:u})}});for(;;){let c=i.filter(f=>f!=null);for(let{value:f}of c)if(!(f instanceof Error))return f;let u=x0(this.quorum,i.filter(f=>f!=null));if((0,Cr.isError)(u,"INSUFFICIENT_FUNDS"))throw u;let l=o.filter((f,h)=>i[h]==null);if(l.length===0)break;await Promise.race(l)}let a=ng(this.quorum,i);if((0,Cr.assert)(a!==void 0,"problem multi-broadcasting","SERVER_ERROR",{request:"%sub-requests",info:{request:e,results:i.map(tg)}}),a instanceof Error)throw a;return a}await this.#o();let t=new Set,n=0;for(;;){let i=this.#s(t,e);if(i==null||(n+=i.config.weight,n>=this.quorum))break}let s=await this.#a(t,e);for(let i of t)i.perform&&i.result==null&&i.config.lateResponses++;return s}async destroy(){for(let{provider:e}of this.#e)e.destroy();super.destroy()}};m0.FallbackProvider=og});var n6=P(y0=>{"use strict";Object.defineProperty(y0,"__esModule",{value:!0});y0.getDefaultProvider=void 0;var bT=$(),xT=Fp(),mT=Hp(),yT=Gp(),wT=Kp(),AT=Jp(),ET=Yp(),PT=eg(),vT=ag(),cg=pr(),_T=Vt(),kT=d0();function TT(r){return r&&typeof r.send=="function"&&typeof r.close=="function"}var BT="goerli kovan sepolia classicKotti optimism-goerli arbitrum-goerli matic-mumbai bnbt".split(" ");function OT(r,e){e==null&&(e={});let t=o=>e[o]==="-"?!1:typeof e.exclusive=="string"?o===e.exclusive:Array.isArray(e.exclusive)?e.exclusive.indexOf(o)!==-1:!0;if(typeof r=="string"&&r.match(/^https?:/))return new cg.JsonRpcProvider(r);if(typeof r=="string"&&r.match(/^wss?:/)||TT(r))return new kT.WebSocketProvider(r);let n=null;try{n=_T.Network.from(r)}catch{}let s=[];if(t("publicPolygon")&&n&&(n.name==="matic"?s.push(new cg.JsonRpcProvider("https://polygon-rpc.com/",n,{staticNetwork:n})):n.name==="matic-amoy"&&s.push(new cg.JsonRpcProvider("https://rpc-amoy.polygon.technology/",n,{staticNetwork:n}))),t("alchemy"))try{s.push(new mT.AlchemyProvider(r,e.alchemy))}catch{}if(t("ankr")&&e.ankr!=null)try{s.push(new xT.AnkrProvider(r,e.ankr))}catch{}if(t("chainstack"))try{s.push(new yT.ChainstackProvider(r,e.chainstack))}catch{}if(t("cloudflare"))try{s.push(new wT.CloudflareProvider(r))}catch{}if(t("etherscan"))try{s.push(new AT.EtherscanProvider(r,e.etherscan))}catch{}if(t("infura"))try{let o=e.infura,a;typeof o=="object"&&(a=o.projectSecret,o=o.projectId),s.push(new ET.InfuraProvider(r,o,a))}catch{}if(t("quicknode"))try{let o=e.quicknode;s.push(new PT.QuickNodeProvider(r,o))}catch{}if((0,bT.assert)(s.length,"unsupported default network","UNSUPPORTED_OPERATION",{operation:"getDefaultProvider"}),s.length===1)return s[0];let i=Math.floor(s.length/2);return i>2&&(i=2),n&&BT.indexOf(n.name)!==-1&&(i=1),e&&e.quorum&&(i=e.quorum),new vT.FallbackProvider(s,void 0,{quorum:i})}y0.getDefaultProvider=OT});var s6=P(w0=>{"use strict";Object.defineProperty(w0,"__esModule",{value:!0});w0.NonceManager=void 0;var ST=$(),CT=$l(),ug=class r extends CT.AbstractSigner{signer;#e;#t;constructor(e){super(e.provider),(0,ST.defineProperties)(this,{signer:e}),this.#e=null,this.#t=0}async getAddress(){return this.signer.getAddress()}connect(e){return new r(this.signer.connect(e))}async getNonce(e){if(e==="pending"){this.#e==null&&(this.#e=super.getNonce("pending"));let t=this.#t;return await this.#e+t}return super.getNonce(e)}increment(){this.#t++}reset(){this.#t=0,this.#e=null}async sendTransaction(e){let t=this.getNonce("pending");return this.increment(),e=await this.signer.populateTransaction(e),e.nonce=await t,await this.signer.sendTransaction(e)}signTransaction(e){return this.signer.signTransaction(e)}signMessage(e){return this.signer.signMessage(e)}signTypedData(e,t,n){return this.signer.signTypedData(e,t,n)}};w0.NonceManager=ug});var i6=P(A0=>{"use strict";Object.defineProperty(A0,"__esModule",{value:!0});A0.BrowserProvider=void 0;var lg=$(),NT=pr(),fg=class r extends NT.JsonRpcApiPollingProvider{#e;#t;constructor(e,t,n){let s=Object.assign({},n??{},{batchMaxCount:1});(0,lg.assertArgument)(e&&e.request,"invalid EIP-1193 provider","ethereum",e),super(t,s),this.#t=null,n&&n.providerInfo&&(this.#t=n.providerInfo),this.#e=async(i,o)=>{let a={method:i,params:o};this.emit("debug",{action:"sendEip1193Request",payload:a});try{let c=await e.request(a);return this.emit("debug",{action:"receiveEip1193Result",result:c}),c}catch(c){let u=new Error(c.message);throw u.code=c.code,u.data=c.data,u.payload=a,this.emit("debug",{action:"receiveEip1193Error",error:u}),u}}}get providerInfo(){return this.#t}async send(e,t){return await this._start(),await super.send(e,t)}async _send(e){(0,lg.assertArgument)(!Array.isArray(e),"EIP-1193 does not support batch request","payload",e);try{let t=await this.#e(e.method,e.params||[]);return[{id:e.id,result:t}]}catch(t){return[{id:e.id,error:{code:t.code,data:t.data,message:t.message}}]}}getRpcError(e,t){switch(t=JSON.parse(JSON.stringify(t)),t.error.code||-1){case 4001:t.error.message=`ethers-user-denied: ${t.error.message}`;break;case 4200:t.error.message=`ethers-unsupported: ${t.error.message}`;break}return super.getRpcError(e,t)}async hasSigner(e){e==null&&(e=0);let t=await this.send("eth_accounts",[]);return typeof e=="number"?t.length>e:(e=e.toLowerCase(),t.filter(n=>n.toLowerCase()===e).length!==0)}async getSigner(e){if(e==null&&(e=0),!await this.hasSigner(e))try{await this.#e("eth_requestAccounts",[])}catch(t){let n=t.payload;throw this.getRpcError(n,{id:n.id,error:t})}return await super.getSigner(e)}static async discover(e){if(e==null&&(e={}),e.provider)return new r(e.provider);let t=e.window?e.window:typeof window<"u"?window:null;if(t==null)return null;let n=e.anyProvider;if(n&&t.ethereum)return new r(t.ethereum);if(!("addEventListener"in t&&"dispatchEvent"in t&&"removeEventListener"in t))return null;let s=e.timeout?e.timeout:300;return s===0?null:await new Promise((i,o)=>{let a=[],c=f=>{a.push(f.detail),n&&u()},u=()=>{if(clearTimeout(l),a.length)if(e&&e.filter){let f=e.filter(a.map(h=>Object.assign({},h.info)));if(f==null)i(null);else if(f instanceof r)i(f);else{let h=null;if(f.uuid&&(h=a.filter(x=>f.uuid===x.info.uuid)[0]),h){let{provider:g,info:x}=h;i(new r(g,void 0,{providerInfo:x}))}else o((0,lg.makeError)("filter returned unknown info","UNSUPPORTED_OPERATION",{value:f}))}}else{let{provider:f,info:h}=a[0];i(new r(f,void 0,{providerInfo:h}))}else i(null);t.removeEventListener("eip6963:announceProvider",c)},l=setTimeout(()=>{u()},s);t.addEventListener("eip6963:announceProvider",c),t.dispatchEvent(new Event("eip6963:requestProvider"))})}};A0.BrowserProvider=fg});var o6=P(P0=>{"use strict";Object.defineProperty(P0,"__esModule",{value:!0});P0.BlockscoutProvider=void 0;var E0=$(),IT=Vt(),RT=pr();function LT(r){switch(r){case"mainnet":return"https://eth.blockscout.com/api/eth-rpc";case"sepolia":return"https://eth-sepolia.blockscout.com/api/eth-rpc";case"holesky":return"https://eth-holesky.blockscout.com/api/eth-rpc";case"classic":return"https://etc.blockscout.com/api/eth-rpc";case"arbitrum":return"https://arbitrum.blockscout.com/api/eth-rpc";case"base":return"https://base.blockscout.com/api/eth-rpc";case"base-sepolia":return"https://base-sepolia.blockscout.com/api/eth-rpc";case"matic":return"https://polygon.blockscout.com/api/eth-rpc";case"optimism":return"https://optimism.blockscout.com/api/eth-rpc";case"optimism-sepolia":return"https://optimism-sepolia.blockscout.com/api/eth-rpc";case"xdai":return"https://gnosis.blockscout.com/api/eth-rpc"}(0,E0.assertArgument)(!1,"unsupported network","network",r)}var dg=class r extends RT.JsonRpcProvider{apiKey;constructor(e,t){e==null&&(e="mainnet");let n=IT.Network.from(e);t==null&&(t=null);let s=r.getRequest(n);super(s,n,{staticNetwork:n}),(0,E0.defineProperties)(this,{apiKey:t})}_getProvider(e){try{return new r(e,this.apiKey)}catch{}return super._getProvider(e)}isCommunityResource(){return this.apiKey===null}getRpcRequest(e){let t=super.getRpcRequest(e);return t&&t.method==="eth_estimateGas"&&t.args.length==1&&(t.args=t.args.slice(),t.args.push("latest")),t}getRpcError(e,t){let n=t?t.error:null;if(n&&n.code===-32015&&!(0,E0.isHexString)(n.data||"",!0)){let s={"assert(false)":"01","arithmetic underflow or overflow":"11","division or modulo by zero":"12","out-of-bounds array access; popping on an empty array":"31","out-of-bounds access of an array or bytesN":"32"},i="";n.message==="VM execution error."?i=s[n.data]||"":s[n.message||""]&&(i=s[n.message||""]),i&&(n.message+=` (reverted: ${n.data})`,n.data="0x4e487b7100000000000000000000000000000000000000000000000000000000000000"+i)}else n&&n.code===-32e3&&n.message==="wrong transaction nonce"&&(n.message+=" (nonce too low)");return super.getRpcError(e,t)}static getRequest(e){let t=new E0.FetchRequest(LT(e.name));return t.allowGzip=!0,t}};P0.BlockscoutProvider=dg});var a6=P(_0=>{"use strict";Object.defineProperty(_0,"__esModule",{value:!0});_0.PocketProvider=void 0;var hg=$(),MT=Ln(),jT=Vt(),UT=pr(),v0="62e1ad51b37b8e00394bda3b";function FT(r){switch(r){case"mainnet":return"eth-mainnet.gateway.pokt.network";case"goerli":return"eth-goerli.gateway.pokt.network";case"matic":return"poly-mainnet.gateway.pokt.network";case"matic-mumbai":return"polygon-mumbai-rpc.gateway.pokt.network"}(0,hg.assertArgument)(!1,"unsupported network","network",r)}var pg=class r extends UT.JsonRpcProvider{applicationId;applicationSecret;constructor(e,t,n){e==null&&(e="mainnet");let s=jT.Network.from(e);t==null&&(t=v0),n==null&&(n=null);let i={staticNetwork:s},o=r.getRequest(s,t,n);super(o,s,i),(0,hg.defineProperties)(this,{applicationId:t,applicationSecret:n})}_getProvider(e){try{return new r(e,this.applicationId,this.applicationSecret)}catch{}return super._getProvider(e)}static getRequest(e,t,n){t==null&&(t=v0);let s=new hg.FetchRequest(`https://${FT(e.name)}/v1/lb/${t}`);return s.allowGzip=!0,n&&s.setCredentials("",n),t===v0&&(s.retryFunc=async(i,o,a)=>((0,MT.showThrottleMessage)("PocketProvider"),!0)),s}isCommunityResource(){return this.applicationId===v0}};_0.PocketProvider=pg});var c6=P(k0=>{"use strict";Object.defineProperty(k0,"__esModule",{value:!0});k0.IpcSocketProvider=void 0;var DT=void 0;k0.IpcSocketProvider=DT});var B0=P(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.SocketEventSubscriber=D.SocketPendingSubscriber=D.SocketBlockSubscriber=D.SocketSubscriber=D.WebSocketProvider=D.SocketProvider=D.IpcSocketProvider=D.QuickNodeProvider=D.PocketProvider=D.InfuraWebSocketProvider=D.InfuraProvider=D.EtherscanPlugin=D.EtherscanProvider=D.ChainstackProvider=D.CloudflareProvider=D.AnkrProvider=D.BlockscoutProvider=D.AlchemyProvider=D.BrowserProvider=D.JsonRpcSigner=D.JsonRpcProvider=D.JsonRpcApiProvider=D.FallbackProvider=D.copyRequest=D.TransactionResponse=D.TransactionReceipt=D.Log=D.FeeData=D.Block=D.FetchUrlFeeDataNetworkPlugin=D.FeeDataNetworkPlugin=D.EnsPlugin=D.GasCostPlugin=D.NetworkPlugin=D.NonceManager=D.Network=D.MulticoinProviderPlugin=D.EnsResolver=D.getDefaultProvider=D.showThrottleMessage=D.VoidSigner=D.AbstractSigner=D.UnmanagedSubscriber=D.AbstractProvider=void 0;var u6=ko();Object.defineProperty(D,"AbstractProvider",{enumerable:!0,get:function(){return u6.AbstractProvider}});Object.defineProperty(D,"UnmanagedSubscriber",{enumerable:!0,get:function(){return u6.UnmanagedSubscriber}});var l6=$l();Object.defineProperty(D,"AbstractSigner",{enumerable:!0,get:function(){return l6.AbstractSigner}});Object.defineProperty(D,"VoidSigner",{enumerable:!0,get:function(){return l6.VoidSigner}});var HT=Ln();Object.defineProperty(D,"showThrottleMessage",{enumerable:!0,get:function(){return HT.showThrottleMessage}});var qT=n6();Object.defineProperty(D,"getDefaultProvider",{enumerable:!0,get:function(){return qT.getDefaultProvider}});var f6=hp();Object.defineProperty(D,"EnsResolver",{enumerable:!0,get:function(){return f6.EnsResolver}});Object.defineProperty(D,"MulticoinProviderPlugin",{enumerable:!0,get:function(){return f6.MulticoinProviderPlugin}});var GT=Vt();Object.defineProperty(D,"Network",{enumerable:!0,get:function(){return GT.Network}});var zT=s6();Object.defineProperty(D,"NonceManager",{enumerable:!0,get:function(){return zT.NonceManager}});var Xa=jl();Object.defineProperty(D,"NetworkPlugin",{enumerable:!0,get:function(){return Xa.NetworkPlugin}});Object.defineProperty(D,"GasCostPlugin",{enumerable:!0,get:function(){return Xa.GasCostPlugin}});Object.defineProperty(D,"EnsPlugin",{enumerable:!0,get:function(){return Xa.EnsPlugin}});Object.defineProperty(D,"FeeDataNetworkPlugin",{enumerable:!0,get:function(){return Xa.FeeDataNetworkPlugin}});Object.defineProperty(D,"FetchUrlFeeDataNetworkPlugin",{enumerable:!0,get:function(){return Xa.FetchUrlFeeDataNetworkPlugin}});var Lo=yo();Object.defineProperty(D,"Block",{enumerable:!0,get:function(){return Lo.Block}});Object.defineProperty(D,"FeeData",{enumerable:!0,get:function(){return Lo.FeeData}});Object.defineProperty(D,"Log",{enumerable:!0,get:function(){return Lo.Log}});Object.defineProperty(D,"TransactionReceipt",{enumerable:!0,get:function(){return Lo.TransactionReceipt}});Object.defineProperty(D,"TransactionResponse",{enumerable:!0,get:function(){return Lo.TransactionResponse}});Object.defineProperty(D,"copyRequest",{enumerable:!0,get:function(){return Lo.copyRequest}});var KT=ag();Object.defineProperty(D,"FallbackProvider",{enumerable:!0,get:function(){return KT.FallbackProvider}});var gg=pr();Object.defineProperty(D,"JsonRpcApiProvider",{enumerable:!0,get:function(){return gg.JsonRpcApiProvider}});Object.defineProperty(D,"JsonRpcProvider",{enumerable:!0,get:function(){return gg.JsonRpcProvider}});Object.defineProperty(D,"JsonRpcSigner",{enumerable:!0,get:function(){return gg.JsonRpcSigner}});var VT=i6();Object.defineProperty(D,"BrowserProvider",{enumerable:!0,get:function(){return VT.BrowserProvider}});var $T=Hp();Object.defineProperty(D,"AlchemyProvider",{enumerable:!0,get:function(){return $T.AlchemyProvider}});var JT=o6();Object.defineProperty(D,"BlockscoutProvider",{enumerable:!0,get:function(){return JT.BlockscoutProvider}});var QT=Fp();Object.defineProperty(D,"AnkrProvider",{enumerable:!0,get:function(){return QT.AnkrProvider}});var WT=Kp();Object.defineProperty(D,"CloudflareProvider",{enumerable:!0,get:function(){return WT.CloudflareProvider}});var YT=Gp();Object.defineProperty(D,"ChainstackProvider",{enumerable:!0,get:function(){return YT.ChainstackProvider}});var d6=Jp();Object.defineProperty(D,"EtherscanProvider",{enumerable:!0,get:function(){return d6.EtherscanProvider}});Object.defineProperty(D,"EtherscanPlugin",{enumerable:!0,get:function(){return d6.EtherscanPlugin}});var h6=Yp();Object.defineProperty(D,"InfuraProvider",{enumerable:!0,get:function(){return h6.InfuraProvider}});Object.defineProperty(D,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return h6.InfuraWebSocketProvider}});var ZT=a6();Object.defineProperty(D,"PocketProvider",{enumerable:!0,get:function(){return ZT.PocketProvider}});var XT=eg();Object.defineProperty(D,"QuickNodeProvider",{enumerable:!0,get:function(){return XT.QuickNodeProvider}});var eB=c6();Object.defineProperty(D,"IpcSocketProvider",{enumerable:!0,get:function(){return eB.IpcSocketProvider}});var tB=l0();Object.defineProperty(D,"SocketProvider",{enumerable:!0,get:function(){return tB.SocketProvider}});var rB=d0();Object.defineProperty(D,"WebSocketProvider",{enumerable:!0,get:function(){return rB.WebSocketProvider}});var T0=l0();Object.defineProperty(D,"SocketSubscriber",{enumerable:!0,get:function(){return T0.SocketSubscriber}});Object.defineProperty(D,"SocketBlockSubscriber",{enumerable:!0,get:function(){return T0.SocketBlockSubscriber}});Object.defineProperty(D,"SocketPendingSubscriber",{enumerable:!0,get:function(){return T0.SocketPendingSubscriber}});Object.defineProperty(D,"SocketEventSubscriber",{enumerable:!0,get:function(){return T0.SocketEventSubscriber}})});var C0=P(S0=>{"use strict";Object.defineProperty(S0,"__esModule",{value:!0});S0.BaseWallet=void 0;var ec=ht(),O0=bn(),p6=B0(),g6=Gt(),Mn=$(),bg=class r extends p6.AbstractSigner{address;#e;constructor(e,t){super(t),(0,Mn.assertArgument)(e&&typeof e.sign=="function","invalid private key","privateKey","[ REDACTED ]"),this.#e=e;let n=(0,g6.computeAddress)(this.signingKey.publicKey);(0,Mn.defineProperties)(this,{address:n})}get signingKey(){return this.#e}get privateKey(){return this.signingKey.privateKey}async getAddress(){return this.address}connect(e){return new r(this.#e,e)}async signTransaction(e){e=(0,p6.copyRequest)(e);let{to:t,from:n}=await(0,Mn.resolveProperties)({to:e.to?(0,ec.resolveAddress)(e.to,this):void 0,from:e.from?(0,ec.resolveAddress)(e.from,this):void 0});t!=null&&(e.to=t),n!=null&&(e.from=n),e.from!=null&&((0,Mn.assertArgument)((0,ec.getAddress)(e.from)===this.address,"transaction from address mismatch","tx.from",e.from),delete e.from);let s=g6.Transaction.from(e);return s.signature=this.signingKey.sign(s.unsignedHash),s.serialized}async signMessage(e){return this.signMessageSync(e)}signMessageSync(e){return this.signingKey.sign((0,O0.hashMessage)(e)).serialized}authorizeSync(e){(0,Mn.assertArgument)(typeof e.address=="string","invalid address for authorizeSync","auth.address",e);let t=this.signingKey.sign((0,O0.hashAuthorization)(e));return Object.assign({},{address:(0,ec.getAddress)(e.address),nonce:(0,Mn.getBigInt)(e.nonce||0),chainId:(0,Mn.getBigInt)(e.chainId||0)},{signature:t})}async authorize(e){return e=Object.assign({},e,{address:await(0,ec.resolveAddress)(e.address,this)}),this.authorizeSync(await this.populateAuthorization(e))}async signTypedData(e,t,n){let s=await O0.TypedDataEncoder.resolveNames(e,t,n,async i=>{(0,Mn.assert)(this.provider!=null,"cannot resolve ENS names without a provider","UNSUPPORTED_OPERATION",{operation:"resolveName",info:{name:i}});let o=await this.provider.resolveName(i);return(0,Mn.assert)(o!=null,"unconfigured ENS name","UNCONFIGURED_NAME",{value:i}),o});return this.signingKey.sign(O0.TypedDataEncoder.hash(s.domain,t,s.value)).serialized}};S0.BaseWallet=bg});var xg=P(Mo=>{"use strict";Object.defineProperty(Mo,"__esModule",{value:!0});Mo.decodeOwl=Mo.decode=void 0;var nB=$(),N0=" !#$%&'()*+,-./<=>?@[]^_`{|}~",sB=/^[a-z]*$/i;function b6(r,e){let t=97;return r.reduce((n,s)=>(s===e?t++:s.match(sB)?n.push(String.fromCharCode(t)+s):(t=97,n.push(s)),n),[])}function x6(r,e){for(let s=N0.length-1;s>=0;s--)r=r.split(N0[s]).join(e.substring(2*s,2*s+2));let t=[],n=r.replace(/(:|([0-9])|([A-Z][a-z]*))/g,(s,i,o,a)=>{if(o)for(let c=parseInt(o);c>=0;c--)t.push(";");else t.push(i.toLowerCase());return""});if(n)throw new Error(`leftovers: ${JSON.stringify(n)}`);return b6(b6(t,";"),":")}Mo.decode=x6;function iB(r){return(0,nB.assertArgument)(r[0]==="0","unsupported auwl data","data",r),x6(r.substring(1+2*N0.length),r.substring(1,1+2*N0.length))}Mo.decodeOwl=iB});var yg=P(I0=>{"use strict";Object.defineProperty(I0,"__esModule",{value:!0});I0.Wordlist=void 0;var oB=$(),mg=class{locale;constructor(e){(0,oB.defineProperties)(this,{locale:e})}split(e){return e.toLowerCase().split(/\s+/g)}join(e){return e.join(" ")}};I0.Wordlist=mg});var L0=P(R0=>{"use strict";Object.defineProperty(R0,"__esModule",{value:!0});R0.WordlistOwl=void 0;var aB=bn(),cB=$(),uB=xg(),lB=yg(),wg=class extends lB.Wordlist{#e;#t;constructor(e,t,n){super(e),this.#e=t,this.#t=n,this.#r=null}get _data(){return this.#e}_decodeWords(){return(0,uB.decodeOwl)(this.#e)}#r;#n(){if(this.#r==null){let e=this._decodeWords();if((0,aB.id)(e.join(`
|
|
537
|
+
`)+`
|
|
538
|
+
`)!==this.#t)throw new Error(`BIP39 Wordlist for ${this.locale} FAILED`);this.#r=e}return this.#r}getWord(e){let t=this.#n();return(0,cB.assertArgument)(e>=0&&e<t.length,`invalid word index: ${e}`,"index",e),t[e]}getWordIndex(e){return this.#n().indexOf(e)}};R0.WordlistOwl=wg});var tc=P(M0=>{"use strict";Object.defineProperty(M0,"__esModule",{value:!0});M0.LangEn=void 0;var fB=L0(),dB="0erleonalorenseinceregesticitStanvetearctssi#ch2Athck&tneLl0And#Il.yLeOutO=S|S%b/ra@SurdU'0Ce[Cid|CountCu'Hie=IdOu,-Qui*Ro[TT]T%T*[Tu$0AptDD-tD*[Ju,M.UltV<)Vi)0Rob-0FairF%dRaid0A(EEntRee0Ead0MRRp%tS!_rmBumCoholErtI&LLeyLowMo,O}PhaReadySoT Ways0A>urAz(gOngOuntU'd0Aly,Ch%Ci|G G!GryIm$K!Noun)Nu$O` Sw T&naTiqueXietyY1ArtOlogyPe?P!Pro=Ril1ChCt-EaEnaGueMMedM%MyOundR<+Re,Ri=RowTTefa@Ti,Tw%k0KPe@SaultSetSi,SumeThma0H!>OmTa{T&dT.udeTra@0Ct]D.Gu,NtTh%ToTumn0Era+OcadoOid0AkeA*AyEsomeFulKw?d0Is:ByChel%C#D+GL<)Lc#y~MbooN<aNn RRelyRga(R*lSeS-SketTt!3A^AnAutyCau'ComeEfF%eG(Ha=H(dLie=LowLtN^Nef./TrayTt Twe&Y#d3Cyc!DKeNdOlogyRdR`Tt _{AdeAmeAnketA,EakE[IndOodO[omOu'UeUrUsh_rdAtDyIlMbNeNusOkO,Rd R(gRrowSsTtomUn)XY_{etA(AndA[A=EadEezeI{Id+IefIghtIngIskOccoliOk&OnzeOomO` OwnUsh2Bb!DdyD+tFf$oIldLbLkL!tNd!Nk Rd&Rg R,SS(e[SyTt Y Zz:Bba+B(B!CtusGeKe~LmM aMpNN$N)lNdyNn#NoeNvasNy#Pab!P.$Pta(RRb#RdRgoRpetRryRtSeShS(o/!Su$TT$ogT^Teg%yTt!UghtU'Ut]Ve3Il(gL yM|NsusNturyRe$Rta(_irAlkAmp]An+AosApt Ar+A'AtEapE{Ee'EfErryE,I{&IefIldIm}yOi)Oo'R#-U{!UnkUrn0G?Nnam#Rc!Tiz&TyVil_imApArifyAwAyE<ErkEv I{I|IffImbIn-IpO{OgO'O`OudOwnUbUmpU, Ut^_^A,C#utDeFfeeIlInL!@L%LumnMb(eMeMf%tM-Mm#Mp<yNc tNdu@NfirmNg*[N}@Nsid NtrolNv()OkOlPp PyR$ReRnR*@/Tt#U^UntryUp!Ur'Us(V Yo>_{Ad!AftAmA}AshAt AwlAzyEamEd.EekEwI{etImeIspIt-OpO[Ou^OwdUci$UelUi'Umb!Un^UshYY,$2BeLtu*PPbo?dRiousRr|Rta(R=Sh]/omTe3C!:DMa+MpN)Ng R(gShUght WnY3AlBa>BrisCadeCemb CideCl(eC%a>C*a'ErF&'F(eFyG*eLayLiv M<dMi'Ni$Nti,NyP?tP&dPos.P`PutyRi=ScribeS tSignSkSpair/royTailTe@VelopVi)Vo>3AgramAlAm#dAryCeE'lEtFf G.$Gn.yLemmaNn NosaurRe@RtSag*eScov Sea'ShSmi[S%d Splay/<)V tVideV%)Zzy5Ct%Cum|G~Lph(Ma(Na>NkeyN%OrSeUb!Ve_ftAg#AmaA,-AwEamE[IftIllInkIpI=OpUmY2CkMbNeR(g/T^Ty1Arf1Nam-:G G!RlyRnR`Sily/Sy1HoOlogyOnomy0GeItUca>1F%t0G1GhtTh 2BowD E@r-Eg<tEm|Eph<tEvat%I>Se0B?kBodyBra)Er+Ot]PloyPow Pty0Ab!A@DD![D%'EmyErgyF%)Ga+G(eH<)JoyLi,OughR-hRollSu*T Ti*TryVelope1Isode0U$Uip0AA'OdeOs]R%Upt0CapeSayS&)Ta>0Ern$H-s1Id&)IlOkeOl=1A@Amp!Ce[Ch<+C.eCludeCu'Ecu>Erci'Hau,Hib.I!I,ItOt-P<dPe@Pi*Pla(Po'P*[T&dTra0EEbrow:Br-CeCultyDeIntI`~L'MeMilyMousNNcyNtasyRmSh]TT$Th TigueUltV%.e3Atu*Bru?yD $EEdElMa!N)/iv$T^V W3B Ct]EldGu*LeLmLt N$NdNeNg NishReRmR,Sc$ShTT}[X_gAmeAshAtAv%EeIghtIpOatO{O%Ow UidUshY_mCusGIlLd~owOdOtR)Re,R+tRkRtu}RumRw?dSsil/ UndX_gi!AmeEqu|EshI&dIn+OgOntO,OwnOz&U.2ElNNnyRna)RyTu*:D+tInLaxy~ yMePRa+Rba+Rd&Rl-Rm|SSpTeTh U+Ze3N $NiusN*Nt!Nu(e/u*2O,0AntFtGg!Ng RaffeRlVe_dAn)A*A[IdeImp'ObeOomOryO=OwUe_tDde[LdOdO'RillaSpelSsipV nWn_bA)A(AntApeA[Av.yEatE&IdIefItOc yOupOwUnt_rdE[IdeIltIt?N3M:B.IrLfMm M, NdPpyRb%RdRshR=,TVeWkZ?d3AdAl`ArtAvyD+hogIght~oLmetLpNRo3Dd&Gh~NtPRe/%y5BbyCkeyLdLeLiday~owMeNeyOdPeRnRr%R'Sp.$/TelUrV 5BGeM<Mb!M%Nd*dNgryNtRd!RryRtSb<d3Brid:1EOn0EaEntifyLe2N%e4LLeg$L}[0A+Ita>M&'Mu}Pa@Po'Pro=Pul'0ChCludeComeC*a'DexD-a>Do%Du,ryF<tFl-tF%mHa!H .Iti$Je@JuryMa>N Noc|PutQuiryS<eSe@SideSpi*/$lTa@T e,ToVe,V.eVol=3On0L<dOla>Sue0Em1Ory:CketGu?RZz3AlousAns~yWel9BInKeUr}yY5D+I)MpNg!Ni%Nk/:Ng?oo3EnEpT^upY3CkDD}yNdNgdomSsTT^&TeTt&Wi4EeIfeO{Ow:BBelB%Dd DyKeMpNgua+PtopR+T T(UghUndryVaWWnWsu.Y Zy3Ad AfArnA=Ctu*FtGG$G&dIsu*M#NdNg`NsOp?dSs#Tt Vel3ArB tyBr?yC&'FeFtGhtKeMbM.NkOnQuid/Tt!VeZ?d5AdAnB, C$CkG-NelyNgOpTt yUdUn+VeY$5CkyGga+Mb N?N^Xury3R-s:Ch(eDG-G}tIdIlInJ%KeMm$NNa+Nda>NgoNs]Nu$P!Rb!R^Rg(R(eRketRria+SkSs/ T^T i$ThTrixTt XimumZe3AdowAnAsu*AtCh<-D$DiaLodyLtMb M%yNt]NuRcyR+R.RryShSsa+T$Thod3Dd!DnightLk~]M-NdNimumN%Nu>Rac!Rr%S ySs/akeXXedXtu*5Bi!DelDifyMM|N.%NkeyN, N`OnR$ReRn(gSqu.oTh T]T%Unta(U'VeVie5ChFf(LeLtiplySc!SeumShroomS-/Tu$3Self/ yTh:I=MePk(Rrow/yT]Tu*3ArCkEdGati=G!@I` PhewR=/TTw%kUtr$V WsXt3CeGht5B!I'M(eeOd!Rm$R`SeTab!TeTh(gTi)VelW5C!?Mb R'T:K0EyJe@Li+Scu*S =Ta(Vious0CurE<Tob 0Or1FF Fi)T&2L1Ay0DI=Ymp-0It0CeEI#L(eLy1EnEraIn]Po'T]1An+B.Ch?dD D(?yG<I|Ig($Ph<0Tr-h0H 0Tdo%T TputTside0AlEnEr0NN 0Yg&0/ 0O}:CtDd!GeIrLa)LmNdaNelN-N` P RadeR|RkRrotRtySsT^ThTi|TrolTt nU'VeYm|3A)AnutArAs<tL-<NN$tyNcilOp!Pp Rfe@Rm.Rs#T2O}OtoRa'Ys-$0AnoCn-Ctu*E)GGe#~LotNkO} Pe/olT^Zza_)A}tA,-A>AyEa'Ed+U{UgUn+2EmEtIntL?LeLi)NdNyOlPul?Rt]S.]Ssib!/TatoTt yV tyWd W _@i)Ai'Ed-tEf Epa*Es|EttyEv|I)IdeIm?yIntI%.yIs#Iva>IzeOb!mO)[Odu)Of.OgramOje@Omo>OofOp tyOsp O>@OudOvide2Bl-Dd(g~LpL'Mpk(N^PilPpyR^a'R.yRpo'R'ShTZz!3Ramid:99Al.yAntumArt E,]I{ItIzO>:Bb.Cco#CeCkD?DioIlInI'~yMpN^NdomN+PidReTeTh V&WZ%3AdyAlAs#BelBuildC$lCei=CipeC%dCyc!Du)F!@F%mFu'G]G*tGul?Je@LaxLea'LiefLyMa(Memb M(dMo=Nd NewNtOp&PairPeatPla)P%tQui*ScueSemb!Si,Sour)Sp#'SultTi*T*atTurnUn]Ve$ViewW?d2Y`m0BBb#CeChDeD+F!GhtGidNgOtPp!SkTu$V$V 5AdA,BotBu,CketM<)OfOkieOmSeTa>UghUndU>Y$5Bb DeGLeNNwayR$:DDd!D}[FeIlLadLm#L#LtLu>MeMp!NdTisfyToshiU)Usa+VeY1A!AnA*Att E}HemeHoolI&)I[%sOrp]OutRapRe&RiptRub1AAr^As#AtC#dC*tCt]Cur.yEdEkGm|Le@~M(?Ni%N'Nt&)RiesRvi)Ss]Tt!TupV&_dowAftAllowA*EdEllEriffIeldIftI}IpIv O{OeOotOpOrtOuld O=RimpRugUff!Y0Bl(gCkDeE+GhtGnL|Lk~yLv Mil?Mp!N)NgR&/ Tua>XZe1A>Et^IIllInIrtUll0AbAmEepEnd I)IdeIghtImOg<OtOwUsh0AllArtI!OkeOo`0A{AkeApIffOw0ApCc Ci$CkDaFtL?Ldi LidLut]L=Me#eNgOnRryRtUlUndUpUr)U`0A)A*Ati$AwnEakEci$EedEllEndH eI)Id IkeInIr.L.OilOns%O#OrtOtRayReadR(gY0Ua*UeezeUir*l_b!AdiumAffA+AirsAmpAndArtA>AyEakEelEmEpE*oI{IllIngO{Oma^O}OolOryO=Ra>gyReetRikeR#gRugg!Ud|UffUmb!Y!0Bje@Bm.BwayC)[ChDd&Ff G?G+,ItMm NNnyN'tP PplyP*meReRfa)R+Rpri'RroundR=ySpe@/a(1AllowAmpApArmE?EetIftImIngIt^Ord1MbolMptomRup/em:B!Ck!GIlL|LkNkPeR+tSk/eTtooXi3A^Am~NN<tNnisNtRm/Xt_nkAtEmeEnE%yE*EyIngIsOughtReeRi=RowUmbUnd 0CketDeG LtMb MeNyPRedSsueT!5A,BaccoDayDdl EGe` I!tK&MatoM%rowNeNgueNightOlO`PP-Pp!R^RnadoRtoi'SsT$Uri,W?dW WnY_{AdeAff-Ag-A(Ansf ApAshA=lAyEatEeEndI$IbeI{Igg ImIpOphyOub!U{UeUlyUmpetU,U`Y2BeIt]Mb!NaN}lRkeyRnRt!1El=EntyI)InI,O1PeP-$:5Ly5B*lla0Ab!Awa*C!Cov D DoFairFoldHappyIf%mIqueItIv 'KnownLo{TilUsu$Veil1Da>GradeHoldOnP Set1B<Ge0A+EEdEfulE![U$0Il.y:C<tCuumGueLidL!yL=NNishP%Rious/Ult3H-!L=tNd%Ntu*NueRbRifyRs]RyS'lT <3Ab!Br<tCiousCt%yDeoEw~a+Nta+Ol(Rtu$RusSaS.Su$T$Vid5C$I)IdLc<oLumeTeYa+:GeG#ItLk~LnutNtRfa*RmRri%ShSp/eT VeY3Al`Ap#ArA'lA` BDd(gEk&dIrdLcome/T_!AtEatEelEnE*IpIsp 0DeD`FeLd~NNdowNeNgNkNn Nt ReSdomSeShT}[5LfM<Nd OdOlRdRkRldRryR`_pE{E,!I,I>Ong::Rd3Ar~ow9UUngU`:3BraRo9NeO",hB="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60",Ag=null,Eg=class r extends fB.WordlistOwl{constructor(){super("en",dB,hB)}static wordlist(){return Ag==null&&(Ag=new r),Ag}};M0.LangEn=Eg});var U0=P(j0=>{"use strict";Object.defineProperty(j0,"__esModule",{value:!0});j0.Mnemonic=void 0;var Tg=xt(),Jt=$(),Bg=tc();function m6(r){return(1<<r)-1<<8-r&255}function pB(r){return(1<<r)-1&255}function Pg(r,e){(0,Jt.assertNormalize)("NFKD"),e==null&&(e=Bg.LangEn.wordlist());let t=e.split(r);(0,Jt.assertArgument)(t.length%3===0&&t.length>=12&&t.length<=24,"invalid mnemonic length","mnemonic","[ REDACTED ]");let n=new Uint8Array(Math.ceil(11*t.length/8)),s=0;for(let u=0;u<t.length;u++){let l=e.getWordIndex(t[u].normalize("NFKD"));(0,Jt.assertArgument)(l>=0,`invalid mnemonic word at index ${u}`,"mnemonic","[ REDACTED ]");for(let f=0;f<11;f++)l&1<<10-f&&(n[s>>3]|=1<<7-s%8),s++}let i=32*t.length/3,o=t.length/3,a=m6(o),c=(0,Jt.getBytes)((0,Tg.sha256)(n.slice(0,i/8)))[0]&a;return(0,Jt.assertArgument)(c===(n[n.length-1]&a),"invalid mnemonic checksum","mnemonic","[ REDACTED ]"),(0,Jt.hexlify)(n.slice(0,i/8))}function vg(r,e){(0,Jt.assertArgument)(r.length%4===0&&r.length>=16&&r.length<=32,"invalid entropy size","entropy","[ REDACTED ]"),e==null&&(e=Bg.LangEn.wordlist());let t=[0],n=11;for(let o=0;o<r.length;o++)n>8?(t[t.length-1]<<=8,t[t.length-1]|=r[o],n-=8):(t[t.length-1]<<=n,t[t.length-1]|=r[o]>>8-n,t.push(r[o]&pB(8-n)),n+=3);let s=r.length/4,i=parseInt((0,Tg.sha256)(r).substring(2,4),16)&m6(s);return t[t.length-1]<<=s,t[t.length-1]|=i>>8-s,e.join(t.map(o=>e.getWord(o)))}var _g={},kg=class r{phrase;password;wordlist;entropy;constructor(e,t,n,s,i){s==null&&(s=""),i==null&&(i=Bg.LangEn.wordlist()),(0,Jt.assertPrivate)(e,_g,"Mnemonic"),(0,Jt.defineProperties)(this,{phrase:n,password:s,wordlist:i,entropy:t})}computeSeed(){let e=(0,Jt.toUtf8Bytes)("mnemonic"+this.password,"NFKD");return(0,Tg.pbkdf2)((0,Jt.toUtf8Bytes)(this.phrase,"NFKD"),e,2048,64,"sha512")}static fromPhrase(e,t,n){let s=Pg(e,n);return e=vg((0,Jt.getBytes)(s),n),new r(_g,s,e,t,n)}static fromEntropy(e,t,n){let s=(0,Jt.getBytes)(e,"entropy"),i=vg(s,n);return new r(_g,(0,Jt.hexlify)(s),i,t,n)}static entropyToPhrase(e,t){let n=(0,Jt.getBytes)(e,"entropy");return vg(n,t)}static phraseToEntropy(e,t){return Pg(e,t)}static isValidMnemonic(e,t){try{return Pg(e,t),!0}catch{}return!1}};j0.Mnemonic=kg});var Ng=P(ms=>{"use strict";var Rt=ms&&ms.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},Og=ms&&ms.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},D0,Ir,wn;Object.defineProperty(ms,"__esModule",{value:!0});ms.AES=void 0;var gB={16:10,24:12,32:14},bB=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],Nr=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],F0=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],xB=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],mB=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],yB=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],wB=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],AB=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],EB=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],PB=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],vB=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],_B=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],kB=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],TB=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],BB=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function Sg(r){let e=[];for(let t=0;t<r.length;t+=4)e.push(r[t]<<24|r[t+1]<<16|r[t+2]<<8|r[t+3]);return e}var Cg=class r{get key(){return Rt(this,D0,"f").slice()}constructor(e){if(D0.set(this,void 0),Ir.set(this,void 0),wn.set(this,void 0),!(this instanceof r))throw Error("AES must be instanitated with `new`");Og(this,D0,new Uint8Array(e),"f");let t=gB[this.key.length];if(t==null)throw new TypeError("invalid key size (must be 16, 24 or 32 bytes)");Og(this,wn,[],"f"),Og(this,Ir,[],"f");for(let l=0;l<=t;l++)Rt(this,wn,"f").push([0,0,0,0]),Rt(this,Ir,"f").push([0,0,0,0]);let n=(t+1)*4,s=this.key.length/4,i=Sg(this.key),o;for(let l=0;l<s;l++)o=l>>2,Rt(this,wn,"f")[o][l%4]=i[l],Rt(this,Ir,"f")[t-o][l%4]=i[l];let a=0,c=s,u;for(;c<n;){if(u=i[s-1],i[0]^=Nr[u>>16&255]<<24^Nr[u>>8&255]<<16^Nr[u&255]<<8^Nr[u>>24&255]^bB[a]<<24,a+=1,s!=8)for(let g=1;g<s;g++)i[g]^=i[g-1];else{for(let g=1;g<s/2;g++)i[g]^=i[g-1];u=i[s/2-1],i[s/2]^=Nr[u&255]^Nr[u>>8&255]<<8^Nr[u>>16&255]<<16^Nr[u>>24&255]<<24;for(let g=s/2+1;g<s;g++)i[g]^=i[g-1]}let l=0,f,h;for(;l<s&&c<n;)f=c>>2,h=c%4,Rt(this,wn,"f")[f][h]=i[l],Rt(this,Ir,"f")[t-f][h]=i[l++],c++}for(let l=1;l<t;l++)for(let f=0;f<4;f++)u=Rt(this,Ir,"f")[l][f],Rt(this,Ir,"f")[l][f]=_B[u>>24&255]^kB[u>>16&255]^TB[u>>8&255]^BB[u&255]}encrypt(e){if(e.length!=16)throw new TypeError("invalid plaintext size (must be 16 bytes)");let t=Rt(this,wn,"f").length-1,n=[0,0,0,0],s=Sg(e);for(let a=0;a<4;a++)s[a]^=Rt(this,wn,"f")[0][a];for(let a=1;a<t;a++){for(let c=0;c<4;c++)n[c]=xB[s[c]>>24&255]^mB[s[(c+1)%4]>>16&255]^yB[s[(c+2)%4]>>8&255]^wB[s[(c+3)%4]&255]^Rt(this,wn,"f")[a][c];s=n.slice()}let i=new Uint8Array(16),o=0;for(let a=0;a<4;a++)o=Rt(this,wn,"f")[t][a],i[4*a]=(Nr[s[a]>>24&255]^o>>24)&255,i[4*a+1]=(Nr[s[(a+1)%4]>>16&255]^o>>16)&255,i[4*a+2]=(Nr[s[(a+2)%4]>>8&255]^o>>8)&255,i[4*a+3]=(Nr[s[(a+3)%4]&255]^o)&255;return i}decrypt(e){if(e.length!=16)throw new TypeError("invalid ciphertext size (must be 16 bytes)");let t=Rt(this,Ir,"f").length-1,n=[0,0,0,0],s=Sg(e);for(let a=0;a<4;a++)s[a]^=Rt(this,Ir,"f")[0][a];for(let a=1;a<t;a++){for(let c=0;c<4;c++)n[c]=AB[s[c]>>24&255]^EB[s[(c+3)%4]>>16&255]^PB[s[(c+2)%4]>>8&255]^vB[s[(c+1)%4]&255]^Rt(this,Ir,"f")[a][c];s=n.slice()}let i=new Uint8Array(16),o=0;for(let a=0;a<4;a++)o=Rt(this,Ir,"f")[t][a],i[4*a]=(F0[s[a]>>24&255]^o>>24)&255,i[4*a+1]=(F0[s[(a+3)%4]>>16&255]^o>>16)&255,i[4*a+2]=(F0[s[(a+2)%4]>>8&255]^o>>8)&255,i[4*a+3]=(F0[s[(a+1)%4]&255]^o)&255;return i}};ms.AES=Cg;D0=new WeakMap,Ir=new WeakMap,wn=new WeakMap});var Ws=P(H0=>{"use strict";Object.defineProperty(H0,"__esModule",{value:!0});H0.ModeOfOperation=void 0;var OB=Ng(),Ig=class{constructor(e,t,n){if(n&&!(this instanceof n))throw new Error(`${e} must be instantiated with "new"`);Object.defineProperties(this,{aes:{enumerable:!0,value:new OB.AES(t)},name:{enumerable:!0,value:e}})}};H0.ModeOfOperation=Ig});var y6=P(ys=>{"use strict";var q0=ys&&ys.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},jo=ys&&ys.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},rc,jn;Object.defineProperty(ys,"__esModule",{value:!0});ys.CBC=void 0;var SB=Ws(),Rg=class r extends SB.ModeOfOperation{constructor(e,t){if(super("ECC",e,r),rc.set(this,void 0),jn.set(this,void 0),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");q0(this,rc,new Uint8Array(t),"f")}else q0(this,rc,new Uint8Array(16),"f");q0(this,jn,this.iv,"f")}get iv(){return new Uint8Array(jo(this,rc,"f"))}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){for(let s=0;s<16;s++)jo(this,jn,"f")[s]^=e[n+s];q0(this,jn,this.aes.encrypt(jo(this,jn,"f")),"f"),t.set(jo(this,jn,"f"),n)}return t}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16){let s=this.aes.decrypt(e.subarray(n,n+16));for(let i=0;i<16;i++)t[n+i]=s[i]^jo(this,jn,"f")[i],jo(this,jn,"f")[i]=e[n+i]}return t}};ys.CBC=Rg;rc=new WeakMap,jn=new WeakMap});var w6=P(Es=>{"use strict";var Lg=Es&&Es.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},ws=Es&&Es.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},G0,nc,As,Mg;Object.defineProperty(Es,"__esModule",{value:!0});Es.CFB=void 0;var CB=Ws(),jg=class r extends CB.ModeOfOperation{constructor(e,t,n=8){if(super("CFB",e,r),G0.add(this),nc.set(this,void 0),As.set(this,void 0),!Number.isInteger(n)||n%8)throw new TypeError("invalid segmentSize");if(Object.defineProperties(this,{segmentSize:{enumerable:!0,value:n}}),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");Lg(this,nc,new Uint8Array(t),"f")}else Lg(this,nc,new Uint8Array(16),"f");Lg(this,As,this.iv,"f")}get iv(){return new Uint8Array(ws(this,nc,"f"))}encrypt(e){if(8*e.length%this.segmentSize)throw new TypeError("invalid plaintext size (must be multiple of segmentSize bytes)");let t=this.segmentSize/8,n=new Uint8Array(e);for(let s=0;s<n.length;s+=t){let i=this.aes.encrypt(ws(this,As,"f"));for(let o=0;o<t;o++)n[s+o]^=i[o];ws(this,G0,"m",Mg).call(this,n.subarray(s))}return n}decrypt(e){if(8*e.length%this.segmentSize)throw new TypeError("invalid ciphertext size (must be multiple of segmentSize bytes)");let t=this.segmentSize/8,n=new Uint8Array(e);for(let s=0;s<n.length;s+=t){let i=this.aes.encrypt(ws(this,As,"f"));for(let o=0;o<t;o++)n[s+o]^=i[o];ws(this,G0,"m",Mg).call(this,e.subarray(s))}return n}};Es.CFB=jg;nc=new WeakMap,As=new WeakMap,G0=new WeakSet,Mg=function(e){let t=this.segmentSize/8;ws(this,As,"f").set(ws(this,As,"f").subarray(t)),ws(this,As,"f").set(e.subarray(0,t),16-t)}});var A6=P(Ps=>{"use strict";var Uo=Ps&&Ps.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},Rr=Ps&&Ps.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},sc,Ys,Lr;Object.defineProperty(Ps,"__esModule",{value:!0});Ps.CTR=void 0;var NB=Ws(),Ug=class r extends NB.ModeOfOperation{constructor(e,t){super("CTR",e,r),sc.set(this,void 0),Ys.set(this,void 0),Lr.set(this,void 0),Uo(this,Lr,new Uint8Array(16),"f"),Rr(this,Lr,"f").fill(0),Uo(this,sc,Rr(this,Lr,"f"),"f"),Uo(this,Ys,16,"f"),t==null&&(t=1),typeof t=="number"?this.setCounterValue(t):this.setCounterBytes(t)}get counter(){return new Uint8Array(Rr(this,Lr,"f"))}setCounterValue(e){if(!Number.isInteger(e)||e<0||e>Number.MAX_SAFE_INTEGER)throw new TypeError("invalid counter initial integer value");for(let t=15;t>=0;--t)Rr(this,Lr,"f")[t]=e%256,e=Math.floor(e/256)}setCounterBytes(e){if(e.length!==16)throw new TypeError("invalid counter initial Uint8Array value length");Rr(this,Lr,"f").set(e)}increment(){for(let e=15;e>=0;e--)if(Rr(this,Lr,"f")[e]===255)Rr(this,Lr,"f")[e]=0;else{Rr(this,Lr,"f")[e]++;break}}encrypt(e){var t,n;let s=new Uint8Array(e);for(let i=0;i<s.length;i++)Rr(this,Ys,"f")===16&&(Uo(this,sc,this.aes.encrypt(Rr(this,Lr,"f")),"f"),Uo(this,Ys,0,"f"),this.increment()),s[i]^=Rr(this,sc,"f")[Uo(this,Ys,(n=Rr(this,Ys,"f"),t=n++,n),"f"),t];return s}decrypt(e){return this.encrypt(e)}};Ps.CTR=Ug;sc=new WeakMap,Ys=new WeakMap,Lr=new WeakMap});var E6=P(z0=>{"use strict";Object.defineProperty(z0,"__esModule",{value:!0});z0.ECB=void 0;var IB=Ws(),Fg=class r extends IB.ModeOfOperation{constructor(e){super("ECB",e,r)}encrypt(e){if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16)t.set(this.aes.encrypt(e.subarray(n,n+16)),n);return t}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");let t=new Uint8Array(e.length);for(let n=0;n<e.length;n+=16)t.set(this.aes.decrypt(e.subarray(n,n+16)),n);return t}};z0.ECB=Fg});var P6=P(vs=>{"use strict";var Zs=vs&&vs.__classPrivateFieldSet||function(r,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!s:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(r,t):s?s.value=t:e.set(r,t),t},ic=vs&&vs.__classPrivateFieldGet||function(r,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(r):n?n.value:e.get(r)},oc,Fo,Xs;Object.defineProperty(vs,"__esModule",{value:!0});vs.OFB=void 0;var RB=Ws(),Dg=class r extends RB.ModeOfOperation{constructor(e,t){if(super("OFB",e,r),oc.set(this,void 0),Fo.set(this,void 0),Xs.set(this,void 0),t){if(t.length%16)throw new TypeError("invalid iv size (must be 16 bytes)");Zs(this,oc,new Uint8Array(t),"f")}else Zs(this,oc,new Uint8Array(16),"f");Zs(this,Fo,this.iv,"f"),Zs(this,Xs,16,"f")}get iv(){return new Uint8Array(ic(this,oc,"f"))}encrypt(e){var t,n;if(e.length%16)throw new TypeError("invalid plaintext size (must be multiple of 16 bytes)");let s=new Uint8Array(e);for(let i=0;i<s.length;i++)ic(this,Xs,"f")===16&&(Zs(this,Fo,this.aes.encrypt(ic(this,Fo,"f")),"f"),Zs(this,Xs,0,"f")),s[i]^=ic(this,Fo,"f")[Zs(this,Xs,(n=ic(this,Xs,"f"),t=n++,n),"f"),t];return s}decrypt(e){if(e.length%16)throw new TypeError("invalid ciphertext size (must be multiple of 16 bytes)");return this.encrypt(e)}};vs.OFB=Dg;oc=new WeakMap,Fo=new WeakMap,Xs=new WeakMap});var v6=P(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});Do.pkcs7Strip=Do.pkcs7Pad=void 0;function LB(r){let e=16-r.length%16,t=new Uint8Array(r.length+e);t.set(r);for(let n=r.length;n<t.length;n++)t[n]=e;return t}Do.pkcs7Pad=LB;function MB(r){if(r.length<16)throw new TypeError("PKCS#7 invalid length");let e=r[r.length-1];if(e>16)throw new TypeError("PKCS#7 padding byte out of range");let t=r.length-e;for(let n=0;n<e;n++)if(r[t+n]!==e)throw new TypeError("PKCS#7 invalid padding byte");return new Uint8Array(r.subarray(0,t))}Do.pkcs7Strip=MB});var Hg=P(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.pkcs7Strip=At.pkcs7Pad=At.OFB=At.ECB=At.CTR=At.CFB=At.CBC=At.ModeOfOperation=At.AES=void 0;var jB=Ng();Object.defineProperty(At,"AES",{enumerable:!0,get:function(){return jB.AES}});var UB=Ws();Object.defineProperty(At,"ModeOfOperation",{enumerable:!0,get:function(){return UB.ModeOfOperation}});var FB=y6();Object.defineProperty(At,"CBC",{enumerable:!0,get:function(){return FB.CBC}});var DB=w6();Object.defineProperty(At,"CFB",{enumerable:!0,get:function(){return DB.CFB}});var HB=A6();Object.defineProperty(At,"CTR",{enumerable:!0,get:function(){return HB.CTR}});var qB=E6();Object.defineProperty(At,"ECB",{enumerable:!0,get:function(){return qB.ECB}});var GB=P6();Object.defineProperty(At,"OFB",{enumerable:!0,get:function(){return GB.OFB}});var _6=v6();Object.defineProperty(At,"pkcs7Pad",{enumerable:!0,get:function(){return _6.pkcs7Pad}});Object.defineProperty(At,"pkcs7Strip",{enumerable:!0,get:function(){return _6.pkcs7Strip}})});var qg=P(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.spelunk=An.getPassword=An.zpad=An.looseArrayify=void 0;var Ho=$();function k6(r){return typeof r=="string"&&!r.startsWith("0x")&&(r="0x"+r),(0,Ho.getBytesCopy)(r)}An.looseArrayify=k6;function zB(r,e){for(r=String(r);r.length<e;)r="0"+r;return r}An.zpad=zB;function KB(r){return typeof r=="string"?(0,Ho.toUtf8Bytes)(r,"NFKC"):(0,Ho.getBytesCopy)(r)}An.getPassword=KB;function VB(r,e){let t=e.match(/^([a-z0-9$_.-]*)(:([a-z]+))?(!)?$/i);(0,Ho.assertArgument)(t!=null,"invalid path","path",e);let n=t[1],s=t[3],i=t[4]==="!",o=r;for(let a of n.toLowerCase().split(".")){if(Array.isArray(o)){if(!a.match(/^[0-9]+$/))break;o=o[parseInt(a)]}else if(typeof o=="object"){let c=null;for(let u in o)if(u.toLowerCase()===a){c=o[u];break}o=c}else o=null;if(o==null)break}if((0,Ho.assertArgument)(!i||o!=null,"missing required value","path",n),s&&o!=null){if(s==="int"){if(typeof o=="string"&&o.match(/^-?[0-9]+$/))return parseInt(o);if(Number.isSafeInteger(o))return o}if(s==="number"&&typeof o=="string"&&o.match(/^-?[0-9.]*$/))return parseFloat(o);if(s==="data"&&typeof o=="string")return k6(o);if(s==="array"&&Array.isArray(o)||s===typeof o)return o;(0,Ho.assertArgument)(!1,`wrong type found for ${s} `,"path",n)}return o}An.spelunk=VB});var $0=P(Mr=>{"use strict";Object.defineProperty(Mr,"__esModule",{value:!0});Mr.encryptKeystoreJson=Mr.encryptKeystoreJsonSync=Mr.decryptKeystoreJson=Mr.decryptKeystoreJsonSync=Mr.isKeystoreJson=void 0;var K0=Hg(),$B=ht(),jr=xt(),JB=Gt(),Ee=$(),Ge=qg(),QB=Ic(),B6="m/44'/60'/0'/0/0";function WB(r){try{let e=JSON.parse(r);if((e.version!=null?parseInt(e.version):0)===3)return!0}catch{}return!1}Mr.isKeystoreJson=WB;function YB(r,e,t){if((0,Ge.spelunk)(r,"crypto.cipher:string")==="aes-128-ctr"){let s=(0,Ge.spelunk)(r,"crypto.cipherparams.iv:data!"),i=new K0.CTR(e,s);return(0,Ee.hexlify)(i.decrypt(t))}(0,Ee.assert)(!1,"unsupported cipher","UNSUPPORTED_OPERATION",{operation:"decrypt"})}function V0(r,e){let t=(0,Ee.getBytes)(e),n=(0,Ge.spelunk)(r,"crypto.ciphertext:data!"),s=(0,Ee.hexlify)((0,jr.keccak256)((0,Ee.concat)([t.slice(16,32),n]))).substring(2);(0,Ee.assertArgument)(s===(0,Ge.spelunk)(r,"crypto.mac:string!").toLowerCase(),"incorrect password","password","[ REDACTED ]");let i=YB(r,t.slice(0,16),n),o=(0,JB.computeAddress)(i);if(r.address){let u=r.address.toLowerCase();u.startsWith("0x")||(u="0x"+u),(0,Ee.assertArgument)((0,$B.getAddress)(u)===o,"keystore address/privateKey mismatch","address",r.address)}let a={address:o,privateKey:i};if((0,Ge.spelunk)(r,"x-ethers.version:string")==="0.1"){let u=t.slice(32,64),l=(0,Ge.spelunk)(r,"x-ethers.mnemonicCiphertext:data!"),f=(0,Ge.spelunk)(r,"x-ethers.mnemonicCounter:data!"),h=new K0.CTR(u,f);a.mnemonic={path:(0,Ge.spelunk)(r,"x-ethers.path:string")||B6,locale:(0,Ge.spelunk)(r,"x-ethers.locale:string")||"en",entropy:(0,Ee.hexlify)((0,Ee.getBytes)(h.decrypt(l)))}}return a}function O6(r){let e=(0,Ge.spelunk)(r,"crypto.kdf:string");if(e&&typeof e=="string"){if(e.toLowerCase()==="scrypt"){let t=(0,Ge.spelunk)(r,"crypto.kdfparams.salt:data!"),n=(0,Ge.spelunk)(r,"crypto.kdfparams.n:int!"),s=(0,Ge.spelunk)(r,"crypto.kdfparams.r:int!"),i=(0,Ge.spelunk)(r,"crypto.kdfparams.p:int!");(0,Ee.assertArgument)(n>0&&(n&n-1)===0,"invalid kdf.N","kdf.N",n),(0,Ee.assertArgument)(s>0&&i>0,"invalid kdf","kdf",e);let o=(0,Ge.spelunk)(r,"crypto.kdfparams.dklen:int!");return(0,Ee.assertArgument)(o===32,"invalid kdf.dklen","kdf.dflen",o),{name:"scrypt",salt:t,N:n,r:s,p:i,dkLen:64}}else if(e.toLowerCase()==="pbkdf2"){let t=(0,Ge.spelunk)(r,"crypto.kdfparams.salt:data!"),n=(0,Ge.spelunk)(r,"crypto.kdfparams.prf:string!"),s=n.split("-").pop();(0,Ee.assertArgument)(s==="sha256"||s==="sha512","invalid kdf.pdf","kdf.pdf",n);let i=(0,Ge.spelunk)(r,"crypto.kdfparams.c:int!"),o=(0,Ge.spelunk)(r,"crypto.kdfparams.dklen:int!");return(0,Ee.assertArgument)(o===32,"invalid kdf.dklen","kdf.dklen",o),{name:"pbkdf2",salt:t,count:i,dkLen:o,algorithm:s}}}(0,Ee.assertArgument)(!1,"unsupported key-derivation function","kdf",e)}function ZB(r,e){let t=JSON.parse(r),n=(0,Ge.getPassword)(e),s=O6(t);if(s.name==="pbkdf2"){let{salt:f,count:h,dkLen:g,algorithm:x}=s,b=(0,jr.pbkdf2)(n,f,h,g,x);return V0(t,b)}(0,Ee.assert)(s.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:s});let{salt:i,N:o,r:a,p:c,dkLen:u}=s,l=(0,jr.scryptSync)(n,i,o,a,c,u);return V0(t,l)}Mr.decryptKeystoreJsonSync=ZB;function T6(r){return new Promise(e=>{setTimeout(()=>{e()},r)})}async function XB(r,e,t){let n=JSON.parse(r),s=(0,Ge.getPassword)(e),i=O6(n);if(i.name==="pbkdf2"){t&&(t(0),await T6(0));let{salt:h,count:g,dkLen:x,algorithm:b}=i,y=(0,jr.pbkdf2)(s,h,g,x,b);return t&&(t(1),await T6(0)),V0(n,y)}(0,Ee.assert)(i.name==="scrypt","cannot be reached","UNKNOWN_ERROR",{params:i});let{salt:o,N:a,r:c,p:u,dkLen:l}=i,f=await(0,jr.scrypt)(s,o,a,c,u,l,t);return V0(n,f)}Mr.decryptKeystoreJson=XB;function S6(r){let e=r.salt!=null?(0,Ee.getBytes)(r.salt,"options.salt"):(0,jr.randomBytes)(32),t=1<<17,n=8,s=1;return r.scrypt&&(r.scrypt.N&&(t=r.scrypt.N),r.scrypt.r&&(n=r.scrypt.r),r.scrypt.p&&(s=r.scrypt.p)),(0,Ee.assertArgument)(typeof t=="number"&&t>0&&Number.isSafeInteger(t)&&(BigInt(t)&BigInt(t-1))===BigInt(0),"invalid scrypt N parameter","options.N",t),(0,Ee.assertArgument)(typeof n=="number"&&n>0&&Number.isSafeInteger(n),"invalid scrypt r parameter","options.r",n),(0,Ee.assertArgument)(typeof s=="number"&&s>0&&Number.isSafeInteger(s),"invalid scrypt p parameter","options.p",s),{name:"scrypt",dkLen:32,salt:e,N:t,r:n,p:s}}function C6(r,e,t,n){let s=(0,Ee.getBytes)(t.privateKey,"privateKey"),i=n.iv!=null?(0,Ee.getBytes)(n.iv,"options.iv"):(0,jr.randomBytes)(16);(0,Ee.assertArgument)(i.length===16,"invalid options.iv length","options.iv",n.iv);let o=n.uuid!=null?(0,Ee.getBytes)(n.uuid,"options.uuid"):(0,jr.randomBytes)(16);(0,Ee.assertArgument)(o.length===16,"invalid options.uuid length","options.uuid",n.iv);let a=r.slice(0,16),c=r.slice(16,32),u=new K0.CTR(a,i),l=(0,Ee.getBytes)(u.encrypt(s)),f=(0,jr.keccak256)((0,Ee.concat)([c,l])),h={address:t.address.substring(2).toLowerCase(),id:(0,Ee.uuidV4)(o),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,Ee.hexlify)(i).substring(2)},ciphertext:(0,Ee.hexlify)(l).substring(2),kdf:"scrypt",kdfparams:{salt:(0,Ee.hexlify)(e.salt).substring(2),n:e.N,dklen:32,p:e.p,r:e.r},mac:f.substring(2)}};if(t.mnemonic){let g=n.client!=null?n.client:`ethers/${QB.version}`,x=t.mnemonic.path||B6,b=t.mnemonic.locale||"en",y=r.slice(32,64),m=(0,Ee.getBytes)(t.mnemonic.entropy,"account.mnemonic.entropy"),E=(0,jr.randomBytes)(16),_=new K0.CTR(y,E),C=(0,Ee.getBytes)(_.encrypt(m)),L=new Date,O="UTC--"+(L.getUTCFullYear()+"-"+(0,Ge.zpad)(L.getUTCMonth()+1,2)+"-"+(0,Ge.zpad)(L.getUTCDate(),2)+"T"+(0,Ge.zpad)(L.getUTCHours(),2)+"-"+(0,Ge.zpad)(L.getUTCMinutes(),2)+"-"+(0,Ge.zpad)(L.getUTCSeconds(),2)+".0Z")+"--"+h.address;h["x-ethers"]={client:g,gethFilename:O,path:x,locale:b,mnemonicCounter:(0,Ee.hexlify)(E).substring(2),mnemonicCiphertext:(0,Ee.hexlify)(C).substring(2),version:"0.1"}}return JSON.stringify(h)}function eO(r,e,t){t==null&&(t={});let n=(0,Ge.getPassword)(e),s=S6(t),i=(0,jr.scryptSync)(n,s.salt,s.N,s.r,s.p,64);return C6((0,Ee.getBytes)(i),s,r,t)}Mr.encryptKeystoreJsonSync=eO;async function tO(r,e,t){t==null&&(t={});let n=(0,Ge.getPassword)(e),s=S6(t),i=await(0,jr.scrypt)(n,s.salt,s.N,s.r,s.p,64,t.progressCallback);return C6((0,Ee.getBytes)(i),s,r,t)}Mr.encryptKeystoreJson=tO});var Kg=P(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.getIndexedAccountPath=Qt.getAccountPath=Qt.HDNodeVoidWallet=Qt.HDNodeWallet=Qt.defaultPath=void 0;var gr=xt(),rO=B0(),L6=Gt(),ee=$(),N6=tc(),nO=C0(),I6=U0(),R6=$0();Qt.defaultPath="m/44'/60'/0'/0/0";var sO=new Uint8Array([66,105,116,99,111,105,110,32,115,101,101,100]),Pn=2147483648,iO=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),oO="0123456789abcdef";function J0(r,e){let t="";for(;r;)t=oO[r%16]+t,r=Math.trunc(r/16);for(;t.length<e*2;)t="0"+t;return"0x"+t}function Gg(r){let e=(0,ee.getBytes)(r),t=(0,ee.dataSlice)((0,gr.sha256)((0,gr.sha256)(e)),0,4),n=(0,ee.concat)([e,t]);return(0,ee.encodeBase58)(n)}var En={};function M6(r,e,t,n){let s=new Uint8Array(37);r&Pn?((0,ee.assert)(n!=null,"cannot derive child of neutered node","UNSUPPORTED_OPERATION",{operation:"deriveChild"}),s.set((0,ee.getBytes)(n),1)):s.set((0,ee.getBytes)(t));for(let o=24;o>=0;o-=8)s[33+(o>>3)]=r>>24-o&255;let i=(0,ee.getBytes)((0,gr.computeHmac)("sha512",e,s));return{IL:i.slice(0,32),IR:i.slice(32)}}function j6(r,e){let t=e.split("/");(0,ee.assertArgument)(t.length>0,"invalid path","path",e),t[0]==="m"&&((0,ee.assertArgument)(r.depth===0,`cannot derive root path (i.e. path starting with "m/") for a node at non-zero depth ${r.depth}`,"path",e),t.shift());let n=r;for(let s=0;s<t.length;s++){let i=t[s];if(i.match(/^[0-9]+'$/)){let o=parseInt(i.substring(0,i.length-1));(0,ee.assertArgument)(o<Pn,"invalid path index",`path[${s}]`,i),n=n.deriveChild(Pn+o)}else if(i.match(/^[0-9]+$/)){let o=parseInt(i);(0,ee.assertArgument)(o<Pn,"invalid path index",`path[${s}]`,i),n=n.deriveChild(o)}else(0,ee.assertArgument)(!1,"invalid path component",`path[${s}]`,i)}return n}var zg=class r extends nO.BaseWallet{publicKey;fingerprint;parentFingerprint;mnemonic;chainCode;path;index;depth;constructor(e,t,n,s,i,o,a,c,u){super(t,u),(0,ee.assertPrivate)(e,En,"HDNodeWallet"),(0,ee.defineProperties)(this,{publicKey:t.compressedPublicKey});let l=(0,ee.dataSlice)((0,gr.ripemd160)((0,gr.sha256)(this.publicKey)),0,4);(0,ee.defineProperties)(this,{parentFingerprint:n,fingerprint:l,chainCode:s,path:i,index:o,depth:a}),(0,ee.defineProperties)(this,{mnemonic:c})}connect(e){return new r(En,this.signingKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.mnemonic,e)}#e(){let e={address:this.address,privateKey:this.privateKey},t=this.mnemonic;return this.path&&t&&t.wordlist.locale==="en"&&t.password===""&&(e.mnemonic={path:this.path,locale:"en",entropy:t.entropy}),e}async encrypt(e,t){return await(0,R6.encryptKeystoreJson)(this.#e(),e,{progressCallback:t})}encryptSync(e){return(0,R6.encryptKeystoreJsonSync)(this.#e(),e)}get extendedKey(){return(0,ee.assert)(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),Gg((0,ee.concat)(["0x0488ADE4",J0(this.depth,1),this.parentFingerprint,J0(this.index,4),this.chainCode,(0,ee.concat)(["0x00",this.privateKey])]))}hasPath(){return this.path!=null}neuter(){return new ac(En,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,this.provider)}deriveChild(e){let t=(0,ee.getNumber)(e,"index");(0,ee.assertArgument)(t<=4294967295,"invalid index","index",t);let n=this.path;n&&(n+="/"+(t&~Pn),t&Pn&&(n+="'"));let{IR:s,IL:i}=M6(t,this.chainCode,this.publicKey,this.privateKey),o=new gr.SigningKey((0,ee.toBeHex)(((0,ee.toBigInt)(i)+BigInt(this.privateKey))%iO,32));return new r(En,o,this.fingerprint,(0,ee.hexlify)(s),n,t,this.depth+1,this.mnemonic,this.provider)}derivePath(e){return j6(this,e)}static#t(e,t){(0,ee.assertArgument)((0,ee.isBytesLike)(e),"invalid seed","seed","[REDACTED]");let n=(0,ee.getBytes)(e,"seed");(0,ee.assertArgument)(n.length>=16&&n.length<=64,"invalid seed","seed","[REDACTED]");let s=(0,ee.getBytes)((0,gr.computeHmac)("sha512",sO,n)),i=new gr.SigningKey((0,ee.hexlify)(s.slice(0,32)));return new r(En,i,"0x00000000",(0,ee.hexlify)(s.slice(32)),"m",0,0,t,null)}static fromExtendedKey(e){let t=(0,ee.toBeArray)((0,ee.decodeBase58)(e));(0,ee.assertArgument)(t.length===82||Gg(t.slice(0,78))===e,"invalid extended key","extendedKey","[ REDACTED ]");let n=t[4],s=(0,ee.hexlify)(t.slice(5,9)),i=parseInt((0,ee.hexlify)(t.slice(9,13)).substring(2),16),o=(0,ee.hexlify)(t.slice(13,45)),a=t.slice(45,78);switch((0,ee.hexlify)(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":{let c=(0,ee.hexlify)(a);return new ac(En,(0,L6.computeAddress)(c),c,s,o,null,i,n,null)}case"0x0488ade4":case"0x04358394 ":if(a[0]!==0)break;return new r(En,new gr.SigningKey(a.slice(1)),s,o,null,i,n,null,null)}(0,ee.assertArgument)(!1,"invalid extended key prefix","extendedKey","[ REDACTED ]")}static createRandom(e,t,n){e==null&&(e=""),t==null&&(t=Qt.defaultPath),n==null&&(n=N6.LangEn.wordlist());let s=I6.Mnemonic.fromEntropy((0,gr.randomBytes)(16),e,n);return r.#t(s.computeSeed(),s).derivePath(t)}static fromMnemonic(e,t){return t||(t=Qt.defaultPath),r.#t(e.computeSeed(),e).derivePath(t)}static fromPhrase(e,t,n,s){t==null&&(t=""),n==null&&(n=Qt.defaultPath),s==null&&(s=N6.LangEn.wordlist());let i=I6.Mnemonic.fromPhrase(e,t,s);return r.#t(i.computeSeed(),i).derivePath(n)}static fromSeed(e){return r.#t(e,null)}};Qt.HDNodeWallet=zg;var ac=class r extends rO.VoidSigner{publicKey;fingerprint;parentFingerprint;chainCode;path;index;depth;constructor(e,t,n,s,i,o,a,c,u){super(t,u),(0,ee.assertPrivate)(e,En,"HDNodeVoidWallet"),(0,ee.defineProperties)(this,{publicKey:n});let l=(0,ee.dataSlice)((0,gr.ripemd160)((0,gr.sha256)(n)),0,4);(0,ee.defineProperties)(this,{publicKey:n,fingerprint:l,parentFingerprint:s,chainCode:i,path:o,index:a,depth:c})}connect(e){return new r(En,this.address,this.publicKey,this.parentFingerprint,this.chainCode,this.path,this.index,this.depth,e)}get extendedKey(){return(0,ee.assert)(this.depth<256,"Depth too deep","UNSUPPORTED_OPERATION",{operation:"extendedKey"}),Gg((0,ee.concat)(["0x0488B21E",J0(this.depth,1),this.parentFingerprint,J0(this.index,4),this.chainCode,this.publicKey]))}hasPath(){return this.path!=null}deriveChild(e){let t=(0,ee.getNumber)(e,"index");(0,ee.assertArgument)(t<=4294967295,"invalid index","index",t);let n=this.path;n&&(n+="/"+(t&~Pn),t&Pn&&(n+="'"));let{IR:s,IL:i}=M6(t,this.chainCode,this.publicKey,null),o=gr.SigningKey.addPoints(i,this.publicKey,!0),a=(0,L6.computeAddress)(o);return new r(En,a,o,this.fingerprint,(0,ee.hexlify)(s),n,t,this.depth+1,this.provider)}derivePath(e){return j6(this,e)}};Qt.HDNodeVoidWallet=ac;function aO(r){let e=(0,ee.getNumber)(r,"index");return(0,ee.assertArgument)(e>=0&&e<Pn,"invalid account index","index",e),`m/44'/60'/${e}'/0/0`}Qt.getAccountPath=aO;function cO(r){let e=(0,ee.getNumber)(r,"index");return(0,ee.assertArgument)(e>=0&&e<Pn,"invalid account index","index",e),`m/44'/60'/0'/0/${e}`}Qt.getIndexedAccountPath=cO});var $g=P(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.decryptCrowdsaleJson=qo.isCrowdsaleJson=void 0;var U6=Hg(),uO=ht(),lO=xt(),fO=bn(),Vg=$(),Q0=qg();function dO(r){try{if(JSON.parse(r).encseed)return!0}catch{}return!1}qo.isCrowdsaleJson=dO;function hO(r,e){let t=JSON.parse(r),n=(0,Q0.getPassword)(e),s=(0,uO.getAddress)((0,Q0.spelunk)(t,"ethaddr:string!")),i=(0,Q0.looseArrayify)((0,Q0.spelunk)(t,"encseed:string!"));(0,Vg.assertArgument)(i&&i.length%16===0,"invalid encseed","json",r);let o=(0,Vg.getBytes)((0,lO.pbkdf2)(n,n,2e3,32,"sha256")).slice(0,16),a=i.slice(0,16),c=i.slice(16),u=new U6.CBC(o,a),l=(0,U6.pkcs7Strip)((0,Vg.getBytes)(u.decrypt(c))),f="";for(let h=0;h<l.length;h++)f+=String.fromCharCode(l[h]);return{address:s,privateKey:(0,fO.id)(f)}}qo.decryptCrowdsaleJson=hO});var D6=P(Y0=>{"use strict";Object.defineProperty(Y0,"__esModule",{value:!0});Y0.Wallet=void 0;var pO=xt(),Jg=$(),gO=C0(),Qg=Kg(),W0=$g(),Go=$0(),bO=U0();function F6(r){return new Promise(e=>{setTimeout(()=>{e()},r)})}var Wg=class r extends gO.BaseWallet{constructor(e,t){typeof e=="string"&&!e.startsWith("0x")&&(e="0x"+e);let n=typeof e=="string"?new pO.SigningKey(e):e;super(n,t)}connect(e){return new r(this.signingKey,e)}async encrypt(e,t){let n={address:this.address,privateKey:this.privateKey};return await(0,Go.encryptKeystoreJson)(n,e,{progressCallback:t})}encryptSync(e){let t={address:this.address,privateKey:this.privateKey};return(0,Go.encryptKeystoreJsonSync)(t,e)}static#e(e){if((0,Jg.assertArgument)(e,"invalid JSON wallet","json","[ REDACTED ]"),"mnemonic"in e&&e.mnemonic&&e.mnemonic.locale==="en"){let n=bO.Mnemonic.fromEntropy(e.mnemonic.entropy),s=Qg.HDNodeWallet.fromMnemonic(n,e.mnemonic.path);if(s.address===e.address&&s.privateKey===e.privateKey)return s;console.log("WARNING: JSON mismatch address/privateKey != mnemonic; fallback onto private key")}let t=new r(e.privateKey);return(0,Jg.assertArgument)(t.address===e.address,"address/privateKey mismatch","json","[ REDACTED ]"),t}static async fromEncryptedJson(e,t,n){let s=null;return(0,Go.isKeystoreJson)(e)?s=await(0,Go.decryptKeystoreJson)(e,t,n):(0,W0.isCrowdsaleJson)(e)&&(n&&(n(0),await F6(0)),s=(0,W0.decryptCrowdsaleJson)(e,t),n&&(n(1),await F6(0))),r.#e(s)}static fromEncryptedJsonSync(e,t){let n=null;return(0,Go.isKeystoreJson)(e)?n=(0,Go.decryptKeystoreJsonSync)(e,t):(0,W0.isCrowdsaleJson)(e)?n=(0,W0.decryptCrowdsaleJson)(e,t):(0,Jg.assertArgument)(!1,"invalid JSON wallet","json","[ REDACTED ]"),r.#e(n)}static createRandom(e){let t=Qg.HDNodeWallet.createRandom();return e?t.connect(e):t}static fromPhrase(e,t){let n=Qg.HDNodeWallet.fromPhrase(e);return t?n.connect(t):n}};Y0.Wallet=Wg});var q6=P(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.Wallet=Re.Mnemonic=Re.encryptKeystoreJsonSync=Re.encryptKeystoreJson=Re.decryptKeystoreJson=Re.decryptKeystoreJsonSync=Re.isKeystoreJson=Re.decryptCrowdsaleJson=Re.isCrowdsaleJson=Re.HDNodeVoidWallet=Re.HDNodeWallet=Re.getIndexedAccountPath=Re.getAccountPath=Re.defaultPath=Re.BaseWallet=void 0;var xO=C0();Object.defineProperty(Re,"BaseWallet",{enumerable:!0,get:function(){return xO.BaseWallet}});var cc=Kg();Object.defineProperty(Re,"defaultPath",{enumerable:!0,get:function(){return cc.defaultPath}});Object.defineProperty(Re,"getAccountPath",{enumerable:!0,get:function(){return cc.getAccountPath}});Object.defineProperty(Re,"getIndexedAccountPath",{enumerable:!0,get:function(){return cc.getIndexedAccountPath}});Object.defineProperty(Re,"HDNodeWallet",{enumerable:!0,get:function(){return cc.HDNodeWallet}});Object.defineProperty(Re,"HDNodeVoidWallet",{enumerable:!0,get:function(){return cc.HDNodeVoidWallet}});var H6=$g();Object.defineProperty(Re,"isCrowdsaleJson",{enumerable:!0,get:function(){return H6.isCrowdsaleJson}});Object.defineProperty(Re,"decryptCrowdsaleJson",{enumerable:!0,get:function(){return H6.decryptCrowdsaleJson}});var uc=$0();Object.defineProperty(Re,"isKeystoreJson",{enumerable:!0,get:function(){return uc.isKeystoreJson}});Object.defineProperty(Re,"decryptKeystoreJsonSync",{enumerable:!0,get:function(){return uc.decryptKeystoreJsonSync}});Object.defineProperty(Re,"decryptKeystoreJson",{enumerable:!0,get:function(){return uc.decryptKeystoreJson}});Object.defineProperty(Re,"encryptKeystoreJson",{enumerable:!0,get:function(){return uc.encryptKeystoreJson}});Object.defineProperty(Re,"encryptKeystoreJsonSync",{enumerable:!0,get:function(){return uc.encryptKeystoreJsonSync}});var mO=U0();Object.defineProperty(Re,"Mnemonic",{enumerable:!0,get:function(){return mO.Mnemonic}});var yO=D6();Object.defineProperty(Re,"Wallet",{enumerable:!0,get:function(){return yO.Wallet}})});var G6=P(Z0=>{"use strict";Object.defineProperty(Z0,"__esModule",{value:!0});Z0.decodeBits=void 0;var wO=")!@#$%^&*(ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_";function AO(r,e){let t=(1<<r)-1,n=[],s=0,i=0,o=0;for(let a=0;a<e.length;a++)for(s=s<<6|wO.indexOf(e[a]),i+=6;i>=r;){let c=s>>i-r;s&=(1<<i-r)-1,i-=r,c===0?o+=t:(n.push(c+o),o=0)}return n}Z0.decodeBits=AO});var z6=P(X0=>{"use strict";Object.defineProperty(X0,"__esModule",{value:!0});X0.decodeOwlA=void 0;var EO=$(),PO=G6(),vO=xg();function _O(r,e){let t=(0,vO.decodeOwl)(r).join(",");return e.split(/,/g).forEach(n=>{let s=n.match(/^([a-z]*)([0-9]+)([0-9])(.*)$/);(0,EO.assertArgument)(s!==null,"internal error parsing accents","accents",e);let i=0,o=(0,PO.decodeBits)(parseInt(s[3]),s[4]),a=parseInt(s[2]),c=new RegExp(`([${s[1]}])`,"g");t=t.replace(c,(u,l)=>(--o[i]===0&&(l=String.fromCharCode(l.charCodeAt(0),a),i++),l))}),t.split(",")}X0.decodeOwlA=_O});var K6=P(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0});ef.WordlistOwlA=void 0;var kO=L0(),TO=z6(),Yg=class extends kO.WordlistOwl{#e;constructor(e,t,n,s){super(e,t,s),this.#e=n}get _accent(){return this.#e}_decodeWords(){return(0,TO.decodeOwlA)(this._data,this._accent)}};ef.WordlistOwlA=Yg});var V6=P(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.wordlists=void 0;var BO=tc();tf.wordlists={en:BO.LangEn.wordlist()}});var $6=P(Ur=>{"use strict";Object.defineProperty(Ur,"__esModule",{value:!0});Ur.wordlists=Ur.WordlistOwlA=Ur.WordlistOwl=Ur.LangEn=Ur.Wordlist=void 0;var OO=yg();Object.defineProperty(Ur,"Wordlist",{enumerable:!0,get:function(){return OO.Wordlist}});var SO=tc();Object.defineProperty(Ur,"LangEn",{enumerable:!0,get:function(){return SO.LangEn}});var CO=L0();Object.defineProperty(Ur,"WordlistOwl",{enumerable:!0,get:function(){return CO.WordlistOwl}});var NO=K6();Object.defineProperty(Ur,"WordlistOwlA",{enumerable:!0,get:function(){return NO.WordlistOwlA}});var IO=V6();Object.defineProperty(Ur,"wordlists",{enumerable:!0,get:function(){return IO.wordlists}})});var Zg=P(d=>{"use strict";Object.defineProperty(d,"__esModule",{value:!0});d.ripemd160=d.keccak256=d.randomBytes=d.computeHmac=d.UndecodedEventLog=d.EventLog=d.ContractUnknownEventPayload=d.ContractTransactionResponse=d.ContractTransactionReceipt=d.ContractEventPayload=d.ContractFactory=d.Contract=d.BaseContract=d.MessagePrefix=d.EtherSymbol=d.ZeroHash=d.N=d.MaxInt256=d.MinInt256=d.MaxUint256=d.WeiPerEther=d.ZeroAddress=d.resolveAddress=d.isAddress=d.isAddressable=d.getCreate2Address=d.getCreateAddress=d.getIcapAddress=d.getAddress=d.Typed=d.TransactionDescription=d.Result=d.LogDescription=d.Interface=d.Indexed=d.ErrorDescription=d.checkResultErrors=d.StructFragment=d.ParamType=d.NamedFragment=d.FunctionFragment=d.FallbackFragment=d.Fragment=d.EventFragment=d.ErrorFragment=d.ConstructorFragment=d.AbiCoder=d.encodeBytes32String=d.decodeBytes32String=d.version=void 0;d.WebSocketProvider=d.SocketProvider=d.IpcSocketProvider=d.QuickNodeProvider=d.PocketProvider=d.InfuraWebSocketProvider=d.InfuraProvider=d.EtherscanProvider=d.CloudflareProvider=d.ChainstackProvider=d.BlockscoutProvider=d.AnkrProvider=d.AlchemyProvider=d.BrowserProvider=d.JsonRpcSigner=d.JsonRpcProvider=d.JsonRpcApiProvider=d.FallbackProvider=d.AbstractProvider=d.VoidSigner=d.NonceManager=d.AbstractSigner=d.TransactionResponse=d.TransactionReceipt=d.Log=d.FeeData=d.Block=d.getDefaultProvider=d.verifyTypedData=d.TypedDataEncoder=d.solidityPackedSha256=d.solidityPackedKeccak256=d.solidityPacked=d.verifyMessage=d.hashMessage=d.verifyAuthorization=d.hashAuthorization=d.dnsEncode=d.namehash=d.isValidName=d.ensNormalize=d.id=d.SigningKey=d.Signature=d.lock=d.scryptSync=d.scrypt=d.pbkdf2=d.sha512=d.sha256=void 0;d.FetchCancelSignal=d.FetchResponse=d.FetchRequest=d.EventPayload=d.isError=d.isCallException=d.makeError=d.assertPrivate=d.assertNormalize=d.assertArgumentCount=d.assertArgument=d.assert=d.resolveProperties=d.defineProperties=d.zeroPadValue=d.zeroPadBytes=d.stripZerosLeft=d.isBytesLike=d.isHexString=d.hexlify=d.getBytesCopy=d.getBytes=d.dataSlice=d.dataLength=d.concat=d.encodeBase64=d.decodeBase64=d.encodeBase58=d.decodeBase58=d.Transaction=d.recoverAddress=d.computeAddress=d.authorizationify=d.accessListify=d.showThrottleMessage=d.copyRequest=d.UnmanagedSubscriber=d.SocketSubscriber=d.SocketPendingSubscriber=d.SocketEventSubscriber=d.SocketBlockSubscriber=d.MulticoinProviderPlugin=d.NetworkPlugin=d.GasCostPlugin=d.FetchUrlFeeDataNetworkPlugin=d.FeeDataNetworkPlugin=d.EtherscanPlugin=d.EnsPlugin=d.Network=d.EnsResolver=void 0;d.wordlists=d.WordlistOwlA=d.WordlistOwl=d.LangEn=d.Wordlist=d.encryptKeystoreJsonSync=d.encryptKeystoreJson=d.decryptKeystoreJson=d.decryptKeystoreJsonSync=d.decryptCrowdsaleJson=d.isKeystoreJson=d.isCrowdsaleJson=d.getIndexedAccountPath=d.getAccountPath=d.defaultPath=d.Wallet=d.HDNodeVoidWallet=d.HDNodeWallet=d.BaseWallet=d.Mnemonic=d.uuidV4=d.encodeRlp=d.decodeRlp=d.Utf8ErrorFuncs=d.toUtf8String=d.toUtf8CodePoints=d.toUtf8Bytes=d.parseUnits=d.formatUnits=d.parseEther=d.formatEther=d.mask=d.toTwos=d.fromTwos=d.toQuantity=d.toNumber=d.toBeHex=d.toBigInt=d.toBeArray=d.getUint=d.getNumber=d.getBigInt=d.FixedNumber=void 0;var RO=Ic();Object.defineProperty(d,"version",{enumerable:!0,get:function(){return RO.version}});var Et=xo();Object.defineProperty(d,"decodeBytes32String",{enumerable:!0,get:function(){return Et.decodeBytes32String}});Object.defineProperty(d,"encodeBytes32String",{enumerable:!0,get:function(){return Et.encodeBytes32String}});Object.defineProperty(d,"AbiCoder",{enumerable:!0,get:function(){return Et.AbiCoder}});Object.defineProperty(d,"ConstructorFragment",{enumerable:!0,get:function(){return Et.ConstructorFragment}});Object.defineProperty(d,"ErrorFragment",{enumerable:!0,get:function(){return Et.ErrorFragment}});Object.defineProperty(d,"EventFragment",{enumerable:!0,get:function(){return Et.EventFragment}});Object.defineProperty(d,"Fragment",{enumerable:!0,get:function(){return Et.Fragment}});Object.defineProperty(d,"FallbackFragment",{enumerable:!0,get:function(){return Et.FallbackFragment}});Object.defineProperty(d,"FunctionFragment",{enumerable:!0,get:function(){return Et.FunctionFragment}});Object.defineProperty(d,"NamedFragment",{enumerable:!0,get:function(){return Et.NamedFragment}});Object.defineProperty(d,"ParamType",{enumerable:!0,get:function(){return Et.ParamType}});Object.defineProperty(d,"StructFragment",{enumerable:!0,get:function(){return Et.StructFragment}});Object.defineProperty(d,"checkResultErrors",{enumerable:!0,get:function(){return Et.checkResultErrors}});Object.defineProperty(d,"ErrorDescription",{enumerable:!0,get:function(){return Et.ErrorDescription}});Object.defineProperty(d,"Indexed",{enumerable:!0,get:function(){return Et.Indexed}});Object.defineProperty(d,"Interface",{enumerable:!0,get:function(){return Et.Interface}});Object.defineProperty(d,"LogDescription",{enumerable:!0,get:function(){return Et.LogDescription}});Object.defineProperty(d,"Result",{enumerable:!0,get:function(){return Et.Result}});Object.defineProperty(d,"TransactionDescription",{enumerable:!0,get:function(){return Et.TransactionDescription}});Object.defineProperty(d,"Typed",{enumerable:!0,get:function(){return Et.Typed}});var ei=ht();Object.defineProperty(d,"getAddress",{enumerable:!0,get:function(){return ei.getAddress}});Object.defineProperty(d,"getIcapAddress",{enumerable:!0,get:function(){return ei.getIcapAddress}});Object.defineProperty(d,"getCreateAddress",{enumerable:!0,get:function(){return ei.getCreateAddress}});Object.defineProperty(d,"getCreate2Address",{enumerable:!0,get:function(){return ei.getCreate2Address}});Object.defineProperty(d,"isAddressable",{enumerable:!0,get:function(){return ei.isAddressable}});Object.defineProperty(d,"isAddress",{enumerable:!0,get:function(){return ei.isAddress}});Object.defineProperty(d,"resolveAddress",{enumerable:!0,get:function(){return ei.resolveAddress}});var Un=Vi();Object.defineProperty(d,"ZeroAddress",{enumerable:!0,get:function(){return Un.ZeroAddress}});Object.defineProperty(d,"WeiPerEther",{enumerable:!0,get:function(){return Un.WeiPerEther}});Object.defineProperty(d,"MaxUint256",{enumerable:!0,get:function(){return Un.MaxUint256}});Object.defineProperty(d,"MinInt256",{enumerable:!0,get:function(){return Un.MinInt256}});Object.defineProperty(d,"MaxInt256",{enumerable:!0,get:function(){return Un.MaxInt256}});Object.defineProperty(d,"N",{enumerable:!0,get:function(){return Un.N}});Object.defineProperty(d,"ZeroHash",{enumerable:!0,get:function(){return Un.ZeroHash}});Object.defineProperty(d,"EtherSymbol",{enumerable:!0,get:function(){return Un.EtherSymbol}});Object.defineProperty(d,"MessagePrefix",{enumerable:!0,get:function(){return Un.MessagePrefix}});var Fn=za();Object.defineProperty(d,"BaseContract",{enumerable:!0,get:function(){return Fn.BaseContract}});Object.defineProperty(d,"Contract",{enumerable:!0,get:function(){return Fn.Contract}});Object.defineProperty(d,"ContractFactory",{enumerable:!0,get:function(){return Fn.ContractFactory}});Object.defineProperty(d,"ContractEventPayload",{enumerable:!0,get:function(){return Fn.ContractEventPayload}});Object.defineProperty(d,"ContractTransactionReceipt",{enumerable:!0,get:function(){return Fn.ContractTransactionReceipt}});Object.defineProperty(d,"ContractTransactionResponse",{enumerable:!0,get:function(){return Fn.ContractTransactionResponse}});Object.defineProperty(d,"ContractUnknownEventPayload",{enumerable:!0,get:function(){return Fn.ContractUnknownEventPayload}});Object.defineProperty(d,"EventLog",{enumerable:!0,get:function(){return Fn.EventLog}});Object.defineProperty(d,"UndecodedEventLog",{enumerable:!0,get:function(){return Fn.UndecodedEventLog}});var Fr=xt();Object.defineProperty(d,"computeHmac",{enumerable:!0,get:function(){return Fr.computeHmac}});Object.defineProperty(d,"randomBytes",{enumerable:!0,get:function(){return Fr.randomBytes}});Object.defineProperty(d,"keccak256",{enumerable:!0,get:function(){return Fr.keccak256}});Object.defineProperty(d,"ripemd160",{enumerable:!0,get:function(){return Fr.ripemd160}});Object.defineProperty(d,"sha256",{enumerable:!0,get:function(){return Fr.sha256}});Object.defineProperty(d,"sha512",{enumerable:!0,get:function(){return Fr.sha512}});Object.defineProperty(d,"pbkdf2",{enumerable:!0,get:function(){return Fr.pbkdf2}});Object.defineProperty(d,"scrypt",{enumerable:!0,get:function(){return Fr.scrypt}});Object.defineProperty(d,"scryptSync",{enumerable:!0,get:function(){return Fr.scryptSync}});Object.defineProperty(d,"lock",{enumerable:!0,get:function(){return Fr.lock}});Object.defineProperty(d,"Signature",{enumerable:!0,get:function(){return Fr.Signature}});Object.defineProperty(d,"SigningKey",{enumerable:!0,get:function(){return Fr.SigningKey}});var ir=bn();Object.defineProperty(d,"id",{enumerable:!0,get:function(){return ir.id}});Object.defineProperty(d,"ensNormalize",{enumerable:!0,get:function(){return ir.ensNormalize}});Object.defineProperty(d,"isValidName",{enumerable:!0,get:function(){return ir.isValidName}});Object.defineProperty(d,"namehash",{enumerable:!0,get:function(){return ir.namehash}});Object.defineProperty(d,"dnsEncode",{enumerable:!0,get:function(){return ir.dnsEncode}});Object.defineProperty(d,"hashAuthorization",{enumerable:!0,get:function(){return ir.hashAuthorization}});Object.defineProperty(d,"verifyAuthorization",{enumerable:!0,get:function(){return ir.verifyAuthorization}});Object.defineProperty(d,"hashMessage",{enumerable:!0,get:function(){return ir.hashMessage}});Object.defineProperty(d,"verifyMessage",{enumerable:!0,get:function(){return ir.verifyMessage}});Object.defineProperty(d,"solidityPacked",{enumerable:!0,get:function(){return ir.solidityPacked}});Object.defineProperty(d,"solidityPackedKeccak256",{enumerable:!0,get:function(){return ir.solidityPackedKeccak256}});Object.defineProperty(d,"solidityPackedSha256",{enumerable:!0,get:function(){return ir.solidityPackedSha256}});Object.defineProperty(d,"TypedDataEncoder",{enumerable:!0,get:function(){return ir.TypedDataEncoder}});Object.defineProperty(d,"verifyTypedData",{enumerable:!0,get:function(){return ir.verifyTypedData}});var pe=B0();Object.defineProperty(d,"getDefaultProvider",{enumerable:!0,get:function(){return pe.getDefaultProvider}});Object.defineProperty(d,"Block",{enumerable:!0,get:function(){return pe.Block}});Object.defineProperty(d,"FeeData",{enumerable:!0,get:function(){return pe.FeeData}});Object.defineProperty(d,"Log",{enumerable:!0,get:function(){return pe.Log}});Object.defineProperty(d,"TransactionReceipt",{enumerable:!0,get:function(){return pe.TransactionReceipt}});Object.defineProperty(d,"TransactionResponse",{enumerable:!0,get:function(){return pe.TransactionResponse}});Object.defineProperty(d,"AbstractSigner",{enumerable:!0,get:function(){return pe.AbstractSigner}});Object.defineProperty(d,"NonceManager",{enumerable:!0,get:function(){return pe.NonceManager}});Object.defineProperty(d,"VoidSigner",{enumerable:!0,get:function(){return pe.VoidSigner}});Object.defineProperty(d,"AbstractProvider",{enumerable:!0,get:function(){return pe.AbstractProvider}});Object.defineProperty(d,"FallbackProvider",{enumerable:!0,get:function(){return pe.FallbackProvider}});Object.defineProperty(d,"JsonRpcApiProvider",{enumerable:!0,get:function(){return pe.JsonRpcApiProvider}});Object.defineProperty(d,"JsonRpcProvider",{enumerable:!0,get:function(){return pe.JsonRpcProvider}});Object.defineProperty(d,"JsonRpcSigner",{enumerable:!0,get:function(){return pe.JsonRpcSigner}});Object.defineProperty(d,"BrowserProvider",{enumerable:!0,get:function(){return pe.BrowserProvider}});Object.defineProperty(d,"AlchemyProvider",{enumerable:!0,get:function(){return pe.AlchemyProvider}});Object.defineProperty(d,"AnkrProvider",{enumerable:!0,get:function(){return pe.AnkrProvider}});Object.defineProperty(d,"BlockscoutProvider",{enumerable:!0,get:function(){return pe.BlockscoutProvider}});Object.defineProperty(d,"ChainstackProvider",{enumerable:!0,get:function(){return pe.ChainstackProvider}});Object.defineProperty(d,"CloudflareProvider",{enumerable:!0,get:function(){return pe.CloudflareProvider}});Object.defineProperty(d,"EtherscanProvider",{enumerable:!0,get:function(){return pe.EtherscanProvider}});Object.defineProperty(d,"InfuraProvider",{enumerable:!0,get:function(){return pe.InfuraProvider}});Object.defineProperty(d,"InfuraWebSocketProvider",{enumerable:!0,get:function(){return pe.InfuraWebSocketProvider}});Object.defineProperty(d,"PocketProvider",{enumerable:!0,get:function(){return pe.PocketProvider}});Object.defineProperty(d,"QuickNodeProvider",{enumerable:!0,get:function(){return pe.QuickNodeProvider}});Object.defineProperty(d,"IpcSocketProvider",{enumerable:!0,get:function(){return pe.IpcSocketProvider}});Object.defineProperty(d,"SocketProvider",{enumerable:!0,get:function(){return pe.SocketProvider}});Object.defineProperty(d,"WebSocketProvider",{enumerable:!0,get:function(){return pe.WebSocketProvider}});Object.defineProperty(d,"EnsResolver",{enumerable:!0,get:function(){return pe.EnsResolver}});Object.defineProperty(d,"Network",{enumerable:!0,get:function(){return pe.Network}});Object.defineProperty(d,"EnsPlugin",{enumerable:!0,get:function(){return pe.EnsPlugin}});Object.defineProperty(d,"EtherscanPlugin",{enumerable:!0,get:function(){return pe.EtherscanPlugin}});Object.defineProperty(d,"FeeDataNetworkPlugin",{enumerable:!0,get:function(){return pe.FeeDataNetworkPlugin}});Object.defineProperty(d,"FetchUrlFeeDataNetworkPlugin",{enumerable:!0,get:function(){return pe.FetchUrlFeeDataNetworkPlugin}});Object.defineProperty(d,"GasCostPlugin",{enumerable:!0,get:function(){return pe.GasCostPlugin}});Object.defineProperty(d,"NetworkPlugin",{enumerable:!0,get:function(){return pe.NetworkPlugin}});Object.defineProperty(d,"MulticoinProviderPlugin",{enumerable:!0,get:function(){return pe.MulticoinProviderPlugin}});Object.defineProperty(d,"SocketBlockSubscriber",{enumerable:!0,get:function(){return pe.SocketBlockSubscriber}});Object.defineProperty(d,"SocketEventSubscriber",{enumerable:!0,get:function(){return pe.SocketEventSubscriber}});Object.defineProperty(d,"SocketPendingSubscriber",{enumerable:!0,get:function(){return pe.SocketPendingSubscriber}});Object.defineProperty(d,"SocketSubscriber",{enumerable:!0,get:function(){return pe.SocketSubscriber}});Object.defineProperty(d,"UnmanagedSubscriber",{enumerable:!0,get:function(){return pe.UnmanagedSubscriber}});Object.defineProperty(d,"copyRequest",{enumerable:!0,get:function(){return pe.copyRequest}});Object.defineProperty(d,"showThrottleMessage",{enumerable:!0,get:function(){return pe.showThrottleMessage}});var lc=Gt();Object.defineProperty(d,"accessListify",{enumerable:!0,get:function(){return lc.accessListify}});Object.defineProperty(d,"authorizationify",{enumerable:!0,get:function(){return lc.authorizationify}});Object.defineProperty(d,"computeAddress",{enumerable:!0,get:function(){return lc.computeAddress}});Object.defineProperty(d,"recoverAddress",{enumerable:!0,get:function(){return lc.recoverAddress}});Object.defineProperty(d,"Transaction",{enumerable:!0,get:function(){return lc.Transaction}});var ne=$();Object.defineProperty(d,"decodeBase58",{enumerable:!0,get:function(){return ne.decodeBase58}});Object.defineProperty(d,"encodeBase58",{enumerable:!0,get:function(){return ne.encodeBase58}});Object.defineProperty(d,"decodeBase64",{enumerable:!0,get:function(){return ne.decodeBase64}});Object.defineProperty(d,"encodeBase64",{enumerable:!0,get:function(){return ne.encodeBase64}});Object.defineProperty(d,"concat",{enumerable:!0,get:function(){return ne.concat}});Object.defineProperty(d,"dataLength",{enumerable:!0,get:function(){return ne.dataLength}});Object.defineProperty(d,"dataSlice",{enumerable:!0,get:function(){return ne.dataSlice}});Object.defineProperty(d,"getBytes",{enumerable:!0,get:function(){return ne.getBytes}});Object.defineProperty(d,"getBytesCopy",{enumerable:!0,get:function(){return ne.getBytesCopy}});Object.defineProperty(d,"hexlify",{enumerable:!0,get:function(){return ne.hexlify}});Object.defineProperty(d,"isHexString",{enumerable:!0,get:function(){return ne.isHexString}});Object.defineProperty(d,"isBytesLike",{enumerable:!0,get:function(){return ne.isBytesLike}});Object.defineProperty(d,"stripZerosLeft",{enumerable:!0,get:function(){return ne.stripZerosLeft}});Object.defineProperty(d,"zeroPadBytes",{enumerable:!0,get:function(){return ne.zeroPadBytes}});Object.defineProperty(d,"zeroPadValue",{enumerable:!0,get:function(){return ne.zeroPadValue}});Object.defineProperty(d,"defineProperties",{enumerable:!0,get:function(){return ne.defineProperties}});Object.defineProperty(d,"resolveProperties",{enumerable:!0,get:function(){return ne.resolveProperties}});Object.defineProperty(d,"assert",{enumerable:!0,get:function(){return ne.assert}});Object.defineProperty(d,"assertArgument",{enumerable:!0,get:function(){return ne.assertArgument}});Object.defineProperty(d,"assertArgumentCount",{enumerable:!0,get:function(){return ne.assertArgumentCount}});Object.defineProperty(d,"assertNormalize",{enumerable:!0,get:function(){return ne.assertNormalize}});Object.defineProperty(d,"assertPrivate",{enumerable:!0,get:function(){return ne.assertPrivate}});Object.defineProperty(d,"makeError",{enumerable:!0,get:function(){return ne.makeError}});Object.defineProperty(d,"isCallException",{enumerable:!0,get:function(){return ne.isCallException}});Object.defineProperty(d,"isError",{enumerable:!0,get:function(){return ne.isError}});Object.defineProperty(d,"EventPayload",{enumerable:!0,get:function(){return ne.EventPayload}});Object.defineProperty(d,"FetchRequest",{enumerable:!0,get:function(){return ne.FetchRequest}});Object.defineProperty(d,"FetchResponse",{enumerable:!0,get:function(){return ne.FetchResponse}});Object.defineProperty(d,"FetchCancelSignal",{enumerable:!0,get:function(){return ne.FetchCancelSignal}});Object.defineProperty(d,"FixedNumber",{enumerable:!0,get:function(){return ne.FixedNumber}});Object.defineProperty(d,"getBigInt",{enumerable:!0,get:function(){return ne.getBigInt}});Object.defineProperty(d,"getNumber",{enumerable:!0,get:function(){return ne.getNumber}});Object.defineProperty(d,"getUint",{enumerable:!0,get:function(){return ne.getUint}});Object.defineProperty(d,"toBeArray",{enumerable:!0,get:function(){return ne.toBeArray}});Object.defineProperty(d,"toBigInt",{enumerable:!0,get:function(){return ne.toBigInt}});Object.defineProperty(d,"toBeHex",{enumerable:!0,get:function(){return ne.toBeHex}});Object.defineProperty(d,"toNumber",{enumerable:!0,get:function(){return ne.toNumber}});Object.defineProperty(d,"toQuantity",{enumerable:!0,get:function(){return ne.toQuantity}});Object.defineProperty(d,"fromTwos",{enumerable:!0,get:function(){return ne.fromTwos}});Object.defineProperty(d,"toTwos",{enumerable:!0,get:function(){return ne.toTwos}});Object.defineProperty(d,"mask",{enumerable:!0,get:function(){return ne.mask}});Object.defineProperty(d,"formatEther",{enumerable:!0,get:function(){return ne.formatEther}});Object.defineProperty(d,"parseEther",{enumerable:!0,get:function(){return ne.parseEther}});Object.defineProperty(d,"formatUnits",{enumerable:!0,get:function(){return ne.formatUnits}});Object.defineProperty(d,"parseUnits",{enumerable:!0,get:function(){return ne.parseUnits}});Object.defineProperty(d,"toUtf8Bytes",{enumerable:!0,get:function(){return ne.toUtf8Bytes}});Object.defineProperty(d,"toUtf8CodePoints",{enumerable:!0,get:function(){return ne.toUtf8CodePoints}});Object.defineProperty(d,"toUtf8String",{enumerable:!0,get:function(){return ne.toUtf8String}});Object.defineProperty(d,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return ne.Utf8ErrorFuncs}});Object.defineProperty(d,"decodeRlp",{enumerable:!0,get:function(){return ne.decodeRlp}});Object.defineProperty(d,"encodeRlp",{enumerable:!0,get:function(){return ne.encodeRlp}});Object.defineProperty(d,"uuidV4",{enumerable:!0,get:function(){return ne.uuidV4}});var Wt=q6();Object.defineProperty(d,"Mnemonic",{enumerable:!0,get:function(){return Wt.Mnemonic}});Object.defineProperty(d,"BaseWallet",{enumerable:!0,get:function(){return Wt.BaseWallet}});Object.defineProperty(d,"HDNodeWallet",{enumerable:!0,get:function(){return Wt.HDNodeWallet}});Object.defineProperty(d,"HDNodeVoidWallet",{enumerable:!0,get:function(){return Wt.HDNodeVoidWallet}});Object.defineProperty(d,"Wallet",{enumerable:!0,get:function(){return Wt.Wallet}});Object.defineProperty(d,"defaultPath",{enumerable:!0,get:function(){return Wt.defaultPath}});Object.defineProperty(d,"getAccountPath",{enumerable:!0,get:function(){return Wt.getAccountPath}});Object.defineProperty(d,"getIndexedAccountPath",{enumerable:!0,get:function(){return Wt.getIndexedAccountPath}});Object.defineProperty(d,"isCrowdsaleJson",{enumerable:!0,get:function(){return Wt.isCrowdsaleJson}});Object.defineProperty(d,"isKeystoreJson",{enumerable:!0,get:function(){return Wt.isKeystoreJson}});Object.defineProperty(d,"decryptCrowdsaleJson",{enumerable:!0,get:function(){return Wt.decryptCrowdsaleJson}});Object.defineProperty(d,"decryptKeystoreJsonSync",{enumerable:!0,get:function(){return Wt.decryptKeystoreJsonSync}});Object.defineProperty(d,"decryptKeystoreJson",{enumerable:!0,get:function(){return Wt.decryptKeystoreJson}});Object.defineProperty(d,"encryptKeystoreJson",{enumerable:!0,get:function(){return Wt.encryptKeystoreJson}});Object.defineProperty(d,"encryptKeystoreJsonSync",{enumerable:!0,get:function(){return Wt.encryptKeystoreJsonSync}});var fc=$6();Object.defineProperty(d,"Wordlist",{enumerable:!0,get:function(){return fc.Wordlist}});Object.defineProperty(d,"LangEn",{enumerable:!0,get:function(){return fc.LangEn}});Object.defineProperty(d,"WordlistOwl",{enumerable:!0,get:function(){return fc.WordlistOwl}});Object.defineProperty(d,"WordlistOwlA",{enumerable:!0,get:function(){return fc.WordlistOwlA}});Object.defineProperty(d,"wordlists",{enumerable:!0,get:function(){return fc.wordlists}})});var Xg=P(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.ethers=void 0;var J6=(km(),kb(_m)),LO=J6.__importStar(Zg());dc.ethers=LO;J6.__exportStar(Zg(),dc)});var nb=P(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.getAddress=_s.hashMessage=_s.verifyMessage=void 0;var zo=Xg(),eb=null,tb=null,rb=null;try{eb=zo.ethers.utils.verifyMessage,tb=zo.ethers.utils.hashMessage,rb=zo.ethers.utils.getAddress}catch{eb=zo.ethers.verifyMessage,tb=zo.ethers.hashMessage,rb=zo.ethers.getAddress}_s.verifyMessage=eb;_s.hashMessage=tb;_s.getAddress=rb});var ib=P(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.SiweErrorType=rn.SiweError=rn.VerifyOptsKeys=rn.VerifyParamsKeys=void 0;rn.VerifyParamsKeys=["signature","scheme","domain","nonce","time"];rn.VerifyOptsKeys=["provider","suppressExceptions","verificationFallback"];var sb=class{constructor(e,t,n){this.type=e,this.expected=t,this.received=n}};rn.SiweError=sb;var MO;(function(r){r.EXPIRED_MESSAGE="Expired message.",r.INVALID_DOMAIN="Invalid domain.",r.SCHEME_MISMATCH="Scheme does not match provided scheme for verification.",r.DOMAIN_MISMATCH="Domain does not match provided domain for verification.",r.NONCE_MISMATCH="Nonce does not match provided nonce for verification.",r.INVALID_ADDRESS="Invalid address.",r.INVALID_URI="URI does not conform to RFC 3986.",r.INVALID_NONCE="Nonce size smaller then 8 characters or is not alphanumeric.",r.NOT_YET_VALID_MESSAGE="Message is not valid yet.",r.INVALID_SIGNATURE="Signature does not match address of the message.",r.INVALID_TIME_FORMAT="Invalid time format.",r.INVALID_MESSAGE_VERSION="Invalid message version.",r.UNABLE_TO_PARSE="Unable to parse the message."})(MO=rn.SiweErrorType||(rn.SiweErrorType={}))});var W6=P(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.BrowserRandomSource=void 0;var Q6=65536,ob=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;let e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");let t=new Uint8Array(e);for(let n=0;n<t.length;n+=Q6)this._crypto.getRandomValues(t.subarray(n,n+Math.min(t.length-n,Q6)));return t}};rf.BrowserRandomSource=ob});var cb=P(ab=>{"use strict";Object.defineProperty(ab,"__esModule",{value:!0});function jO(r){for(var e=0;e<r.length;e++)r[e]=0;return r}ab.wipe=jO});var Y6=P(()=>{"use strict"});var Z6=P(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.NodeRandomSource=void 0;var UO=cb(),ub=class{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof Pb<"u"){let e=Y6();e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let t=this._crypto.randomBytes(e);if(t.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");let n=new Uint8Array(e);for(let s=0;s<n.length;s++)n[s]=t[s];return(0,UO.wipe)(t),n}};nf.NodeRandomSource=ub});var X6=P(sf=>{"use strict";Object.defineProperty(sf,"__esModule",{value:!0});sf.SystemRandomSource=void 0;var FO=W6(),DO=Z6(),lb=class{constructor(){if(this.isAvailable=!1,this.name="",this._source=new FO.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new DO.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}};sf.SystemRandomSource=lb});var e4=P(br=>{"use strict";Object.defineProperty(br,"__esModule",{value:!0});function HO(r,e){var t=r>>>16&65535,n=r&65535,s=e>>>16&65535,i=e&65535;return n*i+(t*i+n*s<<16>>>0)|0}br.mul=Math.imul||HO;function qO(r,e){return r+e|0}br.add=qO;function GO(r,e){return r-e|0}br.sub=GO;function zO(r,e){return r<<e|r>>>32-e}br.rotl=zO;function KO(r,e){return r<<32-e|r>>>e}br.rotr=KO;function VO(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r}br.isInteger=Number.isInteger||VO;br.MAX_SAFE_INTEGER=9007199254740991;br.isSafeInteger=function(r){return br.isInteger(r)&&r>=-br.MAX_SAFE_INTEGER&&r<=br.MAX_SAFE_INTEGER}});var o4=P(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});var t4=e4();function $O(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}Pe.readInt16BE=$O;function JO(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}Pe.readUint16BE=JO;function QO(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}Pe.readInt16LE=QO;function WO(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}Pe.readUint16LE=WO;function r4(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>8,e[t+1]=r>>>0,e}Pe.writeUint16BE=r4;Pe.writeInt16BE=r4;function n4(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e}Pe.writeUint16LE=n4;Pe.writeInt16LE=n4;function fb(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}Pe.readInt32BE=fb;function db(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}Pe.readUint32BE=db;function hb(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}Pe.readInt32LE=hb;function pb(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}Pe.readUint32LE=pb;function of(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>24,e[t+1]=r>>>16,e[t+2]=r>>>8,e[t+3]=r>>>0,e}Pe.writeUint32BE=of;Pe.writeInt32BE=of;function af(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24,e}Pe.writeUint32LE=af;Pe.writeInt32LE=af;function YO(r,e){e===void 0&&(e=0);var t=fb(r,e),n=fb(r,e+4);return t*4294967296+n-(n>>31)*4294967296}Pe.readInt64BE=YO;function ZO(r,e){e===void 0&&(e=0);var t=db(r,e),n=db(r,e+4);return t*4294967296+n}Pe.readUint64BE=ZO;function XO(r,e){e===void 0&&(e=0);var t=hb(r,e),n=hb(r,e+4);return n*4294967296+t-(t>>31)*4294967296}Pe.readInt64LE=XO;function eS(r,e){e===void 0&&(e=0);var t=pb(r,e),n=pb(r,e+4);return n*4294967296+t}Pe.readUint64LE=eS;function s4(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),of(r/4294967296>>>0,e,t),of(r>>>0,e,t+4),e}Pe.writeUint64BE=s4;Pe.writeInt64BE=s4;function i4(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),af(r>>>0,e,t),af(r/4294967296>>>0,e,t+4),e}Pe.writeUint64LE=i4;Pe.writeInt64LE=i4;function tS(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,s=1,i=r/8+t-1;i>=t;i--)n+=e[i]*s,s*=256;return n}Pe.readUintBE=tS;function rS(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,s=1,i=t;i<t+r/8;i++)n+=e[i]*s,s*=256;return n}Pe.readUintLE=rS;function nS(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!t4.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var s=1,i=r/8+n-1;i>=n;i--)t[i]=e/s&255,s*=256;return t}Pe.writeUintBE=nS;function sS(r,e,t,n){if(t===void 0&&(t=new Uint8Array(r/8)),n===void 0&&(n=0),r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!t4.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var s=1,i=n;i<n+r/8;i++)t[i]=e/s&255,s*=256;return t}Pe.writeUintLE=sS;function iS(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e)}Pe.readFloat32BE=iS;function oS(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat32(e,!0)}Pe.readFloat32LE=oS;function aS(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e)}Pe.readFloat64BE=aS;function cS(r,e){e===void 0&&(e=0);var t=new DataView(r.buffer,r.byteOffset,r.byteLength);return t.getFloat64(e,!0)}Pe.readFloat64LE=cS;function uS(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r),e}Pe.writeFloat32BE=uS;function lS(r,e,t){e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(t,r,!0),e}Pe.writeFloat32LE=lS;function fS(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r),e}Pe.writeFloat64BE=fS;function dS(r,e,t){e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(t,r,!0),e}Pe.writeFloat64LE=dS});var l4=P(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.randomStringForEntropy=Dt.randomString=Dt.randomUint32=Dt.randomBytes=Dt.defaultRandomSource=void 0;var hS=X6(),pS=o4(),a4=cb();Dt.defaultRandomSource=new hS.SystemRandomSource;function gb(r,e=Dt.defaultRandomSource){return e.randomBytes(r)}Dt.randomBytes=gb;function gS(r=Dt.defaultRandomSource){let e=gb(4,r),t=(0,pS.readUint32LE)(e);return(0,a4.wipe)(e),t}Dt.randomUint32=gS;var c4="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function u4(r,e=c4,t=Dt.defaultRandomSource){if(e.length<2)throw new Error("randomString charset is too short");if(e.length>256)throw new Error("randomString charset is too long");let n="",s=e.length,i=256-256%s;for(;r>0;){let o=gb(Math.ceil(r*256/i),t);for(let a=0;a<o.length&&r>0;a++){let c=o[a];c<i&&(n+=e.charAt(c%s),r--)}(0,a4.wipe)(o)}return n}Dt.randomString=u4;function bS(r,e=c4,t=Dt.defaultRandomSource){let n=Math.ceil(r/(Math.log(e.length)/Math.LN2));return u4(n,e,t)}Dt.randomStringForEntropy=bS});var bb=P(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.checkInvalidKeys=vn.isValidISO8601Date=vn.generateNonce=vn.checkContractWalletSignature=void 0;var xS=l4(),mS=Xg(),yS=nb(),wS=["function isValidSignature(bytes32 _message, bytes _signature) public view returns (bytes4)"],AS="0x1626ba7e",f4=/^(?<date>[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01]))[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(.[0-9]+)?(([Zz])|([+|-]([01][0-9]|2[0-3]):[0-5][0-9]))$/,ES=async(r,e,t)=>{if(!t)return!1;let n=new mS.Contract(r.address,wS,t),s=(0,yS.hashMessage)(r.prepareMessage());return await n.isValidSignature(s,e)===AS};vn.checkContractWalletSignature=ES;var PS=()=>{let r=(0,xS.randomStringForEntropy)(96);if(!r||r.length<8)throw new Error("Error during nonce creation.");return r};vn.generateNonce=PS;var vS=r=>{let e=f4.exec(r);if(!e)return!1;let t=new Date(e.groups.date).toISOString(),n=f4.exec(t);return e.groups.date===n.groups.date};vn.isValidISO8601Date=vS;var _S=(r,e)=>{let t=[];return Object.keys(r).forEach(n=>{e.includes(n)||t.push(n)}),t};vn.checkInvalidKeys=_S});var d4=P(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});cf.SiweMessage=void 0;var xb=rm(),kS=nb(),or=ib(),hc=bb(),mb=class{constructor(e){if(typeof e=="string"){let t=new xb.ParsedMessage(e);this.scheme=t.scheme,this.domain=t.domain,this.address=t.address,this.statement=t.statement,this.uri=t.uri,this.version=t.version,this.nonce=t.nonce,this.issuedAt=t.issuedAt,this.expirationTime=t.expirationTime,this.notBefore=t.notBefore,this.requestId=t.requestId,this.chainId=t.chainId,this.resources=t.resources}else this.scheme=e?.scheme,this.domain=e.domain,this.address=e.address,this.statement=e?.statement,this.uri=e.uri,this.version=e.version,this.chainId=e.chainId,this.nonce=e.nonce,this.issuedAt=e?.issuedAt,this.expirationTime=e?.expirationTime,this.notBefore=e?.notBefore,this.requestId=e?.requestId,this.resources=e?.resources,typeof this.chainId=="string"&&(this.chainId=(0,xb.parseIntegerNumber)(this.chainId)),this.nonce=this.nonce||(0,hc.generateNonce)(),new xb.ParsedMessage(this.prepareMessage())}toMessage(){let t=`${this.scheme?`${this.scheme}://${this.domain}`:this.domain} wants you to sign in with your Ethereum account:`,n=`URI: ${this.uri}`,s=[t,this.address].join(`
|
|
539
|
+
`),i=`Version: ${this.version}`;this.nonce||(this.nonce=(0,hc.generateNonce)());let o="Chain ID: "+this.chainId||"1",a=`Nonce: ${this.nonce}`,c=[n,i,o,a];if(this.issuedAt=this.issuedAt||new Date().toISOString(),c.push(`Issued At: ${this.issuedAt}`),this.expirationTime){let l=`Expiration Time: ${this.expirationTime}`;c.push(l)}this.notBefore&&c.push(`Not Before: ${this.notBefore}`),this.requestId&&c.push(`Request ID: ${this.requestId}`),this.resources&&c.push(["Resources:",...this.resources.map(l=>`- ${l}`)].join(`
|
|
540
|
+
`));let u=c.join(`
|
|
541
|
+
`);return s=[s,this.statement].join(`
|
|
542
|
+
|
|
543
|
+
`),this.statement!==void 0&&(s+=`
|
|
544
|
+
`),[s,u].join(`
|
|
545
|
+
`)}prepareMessage(){let e;switch(this.version){case"1":{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}async verify(e,t={suppressExceptions:!1}){return new Promise((n,s)=>{var i,o,a;let c=_=>t.suppressExceptions?n(_):s(_),u=(0,hc.checkInvalidKeys)(e,or.VerifyParamsKeys);u.length>0&&c({success:!1,data:this,error:new Error(`${u.join(", ")} is/are not valid key(s) for VerifyParams.`)});let l=(0,hc.checkInvalidKeys)(t,or.VerifyOptsKeys);l.length>0&&c({success:!1,data:this,error:new Error(`${l.join(", ")} is/are not valid key(s) for VerifyOpts.`)});let{signature:f,scheme:h,domain:g,nonce:x,time:b}=e;h&&h!==this.scheme&&c({success:!1,data:this,error:new or.SiweError(or.SiweErrorType.SCHEME_MISMATCH,h,this.scheme)}),g&&g!==this.domain&&c({success:!1,data:this,error:new or.SiweError(or.SiweErrorType.DOMAIN_MISMATCH,g,this.domain)}),x&&x!==this.nonce&&c({success:!1,data:this,error:new or.SiweError(or.SiweErrorType.NONCE_MISMATCH,x,this.nonce)});let y=new Date(b||new Date);if(this.expirationTime){let _=new Date(this.expirationTime);y.getTime()>=_.getTime()&&c({success:!1,data:this,error:new or.SiweError(or.SiweErrorType.EXPIRED_MESSAGE,`${y.toISOString()} < ${_.toISOString()}`,`${y.toISOString()} >= ${_.toISOString()}`)})}if(this.notBefore){let _=new Date(this.notBefore);y.getTime()<_.getTime()&&c({success:!1,data:this,error:new or.SiweError(or.SiweErrorType.NOT_YET_VALID_MESSAGE,`${y.toISOString()} >= ${_.toISOString()}`,`${y.toISOString()} < ${_.toISOString()}`)})}let m;try{m=this.prepareMessage()}catch(_){c({success:!1,data:this,error:_})}let E;try{E=(0,kS.verifyMessage)(m,f)}catch(_){console.error(_)}if(E===this.address)return n({success:!0,data:this});{let _=(0,hc.checkContractWalletSignature)(this,f,t.provider).then(C=>C?{success:!0,data:this}:{success:!1,data:this,error:new or.SiweError(or.SiweErrorType.INVALID_SIGNATURE,E,`Resolved address to be ${this.address}`)}).catch(C=>({success:!1,data:this,error:C}));Promise.all([_,(a=(o=(i=t?.verificationFallback)===null||i===void 0?void 0:i.call(t,e,t,this,_))===null||o===void 0?void 0:o.then(C=>C))===null||a===void 0?void 0:a.catch(C=>C)]).then(([C,L])=>{if(L){if(L.success)return n(L);c(L)}else{if(C.success)return n(C);c(C)}})}})}};cf.SiweMessage=mb});var h4=P(Dn=>{"use strict";var TS=Dn&&Dn.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,s)}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),yb=Dn&&Dn.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&TS(e,r,t)};Object.defineProperty(Dn,"__esModule",{value:!0});yb(d4(),Dn);yb(ib(),Dn);yb(bb(),Dn)});var OS={};uf(OS,{default:()=>BS});var p4=_b(Bb()),g4=_b(h4());var Ab={};uf(Ab,{SiwePayloadMethod:()=>wb});var wb=(n=>(n.GenerateNonce="magic_siwe_generate_nonce",n.GenerateMessage="magic_siwe_generate_message",n.Login="magic_auth_login_with_siwe",n))(wb||{});var pc=class extends p4.Extension.Internal{name="siwe";config={};constructor(){super()}async generateNonce(e){let t=this.utils.createJsonRpcRequestPayload("magic_siwe_generate_nonce",[e]);return this.request(t)}async generateMessage(e){let t=await this.generateNonce({address:e.address});return new g4.SiweMessage({scheme:window.location.protocol.slice(0,-1),domain:window.location.host,address:e.address,statement:e.statement||"By signing, you are proving you own this wallet and logging in.",uri:window.location.origin,version:"1",chainId:e.chainId||1,nonce:t}).prepareMessage()}async login(e){let t=this.utils.createJsonRpcRequestPayload("magic_auth_login_with_siwe",[e]);return this.request(t)}};Object.assign(pc,{...Ab});var BS=pc;return kb(OS);})();
|
|
546
|
+
if (MagicSiweExtension && MagicSiweExtension.default != null) { MagicSiweExtension = Object.assign(MagicSiweExtension.default, MagicSiweExtension); delete MagicSiweExtension.default; }
|