@nodefortress/cc-snap 0.1.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/README.md +3 -0
- package/dist/bundle.js +2 -0
- package/dist/bundle.js.map +1 -0
- package/images/icon.svg +24 -0
- package/locales/RULES.md +24 -0
- package/locales/en.json +164 -0
- package/locales/fr.json +164 -0
- package/package.json +104 -0
- package/snap.manifest.json +46 -0
package/dist/bundle.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(()=>{var e,t,r={8246:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AbiCoder:()=>re,ConstructorFragment:()=>A,ErrorFragment:()=>S,EventFragment:()=>m,FormatTypes:()=>h,Fragment:()=>y,FunctionFragment:()=>_,Indexed:()=>fe,Interface:()=>he,LogDescription:()=>oe,ParamType:()=>b,TransactionDescription:()=>ce,checkResultErrors:()=>O,defaultAbiCoder:()=>ne});var n=r(9674),a=r(2428),i=r(7587);const s="abi/5.7.0",o=new i.Logger(s),c={};let d={calldata:!0,memory:!0,storage:!0},f={calldata:!0,memory:!0};function u(e,t){if("bytes"===e||"string"===e){if(d[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&f[t])return!0;return(d[t]||"payable"===t)&&o.throwArgumentError("invalid modifier","name",t),!1}function l(e,t){for(let r in t)(0,a.defineReadOnly)(e,r,t[r])}const h=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),p=new RegExp(/^(.*)\[([0-9]*)\]$/);class b{constructor(e,t){e!==c&&o.throwError("use fromString",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),l(this,t);let r=this.type.match(p);l(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:b.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=h.sighash),h[e]||o.throwArgumentError("invalid format type","format",e),e===h.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==h.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===h.full?", ":",")+")"):t+=this.type,e!==h.sighash&&(!0===this.indexed&&(t+=" indexed"),e===h.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?b.fromString(e,t):b.fromObject(e)}static fromObject(e){return b.isParamType(e)?e:new b(c,{name:e.name||null,type:I(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(b.fromObject):null})}static fromString(e,t){return r=function(e,t){let r=e;function n(t){o.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function a(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let i={type:"",name:"",state:{allowType:!0}},s=i;for(let r=0;r<e.length;r++){let i=e[r];switch(i){case"(":s.state.allowType&&""===s.type?s.type="tuple":s.state.allowParams||n(r),s.state.allowType=!1,s.type=I(s.type),s.components=[a(s)],s=s.components[0];break;case")":delete s.state,"indexed"===s.name&&(t||n(r),s.indexed=!0,s.name=""),u(s.type,s.name)&&(s.name=""),s.type=I(s.type);let e=s;s=s.parent,s||n(r),delete e.parent,s.state.allowParams=!1,s.state.allowName=!0,s.state.allowArray=!0;break;case",":delete s.state,"indexed"===s.name&&(t||n(r),s.indexed=!0,s.name=""),u(s.type,s.name)&&(s.name=""),s.type=I(s.type);let o=a(s.parent);s.parent.components.push(o),delete s.parent,s=o;break;case" ":s.state.allowType&&""!==s.type&&(s.type=I(s.type),delete s.state.allowType,s.state.allowName=!0,s.state.allowParams=!0),s.state.allowName&&""!==s.name&&("indexed"===s.name?(t||n(r),s.indexed&&n(r),s.indexed=!0,s.name=""):u(s.type,s.name)?s.name="":s.state.allowName=!1);break;case"[":s.state.allowArray||n(r),s.type+=i,s.state.allowArray=!1,s.state.allowName=!1,s.state.readArray=!0;break;case"]":s.state.readArray||n(r),s.type+=i,s.state.readArray=!1,s.state.allowArray=!0,s.state.allowName=!0;break;default:s.state.allowType?(s.type+=i,s.state.allowParams=!0,s.state.allowArray=!0):s.state.allowName?(s.name+=i,delete s.state.allowArray):s.state.readArray?s.type+=i:n(r)}}return s.parent&&o.throwArgumentError("unexpected eof","param",e),delete i.state,"indexed"===s.name?(t||n(r.length-7),s.indexed&&n(r.length-7),s.indexed=!0,s.name=""):u(s.type,s.name)&&(s.name=""),i.type=I(i.type),i}(e,!!t),b.fromObject({name:r.name,type:r.type,indexed:r.indexed,components:r.components});var r}static isParamType(e){return!(null==e||!e._isParamType)}}function g(e,t){return function(e){e=e.trim();let t=[],r="",n=0;for(let a=0;a<e.length;a++){let i=e[a];","===i&&0===n?(t.push(r),r=""):(r+=i,"("===i?n++:")"===i&&(n--,-1===n&&o.throwArgumentError("unbalanced parenthesis","value",e)))}r&&t.push(r);return t}(e).map((e=>b.fromString(e,t)))}class y{constructor(e,t){e!==c&&o.throwError("use a static from method",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),l(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return y.isFragment(e)?e:"string"==typeof e?y.fromString(e):y.fromObject(e)}static fromObject(e){if(y.isFragment(e))return e;switch(e.type){case"function":return _.fromObject(e);case"event":return m.fromObject(e);case"constructor":return A.fromObject(e);case"error":return S.fromObject(e);case"fallback":case"receive":return null}return o.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?m.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?_.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?A.fromString(e.trim()):"error"===e.split(" ")[0]?S.fromString(e.substring(5).trim()):o.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class m extends y{format(e){if(e||(e=h.sighash),h[e]||o.throwArgumentError("invalid format type","format",e),e===h.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==h.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===h.full?", ":",")+") ",e!==h.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?m.fromString(e):m.fromObject(e)}static fromObject(e){if(m.isEventFragment(e))return e;"event"!==e.type&&o.throwArgumentError("invalid event object","value",e);const t={name:C(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(b.fromObject):[],type:"event"};return new m(c,t)}static fromString(e){let t=e.match(T);t||o.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:o.warn("unknown modifier: "+e)}})),m.fromObject({name:t[1].trim(),anonymous:r,inputs:g(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function w(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&o.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||o.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=n.gH.from(r[1]),r[0]):e}function v(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function E(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&o.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&o.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||o.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&o.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&o.throwArgumentError("unable to determine stateMutability","value",e),t}class A extends y{format(e){if(e||(e=h.sighash),h[e]||o.throwArgumentError("invalid format type","format",e),e===h.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===h.sighash&&o.throwError("cannot format a constructor for sighash",i.Logger.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===h.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?A.fromString(e):A.fromObject(e)}static fromObject(e){if(A.isConstructorFragment(e))return e;"constructor"!==e.type&&o.throwArgumentError("invalid constructor object","value",e);let t=E(e);t.constant&&o.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(b.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?n.gH.from(e.gas):null};return new A(c,r)}static fromString(e){let t={type:"constructor"},r=(e=w(e,t)).match(T);return r&&"constructor"===r[1].trim()||o.throwArgumentError("invalid constructor string","value",e),t.inputs=g(r[2].trim(),!1),v(r[3].trim(),t),A.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class _ extends A{format(e){if(e||(e=h.sighash),h[e]||o.throwArgumentError("invalid format type","format",e),e===h.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==h.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===h.full?", ":",")+") ",e!==h.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?_.fromString(e):_.fromObject(e)}static fromObject(e){if(_.isFunctionFragment(e))return e;"function"!==e.type&&o.throwArgumentError("invalid function object","value",e);let t=E(e);const r={type:e.type,name:C(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(b.fromObject):[],outputs:e.outputs?e.outputs.map(b.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?n.gH.from(e.gas):null};return new _(c,r)}static fromString(e){let t={type:"function"},r=(e=w(e,t)).split(" returns ");r.length>2&&o.throwArgumentError("invalid function string","value",e);let n=r[0].match(T);if(n||o.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&C(t.name),t.inputs=g(n[2],!1),v(n[3].trim(),t),r.length>1){let n=r[1].match(T);""==n[1].trim()&&""==n[3].trim()||o.throwArgumentError("unexpected tokens","value",e),t.outputs=g(n[2],!1)}else t.outputs=[];return _.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function x(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||o.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class S extends y{format(e){if(e||(e=h.sighash),h[e]||o.throwArgumentError("invalid format type","format",e),e===h.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==h.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===h.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?S.fromString(e):S.fromObject(e)}static fromObject(e){if(S.isErrorFragment(e))return e;"error"!==e.type&&o.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:C(e.name),inputs:e.inputs?e.inputs.map(b.fromObject):[]};return x(new S(c,t))}static fromString(e){let t={type:"error"},r=e.match(T);return r||o.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&C(t.name),t.inputs=g(r[2],!1),x(S.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function I(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const k=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function C(e){return e&&e.match(k)||o.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const T=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");var B=r(5372);const M=new i.Logger(s);function O(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let a in n){const i=e.slice();i.push(a);try{r(i,n[a])}catch(e){t.push({path:i,error:e})}}};return r([],e),t}class R{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){M.throwArgumentError(e,this.localName,t)}}class N{constructor(e){(0,a.defineReadOnly)(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return(0,B.hexConcat)(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData((0,B.concat)(e._data))}writeBytes(e){let t=(0,B.arrayify)(e);const r=t.length%this.wordSize;return r&&(t=(0,B.concat)([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=(0,B.arrayify)(n.gH.from(e));return t.length>this.wordSize&&M.throwError("value out-of-bounds",i.Logger.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=(0,B.concat)([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class P{constructor(e,t,r,n){(0,a.defineReadOnly)(this,"_data",(0,B.arrayify)(e)),(0,a.defineReadOnly)(this,"wordSize",t||32),(0,a.defineReadOnly)(this,"_coerceFunc",r),(0,a.defineReadOnly)(this,"allowLoose",n),this._offset=0}get data(){return(0,B.hexlify)(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):P.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:M.throwError("data out-of-bounds",i.Logger.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new P(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return n.gH.from(this.readBytes(this.wordSize))}}var L=r(1277);class F extends R{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=(0,L.getAddress)(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return(0,L.getAddress)((0,B.hexZeroPad)(e.readValue().toHexString(),20))}}class D extends R{constructor(e){super(e.name,e.type,void 0,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)}}const U=new i.Logger(s);function H(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map((t=>{const n=t.localName;return n||U.throwError("cannot encode object for signature with missing names",i.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&U.throwError("cannot encode object for signature with duplicate names",i.Logger.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else U.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&U.throwArgumentError("types/value length mismatch","tuple",r);let a=new N(e.wordSize),s=new N(e.wordSize),o=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=s.length;e.encode(s,r);let n=a.writeUpdatableValue();o.push((e=>{n(e+t)}))}else e.encode(a,r)})),o.forEach((e=>{e(a.length)}));let c=e.appendWriter(a);return c+=e.appendWriter(s),c}function j(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let a=null;if(t.dynamic){let r=e.readValue(),s=n.subReader(r.toNumber());try{a=t.decode(s)}catch(e){if(e.code===i.Logger.errors.BUFFER_OVERRUN)throw e;a=e,a.baseType=t.name,a.name=t.localName,a.type=t.type}}else try{a=t.decode(e)}catch(e){if(e.code===i.Logger.errors.BUFFER_OVERRUN)throw e;a=e,a.baseType=t.name,a.name=t.localName,a.type=t.type}null!=a&&r.push(a)}));const a=t.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach(((e,t)=>{let n=e.localName;if(!n||1!==a[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const i=r[t];i instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw i}}):r[n]=i}));for(let e=0;e<r.length;e++){const t=r[e];t instanceof Error&&Object.defineProperty(r,e,{enumerable:!0,get:()=>{throw t}})}return Object.freeze(r)}class V extends R{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;r<this.length;r++)t.push(e);return t}encode(e,t){Array.isArray(t)||this._throwError("expected array value",t);let r=this.length;-1===r&&(r=t.length,e.writeValue(t.length)),U.checkArgumentCount(t.length,r,"coder array"+(this.localName?" "+this.localName:""));let n=[];for(let e=0;e<t.length;e++)n.push(this.coder);return H(e,n,t)}decode(e){let t=this.length;-1===t&&(t=e.readValue().toNumber(),32*t>e._data.length&&U.throwError("insufficient data length",i.Logger.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let e=0;e<t;e++)r.push(new D(this.coder));return e.coerce(this.name,j(e,r))}}class $ extends R{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){return e.writeValue(t?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}}class z extends R{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=(0,B.arrayify)(t);let r=e.writeValue(t.length);return r+=e.writeBytes(t),r}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class q extends z{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,(0,B.hexlify)(super.decode(e)))}}class K extends R{constructor(e,t){let r="bytes"+String(e);super(r,r,t,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let r=(0,B.arrayify)(t);return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}decode(e){return e.coerce(this.name,(0,B.hexlify)(e.readBytes(this.size)))}}class G extends R{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}}var J=r(2899);class W extends R{constructor(e,t,r){const n=(t?"int":"uint")+8*e;super(n,n,r,!1),this.size=e,this.signed=t}defaultValue(){return 0}encode(e,t){let r=n.gH.from(t),a=J.Is.mask(8*e.wordSize);if(this.signed){let e=a.mask(8*this.size-1);(r.gt(e)||r.lt(e.add(J.pD).mul(J.eR)))&&this._throwError("value out-of-bounds",t)}else(r.lt(J.XK)||r.gt(a.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(r)}decode(e){let t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}}var Y=r(7867);class Z extends z{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,(0,Y.YW)(t))}decode(e){return(0,Y._v)(super.decode(e))}}class X extends R{constructor(e,t){let r=!1;const n=[];e.forEach((e=>{e.dynamic&&(r=!0),n.push(e.type)}));super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let a=r.localName;a&&1===t[a]&&("length"===a&&(a="_length"),null==e[a]&&(e[a]=e[n]))})),Object.freeze(e)}encode(e,t){return H(e,this.coders,t)}decode(e){return e.coerce(this.name,j(e,this.coders))}}const Q=new i.Logger(s),ee=new RegExp(/^bytes([0-9]*)$/),te=new RegExp(/^(u?int)([0-9]*)$/);class re{constructor(e){(0,a.defineReadOnly)(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new F(e.name);case"bool":return new $(e.name);case"string":return new Z(e.name);case"bytes":return new q(e.name);case"array":return new V(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new X((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new G(e.name)}let t=e.type.match(te);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&Q.throwArgumentError("invalid "+t[1]+" bit length","param",e),new W(r/8,"int"===t[1],e.name)}if(t=e.type.match(ee),t){let r=parseInt(t[1]);return(0===r||r>32)&&Q.throwArgumentError("invalid bytes length","param",e),new K(r,e.name)}return Q.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new P(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new N(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(b.from(e))));return new X(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&Q.throwError("types/values length mismatch",i.Logger.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder(b.from(e)))),n=new X(r,"_"),a=this._getWriter();return n.encode(a,t),a.data}decode(e,t,r){const n=e.map((e=>this._getCoder(b.from(e))));return new X(n,"_").decode(this._getReader((0,B.arrayify)(t),r))}}const ne=new re;var ae=r(1507),ie=r(9729);const se=new i.Logger(s);class oe extends a.Description{}class ce extends a.Description{}class de extends a.Description{}class fe extends a.Description{static isIndexed(e){return!(!e||!e._isIndexed)}}const ue={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function le(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class he{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,(0,a.defineReadOnly)(this,"fragments",t.map((e=>y.from(e))).filter((e=>null!=e))),(0,a.defineReadOnly)(this,"_abiCoder",(0,a.getStatic)(new.target,"getAbiCoder")()),(0,a.defineReadOnly)(this,"functions",{}),(0,a.defineReadOnly)(this,"errors",{}),(0,a.defineReadOnly)(this,"events",{}),(0,a.defineReadOnly)(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void se.warn("duplicate definition - constructor"):void(0,a.defineReadOnly)(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();t[r]?se.warn("duplicate definition - "+r):t[r]=e})),this.deploy||(0,a.defineReadOnly)(this,"deploy",A.from({payable:!1,type:"constructor"})),(0,a.defineReadOnly)(this,"_isInterface",!0)}format(e){e||(e=h.full),e===h.sighash&&se.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===h.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return ne}static getAddress(e){return(0,L.getAddress)(e)}static getSighash(e){return(0,B.hexDataSlice)((0,ae.id)(e.format()),0,4)}static getEventTopic(e){return(0,ae.id)(e.format())}getFunction(e){if((0,B.isHexString)(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];se.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===r.length?se.throwArgumentError("no matching function","name",t):r.length>1&&se.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[_.fromString(e).format()];return t||se.throwArgumentError("no matching function","signature",e),t}getEvent(e){if((0,B.isHexString)(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];se.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===r.length?se.throwArgumentError("no matching event","name",t):r.length>1&&se.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[m.fromString(e).format()];return t||se.throwArgumentError("no matching event","signature",e),t}getError(e){if((0,B.isHexString)(e)){const t=(0,a.getStatic)(this.constructor,"getSighash");for(const r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}se.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===r.length?se.throwArgumentError("no matching error","name",t):r.length>1&&se.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[_.fromString(e).format()];return t||se.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return(0,a.getStatic)(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),(0,a.getStatic)(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const r=(0,B.arrayify)(t);return(0,B.hexlify)(r.slice(0,4))!==this.getSighash(e)&&se.throwArgumentError(`data signature does not match error ${e.name}.`,"data",(0,B.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),(0,B.hexlify)((0,B.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=(0,B.arrayify)(t);return(0,B.hexlify)(r.slice(0,4))!==this.getSighash(e)&&se.throwArgumentError(`data signature does not match function ${e.name}.`,"data",(0,B.hexlify)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),(0,B.hexlify)((0,B.concat)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=(0,B.arrayify)(t),n=null,a="",s=null,o=null,c=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:{const e=(0,B.hexlify)(r.slice(0,4)),t=ue[e];if(t)s=this._abiCoder.decode(t.inputs,r.slice(4)),o=t.name,c=t.signature,t.reason&&(n=s[0]),"Error"===o?a=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(s[0])}`:"Panic"===o&&(a=`; VM Exception while processing transaction: reverted with panic code ${s[0]}`);else try{const t=this.getError(e);s=this._abiCoder.decode(t.inputs,r.slice(4)),o=t.name,c=t.format()}catch(e){}break}}return se.throwError("call revert exception"+a,i.Logger.errors.CALL_EXCEPTION,{method:e.format(),data:(0,B.hexlify)(t),errorArgs:s,errorName:o,errorSignature:c,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),(0,B.hexlify)(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&se.throwError("too many arguments for "+e.format(),i.Logger.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const a=(e,t)=>"string"===e.type?(0,ae.id)(t):"bytes"===e.type?(0,ie.keccak256)((0,B.hexlify)(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=n.gH.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),(0,B.hexZeroPad)((0,B.hexlify)(t),32));for(t.forEach(((t,n)=>{let i=e.inputs[n];i.indexed?null==t?r.push(null):"array"===i.baseType||"tuple"===i.baseType?se.throwArgumentError("filtering with tuples or arrays not supported","contract."+i.name,t):Array.isArray(t)?r.push(t.map((e=>a(i,e)))):r.push(a(i,t)):null!=t&&se.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+i.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const r=[],n=[],a=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&se.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,i)=>{const s=t[i];if(e.indexed)if("string"===e.type)r.push((0,ae.id)(s));else if("bytes"===e.type)r.push((0,ie.keccak256)(s));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[s]))}else n.push(e),a.push(s)})),{data:this._abiCoder.encode(n,a),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);(0,B.isHexString)(r[0],32)&&r[0].toLowerCase()===t||se.throwError("fragment/topic mismatch",i.Logger.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],a=[],s=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(b.fromObject({type:"bytes32",name:e.name})),s.push(!0)):(n.push(e),s.push(!1)):(a.push(e),s.push(!1))}));let o=null!=r?this._abiCoder.decode(n,(0,B.concat)(r)):null,c=this._abiCoder.decode(a,t,!0),d=[],f=0,u=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==o)d[t]=new fe({_isIndexed:!0,hash:null});else if(s[t])d[t]=new fe({_isIndexed:!0,hash:o[u++]});else try{d[t]=o[u++]}catch(e){d[t]=e}else try{d[t]=c[f++]}catch(e){d[t]=e}if(e.name&&null==d[e.name]){const r=d[t];r instanceof Error?Object.defineProperty(d,e.name,{enumerable:!0,get:()=>{throw le(`property ${JSON.stringify(e.name)}`,r)}}):d[e.name]=r}}));for(let e=0;e<d.length;e++){const t=d[e];t instanceof Error&&Object.defineProperty(d,e,{enumerable:!0,get:()=>{throw le(`index ${e}`,t)}})}return Object.freeze(d)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new ce({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:n.gH.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new oe({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=(0,B.hexlify)(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new de({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!(!e||!e._isInterface)}}},1277:(e,t,r)=>{"use strict";r.r(t),r.d(t,{getAddress:()=>h,getContractAddress:()=>g,getCreate2Address:()=>y,getIcapAddress:()=>b,isAddress:()=>p});var n=r(5372),a=r(9674),i=r(9729),s=r(5205);const o=new(r(7587).Logger)("address/5.7.0");function c(e){(0,n.isHexString)(e,20)||o.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const a=(0,n.arrayify)((0,i.keccak256)(r));for(let e=0;e<40;e+=2)a[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&a[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}const d={};for(let e=0;e<10;e++)d[String(e)]=String(e);for(let e=0;e<26;e++)d[String.fromCharCode(65+e)]=String(10+e);const f=Math.floor((u=9007199254740991,Math.log10?Math.log10(u):Math.log(u)/Math.LN10));var u;function l(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>d[e])).join("");for(;t.length>=f;){let e=t.substring(0,f);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}function h(e){let t=null;if("string"!=typeof e&&o.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=c(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&o.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==l(e)&&o.throwArgumentError("bad icap checksum","address",e),t=(0,a.Os)(e.substring(4));t.length<40;)t="0"+t;t=c("0x"+t)}else o.throwArgumentError("invalid address","address",e);return t}function p(e){try{return h(e),!0}catch(e){}return!1}function b(e){let t=(0,a.ii)(h(e).substring(2)).toUpperCase();for(;t.length<30;)t="0"+t;return"XE"+l("XE00"+t)+t}function g(e){let t=null;try{t=h(e.from)}catch(t){o.throwArgumentError("missing from address","transaction",e)}const r=(0,n.stripZeros)((0,n.arrayify)(a.gH.from(e.nonce).toHexString()));return h((0,n.hexDataSlice)((0,i.keccak256)((0,s.encode)([t,r])),12))}function y(e,t,r){return 32!==(0,n.hexDataLength)(t)&&o.throwArgumentError("salt must be 32 bytes","salt",t),32!==(0,n.hexDataLength)(r)&&o.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),h((0,n.hexDataSlice)((0,i.keccak256)((0,n.concat)(["0xff",h(e),t,r])),12))}},976:(e,t,r)=>{"use strict";r.d(t,{D:()=>a,l:()=>i});var n=r(5372);function a(e){e=atob(e);const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));return(0,n.arrayify)(t)}function i(e){e=(0,n.arrayify)(e);let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}},7423:(e,t,r)=>{"use strict";r.r(t),r.d(t,{decode:()=>n.D,encode:()=>n.l});var n=r(976)},6593:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Base32:()=>s,Base58:()=>o,BaseX:()=>i});var n=r(5372),a=r(2428);class i{constructor(e){(0,a.defineReadOnly)(this,"alphabet",e),(0,a.defineReadOnly)(this,"base",e.length),(0,a.defineReadOnly)(this,"_alphabetMap",{}),(0,a.defineReadOnly)(this,"_leader",e.charAt(0));for(let t=0;t<e.length;t++)this._alphabetMap[e.charAt(t)]=t}encode(e){let t=(0,n.arrayify)(e);if(0===t.length)return"";let r=[0];for(let e=0;e<t.length;++e){let n=t[e];for(let e=0;e<r.length;++e)n+=r[e]<<8,r[e]=n%this.base,n=n/this.base|0;for(;n>0;)r.push(n%this.base),n=n/this.base|0}let a="";for(let e=0;0===t[e]&&e<t.length-1;++e)a+=this._leader;for(let e=r.length-1;e>=0;--e)a+=this.alphabet[r[e]];return a}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r<e.length;r++){let n=this._alphabetMap[e[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");let a=n;for(let e=0;e<t.length;++e)a+=t[e]*this.base,t[e]=255&a,a>>=8;for(;a>0;)t.push(255&a),a>>=8}for(let r=0;e[r]===this._leader&&r<e.length-1;++r)t.push(0);return(0,n.arrayify)(new Uint8Array(t.reverse()))}}const s=new i("abcdefghijklmnopqrstuvwxyz234567"),o=new i("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},3894:(e,t,r)=>{"use strict";r.d(t,{r:()=>n});const n="bignumber/5.7.0"},9674:(e,t,r)=>{"use strict";r.d(t,{Os:()=>w,YR:()=>l,gH:()=>p,ii:()=>v});var n=r(2823),a=r.n(n),i=r(5372),s=r(7587),o=r(3894),c=a().BN;const d=new s.Logger(o.r),f={},u=9007199254740991;function l(e){return null!=e&&(p.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||(0,i.isHexString)(e)||"bigint"==typeof e||(0,i.isBytes)(e))}let h=!1;class p{constructor(e,t){e!==f&&d.throwError("cannot call constructor directly; use BigNumber.from",s.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return g(y(this).fromTwos(e))}toTwos(e){return g(y(this).toTwos(e))}abs(){return"-"===this._hex[0]?p.from(this._hex.substring(1)):this}add(e){return g(y(this).add(y(e)))}sub(e){return g(y(this).sub(y(e)))}div(e){return p.from(e).isZero()&&m("division-by-zero","div"),g(y(this).div(y(e)))}mul(e){return g(y(this).mul(y(e)))}mod(e){const t=y(e);return t.isNeg()&&m("division-by-zero","mod"),g(y(this).umod(t))}pow(e){const t=y(e);return t.isNeg()&&m("negative-power","pow"),g(y(this).pow(t))}and(e){const t=y(e);return(this.isNegative()||t.isNeg())&&m("unbound-bitwise-result","and"),g(y(this).and(t))}or(e){const t=y(e);return(this.isNegative()||t.isNeg())&&m("unbound-bitwise-result","or"),g(y(this).or(t))}xor(e){const t=y(e);return(this.isNegative()||t.isNeg())&&m("unbound-bitwise-result","xor"),g(y(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&m("negative-width","mask"),g(y(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&m("negative-width","shl"),g(y(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&m("negative-width","shr"),g(y(this).shrn(e))}eq(e){return y(this).eq(y(e))}lt(e){return y(this).lt(y(e))}lte(e){return y(this).lte(y(e))}gt(e){return y(this).gt(y(e))}gte(e){return y(this).gte(y(e))}isNegative(){return"-"===this._hex[0]}isZero(){return y(this).isZero()}toNumber(){try{return y(this).toNumber()}catch(e){m("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return d.throwError("this platform does not support BigInt",s.Logger.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?h||(h=!0,d.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?d.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",s.Logger.errors.UNEXPECTED_ARGUMENT,{}):d.throwError("BigNumber.toString does not accept parameters",s.Logger.errors.UNEXPECTED_ARGUMENT,{})),y(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof p)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new p(f,b(e)):e.match(/^-?[0-9]+$/)?new p(f,b(new c(e))):d.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&m("underflow","BigNumber.from",e),(e>=u||e<=-u)&&m("overflow","BigNumber.from",e),p.from(String(e));const t=e;if("bigint"==typeof t)return p.from(t.toString());if((0,i.isBytes)(t))return p.from((0,i.hexlify)(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return p.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&((0,i.isHexString)(e)||"-"===e[0]&&(0,i.isHexString)(e.substring(1))))return p.from(e)}return d.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function b(e){if("string"!=typeof e)return b(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&d.throwArgumentError("invalid hex","value",e),"0x00"===(e=b(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function g(e){return p.from(b(e))}function y(e){const t=p.from(e).toHexString();return"-"===t[0]?new c("-"+t.substring(3),16):new c(t.substring(2),16)}function m(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),d.throwError(e,s.Logger.errors.NUMERIC_FAULT,n)}function w(e){return new c(e,36).toString(16)}function v(e){return new c(e,16).toString(36)}},5372:(e,t,r)=>{"use strict";r.r(t),r.d(t,{arrayify:()=>d,concat:()=>f,hexConcat:()=>m,hexDataLength:()=>g,hexDataSlice:()=>y,hexStripZeros:()=>v,hexValue:()=>w,hexZeroPad:()=>E,hexlify:()=>b,isBytes:()=>c,isBytesLike:()=>s,isHexString:()=>h,joinSignature:()=>_,splitSignature:()=>A,stripZeros:()=>u,zeroPad:()=>l});const n=new(r(7587).Logger)("bytes/5.7.0");function a(e){return!!e.toHexString}function i(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return i(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function s(e){return h(e)&&!(e.length%2)||c(e)}function o(e){return"number"==typeof e&&e==e&&e%1==0}function c(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!o(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!o(r)||r<0||r>=256)return!1}return!0}function d(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),i(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),a(e)&&(e=e.toHexString()),h(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":n.throwArgumentError("hex data is odd-length","value",e));const a=[];for(let e=0;e<r.length;e+=2)a.push(parseInt(r.substring(e,e+2),16));return i(new Uint8Array(a))}return c(e)?i(new Uint8Array(e)):n.throwArgumentError("invalid arrayify value","value",e)}function f(e){const t=e.map((e=>d(e))),r=t.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(r);return t.reduce(((e,t)=>(n.set(t,e),e+t.length)),0),i(n)}function u(e){let t=d(e);if(0===t.length)return t;let r=0;for(;r<t.length&&0===t[r];)r++;return r&&(t=t.slice(r)),t}function l(e,t){(e=d(e)).length>t&&n.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),i(r)}function h(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const p="0123456789abcdef";function b(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=p[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),a(e))return e.toHexString();if(h(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":n.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(c(e)){let t="0x";for(let r=0;r<e.length;r++){let n=e[r];t+=p[(240&n)>>4]+p[15&n]}return t}return n.throwArgumentError("invalid hexlify value","value",e)}function g(e){if("string"!=typeof e)e=b(e);else if(!h(e)||e.length%2)return null;return(e.length-2)/2}function y(e,t,r){return"string"!=typeof e?e=b(e):(!h(e)||e.length%2)&&n.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function m(e){let t="0x";return e.forEach((e=>{t+=b(e).substring(2)})),t}function w(e){const t=v(b(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function v(e){"string"!=typeof e&&(e=b(e)),h(e)||n.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t<e.length&&"0"===e[t];)t++;return"0x"+e.substring(t)}function E(e,t){for("string"!=typeof e?e=b(e):h(e)||n.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&n.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function A(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(s(e)){let r=d(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=b(r.slice(0,32)),t.s=b(r.slice(32,64))):65===r.length?(t.r=b(r.slice(0,32)),t.s=b(r.slice(32,64)),t.v=r[64]):n.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:n.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=b(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const r=l(d(t._vs),32);t._vs=b(r);const a=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=a:t.recoveryParam!==a&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const i=b(r);null==t.s?t.s=i:t.s!==i&&n.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?n.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&n.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&h(t.r)?t.r=E(t.r,32):n.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&h(t.s)?t.s=E(t.s,32):n.throwArgumentError("signature missing or invalid s","signature",e);const r=d(t.s);r[0]>=128&&n.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const a=b(r);t._vs&&(h(t._vs)||n.throwArgumentError("signature invalid _vs","signature",e),t._vs=E(t._vs,32)),null==t._vs?t._vs=a:t._vs!==a&&n.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function _(e){return b(f([(e=A(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},2899:(e,t,r)=>{"use strict";r.d(t,{Is:()=>o,XK:()=>i,eR:()=>a,pD:()=>s});var n=r(9674);const a=n.gH.from(-1),i=n.gH.from(0),s=n.gH.from(1),o=n.gH.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},2265:(e,t,r)=>{"use strict";r.d(t,{r:()=>n});const n="hash/5.7.0"},1507:(e,t,r)=>{"use strict";r.d(t,{id:()=>i});var n=r(9729),a=r(7867);function i(e){return(0,n.keccak256)((0,a.YW)(e))}},8677:(e,t,r)=>{"use strict";r.r(t),r.d(t,{_TypedDataEncoder:()=>U.z,dnsEncode:()=>F,ensNormalize:()=>N,hashMessage:()=>D.A,id:()=>n.id,isValidName:()=>P,messagePrefix:()=>D.o,namehash:()=>L});var n=r(1507),a=r(5372),i=r(7867),s=r(9729),o=r(7587),c=r(2265);function d(e,t){null==t&&(t=1);const r=[],n=r.forEach,a=function(e,t){n.call(e,(function(e){t>0&&Array.isArray(e)?a(e,t-1):r.push(e)}))};return a(e,t),r}function f(e){return function(e){let t=0;return()=>e[t++]}(function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),a=1,i=[0,1];for(let e=1;e<n;e++)i.push(a+=r());let s=r(),o=t;t+=s;let c=0,d=0;function f(){return 0==c&&(d=d<<8|e[t++],c=8),d>>--c&1}const u=Math.pow(2,31),l=u>>>1,h=l>>1,p=u-1;let b=0;for(let e=0;e<31;e++)b=b<<1|f();let g=[],y=0,m=u;for(;;){let e=Math.floor(((b-y+1)*a-1)/m),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e<i[n]?r=n:t=n}if(0==t)break;g.push(t);let s=y+Math.floor(m*i[t]/a),o=y+Math.floor(m*i[t+1]/a)-1;for(;!((s^o)&l);)b=b<<1&p|f(),s=s<<1&p,o=o<<1&p|1;for(;s&~o&h;)b=b&l|b<<1&p>>>1|f(),s=s<<1^l,o=(o^l)<<1|l|1;y=s,m=1+o-s}let w=n-4;return g.map((t=>{switch(t-w){case 3:return w+65792+(e[o++]<<16|e[o++]<<8|e[o++]);case 2:return w+256+(e[o++]<<8|e[o++]);case 1:return w+e[o++];default:return t-1}}))}(e))}function u(e){return 1&e?~e>>1:e>>1}function l(e,t){let r=Array(e);for(let n=0,a=-1;n<e;n++)r[n]=a+=1+t();return r}function h(e,t){let r=Array(e);for(let n=0,a=0;n<e;n++)r[n]=a+=u(t());return r}function p(e,t){let r=l(e(),e),n=e(),a=l(n,e),i=function(e,t){let r=Array(e);for(let n=0;n<e;n++)r[n]=1+t();return r}(n,e);for(let e=0;e<n;e++)for(let t=0;t<i[e];t++)r.push(a[e]+t);return t?r.map((e=>t[e])):r}function b(e,t,r){let n=Array(e).fill(void 0).map((()=>[]));for(let a=0;a<t;a++)h(e,r).forEach(((e,t)=>n[t].push(e)));return n}function g(e,t){let r=1+t(),n=t(),a=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return d(b(a.length,1+e,t).map(((e,t)=>{const i=e[0],s=e.slice(1);return Array(a[t]).fill(void 0).map(((e,t)=>{let a=t*n;return[i+t*r,s.map((e=>e+a))]}))})))}function y(e,t){return b(1+t(),1+e,t).map((e=>[e[0],e.slice(1)]))}const m=f((0,r(976).D)("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),w=new Set(p(m)),v=new Set(p(m)),E=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(g(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(y(r,e))}return function(e){const t={};for(let r=0;r<e.length;r++){const n=e[r];t[n[0]]=n[1]}return t}(d(t))}(m),A=function(e){let t=p(e).sort(((e,t)=>e-t));return function r(){let n=[];for(;;){let a=p(e,t);if(0==a.length)break;n.push({set:new Set(a),node:r()})}n.sort(((e,t)=>t.set.size-e.set.size));let a=e(),i=a%3;a=a/3|0;let s=!!(1&a);return a>>=1,{branches:n,valid:i,fe0f:s,save:1==a,check:2==a}}()}(m),_=45,x=95;function S(e){return(0,i.dg)(e)}function I(e){return e.filter((e=>65039!=e))}function k(e){for(let t of e.split(".")){let e=S(t);try{for(let t=e.lastIndexOf(x)-1;t>=0;t--)if(e[t]!==x)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===_&&e[3]===_)throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${t}": ${e.message}`)}}return e}function C(e){return k(function(e,t){let r=S(e).reverse(),n=[];for(;r.length;){let e=T(r);if(e){n.push(...t(e));continue}let a=r.pop();if(w.has(a)){n.push(a);continue}if(v.has(a))continue;let i=E[a];if(!i)throw new Error(`Disallowed codepoint: 0x${a.toString(16).toUpperCase()}`);n.push(...i)}return k((a=String.fromCodePoint(...n),a.normalize("NFC")));var a}(e,I))}function T(e,t){var r;let n,a,i=A,s=[],o=e.length;for(t&&(t.length=0);o;){let c=e[--o];if(i=null===(r=i.branches.find((e=>e.set.has(c))))||void 0===r?void 0:r.node,!i)break;if(i.save)a=c;else if(i.check&&c===a)break;s.push(c),i.fe0f&&(s.push(65039),o>0&&65039==e[o-1]&&o--),i.valid&&(n=s.slice(),2==i.valid&&n.splice(1,1),t&&t.push(...e.slice(o).reverse()),e.length=o)}return n}const B=new o.Logger(c.r),M=new Uint8Array(32);function O(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function R(e){const t=(0,i.YW)(C(e)),r=[];if(0===e.length)return r;let n=0;for(let e=0;e<t.length;e++){46===t[e]&&(r.push(O(t.slice(n,e))),n=e+1)}if(n>=t.length)throw new Error("invalid ENS name; empty component");return r.push(O(t.slice(n))),r}function N(e){return R(e).map((e=>(0,i._v)(e))).join(".")}function P(e){try{return 0!==R(e).length}catch(e){}return!1}function L(e){"string"!=typeof e&&B.throwArgumentError("invalid ENS name; not a string","name",e);let t=M;const r=R(e);for(;r.length;)t=(0,s.keccak256)((0,a.concat)([t,(0,s.keccak256)(r.pop())]));return(0,a.hexlify)(t)}function F(e){return(0,a.hexlify)((0,a.concat)(R(e).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"}M.fill(0);var D=r(2623),U=r(7273)},2623:(e,t,r)=>{"use strict";r.d(t,{A:()=>o,o:()=>s});var n=r(5372),a=r(9729),i=r(7867);const s="Ethereum Signed Message:\n";function o(e){return"string"==typeof e&&(e=(0,i.YW)(e)),(0,a.keccak256)((0,n.concat)([(0,i.YW)(s),(0,i.YW)(String(e.length)),e]))}},7273:(e,t,r)=>{"use strict";r.d(t,{z:()=>I});var n=r(1277),a=r(9674),i=r(5372),s=r(9729),o=r(2428),c=r(7587),d=r(2265),f=r(1507),u=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function o(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}c((n=n.apply(e,t||[])).next())}))};const l=new c.Logger(d.r),h=new Uint8Array(32);h.fill(0);const p=a.gH.from(-1),b=a.gH.from(0),g=a.gH.from(1),y=a.gH.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const m=(0,i.hexZeroPad)(g.toHexString(),32),w=(0,i.hexZeroPad)(b.toHexString(),32),v={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},E=["name","version","chainId","verifyingContract","salt"];function A(e){return function(t){return"string"!=typeof t&&l.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const _={name:A("name"),version:A("version"),chainId:function(e){try{return a.gH.from(e).toString()}catch(e){}return l.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return(0,n.getAddress)(e).toLowerCase()}catch(e){}return l.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=(0,i.arrayify)(e);if(32!==t.length)throw new Error("bad length");return(0,i.hexlify)(t)}catch(e){}return l.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function x(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&l.throwArgumentError("invalid numeric width","type",e);const s=y.mask(r?n-1:n),o=r?s.add(g).mul(p):b;return function(t){const r=a.gH.from(t);return(r.lt(o)||r.gt(s))&&l.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),(0,i.hexZeroPad)(r.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&l.throwArgumentError("invalid bytes width","type",e),function(t){return(0,i.arrayify)(t).length!==r&&l.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=(0,i.arrayify)(e),r=t.length%32;return r?(0,i.hexConcat)([t,h.slice(r)]):(0,i.hexlify)(t)}(t)}}}switch(e){case"address":return function(e){return(0,i.hexZeroPad)((0,n.getAddress)(e),32)};case"bool":return function(e){return e?m:w};case"bytes":return function(e){return(0,s.keccak256)(e)};case"string":return function(e){return(0,f.id)(e)}}return null}function S(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class I{constructor(e){(0,o.defineReadOnly)(this,"types",Object.freeze((0,o.deepCopy)(e))),(0,o.defineReadOnly)(this,"_encoderCache",{}),(0,o.defineReadOnly)(this,"_types",{});const t={},r={},n={};Object.keys(e).forEach((e=>{t[e]={},r[e]=[],n[e]={}}));for(const n in e){const a={};e[n].forEach((i=>{a[i.name]&&l.throwArgumentError(`duplicate variable name ${JSON.stringify(i.name)} in ${JSON.stringify(n)}`,"types",e),a[i.name]=!0;const s=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===n&&l.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",e);x(s)||(r[s]||l.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",e),r[s].push(n),t[n][s]=!0)}))}const a=Object.keys(r).filter((e=>0===r[e].length));0===a.length?l.throwArgumentError("missing primary type","types",e):a.length>1&&l.throwArgumentError(`ambiguous primary types or unused types: ${a.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),(0,o.defineReadOnly)(this,"primaryType",a[0]),function a(i,s){s[i]&&l.throwArgumentError(`circular type reference to ${JSON.stringify(i)}`,"types",e),s[i]=!0,Object.keys(t[i]).forEach((e=>{r[e]&&(a(e,s),Object.keys(s).forEach((t=>{n[t][e]=!0})))})),delete s[i]}(this.primaryType,{});for(const t in n){const r=Object.keys(n[t]);r.sort(),this._types[t]=S(t,e[t])+r.map((t=>S(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=x(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&l.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let a=t.map(r);return this._types[e]&&(a=a.map(s.keccak256)),(0,s.keccak256)((0,i.hexConcat)(a))}}const r=this.types[e];if(r){const t=(0,f.id)(this._types[e]);return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this._types[r]?(0,s.keccak256)(n):n}));return n.unshift(t),(0,i.hexConcat)(n)}}return l.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||l.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return(0,s.keccak256)(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(x(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const e=n[1],a=parseInt(n[3]);return a>=0&&t.length!==a&&l.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,r)))}const a=this.types[e];return a?a.reduce(((e,{name:n,type:a})=>(e[n]=this._visit(a,t[n],r),e)),{}):l.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new I(e)}static getPrimaryType(e){return I.from(e).primaryType}static hashStruct(e,t,r){return I.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=v[r];n||l.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>E.indexOf(e.name)-E.indexOf(t.name))),I.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return(0,i.hexConcat)(["0x1901",I.hashDomain(e),I.from(t).hash(r)])}static hash(e,t,r){return(0,s.keccak256)(I.encode(e,t,r))}static resolveNames(e,t,r,n){return u(this,void 0,void 0,(function*(){e=(0,o.shallowCopy)(e);const a={};e.verifyingContract&&!(0,i.isHexString)(e.verifyingContract,20)&&(a[e.verifyingContract]="0x");const s=I.from(t);s.visit(r,((e,t)=>("address"!==e||(0,i.isHexString)(t,20)||(a[t]="0x"),t)));for(const e in a)a[e]=yield n(e);return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),r=s.visit(r,((e,t)=>"address"===e&&a[t]?a[t]:t)),{domain:e,value:r}}))}static getPayload(e,t,r){I.hashDomain(e);const n={},s=[];E.forEach((t=>{const r=e[t];null!=r&&(n[t]=_[t](r),s.push({name:t,type:v[t]}))}));const c=I.from(t),d=(0,o.shallowCopy)(t);return d.EIP712Domain?l.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):d.EIP712Domain=s,c.encode(r),{types:d,domain:n,primaryType:c.primaryType,message:c.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return(0,i.hexlify)((0,i.arrayify)(t));if(e.match(/^u?int/))return a.gH.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&l.throwArgumentError("invalid string","value",t),t}return l.throwArgumentError("unsupported type","type",e)}))}}}},2294:(e,t,r)=>{"use strict";r.r(t),r.d(t,{HDNode:()=>M,defaultPath:()=>B,entropyToMnemonic:()=>N,getAccountPath:()=>L,isValidMnemonic:()=>P,mnemonicToEntropy:()=>R,mnemonicToSeed:()=>O});var n=r(6593),a=r(5372),i=r(9674),s=r(7867),o=r(7300),c=r(2428),d=r(379),f=r(5465),u=r(1013),l=r(7808),h=r(1507),p=r(7587);const b=new p.Logger("wordlists/5.7.0");class g{constructor(e){b.checkAbstract(new.target,g),(0,c.defineReadOnly)(this,"locale",e)}split(e){return e.toLowerCase().split(/ +/g)}join(e){return e.join(" ")}static check(e){const t=[];for(let r=0;r<2048;r++){const n=e.getWord(r);if(r!==e.getWordIndex(n))return"0x";t.push(n)}return(0,h.id)(t.join("\n")+"\n")}static register(e,t){t||(t=e.locale)}}let y=null;function m(e){if(null==y&&(y="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==g.check(e)))throw y=null,new Error("BIP39 Wordlist for en (English) FAILED")}const w=new class extends g{constructor(){super("en")}getWord(e){return m(this),y[e]}getWordIndex(e){return m(this),y.indexOf(e)}};g.register(w);const v={en:w},E=new p.Logger("hdnode/5.7.0"),A=i.gH.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_=(0,s.YW)("Bitcoin seed"),x=2147483648;function S(e){return(1<<e)-1<<8-e}function I(e){return(0,a.hexZeroPad)((0,a.hexlify)(e),32)}function k(e){return n.Base58.encode((0,a.concat)([e,(0,a.hexDataSlice)((0,f.sc)((0,f.sc)(e)),0,4)]))}function C(e){if(null==e)return v.en;if("string"==typeof e){const t=v[e];return null==t&&E.throwArgumentError("unknown locale","wordlist",e),t}return e}const T={},B="m/44'/60'/0'/0/0";class M{constructor(e,t,r,n,i,s,o,u){if(e!==T)throw new Error("HDNode constructor cannot be called directly");if(t){const e=new d.SigningKey(t);(0,c.defineReadOnly)(this,"privateKey",e.privateKey),(0,c.defineReadOnly)(this,"publicKey",e.compressedPublicKey)}else(0,c.defineReadOnly)(this,"privateKey",null),(0,c.defineReadOnly)(this,"publicKey",(0,a.hexlify)(r));(0,c.defineReadOnly)(this,"parentFingerprint",n),(0,c.defineReadOnly)(this,"fingerprint",(0,a.hexDataSlice)((0,f.HE)((0,f.sc)(this.publicKey)),0,4)),(0,c.defineReadOnly)(this,"address",(0,l.computeAddress)(this.publicKey)),(0,c.defineReadOnly)(this,"chainCode",i),(0,c.defineReadOnly)(this,"index",s),(0,c.defineReadOnly)(this,"depth",o),null==u?((0,c.defineReadOnly)(this,"mnemonic",null),(0,c.defineReadOnly)(this,"path",null)):"string"==typeof u?((0,c.defineReadOnly)(this,"mnemonic",null),(0,c.defineReadOnly)(this,"path",u)):((0,c.defineReadOnly)(this,"mnemonic",u),(0,c.defineReadOnly)(this,"path",u.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return k((0,a.concat)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",(0,a.hexlify)(this.depth),this.parentFingerprint,(0,a.hexZeroPad)((0,a.hexlify)(this.index),4),this.chainCode,null!=this.privateKey?(0,a.concat)(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new M(T,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(e&~x));const r=new Uint8Array(37);if(e&x){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set((0,a.arrayify)(this.privateKey),1),t&&(t+="'")}else r.set((0,a.arrayify)(this.publicKey));for(let t=24;t>=0;t-=8)r[33+(t>>3)]=e>>24-t&255;const n=(0,a.arrayify)((0,f.L5)(u.q.sha512,this.chainCode,r)),s=n.slice(0,32),o=n.slice(32);let c=null,l=null;if(this.privateKey)c=I(i.gH.from(s).add(this.privateKey).mod(A));else{l=new d.SigningKey((0,a.hexlify)(s))._addPoint(this.publicKey)}let h=t;const p=this.mnemonic;return p&&(h=Object.freeze({phrase:p.phrase,path:t,locale:p.locale||"en"})),new M(T,c,l,this.fingerprint,I(o),e,this.depth+1,h)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let e=0;e<t.length;e++){const n=t[e];if(n.match(/^[0-9]+'$/)){const e=parseInt(n.substring(0,n.length-1));if(e>=x)throw new Error("invalid path index - "+n);r=r._derive(x+e)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);{const e=parseInt(n);if(e>=x)throw new Error("invalid path index - "+n);r=r._derive(e)}}}return r}static _fromSeed(e,t){const r=(0,a.arrayify)(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=(0,a.arrayify)((0,f.L5)(u.q.sha512,_,r));return new M(T,I(n.slice(0,32)),null,"0x00000000",I(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=N(R(e,r=C(r)),r),M._fromSeed(O(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return M._fromSeed(e,null)}static fromExtendedKey(e){const t=n.Base58.decode(e);82===t.length&&k(t.slice(0,78))===e||E.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],i=(0,a.hexlify)(t.slice(5,9)),s=parseInt((0,a.hexlify)(t.slice(9,13)).substring(2),16),o=(0,a.hexlify)(t.slice(13,45)),c=t.slice(45,78);switch((0,a.hexlify)(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new M(T,null,(0,a.hexlify)(c),i,o,s,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==c[0])break;return new M(T,(0,a.hexlify)(c.slice(1)),null,i,o,s,r,null)}return E.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function O(e,t){t||(t="");const r=(0,s.YW)("mnemonic"+t,s.dz.NFKD);return(0,o.A)((0,s.YW)(e,s.dz.NFKD),r,2048,64,"sha512")}function R(e,t){t=C(t),E.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=(0,a.arrayify)(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let e=0;e<r.length;e++){let a=t.getWordIndex(r[e].normalize("NFKD"));if(-1===a)throw new Error("invalid mnemonic");for(let e=0;e<11;e++)a&1<<10-e&&(n[i>>3]|=1<<7-i%8),i++}const s=32*r.length/3,o=S(r.length/3);if(((0,a.arrayify)((0,f.sc)(n.slice(0,s/8)))[0]&o)!==(n[n.length-1]&o))throw new Error("invalid checksum");return(0,a.hexlify)(n.slice(0,s/8))}function N(e,t){if(t=C(t),(e=(0,a.arrayify)(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let t=0;t<e.length;t++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=e[t],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[t]>>8-n,r.push(e[t]&(1<<8-n)-1),n+=3);const i=e.length/4,s=(0,a.arrayify)((0,f.sc)(e))[0]&S(i);return r[r.length-1]<<=i,r[r.length-1]|=s>>8-i,t.join(r.map((e=>t.getWord(e))))}function P(e,t){try{return R(e,t),!0}catch(e){}return!1}function L(e){return("number"!=typeof e||e<0||e>=x||e%1)&&E.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`}},1146:(e,t,r)=>{"use strict";r.d(t,{r:()=>n});const n="json-wallets/5.7.0"},1095:(e,t,r)=>{"use strict";r.r(t),r.d(t,{decryptCrowdsale:()=>g,decryptJsonWallet:()=>E,decryptJsonWalletSync:()=>A,decryptKeystore:()=>v.Yc,decryptKeystoreSync:()=>v.xQ,encryptKeystore:()=>v.w,getJsonWalletAddress:()=>w,isCrowdsaleWallet:()=>y,isKeystoreWallet:()=>m});var n=r(1183),a=r.n(n),i=r(1277),s=r(5372),o=r(9729),c=r(7300),d=r(7867),f=r(2428),u=r(7587),l=r(1146),h=r(3324);const p=new u.Logger(l.r);class b extends f.Description{isCrowdsaleAccount(e){return!(!e||!e._isCrowdsaleAccount)}}function g(e,t){const r=JSON.parse(e);t=(0,h.Qq)(t);const n=(0,i.getAddress)((0,h.oe)(r,"ethaddr")),f=(0,h.m0)((0,h.oe)(r,"encseed"));f&&f.length%16==0||p.throwArgumentError("invalid encseed","json",e);const u=(0,s.arrayify)((0,c.A)(t,t,2e3,32,"sha256")).slice(0,16),l=f.slice(0,16),g=f.slice(16),y=new(a().ModeOfOperation.cbc)(u,l),m=a().padding.pkcs7.strip((0,s.arrayify)(y.decrypt(g)));let w="";for(let e=0;e<m.length;e++)w+=String.fromCharCode(m[e]);const v=(0,d.YW)(w),E=(0,o.keccak256)(v);return new b({_isCrowdsaleAccount:!0,address:n,privateKey:E})}function y(e){let t=null;try{t=JSON.parse(e)}catch(e){return!1}return t.encseed&&t.ethaddr}function m(e){let t=null;try{t=JSON.parse(e)}catch(e){return!1}return!(!t.version||parseInt(t.version)!==t.version||3!==parseInt(t.version))}function w(e){if(y(e))try{return(0,i.getAddress)(JSON.parse(e).ethaddr)}catch(e){return null}if(m(e))try{return(0,i.getAddress)(JSON.parse(e).address)}catch(e){return null}return null}var v=r(453);function E(e,t,r){if(y(e)){r&&r(0);const n=g(e,t);return r&&r(1),Promise.resolve(n)}return m(e)?(0,v.Yc)(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}function A(e,t){if(y(e))return g(e,t);if(m(e))return(0,v.xQ)(e,t);throw new Error("invalid JSON wallet")}},453:(e,t,r)=>{"use strict";r.d(t,{Yc:()=>k,w:()=>C,xQ:()=>I});var n=r(1183),a=r.n(n),i=r(3432),s=r.n(i),o=r(1277),c=r(5372),d=r(2294),f=r(9729),u=r(7300),l=r(4495),h=r(2428),p=r(7808),b=r(3324),g=r(7587),y=r(1146),m=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function o(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}c((n=n.apply(e,t||[])).next())}))};const w=new g.Logger(y.r);function v(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}class E extends h.Description{isKeystoreAccount(e){return!(!e||!e._isKeystoreAccount)}}function A(e,t){const r=(0,b.m0)((0,b.oe)(e,"crypto/ciphertext"));if((0,c.hexlify)((0,f.keccak256)((0,c.concat)([t.slice(16,32),r]))).substring(2)!==(0,b.oe)(e,"crypto/mac").toLowerCase())throw new Error("invalid password");const n=function(e,t,r){if("aes-128-ctr"===(0,b.oe)(e,"crypto/cipher")){const n=(0,b.m0)((0,b.oe)(e,"crypto/cipherparams/iv")),i=new(a().Counter)(n),s=new(a().ModeOfOperation.ctr)(t,i);return(0,c.arrayify)(s.decrypt(r))}return null}(e,t.slice(0,16),r);n||w.throwError("unsupported cipher",g.Logger.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const i=t.slice(32,64),s=(0,p.computeAddress)(n);if(e.address){let t=e.address.toLowerCase();if("0x"!==t.substring(0,2)&&(t="0x"+t),(0,o.getAddress)(t)!==s)throw new Error("address mismatch")}const u={_isKeystoreAccount:!0,address:s,privateKey:(0,c.hexlify)(n)};if("0.1"===(0,b.oe)(e,"x-ethers/version")){const t=(0,b.m0)((0,b.oe)(e,"x-ethers/mnemonicCiphertext")),r=(0,b.m0)((0,b.oe)(e,"x-ethers/mnemonicCounter")),n=new(a().Counter)(r),s=new(a().ModeOfOperation.ctr)(i,n),o=(0,b.oe)(e,"x-ethers/path")||d.defaultPath,f=(0,b.oe)(e,"x-ethers/locale")||"en",l=(0,c.arrayify)(s.decrypt(t));try{const e=(0,d.entropyToMnemonic)(l,f),t=d.HDNode.fromMnemonic(e,null,f).derivePath(o);if(t.privateKey!=u.privateKey)throw new Error("mnemonic mismatch");u.mnemonic=t.mnemonic}catch(e){if(e.code!==g.Logger.errors.INVALID_ARGUMENT||"wordlist"!==e.argument)throw e}}return new E(u)}function _(e,t,r,n,a){return(0,c.arrayify)((0,u.A)(e,t,r,n,a))}function x(e,t,r,n,a){return Promise.resolve(_(e,t,r,n,a))}function S(e,t,r,n,a){const i=(0,b.Qq)(t),s=(0,b.oe)(e,"crypto/kdf");if(s&&"string"==typeof s){const t=function(e,t){return w.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===s.toLowerCase()){const r=(0,b.m0)((0,b.oe)(e,"crypto/kdfparams/salt")),o=parseInt((0,b.oe)(e,"crypto/kdfparams/n")),c=parseInt((0,b.oe)(e,"crypto/kdfparams/r")),d=parseInt((0,b.oe)(e,"crypto/kdfparams/p"));o&&c&&d||t("kdf",s),o&o-1&&t("N",o);const f=parseInt((0,b.oe)(e,"crypto/kdfparams/dklen"));return 32!==f&&t("dklen",f),n(i,r,o,c,d,64,a)}if("pbkdf2"===s.toLowerCase()){const n=(0,b.m0)((0,b.oe)(e,"crypto/kdfparams/salt"));let a=null;const s=(0,b.oe)(e,"crypto/kdfparams/prf");"hmac-sha256"===s?a="sha256":"hmac-sha512"===s?a="sha512":t("prf",s);const o=parseInt((0,b.oe)(e,"crypto/kdfparams/c")),c=parseInt((0,b.oe)(e,"crypto/kdfparams/dklen"));return 32!==c&&t("dklen",c),r(i,n,o,c,a)}}return w.throwArgumentError("unsupported key-derivation function","kdf",s)}function I(e,t){const r=JSON.parse(e);return A(r,S(r,t,_,s().syncScrypt))}function k(e,t,r){return m(this,void 0,void 0,(function*(){const n=JSON.parse(e);return A(n,yield S(n,t,x,s().scrypt,r))}))}function C(e,t,r,n){try{if((0,o.getAddress)(e.address)!==(0,p.computeAddress)(e.privateKey))throw new Error("address/privateKey mismatch");if(v(e)){const t=e.mnemonic;if(d.HDNode.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||d.defaultPath).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(e){return Promise.reject(e)}"function"!=typeof r||n||(n=r,r={}),r||(r={});const i=(0,c.arrayify)(e.privateKey),u=(0,b.Qq)(t);let h=null,g=null,y=null;if(v(e)){const t=e.mnemonic;h=(0,c.arrayify)((0,d.mnemonicToEntropy)(t.phrase,t.locale||"en")),g=t.path||d.defaultPath,y=t.locale||"en"}let m=r.client;m||(m="ethers.js");let w=null;w=r.salt?(0,c.arrayify)(r.salt):(0,l.p)(32);let E=null;if(r.iv){if(E=(0,c.arrayify)(r.iv),16!==E.length)throw new Error("invalid iv")}else E=(0,l.p)(16);let A=null;if(r.uuid){if(A=(0,c.arrayify)(r.uuid),16!==A.length)throw new Error("invalid uuid")}else A=(0,l.p)(16);let _=1<<17,x=8,S=1;return r.scrypt&&(r.scrypt.N&&(_=r.scrypt.N),r.scrypt.r&&(x=r.scrypt.r),r.scrypt.p&&(S=r.scrypt.p)),s().scrypt(u,w,_,x,S,64,n).then((t=>{const r=(t=(0,c.arrayify)(t)).slice(0,16),n=t.slice(16,32),s=t.slice(32,64),o=new(a().Counter)(E),d=new(a().ModeOfOperation.ctr)(r,o),u=(0,c.arrayify)(d.encrypt(i)),p=(0,f.keccak256)((0,c.concat)([n,u])),v={address:e.address.substring(2).toLowerCase(),id:(0,b.QT)(A),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:(0,c.hexlify)(E).substring(2)},ciphertext:(0,c.hexlify)(u).substring(2),kdf:"scrypt",kdfparams:{salt:(0,c.hexlify)(w).substring(2),n:_,dklen:32,p:S,r:x},mac:p.substring(2)}};if(h){const e=(0,l.p)(16),t=new(a().Counter)(e),r=new(a().ModeOfOperation.ctr)(s,t),n=(0,c.arrayify)(r.encrypt(h)),i=new Date,o=i.getUTCFullYear()+"-"+(0,b.Sp)(i.getUTCMonth()+1,2)+"-"+(0,b.Sp)(i.getUTCDate(),2)+"T"+(0,b.Sp)(i.getUTCHours(),2)+"-"+(0,b.Sp)(i.getUTCMinutes(),2)+"-"+(0,b.Sp)(i.getUTCSeconds(),2)+".0Z";v["x-ethers"]={client:m,gethFilename:"UTC--"+o+"--"+v.address,mnemonicCounter:(0,c.hexlify)(e).substring(2),mnemonicCiphertext:(0,c.hexlify)(n).substring(2),path:g,locale:y,version:"0.1"}}return JSON.stringify(v)}))}},3324:(e,t,r)=>{"use strict";r.d(t,{QT:()=>d,Qq:()=>o,Sp:()=>s,m0:()=>i,oe:()=>c});var n=r(5372),a=r(7867);function i(e){return"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),(0,n.arrayify)(e)}function s(e,t){for(e=String(e);e.length<t;)e="0"+e;return e}function o(e){return"string"==typeof e?(0,a.YW)(e,a.dz.NFKC):(0,n.arrayify)(e)}function c(e,t){let r=e;const n=t.toLowerCase().split("/");for(let e=0;e<n.length;e++){let t=null;for(const a in r)if(a.toLowerCase()===n[e]){t=r[a];break}if(null===t)return null;r=t}return r}function d(e){const t=(0,n.arrayify)(e);t[6]=15&t[6]|64,t[8]=63&t[8]|128;const r=(0,n.hexlify)(t);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}},9729:(e,t,r)=>{"use strict";r.r(t),r.d(t,{keccak256:()=>s});var n=r(573),a=r.n(n),i=r(5372);function s(e){return"0x"+a().keccak_256((0,i.arrayify)(e))}},573:(e,t,r)=>{var n;!function(){"use strict";var a="input is invalid type",i="object"==typeof window,s=i?window:{};s.JS_SHA3_NO_WINDOW&&(i=!1);var o=!i&&"object"==typeof self;!s.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?s=r.g:o&&(s=self);var c=!s.JS_SHA3_NO_COMMON_JS&&e.exports,d=r.amdO,f=!s.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,u="0123456789abcdef".split(""),l=[4,1024,262144,67108864],h=[0,8,16,24],p=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],b=[224,256,384,512],g=[128,256],y=["hex","buffer","arrayBuffer","array","digest"],m={128:168,256:136};!s.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!f||!s.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var w=function(e,t,r){return function(n){return new N(e,t,e).update(n)[r]()}},v=function(e,t,r){return function(n,a){return new N(e,t,a).update(n)[r]()}},E=function(e,t,r){return function(t,n,a,i){return I["cshake"+e].update(t,n,a,i)[r]()}},A=function(e,t,r){return function(t,n,a,i){return I["kmac"+e].update(t,n,a,i)[r]()}},_=function(e,t,r,n){for(var a=0;a<y.length;++a){var i=y[a];e[i]=t(r,n,i)}return e},x=function(e,t){var r=w(e,t,"hex");return r.create=function(){return new N(e,t,e)},r.update=function(e){return r.create().update(e)},_(r,w,e,t)},S=[{name:"keccak",padding:[1,256,65536,16777216],bits:b,createMethod:x},{name:"sha3",padding:[6,1536,393216,100663296],bits:b,createMethod:x},{name:"shake",padding:[31,7936,2031616,520093696],bits:g,createMethod:function(e,t){var r=v(e,t,"hex");return r.create=function(r){return new N(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},_(r,v,e,t)}},{name:"cshake",padding:l,bits:g,createMethod:function(e,t){var r=m[e],n=E(e,0,"hex");return n.create=function(n,a,i){return a||i?new N(e,t,n).bytepad([a,i],r):I["shake"+e].create(n)},n.update=function(e,t,r,a){return n.create(t,r,a).update(e)},_(n,E,e,t)}},{name:"kmac",padding:l,bits:g,createMethod:function(e,t){var r=m[e],n=A(e,0,"hex");return n.create=function(n,a,i){return new P(e,t,a).bytepad(["KMAC",i],r).bytepad([n],r)},n.update=function(e,t,r,a){return n.create(e,r,a).update(t)},_(n,A,e,t)}}],I={},k=[],C=0;C<S.length;++C)for(var T=S[C],B=T.bits,M=0;M<B.length;++M){var O=T.name+"_"+B[M];if(k.push(O),I[O]=T.createMethod(B[M],T.padding),"sha3"!==T.name){var R=T.name+B[M];k.push(R),I[R]=I[O]}}function N(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function P(e,t,r){N.call(this,e,t,r)}N.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(a);if(null===e)throw new Error(a);if(f&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||f&&ArrayBuffer.isView(e)))throw new Error(a);t=!0}for(var n,i,s=this.blocks,o=this.byteCount,c=e.length,d=this.blockCount,u=0,l=this.s;u<c;){if(this.reset)for(this.reset=!1,s[0]=this.block,n=1;n<d+1;++n)s[n]=0;if(t)for(n=this.start;u<c&&n<o;++u)s[n>>2]|=e[u]<<h[3&n++];else for(n=this.start;u<c&&n<o;++u)(i=e.charCodeAt(u))<128?s[n>>2]|=i<<h[3&n++]:i<2048?(s[n>>2]|=(192|i>>6)<<h[3&n++],s[n>>2]|=(128|63&i)<<h[3&n++]):i<55296||i>=57344?(s[n>>2]|=(224|i>>12)<<h[3&n++],s[n>>2]|=(128|i>>6&63)<<h[3&n++],s[n>>2]|=(128|63&i)<<h[3&n++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++u)),s[n>>2]|=(240|i>>18)<<h[3&n++],s[n>>2]|=(128|i>>12&63)<<h[3&n++],s[n>>2]|=(128|i>>6&63)<<h[3&n++],s[n>>2]|=(128|63&i)<<h[3&n++]);if(this.lastByteIndex=n,n>=o){for(this.start=n-o,this.block=s[d],n=0;n<d;++n)l[n]^=s[n];L(l),this.reset=!0}else this.start=n}return this},N.prototype.encode=function(e,t){var r=255&e,n=1,a=[r];for(r=255&(e>>=8);r>0;)a.unshift(r),r=255&(e>>=8),++n;return t?a.push(n):a.unshift(n),this.update(a),a.length},N.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(a);if(null===e)throw new Error(a);if(f&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||f&&ArrayBuffer.isView(e)))throw new Error(a);t=!0}var n=0,i=e.length;if(t)n=i;else for(var s=0;s<e.length;++s){var o=e.charCodeAt(s);o<128?n+=1:o<2048?n+=2:o<55296||o>=57344?n+=3:(o=65536+((1023&o)<<10|1023&e.charCodeAt(++s)),n+=4)}return n+=this.encode(8*n),this.update(e),n},N.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var a=t-r%t,i=[];return i.length=a,this.update(i),this},N.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];L(n)}},N.prototype.toString=N.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,a=this.extraBytes,i=0,s=0,o="";s<n;){for(i=0;i<t&&s<n;++i,++s)e=r[i],o+=u[e>>4&15]+u[15&e]+u[e>>12&15]+u[e>>8&15]+u[e>>20&15]+u[e>>16&15]+u[e>>28&15]+u[e>>24&15];s%t==0&&(L(r),i=0)}return a&&(e=r[i],o+=u[e>>4&15]+u[15&e],a>1&&(o+=u[e>>12&15]+u[e>>8&15]),a>2&&(o+=u[e>>20&15]+u[e>>16&15])),o},N.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,a=this.extraBytes,i=0,s=0,o=this.outputBits>>3;e=a?new ArrayBuffer(n+1<<2):new ArrayBuffer(o);for(var c=new Uint32Array(e);s<n;){for(i=0;i<t&&s<n;++i,++s)c[s]=r[i];s%t==0&&L(r)}return a&&(c[i]=r[i],e=e.slice(0,o)),e},N.prototype.buffer=N.prototype.arrayBuffer,N.prototype.digest=N.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,a=this.outputBlocks,i=this.extraBytes,s=0,o=0,c=[];o<a;){for(s=0;s<r&&o<a;++s,++o)e=o<<2,t=n[s],c[e]=255&t,c[e+1]=t>>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;o%r==0&&L(n)}return i&&(e=o<<2,t=n[s],c[e]=255&t,i>1&&(c[e+1]=t>>8&255),i>2&&(c[e+2]=t>>16&255)),c},P.prototype=new N,P.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var L=function(e){var t,r,n,a,i,s,o,c,d,f,u,l,h,b,g,y,m,w,v,E,A,_,x,S,I,k,C,T,B,M,O,R,N,P,L,F,D,U,H,j,V,$,z,q,K,G,J,W,Y,Z,X,Q,ee,te,re,ne,ae,ie,se,oe,ce,de,fe;for(n=0;n<48;n+=2)a=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],o=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],d=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],u=e[7]^e[17]^e[27]^e[37]^e[47],t=(l=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|o>>>31),r=(h=e[9]^e[19]^e[29]^e[39]^e[49])^(o<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=a^(c<<1|d>>>31),r=i^(d<<1|c>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=s^(f<<1|u>>>31),r=o^(u<<1|f>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=c^(l<<1|h>>>31),r=d^(h<<1|l>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=f^(a<<1|i>>>31),r=u^(i<<1|a>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,b=e[0],g=e[1],G=e[11]<<4|e[10]>>>28,J=e[10]<<4|e[11]>>>28,T=e[20]<<3|e[21]>>>29,B=e[21]<<3|e[20]>>>29,oe=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,$=e[40]<<18|e[41]>>>14,z=e[41]<<18|e[40]>>>14,P=e[2]<<1|e[3]>>>31,L=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,W=e[22]<<10|e[23]>>>22,Y=e[23]<<10|e[22]>>>22,M=e[33]<<13|e[32]>>>19,O=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,F=e[14]<<6|e[15]>>>26,D=e[15]<<6|e[14]>>>26,w=e[25]<<11|e[24]>>>21,v=e[24]<<11|e[25]>>>21,Z=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,R=e[45]<<29|e[44]>>>3,N=e[44]<<29|e[45]>>>3,S=e[6]<<28|e[7]>>>4,I=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ae=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,H=e[27]<<25|e[26]>>>7,E=e[36]<<21|e[37]>>>11,A=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,q=e[8]<<27|e[9]>>>5,K=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,C=e[19]<<20|e[18]>>>12,ie=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,j=e[38]<<8|e[39]>>>24,V=e[39]<<8|e[38]>>>24,_=e[48]<<14|e[49]>>>18,x=e[49]<<14|e[48]>>>18,e[0]=b^~y&w,e[1]=g^~m&v,e[10]=S^~k&T,e[11]=I^~C&B,e[20]=P^~F&U,e[21]=L^~D&H,e[30]=q^~G&W,e[31]=K^~J&Y,e[40]=te^~ne&ie,e[41]=re^~ae&se,e[2]=y^~w&E,e[3]=m^~v&A,e[12]=k^~T&M,e[13]=C^~B&O,e[22]=F^~U&j,e[23]=D^~H&V,e[32]=G^~W&Z,e[33]=J^~Y&X,e[42]=ne^~ie&oe,e[43]=ae^~se&ce,e[4]=w^~E&_,e[5]=v^~A&x,e[14]=T^~M&R,e[15]=B^~O&N,e[24]=U^~j&$,e[25]=H^~V&z,e[34]=W^~Z&Q,e[35]=Y^~X&ee,e[44]=ie^~oe&de,e[45]=se^~ce&fe,e[6]=E^~_&b,e[7]=A^~x&g,e[16]=M^~R&S,e[17]=O^~N&I,e[26]=j^~$&P,e[27]=V^~z&L,e[36]=Z^~Q&q,e[37]=X^~ee&K,e[46]=oe^~de&te,e[47]=ce^~fe&re,e[8]=_^~b&y,e[9]=x^~g&m,e[18]=R^~S&k,e[19]=N^~I&C,e[28]=$^~P&F,e[29]=z^~L&D,e[38]=Q^~q&G,e[39]=ee^~K&J,e[48]=de^~te&ne,e[49]=fe^~re&ae,e[0]^=p[n],e[1]^=p[n+1]};if(c)e.exports=I;else{for(C=0;C<k.length;++C)s[k[C]]=I[k[C]];d&&(void 0===(n=function(){return I}.call(t,r,t,e))||(e.exports=n))}}()},7587:(e,t,r)=>{"use strict";r.r(t),r.d(t,{ErrorCode:()=>f,LogLevel:()=>d,Logger:()=>l});let n=!1,a=!1;const i={debug:1,default:2,info:2,warning:3,error:4,off:5};let s=i.default,o=null;const c=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var d,f;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(d||(d={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(f||(f={}));const u="0123456789abcdef";class l{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==i[r]&&this.throwArgumentError("invalid log level name","logLevel",e),s>i[r]||console.log.apply(console,t)}debug(...e){this._log(l.levels.DEBUG,e)}info(...e){this._log(l.levels.INFO,e)}warn(...e){this._log(l.levels.WARNING,e)}makeError(e,t,r){if(a)return this.makeError("censored error",t,{});t||(t=l.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e<t.length;e++)r+=u[t[e]>>4],r+=u[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}})),n.push(`code=${t}`),n.push(`version=${this.version}`);const i=e;let s="";switch(t){case f.NUMERIC_FAULT:{s="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":s+="-"+t;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result"}break}case f.CALL_EXCEPTION:case f.INSUFFICIENT_FUNDS:case f.MISSING_NEW:case f.NONCE_EXPIRED:case f.REPLACEMENT_UNDERPRICED:case f.TRANSACTION_REPLACED:case f.UNPREDICTABLE_GAS_LIMIT:s=t}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const o=new Error(e);return o.reason=i,o.code=t,Object.keys(r).forEach((function(e){o[e]=r[e]})),o}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,l.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),c&&this.throwError("platform missing String.prototype.normalize",l.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:c})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,l.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,l.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",e<t&&this.throwError("missing argument"+r,l.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,l.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",l.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",l.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",l.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return o||(o=new l("logger/5.7.0")),o}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",l.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),n){if(!e)return;this.globalLogger().throwError("error censorship permanent",l.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}a=!!e,n=!!t}static setLogLevel(e){const t=i[e.toLowerCase()];null!=t?s=t:l.globalLogger().warn("invalid log level - "+e)}static from(e){return new l(e)}}l.errors=f,l.levels=d},7300:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(5372),a=r(5465);function i(e,t,r,i,s){let o;e=(0,n.arrayify)(e),t=(0,n.arrayify)(t);let c=1;const d=new Uint8Array(i),f=new Uint8Array(t.length+4);let u,l;f.set(t);for(let h=1;h<=c;h++){f[t.length]=h>>24&255,f[t.length+1]=h>>16&255,f[t.length+2]=h>>8&255,f[t.length+3]=255&h;let p=(0,n.arrayify)((0,a.L5)(s,e,f));o||(o=p.length,l=new Uint8Array(o),c=Math.ceil(i/o),u=i-(c-1)*o),l.set(p);for(let t=1;t<r;t++){p=(0,n.arrayify)((0,a.L5)(s,e,p));for(let e=0;e<o;e++)l[e]^=p[e]}const b=(h-1)*o,g=h===c?u:o;d.set((0,n.arrayify)(l).slice(0,g),b)}return(0,n.hexlify)(d)}},2428:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Description:()=>b,checkProperties:()=>d,deepCopy:()=>p,defineReadOnly:()=>s,getStatic:()=>o,resolveProperties:()=>c,shallowCopy:()=>f});var n=r(7587);var a=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function o(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}c((n=n.apply(e,t||[])).next())}))};const i=new n.Logger("properties/5.7.0");function s(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function o(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function c(e){return a(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const r=e[t];return Promise.resolve(r).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function d(e,t){e&&"object"==typeof e||i.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((r=>{t[r]||i.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function f(e){const t={};for(const r in e)t[r]=e[r];return t}const u={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function l(e){if(null==e||u[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let r=0;r<t.length;r++){let n=null;try{n=e[t[r]]}catch(e){continue}if(!l(n))return!1}return!0}return i.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function h(e){if(l(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>p(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&s(t,r,p(n))}return t}return i.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function p(e){return h(e)}class b{constructor(e){for(const t in e)this[t]=p(e[t])}}},8846:(e,t,r)=>{"use strict";r.r(t),r.d(t,{randomBytes:()=>n.p,shuffled:()=>a});var n=r(4495);function a(e){for(let t=(e=e.slice()).length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}},4495:(e,t,r)=>{"use strict";r.d(t,{p:()=>c});var n=r(5372),a=r(7587);const i=new a.Logger("random/5.7.0");const s=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r.g)return r.g;throw new Error("unable to locate global object")}();let o=s.crypto||s.msCrypto;function c(e){(e<=0||e>1024||e%1||e!=e)&&i.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return o.getRandomValues(t),(0,n.arrayify)(t)}o&&o.getRandomValues||(i.warn("WARNING: Missing strong random number source"),o={getRandomValues:function(e){return i.throwError("no secure random source avaialble",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})},5205:(e,t,r)=>{"use strict";r.r(t),r.d(t,{decode:()=>l,encode:()=>d});var n=r(5372),a=r(7587);const i=new a.Logger("rlp/5.7.0");function s(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function o(e,t,r){let n=0;for(let a=0;a<r;a++)n=256*n+e[t+a];return n}function c(e){if(Array.isArray(e)){let t=[];if(e.forEach((function(e){t=t.concat(c(e))})),t.length<=55)return t.unshift(192+t.length),t;const r=s(t.length);return r.unshift(247+r.length),r.concat(t)}(0,n.isBytesLike)(e)||i.throwArgumentError("RLP object must be BytesLike","object",e);const t=Array.prototype.slice.call((0,n.arrayify)(e));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=s(t.length);return r.unshift(183+r.length),r.concat(t)}function d(e){return(0,n.hexlify)(c(e))}function f(e,t,r,n){const s=[];for(;r<t+1+n;){const o=u(e,r);s.push(o.result),(r+=o.consumed)>t+1+n&&i.throwError("child data too short",a.Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:s}}function u(e,t){if(0===e.length&&i.throwError("data too short",a.Logger.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&i.throwError("data short segment too short",a.Logger.errors.BUFFER_OVERRUN,{});const n=o(e,t+1,r);return t+1+r+n>e.length&&i.throwError("data long segment too short",a.Logger.errors.BUFFER_OVERRUN,{}),f(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&i.throwError("data array too short",a.Logger.errors.BUFFER_OVERRUN,{}),f(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&i.throwError("data array too short",a.Logger.errors.BUFFER_OVERRUN,{});const s=o(e,t+1,r);t+1+r+s>e.length&&i.throwError("data array too short",a.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+r+s,result:(0,n.hexlify)(e.slice(t+1+r,t+1+r+s))}}if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&i.throwError("data too short",a.Logger.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:(0,n.hexlify)(e.slice(t+1,t+1+r))}}return{consumed:1,result:(0,n.hexlify)(e[t])}}function l(e){const t=(0,n.arrayify)(e),r=u(t,0);return r.consumed!==t.length&&i.throwArgumentError("invalid rlp data","data",e),r.result}},9712:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SupportedAlgorithm:()=>a.q,computeHmac:()=>n.L5,ripemd160:()=>n.HE,sha256:()=>n.sc,sha512:()=>n.Zf});var n=r(5465),a=r(1013)},5465:(e,t,r)=>{"use strict";r.d(t,{L5:()=>l,HE:()=>d,sc:()=>f,Zf:()=>u});var n=r(9499),a=r.n(n),i=r(5372),s=r(1013),o=r(7587);const c=new o.Logger("sha2/5.7.0");function d(e){return"0x"+a().ripemd160().update((0,i.arrayify)(e)).digest("hex")}function f(e){return"0x"+a().sha256().update((0,i.arrayify)(e)).digest("hex")}function u(e){return"0x"+a().sha512().update((0,i.arrayify)(e)).digest("hex")}function l(e,t,r){return s.q[e]||c.throwError("unsupported algorithm "+e,o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+a().hmac(a()[e],(0,i.arrayify)(t)).update((0,i.arrayify)(r)).digest("hex")}},1013:(e,t,r)=>{"use strict";var n;r.d(t,{q:()=>n}),function(e){e.sha256="sha256",e.sha512="sha512"}(n||(n={}))},379:(e,t,r)=>{"use strict";r.r(t),r.d(t,{SigningKey:()=>J,computePublicKey:()=>Y,recoverPublicKey:()=>W});var n=r(2823),a=r.n(n),i=r(9499),s=r.n(i);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self&&self;function o(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},e(r,r.exports),r.exports}var c=d;function d(e,t){if(!e)throw new Error(t||"Assertion failed")}d.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var f=o((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function a(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var a=e.charCodeAt(n),i=a>>8,s=255&a;i?r.push(i,s):r.push(s)}return r},r.zero2=n,r.toHex=a,r.encode=function(e,t){return"hex"===t?a(e):e}})),u=o((function(e,t){var r=t;r.assert=c,r.toArray=f.toArray,r.zero2=f.zero2,r.toHex=f.toHex,r.encode=f.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var a=1<<t+1,i=e.clone(),s=0;s<n.length;s++){var o,c=i.andln(a-1);i.isOdd()?(o=c>(a>>1)-1?(a>>1)-c:c,i.isubn(o)):o=0,n[s]=o,i.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,a=0,i=0;e.cmpn(-a)>0||t.cmpn(-i)>0;){var s,o,c=e.andln(3)+a&3,d=t.andln(3)+i&3;3===c&&(c=-1),3===d&&(d=-1),s=1&c?3!==(n=e.andln(7)+a&7)&&5!==n||2!==d?c:-c:0,r[0].push(s),o=1&d?3!==(n=t.andln(7)+i&7)&&5!==n||2!==c?d:-d:0,r[1].push(o),2*a===s+1&&(a=1-a),2*i===o+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new(a())(e,"hex","le")}})),l=u.getNAF,h=u.getJSF,p=u.assert;function b(e,t){this.type=e,this.p=new(a())(t.p,16),this.red=t.prime?a().red(t.prime):a().mont(this.p),this.zero=new(a())(0).toRed(this.red),this.one=new(a())(1).toRed(this.red),this.two=new(a())(2).toRed(this.red),this.n=t.n&&new(a())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var g=b;function y(e,t){this.curve=e,this.type=t,this.precomputed=null}b.prototype.point=function(){throw new Error("Not implemented")},b.prototype.validate=function(){throw new Error("Not implemented")},b.prototype._fixedNafMul=function(e,t){p(e.precomputed);var r=e._getDoubles(),n=l(t,1,this._bitLength),a=(1<<r.step+1)-(r.step%2==0?2:1);a/=3;var i,s,o=[];for(i=0;i<n.length;i+=r.step){s=0;for(var c=i+r.step-1;c>=i;c--)s=(s<<1)+n[c];o.push(s)}for(var d=this.jpoint(null,null,null),f=this.jpoint(null,null,null),u=a;u>0;u--){for(i=0;i<o.length;i++)(s=o[i])===u?f=f.mixedAdd(r.points[i]):s===-u&&(f=f.mixedAdd(r.points[i].neg()));d=d.add(f)}return d.toP()},b.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var a=n.points,i=l(t,r,this._bitLength),s=this.jpoint(null,null,null),o=i.length-1;o>=0;o--){for(var c=0;o>=0&&0===i[o];o--)c++;if(o>=0&&c++,s=s.dblp(c),o<0)break;var d=i[o];p(0!==d),s="affine"===e.type?d>0?s.mixedAdd(a[d-1>>1]):s.mixedAdd(a[-d-1>>1].neg()):d>0?s.add(a[d-1>>1]):s.add(a[-d-1>>1].neg())}return"affine"===e.type?s.toP():s},b.prototype._wnafMulAdd=function(e,t,r,n,a){var i,s,o,c=this._wnafT1,d=this._wnafT2,f=this._wnafT3,u=0;for(i=0;i<n;i++){var p=(o=t[i])._getNAFPoints(e);c[i]=p.wnd,d[i]=p.points}for(i=n-1;i>=1;i-=2){var b=i-1,g=i;if(1===c[b]&&1===c[g]){var y=[t[b],null,null,t[g]];0===t[b].y.cmp(t[g].y)?(y[1]=t[b].add(t[g]),y[2]=t[b].toJ().mixedAdd(t[g].neg())):0===t[b].y.cmp(t[g].y.redNeg())?(y[1]=t[b].toJ().mixedAdd(t[g]),y[2]=t[b].add(t[g].neg())):(y[1]=t[b].toJ().mixedAdd(t[g]),y[2]=t[b].toJ().mixedAdd(t[g].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],w=h(r[b],r[g]);for(u=Math.max(w[0].length,u),f[b]=new Array(u),f[g]=new Array(u),s=0;s<u;s++){var v=0|w[0][s],E=0|w[1][s];f[b][s]=m[3*(v+1)+(E+1)],f[g][s]=0,d[b]=y}}else f[b]=l(r[b],c[b],this._bitLength),f[g]=l(r[g],c[g],this._bitLength),u=Math.max(f[b].length,u),u=Math.max(f[g].length,u)}var A=this.jpoint(null,null,null),_=this._wnafT4;for(i=u;i>=0;i--){for(var x=0;i>=0;){var S=!0;for(s=0;s<n;s++)_[s]=0|f[s][i],0!==_[s]&&(S=!1);if(!S)break;x++,i--}if(i>=0&&x++,A=A.dblp(x),i<0)break;for(s=0;s<n;s++){var I=_[s];0!==I&&(I>0?o=d[s][I-1>>1]:I<0&&(o=d[s][-I-1>>1].neg()),A="affine"===o.type?A.mixedAdd(o):A.add(o))}}for(i=0;i<n;i++)d[i]=null;return a?A:A.toP()},b.BasePoint=y,y.prototype.eq=function(){throw new Error("Not implemented")},y.prototype.validate=function(){return this.curve.validate(this)},b.prototype.decodePoint=function(e,t){e=u.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?p(e[e.length-1]%2==0):7===e[0]&&p(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},y.prototype.encodeCompressed=function(e){return this.encode(e,!0)},y.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},y.prototype.encode=function(e,t){return u.encode(this._encode(t),e)},y.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},y.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},y.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,a=0;a<t;a+=e){for(var i=0;i<e;i++)n=n.dbl();r.push(n)}return{step:e,points:r}},y.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),a=1;a<r;a++)t[a]=t[a-1].add(n);return{wnd:e,points:t}},y.prototype._getBeta=function(){return null},y.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var m=o((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),w=u.assert;function v(e){g.call(this,"short",e),this.a=new(a())(e.a,16).toRed(this.red),this.b=new(a())(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}m(v,g);var E=v;function A(e,t,r,n){g.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new(a())(t,16),this.y=new(a())(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function _(e,t,r,n){g.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new(a())(0)):(this.x=new(a())(t,16),this.y=new(a())(r,16),this.z=new(a())(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}v.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new(a())(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new(a())(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],w(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new(a())(e.a,16),b:new(a())(e.b,16)}})):this._getEndoBasis(r)}}},v.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:a().mont(e),r=new(a())(2).toRed(t).redInvm(),n=r.redNeg(),i=new(a())(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},v.prototype._getEndoBasis=function(e){for(var t,r,n,i,s,o,c,d,f,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,h=this.n.clone(),p=new(a())(1),b=new(a())(0),g=new(a())(0),y=new(a())(1),m=0;0!==l.cmpn(0);){var w=h.div(l);d=h.sub(w.mul(l)),f=g.sub(w.mul(p));var v=y.sub(w.mul(b));if(!n&&d.cmp(u)<0)t=c.neg(),r=p,n=d.neg(),i=f;else if(n&&2==++m)break;c=d,h=l,l=d,g=p,p=f,y=b,b=v}s=d.neg(),o=f;var E=n.sqr().add(i.sqr());return s.sqr().add(o.sqr()).cmp(E)>=0&&(s=t,o=r),n.negative&&(n=n.neg(),i=i.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:n,b:i},{a:s,b:o}]},v.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],a=n.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),s=a.mul(r.a),o=i.mul(n.a),c=a.mul(r.b),d=i.mul(n.b);return{k1:e.sub(s).sub(o),k2:c.add(d).neg()}},v.prototype.pointFromX=function(e,t){(e=new(a())(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},v.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),a=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(a).cmpn(0)},v.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,a=this._endoWnafT2,i=0;i<e.length;i++){var s=this._endoSplit(t[i]),o=e[i],c=o._getBeta();s.k1.negative&&(s.k1.ineg(),o=o.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),n[2*i]=o,n[2*i+1]=c,a[2*i]=s.k1,a[2*i+1]=s.k2}for(var d=this._wnafMulAdd(1,n,a,2*i,r),f=0;f<2*i;f++)n[f]=null,a[f]=null;return d},m(A,g.BasePoint),v.prototype.point=function(e,t,r){return new A(this,e,t,r)},v.prototype.pointFromJSON=function(e,t){return A.fromJSON(this,e,t)},A.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},A.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},A.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function a(t){return e.point(t[0],t[1],r)}var i=t[2];return n.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[n].concat(i.doubles.points.map(a))},naf:i.naf&&{wnd:i.naf.wnd,points:[n].concat(i.naf.points.map(a))}},n},A.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},A.prototype.isInfinity=function(){return this.inf},A.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},A.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),a=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),i=a.redSqr().redISub(this.x.redAdd(this.x)),s=a.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,s)},A.prototype.getX=function(){return this.x.fromRed()},A.prototype.getY=function(){return this.y.fromRed()},A.prototype.mul=function(e){return e=new(a())(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},A.prototype.mulAdd=function(e,t,r){var n=[this,t],a=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,a):this.curve._wnafMulAdd(1,n,a,2)},A.prototype.jmulAdd=function(e,t,r){var n=[this,t],a=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,a,!0):this.curve._wnafMulAdd(1,n,a,2,!0)},A.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},A.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},A.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},m(_,g.BasePoint),v.prototype.jpoint=function(e,t,r){return new _(this,e,t,r)},_.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},_.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},_.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),a=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),o=n.redSub(a),c=i.redSub(s);if(0===o.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var d=o.redSqr(),f=d.redMul(o),u=n.redMul(d),l=c.redSqr().redIAdd(f).redISub(u).redISub(u),h=c.redMul(u.redISub(l)).redISub(i.redMul(f)),p=this.z.redMul(e.z).redMul(o);return this.curve.jpoint(l,h,p)},_.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),a=this.y,i=e.y.redMul(t).redMul(this.z),s=r.redSub(n),o=a.redSub(i);if(0===s.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),d=c.redMul(s),f=r.redMul(c),u=o.redSqr().redIAdd(d).redISub(f).redISub(f),l=o.redMul(f.redISub(u)).redISub(a.redMul(d)),h=this.z.redMul(s);return this.curve.jpoint(u,l,h)},_.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,a=this.curve.tinv,i=this.x,s=this.y,o=this.z,c=o.redSqr().redSqr(),d=s.redAdd(s);for(t=0;t<e;t++){var f=i.redSqr(),u=d.redSqr(),l=u.redSqr(),h=f.redAdd(f).redIAdd(f).redIAdd(n.redMul(c)),p=i.redMul(u),b=h.redSqr().redISub(p.redAdd(p)),g=p.redISub(b),y=h.redMul(g);y=y.redIAdd(y).redISub(l);var m=d.redMul(o);t+1<e&&(c=c.redMul(l)),i=b,o=m,d=y}return this.curve.jpoint(i,d.redMul(a),o)},_.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},_.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),a=this.y.redSqr(),i=a.redSqr(),s=this.x.redAdd(a).redSqr().redISub(n).redISub(i);s=s.redIAdd(s);var o=n.redAdd(n).redIAdd(n),c=o.redSqr().redISub(s).redISub(s),d=i.redIAdd(i);d=(d=d.redIAdd(d)).redIAdd(d),e=c,t=o.redMul(s.redISub(c)).redISub(d),r=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),u=this.y.redSqr(),l=u.redSqr(),h=this.x.redAdd(u).redSqr().redISub(f).redISub(l);h=h.redIAdd(h);var p=f.redAdd(f).redIAdd(f),b=p.redSqr(),g=l.redIAdd(l);g=(g=g.redIAdd(g)).redIAdd(g),e=b.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},_.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),a=this.y.redSqr(),i=a.redSqr(),s=this.x.redAdd(a).redSqr().redISub(n).redISub(i);s=s.redIAdd(s);var o=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=o.redSqr().redISub(s).redISub(s);e=c;var d=i.redIAdd(i);d=(d=d.redIAdd(d)).redIAdd(d),t=o.redMul(s.redISub(c)).redISub(d),r=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),u=this.y.redSqr(),l=this.x.redMul(u),h=this.x.redSub(f).redMul(this.x.redAdd(f));h=h.redAdd(h).redIAdd(h);var p=l.redIAdd(l),b=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(u).redISub(f);var g=u.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=h.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},_.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,a=n.redSqr().redSqr(),i=t.redSqr(),s=r.redSqr(),o=i.redAdd(i).redIAdd(i).redIAdd(e.redMul(a)),c=t.redAdd(t),d=(c=c.redIAdd(c)).redMul(s),f=o.redSqr().redISub(d.redAdd(d)),u=d.redISub(f),l=s.redSqr();l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var h=o.redMul(u).redISub(l),p=r.redAdd(r).redMul(n);return this.curve.jpoint(f,h,p)},_.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),a=e.redAdd(e).redIAdd(e),i=a.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),o=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(i)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var d=a.redIAdd(s).redSqr().redISub(i).redISub(o).redISub(c),f=t.redMul(d);f=(f=f.redIAdd(f)).redIAdd(f);var u=this.x.redMul(o).redISub(f);u=(u=u.redIAdd(u)).redIAdd(u);var l=this.y.redMul(d.redMul(c.redISub(d)).redISub(s.redMul(o)));l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var h=this.z.redAdd(s).redSqr().redISub(r).redISub(o);return this.curve.jpoint(u,l,h)},_.prototype.mul=function(e,t){return e=new(a())(e,t),this.curve._wnafMul(this,e)},_.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),a=r.redMul(e.z);return 0===this.y.redMul(a).redISub(e.y.redMul(n)).cmpn(0)},_.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),a=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(a),0===this.x.cmp(r))return!0}},_.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},_.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var x=o((function(e,t){var r=t;r.base=g,r.short=E,r.mont=null,r.edwards=null})),S=o((function(e,t){var r,n=t,a=u.assert;function i(e){"short"===e.type?this.curve=new x.short(e):"edwards"===e.type?this.curve=new x.edwards(e):this.curve=new x.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function o(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new i(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=i,o("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:s().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:s().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:s().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:s().sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),o("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:s().sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s().sha256,gRed:!1,g:["9"]}),o("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}o("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:s().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function I(e){if(!(this instanceof I))return new I(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=f.toArray(e.entropy,e.entropyEnc||"hex"),r=f.toArray(e.nonce,e.nonceEnc||"hex"),n=f.toArray(e.pers,e.persEnc||"hex");c(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var k=I;I.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a<this.V.length;a++)this.K[a]=0,this.V[a]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},I.prototype._hmac=function(){return new(s().hmac)(this.hash,this.K)},I.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},I.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=f.toArray(e,t),r=f.toArray(r,n),c(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},I.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=f.toArray(r,n||"hex"),this._update(r));for(var a=[];a.length<e;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var i=a.slice(0,e);return this._update(r),this._reseed++,f.encode(i,t)};var C=u.assert;function T(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var B=T;T.fromPublic=function(e,t,r){return t instanceof T?t:new T(e,{pub:t,pubEnc:r})},T.fromPrivate=function(e,t,r){return t instanceof T?t:new T(e,{priv:t,privEnc:r})},T.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},T.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},T.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},T.prototype._importPrivate=function(e,t){this.priv=new(a())(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},T.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?C(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||C(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},T.prototype.derive=function(e){return e.validate()||C(e.validate(),"public point not validated"),e.mul(this.priv).getX()},T.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},T.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},T.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var M=u.assert;function O(e,t){if(e instanceof O)return e;this._importDER(e,t)||(M(e.r&&e.s,"Signature without r or s"),this.r=new(a())(e.r,16),this.s=new(a())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var R=O;function N(){this.place=0}function P(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var a=0,i=0,s=t.place;i<n;i++,s++)a<<=8,a|=e[s],a>>>=0;return!(a<=127)&&(t.place=s,a)}function L(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function F(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}O.prototype._importDER=function(e,t){e=u.toArray(e,t);var r=new N;if(48!==e[r.place++])return!1;var n=P(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=P(e,r);if(!1===i)return!1;var s=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var o=P(e,r);if(!1===o)return!1;if(e.length!==o+r.place)return!1;var c=e.slice(r.place,o+r.place);if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}return this.r=new(a())(s),this.s=new(a())(c),this.recoveryParam=null,!0},O.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=L(t),r=L(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];F(n,t.length),(n=n.concat(t)).push(2),F(n,r.length);var a=n.concat(r),i=[48];return F(i,a.length),i=i.concat(a),u.encode(i,e)};var D=function(){throw new Error("unsupported")},U=u.assert;function H(e){if(!(this instanceof H))return new H(e);"string"==typeof e&&(U(Object.prototype.hasOwnProperty.call(S,e),"Unknown curve "+e),e=S[e]),e instanceof S.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var j=H;H.prototype.keyPair=function(e){return new B(this,e)},H.prototype.keyFromPrivate=function(e,t){return B.fromPrivate(this,e,t)},H.prototype.keyFromPublic=function(e,t){return B.fromPublic(this,e,t)},H.prototype.genKeyPair=function(e){e||(e={});for(var t=new k({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||D(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(a())(2));;){var i=new(a())(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},H.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},H.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new(a())(e,16));for(var i=this.n.byteLength(),s=t.getPrivate().toArray("be",i),o=e.toArray("be",i),c=new k({hash:this.hash,entropy:s,nonce:o,pers:n.pers,persEnc:n.persEnc||"utf8"}),d=this.n.sub(new(a())(1)),f=0;;f++){var u=n.k?n.k(f):new(a())(c.generate(this.n.byteLength()));if(!((u=this._truncateToN(u,!0)).cmpn(1)<=0||u.cmp(d)>=0)){var l=this.g.mul(u);if(!l.isInfinity()){var h=l.getX(),p=h.umod(this.n);if(0!==p.cmpn(0)){var b=u.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(b=b.umod(this.n)).cmpn(0)){var g=(l.getY().isOdd()?1:0)|(0!==h.cmp(p)?2:0);return n.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),g^=1),new R({r:p,s:b,recoveryParam:g})}}}}}},H.prototype.verify=function(e,t,r,n){e=this._truncateToN(new(a())(e,16)),r=this.keyFromPublic(r,n);var i=(t=new R(t,"hex")).r,s=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var o,c=s.invm(this.n),d=c.mul(e).umod(this.n),f=c.mul(i).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(d,r.getPublic(),f)).isInfinity()&&o.eqXToP(i):!(o=this.g.mulAdd(d,r.getPublic(),f)).isInfinity()&&0===o.getX().umod(this.n).cmp(i)},H.prototype.recoverPubKey=function(e,t,r,n){U((3&r)===r,"The recovery param is more than two bits"),t=new R(t,n);var i=this.n,s=new(a())(e),o=t.r,c=t.s,d=1&r,f=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");o=f?this.curve.pointFromX(o.add(this.curve.n),d):this.curve.pointFromX(o,d);var u=t.r.invm(i),l=i.sub(s).mul(u).umod(i),h=c.mul(u).umod(i);return this.g.mulAdd(l,o,h)},H.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new R(t,n)).recoveryParam)return t.recoveryParam;for(var a=0;a<4;a++){var i;try{i=this.recoverPubKey(e,t,a)}catch(e){continue}if(i.eq(r))return a}throw new Error("Unable to find valid recovery factor")};var V=o((function(e,t){var r=t;r.version="6.5.4",r.utils=u,r.rand=function(){throw new Error("unsupported")},r.curve=x,r.curves=S,r.ec=j,r.eddsa=null})).ec,$=r(5372),z=r(2428);const q=new(r(7587).Logger)("signing-key/5.7.0");let K=null;function G(){return K||(K=new V("secp256k1")),K}class J{constructor(e){(0,z.defineReadOnly)(this,"curve","secp256k1"),(0,z.defineReadOnly)(this,"privateKey",(0,$.hexlify)(e)),32!==(0,$.hexDataLength)(this.privateKey)&&q.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=G().keyFromPrivate((0,$.arrayify)(this.privateKey));(0,z.defineReadOnly)(this,"publicKey","0x"+t.getPublic(!1,"hex")),(0,z.defineReadOnly)(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),(0,z.defineReadOnly)(this,"_isSigningKey",!0)}_addPoint(e){const t=G().keyFromPublic((0,$.arrayify)(this.publicKey)),r=G().keyFromPublic((0,$.arrayify)(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=G().keyFromPrivate((0,$.arrayify)(this.privateKey)),r=(0,$.arrayify)(e);32!==r.length&&q.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return(0,$.splitSignature)({recoveryParam:n.recoveryParam,r:(0,$.hexZeroPad)("0x"+n.r.toString(16),32),s:(0,$.hexZeroPad)("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=G().keyFromPrivate((0,$.arrayify)(this.privateKey)),r=G().keyFromPublic((0,$.arrayify)(Y(e)));return(0,$.hexZeroPad)("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function W(e,t){const r=(0,$.splitSignature)(t),n={r:(0,$.arrayify)(r.r),s:(0,$.arrayify)(r.s)};return"0x"+G().recoverPubKey((0,$.arrayify)(e),n,r.recoveryParam).encode("hex",!1)}function Y(e,t){const r=(0,$.arrayify)(e);if(32===r.length){const e=new J(r);return t?"0x"+G().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?(0,$.hexlify)(r):"0x"+G().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+G().keyFromPublic(r).getPublic(!0,"hex"):(0,$.hexlify)(r):q.throwArgumentError("invalid public or private key","key","[REDACTED]")}},440:(e,t,r)=>{"use strict";r.r(t),r.d(t,{keccak256:()=>g,pack:()=>b,sha256:()=>y});var n=r(9674),a=r(5372),i=r(9729),s=r(5465),o=r(7867),c=r(7587);const d=new RegExp("^bytes([0-9]+)$"),f=new RegExp("^(u?int)([0-9]*)$"),u=new RegExp("^(.*)\\[([0-9]*)\\]$"),l="0000000000000000000000000000000000000000000000000000000000000000",h=new c.Logger("solidity/5.7.0");function p(e,t,r){switch(e){case"address":return r?(0,a.zeroPad)(t,32):(0,a.arrayify)(t);case"string":return(0,o.YW)(t);case"bytes":return(0,a.arrayify)(t);case"bool":return t=t?"0x01":"0x00",r?(0,a.zeroPad)(t,32):(0,a.arrayify)(t)}let i=e.match(f);if(i){let s=parseInt(i[2]||"256");return(i[2]&&String(s)!==i[2]||s%8!=0||0===s||s>256)&&h.throwArgumentError("invalid number type","type",e),r&&(s=256),t=n.gH.from(t).toTwos(s),(0,a.zeroPad)(t,s/8)}if(i=e.match(d),i){const n=parseInt(i[1]);return(String(n)!==i[1]||0===n||n>32)&&h.throwArgumentError("invalid bytes type","type",e),(0,a.arrayify)(t).byteLength!==n&&h.throwArgumentError(`invalid value for ${e}`,"value",t),r?(0,a.arrayify)((t+l).substring(0,66)):t}if(i=e.match(u),i&&Array.isArray(t)){const r=i[1];parseInt(i[2]||String(t.length))!=t.length&&h.throwArgumentError(`invalid array length for ${e}`,"value",t);const n=[];return t.forEach((function(e){n.push(p(r,e,!0))})),(0,a.concat)(n)}return h.throwArgumentError("invalid type","type",e)}function b(e,t){e.length!=t.length&&h.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,n){r.push(p(e,t[n]))})),(0,a.hexlify)((0,a.concat)(r))}function g(e,t){return(0,i.keccak256)(b(e,t))}function y(e,t){return(0,s.sc)(b(e,t))}},5413:(e,t,r)=>{"use strict";r.r(t),r.d(t,{UnicodeNormalizationForm:()=>i.dz,Utf8ErrorFuncs:()=>i.d5,Utf8ErrorReason:()=>i._E,_toEscapedUtf8String:()=>i.Wj,formatBytes32String:()=>s,nameprep:()=>m,parseBytes32String:()=>o,toUtf8Bytes:()=>i.YW,toUtf8CodePoints:()=>i.dg,toUtf8String:()=>i._v});const n="0x0000000000000000000000000000000000000000000000000000000000000000";var a=r(5372),i=r(7867);function s(e){const t=(0,i.YW)(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return(0,a.hexlify)((0,a.concat)([t,n]).slice(0,32))}function o(e){const t=(0,a.arrayify)(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return(0,i._v)(t.slice(0,r))}function c(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach((e=>{let a=e.split(":");r+=parseInt(a[0],16),n[r]=t(a[1])})),n}function d(e){let t=0;return e.split(",").map((e=>{let r=e.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=t+parseInt(r[0],16);return t=parseInt(r[1],16),{l:n,h:t}}))}function f(e,t){let r=0;for(let n=0;n<t.length;n++){let a=t[n];if(r+=a.l,e>=r&&e<=r+a.h&&(e-r)%(a.d||1)==0){if(a.e&&-1!==a.e.indexOf(e-r))continue;return a}}return null}const u=d("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),l="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),h=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],p=c("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),b=c("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),g=c("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let r=0;r<e.length;r+=4)t.push(parseInt(e.substring(r,r+4),16));return t})),y=d("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function m(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let t=(0,i.dg)(e);var r;r=t.map((e=>{if(l.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=f(e,h);if(t)return[e+t.s];let r=p[e];if(r)return r;let n=b[e];return n?[e+n[0]]:g[e]||null}(e);return t||[e]})),t=r.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=(0,i.dg)((0,i.H5)(t),i.dz.NFKC),t.forEach((e=>{if(f(e,y))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(f(e,u))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let n=(0,i.H5)(t);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");return n}},7867:(e,t,r)=>{"use strict";r.d(t,{dz:()=>i,d5:()=>c,_E:()=>s,Wj:()=>l,H5:()=>h,YW:()=>f,dg:()=>b,_v:()=>p});var n=r(5372);const a=new(r(7587).Logger)("strings/5.7.0");var i,s;function o(e,t,r,n,a){if(e===s.BAD_PREFIX||e===s.UNEXPECTED_CONTINUE){let e=0;for(let n=t+1;n<r.length&&r[n]>>6==2;n++)e++;return e}return e===s.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(i||(i={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(s||(s={}));const c=Object.freeze({error:function(e,t,r,n,i){return a.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:o,replace:function(e,t,r,n,a){return e===s.OVERLONG?(n.push(a),0):(n.push(65533),o(e,t,r))}});function d(e,t){null==t&&(t=c.error),e=(0,n.arrayify)(e);const r=[];let a=0;for(;a<e.length;){const n=e[a++];if(!(n>>7)){r.push(n);continue}let i=null,o=null;if(192==(224&n))i=1,o=127;else if(224==(240&n))i=2,o=2047;else{if(240!=(248&n)){a+=t(128==(192&n)?s.UNEXPECTED_CONTINUE:s.BAD_PREFIX,a-1,e,r);continue}i=3,o=65535}if(a-1+i>=e.length){a+=t(s.OVERRUN,a-1,e,r);continue}let c=n&(1<<8-i-1)-1;for(let n=0;n<i;n++){let n=e[a];if(128!=(192&n)){a+=t(s.MISSING_CONTINUE,a,e,r),c=null;break}c=c<<6|63&n,a++}null!==c&&(c>1114111?a+=t(s.OUT_OF_RANGE,a-1-i,e,r,c):c>=55296&&c<=57343?a+=t(s.UTF16_SURROGATE,a-1-i,e,r,c):c<=o?a+=t(s.OVERLONG,a-1-i,e,r,c):r.push(c))}return r}function f(e,t=i.current){t!=i.current&&(a.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const a=e.charCodeAt(t);if(t>=e.length||56320!=(64512&a))throw new Error("invalid utf-8 string");const i=65536+((1023&n)<<10)+(1023&a);r.push(i>>18|240),r.push(i>>12&63|128),r.push(i>>6&63|128),r.push(63&i|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return(0,n.arrayify)(r)}function u(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function l(e,t){return'"'+d(e,t).map((e=>{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?u(e):u(55296+((e-=65536)>>10&1023))+u(56320+(1023&e))})).join("")+'"'}function h(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function p(e,t){return h(d(e,t))}function b(e,t=i.current){return d(f(e,t))}},7808:(e,t,r)=>{"use strict";r.r(t),r.d(t,{TransactionTypes:()=>h,accessListify:()=>A,computeAddress:()=>m,parse:()=>C,recoverAddress:()=>w,serialize:()=>I});var n=r(1277),a=r(9674),i=r(5372),s=r(2899),o=r(9729),c=r(2428),d=r(5205),f=r(379),u=r(7587);const l=new u.Logger("transactions/5.7.0");var h;function p(e){return"0x"===e?null:(0,n.getAddress)(e)}function b(e){return"0x"===e?s.XK:a.gH.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(h||(h={}));const g=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],y={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function m(e){const t=(0,f.computePublicKey)(e);return(0,n.getAddress)((0,i.hexDataSlice)((0,o.keccak256)((0,i.hexDataSlice)(t,1)),12))}function w(e,t){return m((0,f.recoverPublicKey)((0,i.arrayify)(e),t))}function v(e,t){const r=(0,i.stripZeros)(a.gH.from(e).toHexString());return r.length>32&&l.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function E(e,t){return{address:(0,n.getAddress)(e),storageKeys:(t||[]).map(((t,r)=>(32!==(0,i.hexDataLength)(t)&&l.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase())))}}function A(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&l.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),E(e[0],e[1])):E(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return E(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function _(e){return A(e).map((e=>[e.address,e.storageKeys]))}function x(e,t){if(null!=e.gasPrice){const t=a.gH.from(e.gasPrice),r=a.gH.from(e.maxFeePerGas||0);t.eq(r)||l.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[v(e.chainId||0,"chainId"),v(e.nonce||0,"nonce"),v(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),v(e.maxFeePerGas||0,"maxFeePerGas"),v(e.gasLimit||0,"gasLimit"),null!=e.to?(0,n.getAddress)(e.to):"0x",v(e.value||0,"value"),e.data||"0x",_(e.accessList||[])];if(t){const e=(0,i.splitSignature)(t);r.push(v(e.recoveryParam,"recoveryParam")),r.push((0,i.stripZeros)(e.r)),r.push((0,i.stripZeros)(e.s))}return(0,i.hexConcat)(["0x02",d.encode(r)])}function S(e,t){const r=[v(e.chainId||0,"chainId"),v(e.nonce||0,"nonce"),v(e.gasPrice||0,"gasPrice"),v(e.gasLimit||0,"gasLimit"),null!=e.to?(0,n.getAddress)(e.to):"0x",v(e.value||0,"value"),e.data||"0x",_(e.accessList||[])];if(t){const e=(0,i.splitSignature)(t);r.push(v(e.recoveryParam,"recoveryParam")),r.push((0,i.stripZeros)(e.r)),r.push((0,i.stripZeros)(e.s))}return(0,i.hexConcat)(["0x01",d.encode(r)])}function I(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&l.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){(0,c.checkProperties)(e,y);const r=[];g.forEach((function(t){let n=e[t.name]||[];const a={};t.numeric&&(a.hexPad="left"),n=(0,i.arrayify)((0,i.hexlify)(n,a)),t.length&&n.length!==t.length&&n.length>0&&l.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=(0,i.stripZeros)(n),n.length>t.maxLength&&l.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push((0,i.hexlify)(n))}));let n=0;if(null!=e.chainId?(n=e.chainId,"number"!=typeof n&&l.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!(0,i.isBytesLike)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push((0,i.hexlify)(n)),r.push("0x"),r.push("0x")),!t)return d.encode(r);const a=(0,i.splitSignature)(t);let s=27+a.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),s+=2*n+8,a.v>28&&a.v!==s&&l.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):a.v!==s&&l.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push((0,i.hexlify)(s)),r.push((0,i.stripZeros)((0,i.arrayify)(a.r))),r.push((0,i.stripZeros)((0,i.arrayify)(a.s))),d.encode(r)}(e,t);switch(e.type){case 1:return S(e,t);case 2:return x(e,t)}return l.throwError(`unsupported transaction type: ${e.type}`,u.Logger.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function k(e,t,r){try{const r=b(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){l.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=(0,i.hexZeroPad)(t[1],32),e.s=(0,i.hexZeroPad)(t[2],32);try{const t=(0,o.keccak256)(r(e));e.from=w(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function C(e){const t=(0,i.arrayify)(e);if(t[0]>127)return function(e){const t=d.decode(e);9!==t.length&&6!==t.length&&l.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:b(t[0]).toNumber(),gasPrice:b(t[1]),gasLimit:b(t[2]),to:p(t[3]),value:b(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=a.gH.from(t[6]).toNumber()}catch(e){return r}if(r.r=(0,i.hexZeroPad)(t[7],32),r.s=(0,i.hexZeroPad)(t[8],32),a.gH.from(r.r).isZero()&&a.gH.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const a=t.slice(0,6);0!==r.chainId&&(a.push((0,i.hexlify)(r.chainId)),a.push("0x"),a.push("0x"),n-=2*r.chainId+8);const s=(0,o.keccak256)(d.encode(a));try{r.from=w(s,{r:(0,i.hexlify)(r.r),s:(0,i.hexlify)(r.s),recoveryParam:n})}catch(e){}r.hash=(0,o.keccak256)(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=d.decode(e.slice(1));8!==t.length&&11!==t.length&&l.throwArgumentError("invalid component count for transaction type: 1","payload",(0,i.hexlify)(e));const r={type:1,chainId:b(t[0]).toNumber(),nonce:b(t[1]).toNumber(),gasPrice:b(t[2]),gasLimit:b(t[3]),to:p(t[4]),value:b(t[5]),data:t[6],accessList:A(t[7])};return 8===t.length||(r.hash=(0,o.keccak256)(e),k(r,t.slice(8),S)),r}(t);case 2:return function(e){const t=d.decode(e.slice(1));9!==t.length&&12!==t.length&&l.throwArgumentError("invalid component count for transaction type: 2","payload",(0,i.hexlify)(e));const r=b(t[2]),n=b(t[3]),a={type:2,chainId:b(t[0]).toNumber(),nonce:b(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:b(t[4]),to:p(t[5]),value:b(t[6]),data:t[7],accessList:A(t[8])};return 9===t.length||(a.hash=(0,o.keccak256)(e),k(a,t.slice(9),x)),a}(t)}return l.throwError(`unsupported transaction type: ${t[0]}`,u.Logger.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}},9967:(e,t,r)=>{"use strict";r.r(t),r.d(t,{commify:()=>A,formatEther:()=>S,formatUnits:()=>_,parseEther:()=>I,parseUnits:()=>x});var n=r(5372),a=r(7587),i=r(3894),s=r(9674);const o=new a.Logger(i.r),c={},d=s.gH.from(0),f=s.gH.from(-1);function u(e,t,r,n){const i={fault:t,operation:r};return void 0!==n&&(i.value=n),o.throwError(e,a.Logger.errors.NUMERIC_FAULT,i)}let l="0";for(;l.length<256;)l+=l;function h(e){if("number"!=typeof e)try{e=s.gH.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+l.substring(0,e):o.throwArgumentError("invalid decimal size","decimals",e)}function p(e,t){null==t&&(t=0);const r=h(t),n=(e=s.gH.from(e)).lt(d);n&&(e=e.mul(f));let a=e.mod(r).toString();for(;a.length<r.length-1;)a="0"+a;a=a.match(/^([0-9]*[1-9]|0)(0*)/)[1];const i=e.div(r).toString();return e=1===r.length?i:i+"."+a,n&&(e="-"+e),e}function b(e,t){null==t&&(t=0);const r=h(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||o.throwArgumentError("invalid decimal value","value",e);const n="-"===e.substring(0,1);n&&(e=e.substring(1)),"."===e&&o.throwArgumentError("missing value","value",e);const a=e.split(".");a.length>2&&o.throwArgumentError("too many decimal points","value",e);let i=a[0],c=a[1];for(i||(i="0"),c||(c="0");"0"===c[c.length-1];)c=c.substring(0,c.length-1);for(c.length>r.length-1&&u("fractional component exceeds decimals","underflow","parseFixed"),""===c&&(c="0");c.length<r.length-1;)c+="0";const d=s.gH.from(i),l=s.gH.from(c);let p=d.mul(r).add(l);return n&&(p=p.mul(f)),p}class g{constructor(e,t,r,n){e!==c&&o.throwError("cannot use FixedFormat constructor; use FixedFormat.from",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=r,this.decimals=n,this.name=(t?"":"u")+"fixed"+String(r)+"x"+String(n),this._multiplier=h(n),Object.freeze(this)}static from(e){if(e instanceof g)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,r=128,n=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const a=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);a||o.throwArgumentError("invalid fixed format","format",e),t="u"!==a[1],r=parseInt(a[2]),n=parseInt(a[3])}else if(e){const a=(t,r,n)=>null==e[t]?n:(typeof e[t]!==r&&o.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=a("signed","boolean",t),r=a("width","number",r),n=a("decimals","number",n)}return r%8&&o.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&o.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new g(c,t,r,n)}}class y{constructor(e,t,r,n){e!==c&&o.throwError("cannot use FixedNumber constructor; use FixedNumber.from",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&o.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=b(this._value,this.format.decimals),r=b(e._value,e.format.decimals);return y.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=b(this._value,this.format.decimals),r=b(e._value,e.format.decimals);return y.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=b(this._value,this.format.decimals),r=b(e._value,e.format.decimals);return y.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=b(this._value,this.format.decimals),r=b(e._value,e.format.decimals);return y.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=y.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(m.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=y.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(m.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&o.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=y.from("1"+l.substring(0,e),this.format),n=w.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&o.throwArgumentError("invalid byte width","width",e);const t=s.gH.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return(0,n.hexZeroPad)(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return y.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||(0,s.YR)(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),y.fromString(p(e,t),g.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=g.from(t),a=b(e,r.decimals);!r.signed&&a.lt(d)&&u("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=a.toTwos(r.width).toHexString():(i=a.toHexString(),i=(0,n.hexZeroPad)(i,r.width/8));const s=p(a,r.decimals);return new y(c,i,s,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=g.from(t);if((0,n.arrayify)(e).length>r.width/8)throw new Error("overflow");let a=s.gH.from(e);r.signed&&(a=a.fromTwos(r.width));const i=a.toTwos((r.signed?0:1)+r.width).toHexString(),o=p(a,r.decimals);return new y(c,i,o,r)}static from(e,t){if("string"==typeof e)return y.fromString(e,t);if((0,n.isBytes)(e))return y.fromBytes(e,t);try{return y.fromValue(e,0,t)}catch(e){if(e.code!==a.Logger.errors.INVALID_ARGUMENT)throw e}return o.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const m=y.from(1),w=y.from("0.5"),v=new a.Logger("units/5.7.0"),E=["wei","kwei","mwei","gwei","szabo","finney","ether"];function A(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&v.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let a="";for(2===t.length&&(a="."+(t[1]||"0"));a.length>2&&"0"===a[a.length-1];)a=a.substring(0,a.length-1);const i=[];for(;r.length;){if(r.length<=3){i.unshift(r);break}{const e=r.length-3;i.unshift(r.substring(e)),r=r.substring(0,e)}}return n+i.join(",")+a}function _(e,t){if("string"==typeof t){const e=E.indexOf(t);-1!==e&&(t=3*e)}return p(e,null!=t?t:18)}function x(e,t){if("string"!=typeof e&&v.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=E.indexOf(t);-1!==e&&(t=3*e)}return b(e,null!=t?t:18)}function S(e){return _(e,18)}function I(e){return x(e,18)}},1196:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Wallet:()=>k,verifyMessage:()=>C,verifyTypedData:()=>T});var n=r(1277),a=r(9674),i=r(5372),s=r(2428),o=r(7587);var c=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function o(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}c((n=n.apply(e,t||[])).next())}))};const d=new o.Logger("abstract-provider/5.7.0");s.Description;class f{constructor(){d.checkAbstract(new.target,f),(0,s.defineReadOnly)(this,"_isProvider",!0)}getFeeData(){return c(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield(0,s.resolveProperties)({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let r=null,n=null,i=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,i=a.gH.from("1500000000"),n=e.baseFeePerGas.mul(2).add(i)),{lastBaseFeePerGas:r,maxFeePerGas:n,maxPriorityFeePerGas:i,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}var u=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function o(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}c((n=n.apply(e,t||[])).next())}))};const l=new o.Logger("abstract-signer/5.7.0"),h=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],p=[o.Logger.errors.INSUFFICIENT_FUNDS,o.Logger.errors.NONCE_EXPIRED,o.Logger.errors.REPLACEMENT_UNDERPRICED];class b{constructor(){l.checkAbstract(new.target,b),(0,s.defineReadOnly)(this,"_isSigner",!0)}getBalance(e){return u(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return u(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return u(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield(0,s.resolveProperties)(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return u(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield(0,s.resolveProperties)(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return u(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)}))}getChainId(){return u(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return u(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return u(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return u(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const t in e)-1===h.indexOf(t)&&l.throwArgumentError("invalid transaction key: "+t,"transaction",e);const t=(0,s.shallowCopy)(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&l.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return u(this,void 0,void 0,(function*(){const t=yield(0,s.resolveProperties)(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>u(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&l.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||l.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):l.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(r&&l.throwError("network does not support EIP-1559",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):l.throwError("failed to get consistent fee data",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(p.indexOf(e.code)>=0)throw e;return l.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",o.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&l.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield(0,s.resolveProperties)(t)}))}_checkProvider(e){this.provider||l.throwError("missing provider",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}var g=r(2623),y=r(7273),m=r(2294),w=r(9729),v=r(4495),E=r(379),A=r(453),_=r(1095),x=r(7808);var S=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function o(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}c((n=n.apply(e,t||[])).next())}))};const I=new o.Logger("wallet/5.7.0");class k extends b{constructor(e,t){if(super(),null!=(r=e)&&(0,i.isHexString)(r.privateKey,32)&&null!=r.address){const t=new E.SigningKey(e.privateKey);if((0,s.defineReadOnly)(this,"_signingKey",(()=>t)),(0,s.defineReadOnly)(this,"address",(0,x.computeAddress)(this.publicKey)),this.address!==(0,n.getAddress)(e.address)&&I.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;(0,s.defineReadOnly)(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||m.defaultPath,locale:t.locale||"en"})));const r=this.mnemonic,n=m.HDNode.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path);(0,x.computeAddress)(n.privateKey)!==this.address&&I.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else(0,s.defineReadOnly)(this,"_mnemonic",(()=>null))}else{if(E.SigningKey.isSigningKey(e))"secp256k1"!==e.curve&&I.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),(0,s.defineReadOnly)(this,"_signingKey",(()=>e));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new E.SigningKey(e);(0,s.defineReadOnly)(this,"_signingKey",(()=>t))}(0,s.defineReadOnly)(this,"_mnemonic",(()=>null)),(0,s.defineReadOnly)(this,"address",(0,x.computeAddress)(this.publicKey))}var r;t&&!f.isProvider(t)&&I.throwArgumentError("invalid provider","provider",t),(0,s.defineReadOnly)(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new k(this,e)}signTransaction(e){return(0,s.resolveProperties)(e).then((t=>{null!=t.from&&((0,n.getAddress)(t.from)!==this.address&&I.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest((0,w.keccak256)((0,x.serialize)(t)));return(0,x.serialize)(t,r)}))}signMessage(e){return S(this,void 0,void 0,(function*(){return(0,i.joinSignature)(this._signingKey().signDigest((0,g.A)(e)))}))}_signTypedData(e,t,r){return S(this,void 0,void 0,(function*(){const n=yield y.z.resolveNames(e,t,r,(e=>(null==this.provider&&I.throwError("cannot resolve ENS names without a provider",o.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return(0,i.joinSignature)(this._signingKey().signDigest(y.z.hash(n.domain,t,n.value)))}))}encrypt(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw new Error("invalid callback");return t||(t={}),(0,A.w)(this,e,t,r)}static createRandom(e){let t=(0,v.p)(16);e||(e={}),e.extraEntropy&&(t=(0,i.arrayify)((0,i.hexDataSlice)((0,w.keccak256)((0,i.concat)([t,e.extraEntropy])),0,16)));const r=(0,m.entropyToMnemonic)(t,e.locale);return k.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return(0,_.decryptJsonWallet)(e,t,r).then((e=>new k(e)))}static fromEncryptedJsonSync(e,t){return new k((0,_.decryptJsonWalletSync)(e,t))}static fromMnemonic(e,t,r){return t||(t=m.defaultPath),new k(m.HDNode.fromMnemonic(e,null,r).derivePath(t))}}function C(e,t){return(0,x.recoverAddress)((0,g.A)(e),t)}function T(e,t,r,n){return(0,x.recoverAddress)(y.z.hash(e,t,r),n)}},3546:(e,t,r)=>{"use strict";r.r(t),r.d(t,{_fetchData:()=>p,fetchJson:()=>b,poll:()=>g});var n=r(976),a=r(5372),i=r(2428),s=r(7867),o=r(7587);var c=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function o(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}c((n=n.apply(e,t||[])).next())}))};function d(e,t){return c(this,void 0,void 0,(function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};if(!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client"),null!=t.fetchOptions){const e=t.fetchOptions;e.mode&&(r.mode=e.mode),e.cache&&(r.cache=e.cache),e.credentials&&(r.credentials=e.credentials),e.redirect&&(r.redirect=e.redirect),e.referrer&&(r.referrer=e.referrer)}const n=yield fetch(e,r),i=yield n.arrayBuffer(),s={};return n.headers.forEach?n.headers.forEach(((e,t)=>{s[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{s[e.toLowerCase()]=n.headers.get(e)})),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:(0,a.arrayify)(new Uint8Array(i))}}))}var f=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function o(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}c((n=n.apply(e,t||[])).next())}))};const u=new o.Logger("web/5.7.1");function l(e){return new Promise((t=>{setTimeout(t,e)}))}function h(e,t){if(null==e)return null;if("string"==typeof e)return e;if((0,a.isBytesLike)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return(0,s._v)(e)}catch(e){}return(0,a.hexlify)(e)}return e}function p(e,t,r){const a="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;u.assertArgument(a>0&&a%1==0,"invalid connection throttle limit","connection.throttleLimit",a);const c="object"==typeof e?e.throttleCallback:null,p="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;u.assertArgument(p>0&&p%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",p);const b="object"==typeof e&&!!e.errorPassThrough,g={};let y=null;const m={method:"GET"};let w=!1,v=12e4;if("string"==typeof e)y=e;else if("object"==typeof e){if(null!=e&&null!=e.url||u.throwArgumentError("missing URL","connection.url",e),y=e.url,"number"==typeof e.timeout&&e.timeout>0&&(v=e.timeout),e.headers)for(const t in e.headers)g[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(w=!0);if(m.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==y.substring(0,6)&&!0!==e.allowInsecureAuthentication&&u.throwError("basic authentication requires a secure https url",o.Logger.errors.INVALID_ARGUMENT,{argument:"url",url:y,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;g.authorization={key:"Authorization",value:"Basic "+(0,n.l)((0,s.YW)(t))}}null!=e.skipFetchSetup&&(m.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(m.fetchOptions=(0,i.shallowCopy)(e.fetchOptions))}const E=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),A=y?y.match(E):null;if(A)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":A[1]||"text/plain"},body:A[2]?(0,n.D)(A[3]):(_=A[3],(0,s.YW)(_.replace(/%([0-9a-f][0-9a-f])/gi,((e,t)=>String.fromCharCode(parseInt(t,16))))))};let t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(e){u.throwError("processing response error",o.Logger.errors.SERVER_ERROR,{body:h(A[1],A[2]),error:e,requestBody:null,requestMethod:"GET",url:y})}var _;t&&(m.method="POST",m.body=t,null==g["content-type"]&&(g["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==g["content-length"]&&(g["content-length"]={key:"Content-Length",value:String(t.length)}));const x={};Object.keys(g).forEach((e=>{const t=g[e];x[t.key]=t.value})),m.headers=x;const S=function(){let e=null;return{promise:new Promise((function(t,r){v&&(e=setTimeout((()=>{null!=e&&(e=null,r(u.makeError("timeout",o.Logger.errors.TIMEOUT,{requestBody:h(m.body,x["content-type"]),requestMethod:m.method,timeout:v,url:y})))}),v))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),I=function(){return f(this,void 0,void 0,(function*(){for(let e=0;e<a;e++){let t=null;try{if(t=yield d(y,m),e<a)if(301===t.statusCode||302===t.statusCode){const e=t.headers.location||"";if("GET"===m.method&&e.match(/^https:/)){y=t.headers.location;continue}}else if(429===t.statusCode){let r=!0;if(c&&(r=yield c(e,y)),r){let r=0;const n=t.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):p*parseInt(String(Math.random()*Math.pow(2,e))),yield l(r);continue}}}catch(e){t=e.response,null==t&&(S.cancel(),u.throwError("missing response",o.Logger.errors.SERVER_ERROR,{requestBody:h(m.body,x["content-type"]),requestMethod:m.method,serverError:e,url:y}))}let n=t.body;if(w&&304===t.statusCode?n=null:!b&&(t.statusCode<200||t.statusCode>=300)&&(S.cancel(),u.throwError("bad response",o.Logger.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:h(n,t.headers?t.headers["content-type"]:null),requestBody:h(m.body,x["content-type"]),requestMethod:m.method,url:y})),r)try{const e=yield r(n,t);return S.cancel(),e}catch(r){if(r.throttleRetry&&e<a){let t=!0;if(c&&(t=yield c(e,y)),t){const t=p*parseInt(String(Math.random()*Math.pow(2,e)));yield l(t);continue}}S.cancel(),u.throwError("processing response error",o.Logger.errors.SERVER_ERROR,{body:h(n,t.headers?t.headers["content-type"]:null),error:r,requestBody:h(m.body,x["content-type"]),requestMethod:m.method,url:y})}return S.cancel(),n}return u.throwError("failed response",o.Logger.errors.SERVER_ERROR,{requestBody:h(m.body,x["content-type"]),requestMethod:m.method,url:y})}))}();return Promise.race([S.promise,I])}function b(e,t,r){let n=null;if(null!=t){n=(0,s.YW)(t);const r="string"==typeof e?{url:e}:(0,i.shallowCopy)(e);if(r.headers){0!==Object.keys(r.headers).filter((e=>"content-type"===e.toLowerCase())).length||(r.headers=(0,i.shallowCopy)(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};e=r}return p(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse((0,s._v)(e))}catch(t){u.throwError("invalid JSON",o.Logger.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function g(e,t){return t||(t={}),null==(t=(0,i.shallowCopy)(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){let a=null,i=!1;const s=()=>!i&&(i=!0,a&&clearTimeout(a),!0);t.timeout&&(a=setTimeout((()=>{s()&&n(new Error("timeout"))}),t.timeout));const o=t.retryLimit;let c=0;!function a(){return e().then((function(e){if(void 0!==e)s()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",a);else if(t.onceBlock)t.onceBlock.once("block",a);else if(!i){if(c++,c>o)return void(s()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));e<t.floor&&(e=t.floor),e>t.ceiling&&(e=t.ceiling),setTimeout(a,e)}return null}),(function(e){s()&&n(e)}))}()}))}},4606:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertExhaustive=t.assertStruct=t.assert=t.AssertionError=void 0;const n=r(9999);function a(e,t){return r=e,Boolean("string"==typeof r?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var r}class i extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}t.AssertionError=i,t.assert=function(e,t="Assertion failed.",r=i){if(!e){if(t instanceof Error)throw t;throw a(r,t)}},t.assertStruct=function(e,t,r="Assertion failed",s=i){try{(0,n.assert)(e,t)}catch(e){throw a(s,`${r}: ${function(e){const t=function(e){return"object"==typeof e&&null!==e&&"message"in e}(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}(e)}.`)}},t.assertExhaustive=function(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}},6907:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.base64=void 0;const n=r(9999),a=r(4606);t.base64=(e,t={})=>{const r=t.paddingRequired??!1,i=t.characterSet??"base64";let s,o;return"base64"===i?s=String.raw`[A-Za-z0-9+\/]`:((0,a.assert)("base64url"===i),s=String.raw`[-_A-Za-z0-9]`),o=r?new RegExp(`^(?:${s}{4})*(?:${s}{3}=|${s}{2}==)?$`,"u"):new RegExp(`^(?:${s}{4})*(?:${s}{2,3}|${s}{3}=|${s}{2}==)?$`,"u"),(0,n.pattern)(e,o)}},8609:(e,t,r)=>{"use strict";var n=r(1048).hp;Object.defineProperty(t,"__esModule",{value:!0}),t.createDataView=t.concatBytes=t.valueToBytes=t.stringToBytes=t.numberToBytes=t.signedBigIntToBytes=t.bigIntToBytes=t.hexToBytes=t.bytesToString=t.bytesToNumber=t.bytesToSignedBigInt=t.bytesToBigInt=t.bytesToHex=t.assertIsBytes=t.isBytes=void 0;const a=r(4606),i=r(6395),s=48,o=58,c=87;const d=function(){const e=[];return()=>{if(0===e.length)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}();function f(e){return e instanceof Uint8Array}function u(e){(0,a.assert)(f(e),"Value must be a Uint8Array.")}function l(e){if(u(e),0===e.length)return"0x";const t=d(),r=new Array(e.length);for(let n=0;n<e.length;n++)r[n]=t[e[n]];return(0,i.add0x)(r.join(""))}function h(e){u(e);const t=l(e);return BigInt(t)}function p(e){if("0x"===e?.toLowerCase?.())return new Uint8Array;(0,i.assertIsHexString)(e);const t=(0,i.remove0x)(e).toLowerCase(),r=t.length%2==0?t:`0${t}`,n=new Uint8Array(r.length/2);for(let e=0;e<n.length;e++){const t=r.charCodeAt(2*e),a=r.charCodeAt(2*e+1),i=t-(t<o?s:c),d=a-(a<o?s:c);n[e]=16*i+d}return n}function b(e){(0,a.assert)("bigint"==typeof e,"Value must be a bigint."),(0,a.assert)(e>=BigInt(0),"Value must be a non-negative bigint.");return p(e.toString(16))}function g(e){(0,a.assert)("number"==typeof e,"Value must be a number."),(0,a.assert)(e>=0,"Value must be a non-negative number."),(0,a.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");return p(e.toString(16))}function y(e){return(0,a.assert)("string"==typeof e,"Value must be a string."),(new TextEncoder).encode(e)}function m(e){if("bigint"==typeof e)return b(e);if("number"==typeof e)return g(e);if("string"==typeof e)return e.startsWith("0x")?p(e):y(e);if(f(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}t.isBytes=f,t.assertIsBytes=u,t.bytesToHex=l,t.bytesToBigInt=h,t.bytesToSignedBigInt=function(e){u(e);let t=BigInt(0);for(const r of e)t=(t<<BigInt(8))+BigInt(r);return BigInt.asIntN(8*e.length,t)},t.bytesToNumber=function(e){u(e);const t=h(e);return(0,a.assert)(t<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(t)},t.bytesToString=function(e){return u(e),(new TextDecoder).decode(e)},t.hexToBytes=p,t.bigIntToBytes=b,t.signedBigIntToBytes=function(e,t){(0,a.assert)("bigint"==typeof e,"Value must be a bigint."),(0,a.assert)("number"==typeof t,"Byte length must be a number."),(0,a.assert)(t>0,"Byte length must be greater than 0."),(0,a.assert)(function(e,t){(0,a.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(8*t-1))}(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let e=0;e<n.length;e++)n[e]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()},t.numberToBytes=g,t.stringToBytes=y,t.valueToBytes=m,t.concatBytes=function(e){const t=new Array(e.length);let r=0;for(let n=0;n<e.length;n++){const a=m(e[n]);t[n]=a,r+=a.length}const n=new Uint8Array(r);for(let e=0,r=0;e<t.length;e++)n.set(t[e],r),r+=t[e].length;return n},t.createDataView=function(e){if(void 0!==n&&e instanceof n){const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new DataView(t)}return new DataView(e.buffer,e.byteOffset,e.byteLength)}},6247:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChecksumStruct=void 0;const n=r(9999),a=r(6907);t.ChecksumStruct=(0,n.size)((0,a.base64)((0,n.string)(),{paddingRequired:!0}),44,44)},9278:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHex=t.createBytes=t.createBigInt=t.createNumber=void 0;const n=r(9999),a=r(4606),i=r(8609),s=r(6395),o=(0,n.union)([(0,n.number)(),(0,n.bigint)(),(0,n.string)(),s.StrictHexStruct]),c=(0,n.coerce)((0,n.number)(),o,Number),d=(0,n.coerce)((0,n.bigint)(),o,BigInt),f=((0,n.union)([s.StrictHexStruct,(0,n.instance)(Uint8Array)]),(0,n.coerce)((0,n.instance)(Uint8Array),(0,n.union)([s.StrictHexStruct]),i.hexToBytes)),u=(0,n.coerce)(s.StrictHexStruct,(0,n.instance)(Uint8Array),i.bytesToHex);t.createNumber=function(e){try{const t=(0,n.create)(e,c);return(0,a.assert)(Number.isFinite(t),`Expected a number-like value, got "${e}".`),t}catch(t){if(t instanceof n.StructError)throw new Error(`Expected a number-like value, got "${e}".`);throw t}},t.createBigInt=function(e){try{return(0,n.create)(e,d)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a number-like value, got "${String(e.value)}".`);throw e}},t.createBytes=function(e){if("string"==typeof e&&"0x"===e.toLowerCase())return new Uint8Array;try{return(0,n.create)(e,f)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}},t.createHex=function(e){if(e instanceof Uint8Array&&0===e.length||"string"==typeof e&&"0x"===e.toLowerCase())return"0x";try{return(0,n.create)(e,u)}catch(e){if(e instanceof n.StructError)throw new Error(`Expected a bytes-like value, got "${String(e.value)}".`);throw e}}},1599:function(e,t){"use strict";var r,n,a=this&&this.__classPrivateFieldSet||function(e,t,r,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?a.call(e,r):a?a.value=r:t.set(e,r),r},i=this&&this.__classPrivateFieldGet||function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};Object.defineProperty(t,"__esModule",{value:!0}),t.FrozenSet=t.FrozenMap=void 0;class s{constructor(e){r.set(this,void 0),a(this,r,new Map(e),"f"),Object.freeze(this)}get size(){return i(this,r,"f").size}[(r=new WeakMap,Symbol.iterator)](){return i(this,r,"f")[Symbol.iterator]()}entries(){return i(this,r,"f").entries()}forEach(e,t){return i(this,r,"f").forEach(((r,n,a)=>e.call(t,r,n,this)))}get(e){return i(this,r,"f").get(e)}has(e){return i(this,r,"f").has(e)}keys(){return i(this,r,"f").keys()}values(){return i(this,r,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map((([e,t])=>`${String(e)} => ${String(t)}`)).join(", ")} `:""}}`}}t.FrozenMap=s;class o{constructor(e){n.set(this,void 0),a(this,n,new Set(e),"f"),Object.freeze(this)}get size(){return i(this,n,"f").size}[(n=new WeakMap,Symbol.iterator)](){return i(this,n,"f")[Symbol.iterator]()}entries(){return i(this,n,"f").entries()}forEach(e,t){return i(this,n,"f").forEach(((r,n,a)=>e.call(t,r,n,this)))}has(e){return i(this,n,"f").has(e)}keys(){return i(this,n,"f").keys()}values(){return i(this,n,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map((e=>String(e))).join(", ")} `:""}}`}}t.FrozenSet=o,Object.freeze(s),Object.freeze(s.prototype),Object.freeze(o),Object.freeze(o.prototype)},6809:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6395:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.isValidChecksumAddress=t.getChecksumAddress=t.isValidHexAddress=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.HexChecksumAddressStruct=t.HexAddressStruct=t.StrictHexStruct=t.HexStruct=void 0;const n=r(448),a=r(9999),i=r(4606),s=r(8609);function o(e){return(0,a.is)(e,t.HexStruct)}function c(e){return(0,a.is)(e,t.StrictHexStruct)}function d(e){(0,i.assert)((0,a.is)(e,t.HexChecksumAddressStruct),"Invalid hex address.");const r=u(e.toLowerCase()),o=u((0,s.bytesToHex)((0,n.keccak_256)(r)));return`0x${r.split("").map(((e,t)=>{const r=o[t];return(0,i.assert)((0,a.is)(r,(0,a.string)()),"Hash shorter than address."),parseInt(r,16)>7?e.toUpperCase():e})).join("")}`}function f(e){return!!(0,a.is)(e,t.HexChecksumAddressStruct)&&d(e)===e}function u(e){return e.startsWith("0x")||e.startsWith("0X")?e.substring(2):e}t.HexStruct=(0,a.pattern)((0,a.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,a.pattern)((0,a.string)(),/^0x[0-9a-f]+$/iu),t.HexAddressStruct=(0,a.pattern)((0,a.string)(),/^0x[0-9a-f]{40}$/u),t.HexChecksumAddressStruct=(0,a.pattern)((0,a.string)(),/^0x[0-9a-fA-F]{40}$/u),t.isHexString=o,t.isStrictHexString=c,t.assertIsHexString=function(e){(0,i.assert)(o(e),"Value must be a hexadecimal string.")},t.assertIsStrictHexString=function(e){(0,i.assert)(c(e),'Value must be a hexadecimal string, starting with "0x".')},t.isValidHexAddress=function(e){return(0,a.is)(e,t.HexAddressStruct)||f(e)},t.getChecksumAddress=d,t.isValidChecksumAddress=f,t.add0x=function(e){return e.startsWith("0x")?e:e.startsWith("0X")?`0x${e.substring(2)}`:`0x${e}`},t.remove0x=u},1642:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),a(r(4606),t),a(r(6907),t),a(r(8609),t),a(r(6247),t),a(r(9278),t),a(r(1599),t),a(r(6809),t),a(r(6395),t),a(r(2882),t),a(r(6951),t),a(r(4499),t),a(r(2036),t),a(r(2445),t),a(r(4351),t),a(r(5709),t),a(r(6050),t),a(r(2869),t)},2882:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.getJsonSize=t.getSafeJson=t.isValidJson=t.JsonStruct=t.UnsafeJsonStruct=void 0;const n=r(9999),a=r(4606);function i(e){return(0,n.create)(e,t.JsonStruct)}t.UnsafeJsonStruct=(0,n.union)([(0,n.literal)(null),(0,n.boolean)(),(0,n.define)("finite number",(e=>(0,n.is)(e,(0,n.number)())&&Number.isFinite(e))),(0,n.string)(),(0,n.array)((0,n.lazy)((()=>t.UnsafeJsonStruct))),(0,n.record)((0,n.string)(),(0,n.lazy)((()=>t.UnsafeJsonStruct)))]),t.JsonStruct=(0,n.coerce)(t.UnsafeJsonStruct,(0,n.any)(),(e=>((0,a.assertStruct)(e,t.UnsafeJsonStruct),JSON.parse(JSON.stringify(e,((e,t)=>{if("__proto__"!==e&&"constructor"!==e)return t})))))),t.isValidJson=function(e){try{return i(e),!0}catch{return!1}},t.getSafeJson=i,t.getJsonSize=function(e){(0,a.assertStruct)(e,t.JsonStruct,"Invalid JSON value");const r=JSON.stringify(e);return(new TextEncoder).encode(r).byteLength},t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,n.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,n.nullable)((0,n.union)([(0,n.number)(),(0,n.string)()])),t.JsonRpcErrorStruct=(0,n.object)({code:(0,n.integer)(),message:(0,n.string)(),data:(0,n.optional)(t.JsonStruct),stack:(0,n.optional)((0,n.string)())}),t.JsonRpcParamsStruct=(0,n.optional)((0,n.union)([(0,n.record)((0,n.string)(),t.JsonStruct),(0,n.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,n.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,n.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,n.omit)(t.JsonRpcRequestStruct,["id"]),t.isJsonRpcNotification=function(e){return(0,n.is)(e,t.JsonRpcNotificationStruct)},t.assertIsJsonRpcNotification=function(e,r){(0,a.assertStruct)(e,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",r)},t.isJsonRpcRequest=function(e){return(0,n.is)(e,t.JsonRpcRequestStruct)},t.assertIsJsonRpcRequest=function(e,r){(0,a.assertStruct)(e,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",r)},t.PendingJsonRpcResponseStruct=(0,n.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,n.optional)((0,n.unknown)()),error:(0,n.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,n.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,n.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,n.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]),t.isPendingJsonRpcResponse=function(e){return(0,n.is)(e,t.PendingJsonRpcResponseStruct)},t.assertIsPendingJsonRpcResponse=function(e,r){(0,a.assertStruct)(e,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",r)},t.isJsonRpcResponse=function(e){return(0,n.is)(e,t.JsonRpcResponseStruct)},t.assertIsJsonRpcResponse=function(e,r){(0,a.assertStruct)(e,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",r)},t.isJsonRpcSuccess=function(e){return(0,n.is)(e,t.JsonRpcSuccessStruct)},t.assertIsJsonRpcSuccess=function(e,r){(0,a.assertStruct)(e,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",r)},t.isJsonRpcFailure=function(e){return(0,n.is)(e,t.JsonRpcFailureStruct)},t.assertIsJsonRpcFailure=function(e,r){(0,a.assertStruct)(e,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",r)},t.isJsonRpcError=function(e){return(0,n.is)(e,t.JsonRpcErrorStruct)},t.assertIsJsonRpcError=function(e,r){(0,a.assertStruct)(e,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",r)},t.getJsonRpcIdValidator=function(e){const{permitEmptyString:t,permitFractions:r,permitNull:n}={permitEmptyString:!0,permitFractions:!1,permitNull:!0,...e};return e=>Boolean("number"==typeof e&&(r||Number.isInteger(e))||"string"==typeof e&&(t||e.length>0)||n&&null===e)}},6951:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4499:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.createProjectLogger=void 0;const a=(0,n(r(124)).default)("metamask");t.createProjectLogger=function(e){return a.extend(e)},t.createModuleLogger=function(e,t){return e.extend(t)}},2036:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0,t.isNonEmptyArray=function(e){return Array.isArray(e)&&e.length>0},t.isNullOrUndefined=function(e){return null==e},t.isObject=function(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)};function r(e){return e.charCodeAt(0)<=127}t.hasProperty=(e,t)=>Object.hasOwnProperty.call(e,t),function(e){e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu,t.isPlainObject=function(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}},t.isASCII=r,t.calculateStringSize=function(e){return e.split("").reduce(((e,t)=>r(t)?e+1:e+2),0)+(e.match(t.ESCAPE_CHARACTERS_REGEXP)??[]).length},t.calculateNumberSize=function(e){return e.toString().length}},2445:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexToBigInt=t.hexToNumber=t.bigIntToHex=t.numberToHex=void 0;const n=r(4606),a=r(6395);t.numberToHex=e=>((0,n.assert)("number"==typeof e,"Value must be a number."),(0,n.assert)(e>=0,"Value must be a non-negative number."),(0,n.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,a.add0x)(e.toString(16)));t.bigIntToHex=e=>((0,n.assert)("bigint"==typeof e,"Value must be a bigint."),(0,n.assert)(e>=0,"Value must be a non-negative bigint."),(0,a.add0x)(e.toString(16)));t.hexToNumber=e=>{(0,a.assertIsHexString)(e);const t=parseInt(e,16);return(0,n.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};t.hexToBigInt=e=>((0,a.assertIsHexString)(e),BigInt((0,a.add0x)(e)))},4351:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5709:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(e){e[e.Millisecond=1]="Millisecond",e[e.Second=1e3]="Second",e[e.Minute=6e4]="Minute",e[e.Hour=36e5]="Hour",e[e.Day=864e5]="Day",e[e.Week=6048e5]="Week",e[e.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));const r=(e,t)=>{if(!(e=>Number.isInteger(e)&&e>=0)(e))throw new Error(`"${t}" must be a non-negative integer. Received: "${e}".`)};t.inMilliseconds=function(e,t){return r(e,"count"),e*t},t.timeSince=function(e){return r(e,"timestamp"),Date.now()-e}},6050:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2869:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const n=r(2722),a=r(9999),i=r(4606);t.VersionStruct=(0,a.refine)((0,a.string)(),"Version",(e=>null!==(0,n.valid)(e)||`Expected SemVer version, got "${e}"`)),t.VersionRangeStruct=(0,a.refine)((0,a.string)(),"Version range",(e=>null!==(0,n.validRange)(e)||`Expected SemVer range, got "${e}"`)),t.isValidSemVerVersion=function(e){return(0,a.is)(e,t.VersionStruct)},t.isValidSemVerRange=function(e){return(0,a.is)(e,t.VersionRangeStruct)},t.assertIsSemVerVersion=function(e){(0,i.assertStruct)(e,t.VersionStruct)},t.assertIsSemVerRange=function(e){(0,i.assertStruct)(e,t.VersionRangeStruct)},t.gtVersion=function(e,t){return(0,n.gt)(e,t)},t.gtRange=function(e,t){return(0,n.gtr)(e,t)},t.satisfiesVersionRange=function(e,t){return(0,n.satisfies)(e,t,{includePrerelease:!0})}},2091:(e,t,r)=>{"use strict";t.nl=void 0;const n=r(9648),a=r(486),i=r(7004),s=r(2249),o=r(3654),c=r(6710);function d(e){if("string"!=typeof e)throw new TypeError("Invalid mnemonic type: "+typeof e);return e.normalize("NFKD")}function f(e){const t=d(e),r=t.split(" ");if(![12,15,18,21,24].includes(r.length))throw new Error("Invalid mnemonic");return{nfkd:t,words:r}}function u(e){n.default.bytes(e,16,20,24,28,32)}const l=e=>{const t=8-e.length/4;return new Uint8Array([(0,i.sha256)(e)[0]>>t<<t])};function h(e){if(!Array.isArray(e)||2048!==e.length||"string"!=typeof e[0])throw new Error("Worlist: expected array of 2048 strings");return e.forEach((e=>{if("string"!=typeof e)throw new Error(`Wordlist: non-string element: ${e}`)})),c.utils.chain(c.utils.checksum(1,l),c.utils.radix2(11,!0),c.utils.alphabet(e))}function p(e,t){let r;if("string"==typeof e){const{words:n}=f(e);r=h(t).decode(n)}else r=h(t).decode(Array.from(new Uint16Array(e.buffer)).map((e=>t[e])));return u(r),r}function b(e,t){u(e);const r=h(t).encode(e).map((e=>t.indexOf(e)));return new Uint8Array(new Uint16Array(r).buffer)}const g=e=>d(`mnemonic${e}`);function y(e,t){let r;return r="string"==typeof e?(new TextEncoder).encode(f(e).nfkd):(new TextEncoder).encode(Array.from(new Uint16Array(e.buffer)).map((e=>t[e])).join(" ")),r}t.nl=function(e,t,r=""){const n=y(e,t);return(0,a.pbkdf2Async)(s.sha512,n,g(r),{c:2048,dkLen:64})}},6925:(e,t)=>{"use strict";t.p=void 0,t.p="abandon\nability\nable\nabout\nabove\nabsent\nabsorb\nabstract\nabsurd\nabuse\naccess\naccident\naccount\naccuse\nachieve\nacid\nacoustic\nacquire\nacross\nact\naction\nactor\nactress\nactual\nadapt\nadd\naddict\naddress\nadjust\nadmit\nadult\nadvance\nadvice\naerobic\naffair\nafford\nafraid\nagain\nage\nagent\nagree\nahead\naim\nair\nairport\naisle\nalarm\nalbum\nalcohol\nalert\nalien\nall\nalley\nallow\nalmost\nalone\nalpha\nalready\nalso\nalter\nalways\namateur\namazing\namong\namount\namused\nanalyst\nanchor\nancient\nanger\nangle\nangry\nanimal\nankle\nannounce\nannual\nanother\nanswer\nantenna\nantique\nanxiety\nany\napart\napology\nappear\napple\napprove\napril\narch\narctic\narea\narena\nargue\narm\narmed\narmor\narmy\naround\narrange\narrest\narrive\narrow\nart\nartefact\nartist\nartwork\nask\naspect\nassault\nasset\nassist\nassume\nasthma\nathlete\natom\nattack\nattend\nattitude\nattract\nauction\naudit\naugust\naunt\nauthor\nauto\nautumn\naverage\navocado\navoid\nawake\naware\naway\nawesome\nawful\nawkward\naxis\nbaby\nbachelor\nbacon\nbadge\nbag\nbalance\nbalcony\nball\nbamboo\nbanana\nbanner\nbar\nbarely\nbargain\nbarrel\nbase\nbasic\nbasket\nbattle\nbeach\nbean\nbeauty\nbecause\nbecome\nbeef\nbefore\nbegin\nbehave\nbehind\nbelieve\nbelow\nbelt\nbench\nbenefit\nbest\nbetray\nbetter\nbetween\nbeyond\nbicycle\nbid\nbike\nbind\nbiology\nbird\nbirth\nbitter\nblack\nblade\nblame\nblanket\nblast\nbleak\nbless\nblind\nblood\nblossom\nblouse\nblue\nblur\nblush\nboard\nboat\nbody\nboil\nbomb\nbone\nbonus\nbook\nboost\nborder\nboring\nborrow\nboss\nbottom\nbounce\nbox\nboy\nbracket\nbrain\nbrand\nbrass\nbrave\nbread\nbreeze\nbrick\nbridge\nbrief\nbright\nbring\nbrisk\nbroccoli\nbroken\nbronze\nbroom\nbrother\nbrown\nbrush\nbubble\nbuddy\nbudget\nbuffalo\nbuild\nbulb\nbulk\nbullet\nbundle\nbunker\nburden\nburger\nburst\nbus\nbusiness\nbusy\nbutter\nbuyer\nbuzz\ncabbage\ncabin\ncable\ncactus\ncage\ncake\ncall\ncalm\ncamera\ncamp\ncan\ncanal\ncancel\ncandy\ncannon\ncanoe\ncanvas\ncanyon\ncapable\ncapital\ncaptain\ncar\ncarbon\ncard\ncargo\ncarpet\ncarry\ncart\ncase\ncash\ncasino\ncastle\ncasual\ncat\ncatalog\ncatch\ncategory\ncattle\ncaught\ncause\ncaution\ncave\nceiling\ncelery\ncement\ncensus\ncentury\ncereal\ncertain\nchair\nchalk\nchampion\nchange\nchaos\nchapter\ncharge\nchase\nchat\ncheap\ncheck\ncheese\nchef\ncherry\nchest\nchicken\nchief\nchild\nchimney\nchoice\nchoose\nchronic\nchuckle\nchunk\nchurn\ncigar\ncinnamon\ncircle\ncitizen\ncity\ncivil\nclaim\nclap\nclarify\nclaw\nclay\nclean\nclerk\nclever\nclick\nclient\ncliff\nclimb\nclinic\nclip\nclock\nclog\nclose\ncloth\ncloud\nclown\nclub\nclump\ncluster\nclutch\ncoach\ncoast\ncoconut\ncode\ncoffee\ncoil\ncoin\ncollect\ncolor\ncolumn\ncombine\ncome\ncomfort\ncomic\ncommon\ncompany\nconcert\nconduct\nconfirm\ncongress\nconnect\nconsider\ncontrol\nconvince\ncook\ncool\ncopper\ncopy\ncoral\ncore\ncorn\ncorrect\ncost\ncotton\ncouch\ncountry\ncouple\ncourse\ncousin\ncover\ncoyote\ncrack\ncradle\ncraft\ncram\ncrane\ncrash\ncrater\ncrawl\ncrazy\ncream\ncredit\ncreek\ncrew\ncricket\ncrime\ncrisp\ncritic\ncrop\ncross\ncrouch\ncrowd\ncrucial\ncruel\ncruise\ncrumble\ncrunch\ncrush\ncry\ncrystal\ncube\nculture\ncup\ncupboard\ncurious\ncurrent\ncurtain\ncurve\ncushion\ncustom\ncute\ncycle\ndad\ndamage\ndamp\ndance\ndanger\ndaring\ndash\ndaughter\ndawn\nday\ndeal\ndebate\ndebris\ndecade\ndecember\ndecide\ndecline\ndecorate\ndecrease\ndeer\ndefense\ndefine\ndefy\ndegree\ndelay\ndeliver\ndemand\ndemise\ndenial\ndentist\ndeny\ndepart\ndepend\ndeposit\ndepth\ndeputy\nderive\ndescribe\ndesert\ndesign\ndesk\ndespair\ndestroy\ndetail\ndetect\ndevelop\ndevice\ndevote\ndiagram\ndial\ndiamond\ndiary\ndice\ndiesel\ndiet\ndiffer\ndigital\ndignity\ndilemma\ndinner\ndinosaur\ndirect\ndirt\ndisagree\ndiscover\ndisease\ndish\ndismiss\ndisorder\ndisplay\ndistance\ndivert\ndivide\ndivorce\ndizzy\ndoctor\ndocument\ndog\ndoll\ndolphin\ndomain\ndonate\ndonkey\ndonor\ndoor\ndose\ndouble\ndove\ndraft\ndragon\ndrama\ndrastic\ndraw\ndream\ndress\ndrift\ndrill\ndrink\ndrip\ndrive\ndrop\ndrum\ndry\nduck\ndumb\ndune\nduring\ndust\ndutch\nduty\ndwarf\ndynamic\neager\neagle\nearly\nearn\nearth\neasily\neast\neasy\necho\necology\neconomy\nedge\nedit\neducate\neffort\negg\neight\neither\nelbow\nelder\nelectric\nelegant\nelement\nelephant\nelevator\nelite\nelse\nembark\nembody\nembrace\nemerge\nemotion\nemploy\nempower\nempty\nenable\nenact\nend\nendless\nendorse\nenemy\nenergy\nenforce\nengage\nengine\nenhance\nenjoy\nenlist\nenough\nenrich\nenroll\nensure\nenter\nentire\nentry\nenvelope\nepisode\nequal\nequip\nera\nerase\nerode\nerosion\nerror\nerupt\nescape\nessay\nessence\nestate\neternal\nethics\nevidence\nevil\nevoke\nevolve\nexact\nexample\nexcess\nexchange\nexcite\nexclude\nexcuse\nexecute\nexercise\nexhaust\nexhibit\nexile\nexist\nexit\nexotic\nexpand\nexpect\nexpire\nexplain\nexpose\nexpress\nextend\nextra\neye\neyebrow\nfabric\nface\nfaculty\nfade\nfaint\nfaith\nfall\nfalse\nfame\nfamily\nfamous\nfan\nfancy\nfantasy\nfarm\nfashion\nfat\nfatal\nfather\nfatigue\nfault\nfavorite\nfeature\nfebruary\nfederal\nfee\nfeed\nfeel\nfemale\nfence\nfestival\nfetch\nfever\nfew\nfiber\nfiction\nfield\nfigure\nfile\nfilm\nfilter\nfinal\nfind\nfine\nfinger\nfinish\nfire\nfirm\nfirst\nfiscal\nfish\nfit\nfitness\nfix\nflag\nflame\nflash\nflat\nflavor\nflee\nflight\nflip\nfloat\nflock\nfloor\nflower\nfluid\nflush\nfly\nfoam\nfocus\nfog\nfoil\nfold\nfollow\nfood\nfoot\nforce\nforest\nforget\nfork\nfortune\nforum\nforward\nfossil\nfoster\nfound\nfox\nfragile\nframe\nfrequent\nfresh\nfriend\nfringe\nfrog\nfront\nfrost\nfrown\nfrozen\nfruit\nfuel\nfun\nfunny\nfurnace\nfury\nfuture\ngadget\ngain\ngalaxy\ngallery\ngame\ngap\ngarage\ngarbage\ngarden\ngarlic\ngarment\ngas\ngasp\ngate\ngather\ngauge\ngaze\ngeneral\ngenius\ngenre\ngentle\ngenuine\ngesture\nghost\ngiant\ngift\ngiggle\nginger\ngiraffe\ngirl\ngive\nglad\nglance\nglare\nglass\nglide\nglimpse\nglobe\ngloom\nglory\nglove\nglow\nglue\ngoat\ngoddess\ngold\ngood\ngoose\ngorilla\ngospel\ngossip\ngovern\ngown\ngrab\ngrace\ngrain\ngrant\ngrape\ngrass\ngravity\ngreat\ngreen\ngrid\ngrief\ngrit\ngrocery\ngroup\ngrow\ngrunt\nguard\nguess\nguide\nguilt\nguitar\ngun\ngym\nhabit\nhair\nhalf\nhammer\nhamster\nhand\nhappy\nharbor\nhard\nharsh\nharvest\nhat\nhave\nhawk\nhazard\nhead\nhealth\nheart\nheavy\nhedgehog\nheight\nhello\nhelmet\nhelp\nhen\nhero\nhidden\nhigh\nhill\nhint\nhip\nhire\nhistory\nhobby\nhockey\nhold\nhole\nholiday\nhollow\nhome\nhoney\nhood\nhope\nhorn\nhorror\nhorse\nhospital\nhost\nhotel\nhour\nhover\nhub\nhuge\nhuman\nhumble\nhumor\nhundred\nhungry\nhunt\nhurdle\nhurry\nhurt\nhusband\nhybrid\nice\nicon\nidea\nidentify\nidle\nignore\nill\nillegal\nillness\nimage\nimitate\nimmense\nimmune\nimpact\nimpose\nimprove\nimpulse\ninch\ninclude\nincome\nincrease\nindex\nindicate\nindoor\nindustry\ninfant\ninflict\ninform\ninhale\ninherit\ninitial\ninject\ninjury\ninmate\ninner\ninnocent\ninput\ninquiry\ninsane\ninsect\ninside\ninspire\ninstall\nintact\ninterest\ninto\ninvest\ninvite\ninvolve\niron\nisland\nisolate\nissue\nitem\nivory\njacket\njaguar\njar\njazz\njealous\njeans\njelly\njewel\njob\njoin\njoke\njourney\njoy\njudge\njuice\njump\njungle\njunior\njunk\njust\nkangaroo\nkeen\nkeep\nketchup\nkey\nkick\nkid\nkidney\nkind\nkingdom\nkiss\nkit\nkitchen\nkite\nkitten\nkiwi\nknee\nknife\nknock\nknow\nlab\nlabel\nlabor\nladder\nlady\nlake\nlamp\nlanguage\nlaptop\nlarge\nlater\nlatin\nlaugh\nlaundry\nlava\nlaw\nlawn\nlawsuit\nlayer\nlazy\nleader\nleaf\nlearn\nleave\nlecture\nleft\nleg\nlegal\nlegend\nleisure\nlemon\nlend\nlength\nlens\nleopard\nlesson\nletter\nlevel\nliar\nliberty\nlibrary\nlicense\nlife\nlift\nlight\nlike\nlimb\nlimit\nlink\nlion\nliquid\nlist\nlittle\nlive\nlizard\nload\nloan\nlobster\nlocal\nlock\nlogic\nlonely\nlong\nloop\nlottery\nloud\nlounge\nlove\nloyal\nlucky\nluggage\nlumber\nlunar\nlunch\nluxury\nlyrics\nmachine\nmad\nmagic\nmagnet\nmaid\nmail\nmain\nmajor\nmake\nmammal\nman\nmanage\nmandate\nmango\nmansion\nmanual\nmaple\nmarble\nmarch\nmargin\nmarine\nmarket\nmarriage\nmask\nmass\nmaster\nmatch\nmaterial\nmath\nmatrix\nmatter\nmaximum\nmaze\nmeadow\nmean\nmeasure\nmeat\nmechanic\nmedal\nmedia\nmelody\nmelt\nmember\nmemory\nmention\nmenu\nmercy\nmerge\nmerit\nmerry\nmesh\nmessage\nmetal\nmethod\nmiddle\nmidnight\nmilk\nmillion\nmimic\nmind\nminimum\nminor\nminute\nmiracle\nmirror\nmisery\nmiss\nmistake\nmix\nmixed\nmixture\nmobile\nmodel\nmodify\nmom\nmoment\nmonitor\nmonkey\nmonster\nmonth\nmoon\nmoral\nmore\nmorning\nmosquito\nmother\nmotion\nmotor\nmountain\nmouse\nmove\nmovie\nmuch\nmuffin\nmule\nmultiply\nmuscle\nmuseum\nmushroom\nmusic\nmust\nmutual\nmyself\nmystery\nmyth\nnaive\nname\nnapkin\nnarrow\nnasty\nnation\nnature\nnear\nneck\nneed\nnegative\nneglect\nneither\nnephew\nnerve\nnest\nnet\nnetwork\nneutral\nnever\nnews\nnext\nnice\nnight\nnoble\nnoise\nnominee\nnoodle\nnormal\nnorth\nnose\nnotable\nnote\nnothing\nnotice\nnovel\nnow\nnuclear\nnumber\nnurse\nnut\noak\nobey\nobject\noblige\nobscure\nobserve\nobtain\nobvious\noccur\nocean\noctober\nodor\noff\noffer\noffice\noften\noil\nokay\nold\nolive\nolympic\nomit\nonce\none\nonion\nonline\nonly\nopen\nopera\nopinion\noppose\noption\norange\norbit\norchard\norder\nordinary\norgan\norient\noriginal\norphan\nostrich\nother\noutdoor\nouter\noutput\noutside\noval\noven\nover\nown\nowner\noxygen\noyster\nozone\npact\npaddle\npage\npair\npalace\npalm\npanda\npanel\npanic\npanther\npaper\nparade\nparent\npark\nparrot\nparty\npass\npatch\npath\npatient\npatrol\npattern\npause\npave\npayment\npeace\npeanut\npear\npeasant\npelican\npen\npenalty\npencil\npeople\npepper\nperfect\npermit\nperson\npet\nphone\nphoto\nphrase\nphysical\npiano\npicnic\npicture\npiece\npig\npigeon\npill\npilot\npink\npioneer\npipe\npistol\npitch\npizza\nplace\nplanet\nplastic\nplate\nplay\nplease\npledge\npluck\nplug\nplunge\npoem\npoet\npoint\npolar\npole\npolice\npond\npony\npool\npopular\nportion\nposition\npossible\npost\npotato\npottery\npoverty\npowder\npower\npractice\npraise\npredict\nprefer\nprepare\npresent\npretty\nprevent\nprice\npride\nprimary\nprint\npriority\nprison\nprivate\nprize\nproblem\nprocess\nproduce\nprofit\nprogram\nproject\npromote\nproof\nproperty\nprosper\nprotect\nproud\nprovide\npublic\npudding\npull\npulp\npulse\npumpkin\npunch\npupil\npuppy\npurchase\npurity\npurpose\npurse\npush\nput\npuzzle\npyramid\nquality\nquantum\nquarter\nquestion\nquick\nquit\nquiz\nquote\nrabbit\nraccoon\nrace\nrack\nradar\nradio\nrail\nrain\nraise\nrally\nramp\nranch\nrandom\nrange\nrapid\nrare\nrate\nrather\nraven\nraw\nrazor\nready\nreal\nreason\nrebel\nrebuild\nrecall\nreceive\nrecipe\nrecord\nrecycle\nreduce\nreflect\nreform\nrefuse\nregion\nregret\nregular\nreject\nrelax\nrelease\nrelief\nrely\nremain\nremember\nremind\nremove\nrender\nrenew\nrent\nreopen\nrepair\nrepeat\nreplace\nreport\nrequire\nrescue\nresemble\nresist\nresource\nresponse\nresult\nretire\nretreat\nreturn\nreunion\nreveal\nreview\nreward\nrhythm\nrib\nribbon\nrice\nrich\nride\nridge\nrifle\nright\nrigid\nring\nriot\nripple\nrisk\nritual\nrival\nriver\nroad\nroast\nrobot\nrobust\nrocket\nromance\nroof\nrookie\nroom\nrose\nrotate\nrough\nround\nroute\nroyal\nrubber\nrude\nrug\nrule\nrun\nrunway\nrural\nsad\nsaddle\nsadness\nsafe\nsail\nsalad\nsalmon\nsalon\nsalt\nsalute\nsame\nsample\nsand\nsatisfy\nsatoshi\nsauce\nsausage\nsave\nsay\nscale\nscan\nscare\nscatter\nscene\nscheme\nschool\nscience\nscissors\nscorpion\nscout\nscrap\nscreen\nscript\nscrub\nsea\nsearch\nseason\nseat\nsecond\nsecret\nsection\nsecurity\nseed\nseek\nsegment\nselect\nsell\nseminar\nsenior\nsense\nsentence\nseries\nservice\nsession\nsettle\nsetup\nseven\nshadow\nshaft\nshallow\nshare\nshed\nshell\nsheriff\nshield\nshift\nshine\nship\nshiver\nshock\nshoe\nshoot\nshop\nshort\nshoulder\nshove\nshrimp\nshrug\nshuffle\nshy\nsibling\nsick\nside\nsiege\nsight\nsign\nsilent\nsilk\nsilly\nsilver\nsimilar\nsimple\nsince\nsing\nsiren\nsister\nsituate\nsix\nsize\nskate\nsketch\nski\nskill\nskin\nskirt\nskull\nslab\nslam\nsleep\nslender\nslice\nslide\nslight\nslim\nslogan\nslot\nslow\nslush\nsmall\nsmart\nsmile\nsmoke\nsmooth\nsnack\nsnake\nsnap\nsniff\nsnow\nsoap\nsoccer\nsocial\nsock\nsoda\nsoft\nsolar\nsoldier\nsolid\nsolution\nsolve\nsomeone\nsong\nsoon\nsorry\nsort\nsoul\nsound\nsoup\nsource\nsouth\nspace\nspare\nspatial\nspawn\nspeak\nspecial\nspeed\nspell\nspend\nsphere\nspice\nspider\nspike\nspin\nspirit\nsplit\nspoil\nsponsor\nspoon\nsport\nspot\nspray\nspread\nspring\nspy\nsquare\nsqueeze\nsquirrel\nstable\nstadium\nstaff\nstage\nstairs\nstamp\nstand\nstart\nstate\nstay\nsteak\nsteel\nstem\nstep\nstereo\nstick\nstill\nsting\nstock\nstomach\nstone\nstool\nstory\nstove\nstrategy\nstreet\nstrike\nstrong\nstruggle\nstudent\nstuff\nstumble\nstyle\nsubject\nsubmit\nsubway\nsuccess\nsuch\nsudden\nsuffer\nsugar\nsuggest\nsuit\nsummer\nsun\nsunny\nsunset\nsuper\nsupply\nsupreme\nsure\nsurface\nsurge\nsurprise\nsurround\nsurvey\nsuspect\nsustain\nswallow\nswamp\nswap\nswarm\nswear\nsweet\nswift\nswim\nswing\nswitch\nsword\nsymbol\nsymptom\nsyrup\nsystem\ntable\ntackle\ntag\ntail\ntalent\ntalk\ntank\ntape\ntarget\ntask\ntaste\ntattoo\ntaxi\nteach\nteam\ntell\nten\ntenant\ntennis\ntent\nterm\ntest\ntext\nthank\nthat\ntheme\nthen\ntheory\nthere\nthey\nthing\nthis\nthought\nthree\nthrive\nthrow\nthumb\nthunder\nticket\ntide\ntiger\ntilt\ntimber\ntime\ntiny\ntip\ntired\ntissue\ntitle\ntoast\ntobacco\ntoday\ntoddler\ntoe\ntogether\ntoilet\ntoken\ntomato\ntomorrow\ntone\ntongue\ntonight\ntool\ntooth\ntop\ntopic\ntopple\ntorch\ntornado\ntortoise\ntoss\ntotal\ntourist\ntoward\ntower\ntown\ntoy\ntrack\ntrade\ntraffic\ntragic\ntrain\ntransfer\ntrap\ntrash\ntravel\ntray\ntreat\ntree\ntrend\ntrial\ntribe\ntrick\ntrigger\ntrim\ntrip\ntrophy\ntrouble\ntruck\ntrue\ntruly\ntrumpet\ntrust\ntruth\ntry\ntube\ntuition\ntumble\ntuna\ntunnel\nturkey\nturn\nturtle\ntwelve\ntwenty\ntwice\ntwin\ntwist\ntwo\ntype\ntypical\nugly\numbrella\nunable\nunaware\nuncle\nuncover\nunder\nundo\nunfair\nunfold\nunhappy\nuniform\nunique\nunit\nuniverse\nunknown\nunlock\nuntil\nunusual\nunveil\nupdate\nupgrade\nuphold\nupon\nupper\nupset\nurban\nurge\nusage\nuse\nused\nuseful\nuseless\nusual\nutility\nvacant\nvacuum\nvague\nvalid\nvalley\nvalve\nvan\nvanish\nvapor\nvarious\nvast\nvault\nvehicle\nvelvet\nvendor\nventure\nvenue\nverb\nverify\nversion\nvery\nvessel\nveteran\nviable\nvibrant\nvicious\nvictory\nvideo\nview\nvillage\nvintage\nviolin\nvirtual\nvirus\nvisa\nvisit\nvisual\nvital\nvivid\nvocal\nvoice\nvoid\nvolcano\nvolume\nvote\nvoyage\nwage\nwagon\nwait\nwalk\nwall\nwalnut\nwant\nwarfare\nwarm\nwarrior\nwash\nwasp\nwaste\nwater\nwave\nway\nwealth\nweapon\nwear\nweasel\nweather\nweb\nwedding\nweekend\nweird\nwelcome\nwest\nwet\nwhale\nwhat\nwheat\nwheel\nwhen\nwhere\nwhip\nwhisper\nwide\nwidth\nwife\nwild\nwill\nwin\nwindow\nwine\nwing\nwink\nwinner\nwinter\nwire\nwisdom\nwise\nwish\nwitness\nwolf\nwoman\nwonder\nwood\nwool\nword\nwork\nworld\nworry\nworth\nwrap\nwreck\nwrestle\nwrist\nwrite\nwrong\nyard\nyear\nyellow\nyou\nyoung\nyouth\nzebra\nzero\nzone\nzoo".split("\n")},9648:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function a(e,...t){if(!((r=e)instanceof Uint8Array||null!=r&&"object"==typeof r&&"Uint8Array"===r.constructor.name))throw new Error("Expected Uint8Array");var r;if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function i(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function o(e,t){a(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=r,t.bool=n,t.bytes=a,t.hash=i,t.exists=s,t.output=o;const c={number:r,bool:n,bytes:a,hash:i,exists:s,output:o};t.default=c},3134:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const n=r(9648),a=r(3654);class i extends a.Hash{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,a.createView)(this.buffer)}update(e){(0,n.exists)(this);const{view:t,buffer:r,blockLen:i}=this,s=(e=(0,a.toBytes)(e)).length;for(let n=0;n<s;){const o=Math.min(i-this.pos,s-n);if(o!==i)r.set(e.subarray(n,n+o),this.pos),this.pos+=o,n+=o,this.pos===i&&(this.process(t,0),this.pos=0);else{const t=(0,a.createView)(e);for(;i<=s-n;n+=i)this.process(t,n)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.exists)(this),(0,n.output)(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:i,isLE:s}=this;let{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>i-o&&(this.process(r,0),o=0);for(let e=o;e<i;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const a=BigInt(32),i=BigInt(4294967295),s=Number(r>>a&i),o=Number(r&i),c=n?4:0,d=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+d,o,n)}(r,i-8,BigInt(8*this.length),s),this.process(r,0);const c=(0,a.createView)(e),d=this.outputLen;if(d%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const f=d/4,u=this.get();if(f>u.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<f;e++)c.setUint32(4*e,u[e],s)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:a,destroyed:i,pos:s}=this;return e.length=n,e.pos=s,e.finished=a,e.destroyed=i,n%t&&e.buffer.set(r),e}}t.SHA2=i},3109:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add5L=t.add5H=t.add4H=t.add4L=t.add3H=t.add3L=t.add=t.rotlBL=t.rotlBH=t.rotlSL=t.rotlSH=t.rotr32L=t.rotr32H=t.rotrBL=t.rotrBH=t.rotrSL=t.rotrSH=t.shrSL=t.shrSH=t.toBig=t.split=t.fromBig=void 0;const r=BigInt(2**32-1),n=BigInt(32);function a(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function i(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:s,l:o}=a(e[i],t);[r[i],n[i]]=[s,o]}return[r,n]}t.fromBig=a,t.split=i;const s=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0);t.toBig=s;const o=(e,t,r)=>e>>>r;t.shrSH=o;const c=(e,t,r)=>e<<32-r|t>>>r;t.shrSL=c;const d=(e,t,r)=>e>>>r|t<<32-r;t.rotrSH=d;const f=(e,t,r)=>e<<32-r|t>>>r;t.rotrSL=f;const u=(e,t,r)=>e<<64-r|t>>>r-32;t.rotrBH=u;const l=(e,t,r)=>e>>>r-32|t<<64-r;t.rotrBL=l;const h=(e,t)=>t;t.rotr32H=h;const p=(e,t)=>e;t.rotr32L=p;const b=(e,t,r)=>e<<r|t>>>32-r;t.rotlSH=b;const g=(e,t,r)=>t<<r|e>>>32-r;t.rotlSL=g;const y=(e,t,r)=>t<<r-32|e>>>64-r;t.rotlBH=y;const m=(e,t,r)=>e<<r-32|t>>>64-r;function w(e,t,r,n){const a=(t>>>0)+(n>>>0);return{h:e+r+(a/2**32|0)|0,l:0|a}}t.rotlBL=m,t.add=w;const v=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);t.add3L=v;const E=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;t.add3H=E;const A=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);t.add4L=A;const _=(e,t,r,n,a)=>t+r+n+a+(e/2**32|0)|0;t.add4H=_;const x=(e,t,r,n,a)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(a>>>0);t.add5L=x;const S=(e,t,r,n,a,i)=>t+r+n+a+i+(e/2**32|0)|0;t.add5H=S;const I={fromBig:a,split:i,toBig:s,shrSH:o,shrSL:c,rotrSH:d,rotrSL:f,rotrBH:u,rotrBL:l,rotr32H:h,rotr32L:p,rotlSH:b,rotlSL:g,rotlBH:y,rotlBL:m,add:w,add3L:v,add3H:E,add4L:A,add4H:_,add5H:S,add5L:x};t.default=I},4610:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},4832:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hmac=t.HMAC=void 0;const n=r(9648),a=r(3654);class i extends a.Hash{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,n.hash)(e);const r=(0,a.toBytes)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,s=new Uint8Array(i);s.set(r.length>i?e.create().update(r).digest():r);for(let e=0;e<s.length;e++)s[e]^=54;this.iHash.update(s),this.oHash=e.create();for(let e=0;e<s.length;e++)s[e]^=106;this.oHash.update(s),s.fill(0)}update(e){return(0,n.exists)(this),this.iHash.update(e),this}digestInto(e){(0,n.exists)(this),(0,n.bytes)(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:a,blockLen:i,outputLen:s}=this;return e.finished=n,e.destroyed=a,e.blockLen=i,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}t.HMAC=i;t.hmac=(e,t,r)=>new i(e,t).update(r).digest(),t.hmac.create=(e,t)=>new i(e,t)},486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.pbkdf2Async=t.pbkdf2=void 0;const n=r(9648),a=r(4832),i=r(3654);function s(e,t,r,s){(0,n.hash)(e);const o=(0,i.checkOpts)({dkLen:32,asyncTick:10},s),{c,dkLen:d,asyncTick:f}=o;if((0,n.number)(c),(0,n.number)(d),(0,n.number)(f),c<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const u=(0,i.toBytes)(t),l=(0,i.toBytes)(r),h=new Uint8Array(d),p=a.hmac.create(e,u),b=p._cloneInto().update(l);return{c,dkLen:d,asyncTick:f,DK:h,PRF:p,PRFSalt:b}}function o(e,t,r,n,a){return e.destroy(),t.destroy(),n&&n.destroy(),a.fill(0),r}t.pbkdf2=function(e,t,r,n){const{c:a,dkLen:c,DK:d,PRF:f,PRFSalt:u}=s(e,t,r,n);let l;const h=new Uint8Array(4),p=(0,i.createView)(h),b=new Uint8Array(f.outputLen);for(let e=1,t=0;t<c;e++,t+=f.outputLen){const r=d.subarray(t,t+f.outputLen);p.setInt32(0,e,!1),(l=u._cloneInto(l)).update(h).digestInto(b),r.set(b.subarray(0,r.length));for(let e=1;e<a;e++){f._cloneInto(l).update(b).digestInto(b);for(let e=0;e<r.length;e++)r[e]^=b[e]}}return o(f,u,d,l,b)},t.pbkdf2Async=async function(e,t,r,n){const{c:a,dkLen:c,asyncTick:d,DK:f,PRF:u,PRFSalt:l}=s(e,t,r,n);let h;const p=new Uint8Array(4),b=(0,i.createView)(p),g=new Uint8Array(u.outputLen);for(let e=1,t=0;t<c;e++,t+=u.outputLen){const r=f.subarray(t,t+u.outputLen);b.setInt32(0,e,!1),(h=l._cloneInto(h)).update(p).digestInto(g),r.set(g.subarray(0,r.length)),await(0,i.asyncLoop)(a-1,d,(()=>{u._cloneInto(h).update(g).digestInto(g);for(let e=0;e<r.length;e++)r[e]^=g[e]}))}return o(u,l,f,h,g)}},7004:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=void 0;const n=r(3134),a=r(3654),i=(e,t,r)=>e&t^e&r^t&r,s=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]),o=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint32Array(64);class d extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|o[0],this.B=0|o[1],this.C=0|o[2],this.D=0|o[3],this.E=0|o[4],this.F=0|o[5],this.G=0|o[6],this.H=0|o[7]}get(){const{A:e,B:t,C:r,D:n,E:a,F:i,G:s,H:o}=this;return[e,t,r,n,a,i,s,o]}set(e,t,r,n,a,i,s,o){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|a,this.F=0|i,this.G=0|s,this.H=0|o}process(e,t){for(let r=0;r<16;r++,t+=4)c[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=c[e-15],r=c[e-2],n=(0,a.rotr)(t,7)^(0,a.rotr)(t,18)^t>>>3,i=(0,a.rotr)(r,17)^(0,a.rotr)(r,19)^r>>>10;c[e]=i+c[e-7]+n+c[e-16]|0}let{A:r,B:n,C:o,D:d,E:f,F:u,G:l,H:h}=this;for(let e=0;e<64;e++){const t=h+((0,a.rotr)(f,6)^(0,a.rotr)(f,11)^(0,a.rotr)(f,25))+((p=f)&u^~p&l)+s[e]+c[e]|0,b=((0,a.rotr)(r,2)^(0,a.rotr)(r,13)^(0,a.rotr)(r,22))+i(r,n,o)|0;h=l,l=u,u=f,f=d+t|0,d=o,o=n,n=r,r=t+b|0}var p;r=r+this.A|0,n=n+this.B|0,o=o+this.C|0,d=d+this.D|0,f=f+this.E|0,u=u+this.F|0,l=l+this.G|0,h=h+this.H|0,this.set(r,n,o,d,f,u,l,h)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class f extends d{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}}t.sha256=(0,a.wrapConstructor)((()=>new d)),t.sha224=(0,a.wrapConstructor)((()=>new f))},2249:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha384=t.sha512_256=t.sha512_224=t.sha512=t.SHA512=void 0;const n=r(3134),a=r(3109),i=r(3654),[s,o]=a.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((e=>BigInt(e)))),c=new Uint32Array(80),d=new Uint32Array(80);class f extends n.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(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:a,Cl:i,Dh:s,Dl:o,Eh:c,El:d,Fh:f,Fl:u,Gh:l,Gl:h,Hh:p,Hl:b}=this;return[e,t,r,n,a,i,s,o,c,d,f,u,l,h,p,b]}set(e,t,r,n,a,i,s,o,c,d,f,u,l,h,p,b){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|a,this.Cl=0|i,this.Dh=0|s,this.Dl=0|o,this.Eh=0|c,this.El=0|d,this.Fh=0|f,this.Fl=0|u,this.Gh=0|l,this.Gl=0|h,this.Hh=0|p,this.Hl=0|b}process(e,t){for(let r=0;r<16;r++,t+=4)c[r]=e.getUint32(t),d[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|c[e-15],r=0|d[e-15],n=a.default.rotrSH(t,r,1)^a.default.rotrSH(t,r,8)^a.default.shrSH(t,r,7),i=a.default.rotrSL(t,r,1)^a.default.rotrSL(t,r,8)^a.default.shrSL(t,r,7),s=0|c[e-2],o=0|d[e-2],f=a.default.rotrSH(s,o,19)^a.default.rotrBH(s,o,61)^a.default.shrSH(s,o,6),u=a.default.rotrSL(s,o,19)^a.default.rotrBL(s,o,61)^a.default.shrSL(s,o,6),l=a.default.add4L(i,u,d[e-7],d[e-16]),h=a.default.add4H(l,n,f,c[e-7],c[e-16]);c[e]=0|h,d[e]=0|l}let{Ah:r,Al:n,Bh:i,Bl:f,Ch:u,Cl:l,Dh:h,Dl:p,Eh:b,El:g,Fh:y,Fl:m,Gh:w,Gl:v,Hh:E,Hl:A}=this;for(let e=0;e<80;e++){const t=a.default.rotrSH(b,g,14)^a.default.rotrSH(b,g,18)^a.default.rotrBH(b,g,41),_=a.default.rotrSL(b,g,14)^a.default.rotrSL(b,g,18)^a.default.rotrBL(b,g,41),x=b&y^~b&w,S=g&m^~g&v,I=a.default.add5L(A,_,S,o[e],d[e]),k=a.default.add5H(I,E,t,x,s[e],c[e]),C=0|I,T=a.default.rotrSH(r,n,28)^a.default.rotrBH(r,n,34)^a.default.rotrBH(r,n,39),B=a.default.rotrSL(r,n,28)^a.default.rotrBL(r,n,34)^a.default.rotrBL(r,n,39),M=r&i^r&u^i&u,O=n&f^n&l^f&l;E=0|w,A=0|v,w=0|y,v=0|m,y=0|b,m=0|g,({h:b,l:g}=a.default.add(0|h,0|p,0|k,0|C)),h=0|u,p=0|l,u=0|i,l=0|f,i=0|r,f=0|n;const R=a.default.add3L(C,B,O);r=a.default.add3H(R,k,T,M),n=0|R}({h:r,l:n}=a.default.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:f}=a.default.add(0|this.Bh,0|this.Bl,0|i,0|f)),({h:u,l}=a.default.add(0|this.Ch,0|this.Cl,0|u,0|l)),({h,l:p}=a.default.add(0|this.Dh,0|this.Dl,0|h,0|p)),({h:b,l:g}=a.default.add(0|this.Eh,0|this.El,0|b,0|g)),({h:y,l:m}=a.default.add(0|this.Fh,0|this.Fl,0|y,0|m)),({h:w,l:v}=a.default.add(0|this.Gh,0|this.Gl,0|w,0|v)),({h:E,l:A}=a.default.add(0|this.Hh,0|this.Hl,0|E,0|A)),this.set(r,n,i,f,u,l,h,p,b,g,y,m,w,v,E,A)}roundClean(){c.fill(0),d.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)}}t.SHA512=f;class u extends f{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}}class l extends f{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}}class h extends f{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}}t.sha512=(0,i.wrapConstructor)((()=>new f)),t.sha512_224=(0,i.wrapConstructor)((()=>new u)),t.sha512_256=(0,i.wrapConstructor)((()=>new l)),t.sha384=(0,i.wrapConstructor)((()=>new h))},3654:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const n=r(4610);t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);function a(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const i=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));t.bytesToHex=function(e){if(!a(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=i[e[r]];return t};const s={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function o(e){return e>=s._0&&e<=s._9?e-s._0:e>=s._A&&e<=s._F?e-(s._A-10):e>=s._a&&e<=s._f?e-(s._a-10):void 0}t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,a=0;t<r;t++,a+=2){const r=o(e.charCodeAt(a)),i=o(e.charCodeAt(a+1));if(void 0===r||void 0===i){const t=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+a)}n[t]=16*r+i}return n};function c(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function d(e){if("string"==typeof e&&(e=c(e)),!a(e))throw new Error("expected Uint8Array, got "+typeof e);return e}t.nextTick=async()=>{},t.asyncLoop=async function(e,r,n){let a=Date.now();for(let i=0;i<e;i++){n(i);const e=Date.now()-a;e>=0&&e<r||(await(0,t.nextTick)(),a+=e)}},t.utf8ToBytes=c,t.toBytes=d,t.concatBytes=function(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];if(!a(n))throw new Error("Uint8Array expected");t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const a=e[t];r.set(a,n),n+=a.length}return r};t.Hash=class{clone(){return this._cloneInto()}};const f={}.toString;t.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!==f.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(d(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(d(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(d(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},8460:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function n(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function a(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function i(e,...t){if(!a(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function s(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function o(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function c(e,t){i(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=t.isBytes=void 0,t.number=r,t.bool=n,t.isBytes=a,t.bytes=i,t.hash=s,t.exists=o,t.output=c;const d={number:r,bool:n,bytes:i,hash:s,exists:o,output:c};t.default=d},8081:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add5L=t.add5H=t.add4H=t.add4L=t.add3H=t.add3L=t.add=t.rotlBL=t.rotlBH=t.rotlSL=t.rotlSH=t.rotr32L=t.rotr32H=t.rotrBL=t.rotrBH=t.rotrSL=t.rotrSH=t.shrSL=t.shrSH=t.toBig=t.split=t.fromBig=void 0;const r=BigInt(2**32-1),n=BigInt(32);function a(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function i(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:s,l:o}=a(e[i],t);[r[i],n[i]]=[s,o]}return[r,n]}t.fromBig=a,t.split=i;const s=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0);t.toBig=s;const o=(e,t,r)=>e>>>r;t.shrSH=o;const c=(e,t,r)=>e<<32-r|t>>>r;t.shrSL=c;const d=(e,t,r)=>e>>>r|t<<32-r;t.rotrSH=d;const f=(e,t,r)=>e<<32-r|t>>>r;t.rotrSL=f;const u=(e,t,r)=>e<<64-r|t>>>r-32;t.rotrBH=u;const l=(e,t,r)=>e>>>r-32|t<<64-r;t.rotrBL=l;const h=(e,t)=>t;t.rotr32H=h;const p=(e,t)=>e;t.rotr32L=p;const b=(e,t,r)=>e<<r|t>>>32-r;t.rotlSH=b;const g=(e,t,r)=>t<<r|e>>>32-r;t.rotlSL=g;const y=(e,t,r)=>t<<r-32|e>>>64-r;t.rotlBH=y;const m=(e,t,r)=>e<<r-32|t>>>64-r;function w(e,t,r,n){const a=(t>>>0)+(n>>>0);return{h:e+r+(a/2**32|0)|0,l:0|a}}t.rotlBL=m,t.add=w;const v=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);t.add3L=v;const E=(e,t,r,n)=>t+r+n+(e/2**32|0)|0;t.add3H=E;const A=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);t.add4L=A;const _=(e,t,r,n,a)=>t+r+n+a+(e/2**32|0)|0;t.add4H=_;const x=(e,t,r,n,a)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(a>>>0);t.add5L=x;const S=(e,t,r,n,a,i)=>t+r+n+a+i+(e/2**32|0)|0;t.add5H=S;const I={fromBig:a,split:i,toBig:s,shrSH:o,shrSL:c,rotrSH:d,rotrSL:f,rotrBH:u,rotrBL:l,rotr32H:h,rotr32L:p,rotlSH:b,rotlSL:g,rotlBH:y,rotlBL:m,add:w,add3L:v,add3H:E,add4L:A,add4H:_,add5H:S,add5L:x};t.default=I},6910:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},448:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shake256=t.shake128=t.keccak_512=t.keccak_384=t.keccak_256=t.keccak_224=t.sha3_512=t.sha3_384=t.sha3_256=t.sha3_224=t.Keccak=t.keccakP=void 0;const n=r(8460),a=r(8081),i=r(9074),s=[],o=[],c=[],d=BigInt(0),f=BigInt(1),u=BigInt(2),l=BigInt(7),h=BigInt(256),p=BigInt(113);for(let e=0,t=f,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],s.push(2*(5*n+r)),o.push((e+1)*(e+2)/2%64);let a=d;for(let e=0;e<7;e++)t=(t<<f^(t>>l)*p)%h,t&u&&(a^=f<<(f<<BigInt(e))-f);c.push(a)}const[b,g]=(0,a.split)(c,!0),y=(e,t,r)=>r>32?(0,a.rotlBH)(e,t,r):(0,a.rotlSH)(e,t,r),m=(e,t,r)=>r>32?(0,a.rotlBL)(e,t,r):(0,a.rotlSL)(e,t,r);function w(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,a=(t+2)%10,i=r[a],s=r[a+1],o=y(i,s,1)^r[n],c=m(i,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=o,e[t+r+1]^=c}let t=e[2],a=e[3];for(let r=0;r<24;r++){const n=o[r],i=y(t,a,n),c=m(t,a,n),d=s[r];t=e[d],a=e[d+1],e[d]=i,e[d+1]=c}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=b[n],e[1]^=g[n]}r.fill(0)}t.keccakP=w;class v extends i.Hash{constructor(e,t,r,a=!1,s=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=a,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,n.number)(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,i.u32)(this.state)}keccak(){i.isLE||(0,i.byteSwap32)(this.state32),w(this.state32,this.rounds),i.isLE||(0,i.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(e){(0,n.exists)(this);const{blockLen:t,state:r}=this,a=(e=(0,i.toBytes)(e)).length;for(let n=0;n<a;){const i=Math.min(t-this.pos,a-n);for(let t=0;t<i;t++)r[this.pos++]^=e[n++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,128&t&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){(0,n.exists)(this,!1),(0,n.bytes)(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,a=e.length;n<a;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,a-n);e.set(t.subarray(this.posOut,this.posOut+i),n),this.posOut+=i,n+=i}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,n.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,n.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){const{blockLen:t,suffix:r,outputLen:n,rounds:a,enableXOF:i}=this;return e||(e=new v(t,r,n,i,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=r,e.outputLen=n,e.enableXOF=i,e.destroyed=this.destroyed,e}}t.Keccak=v;const E=(e,t,r)=>(0,i.wrapConstructor)((()=>new v(t,e,r)));t.sha3_224=E(6,144,28),t.sha3_256=E(6,136,32),t.sha3_384=E(6,104,48),t.sha3_512=E(6,72,64),t.keccak_224=E(1,144,28),t.keccak_256=E(1,136,32),t.keccak_384=E(1,104,48),t.keccak_512=E(1,72,64);const A=(e,t,r)=>(0,i.wrapXOFConstructorWithOpts)(((n={})=>new v(t,e,void 0===n.dkLen?r:n.dkLen,!0)));t.shake128=A(31,168,16),t.shake256=A(31,136,32)},9074:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.byteSwap32=t.byteSwapIfBE=t.byteSwap=t.isLE=t.rotl=t.rotr=t.createView=t.u32=t.u8=t.isBytes=void 0;const n=r(6910),a=r(8460);t.isBytes=function(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name};t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);t.rotr=(e,t)=>e<<32-t|e>>>t;t.rotl=(e,t)=>e<<t|e>>>32-t>>>0,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0];t.byteSwap=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,t.byteSwapIfBE=t.isLE?e=>e:e=>(0,t.byteSwap)(e),t.byteSwap32=function(e){for(let r=0;r<e.length;r++)e[r]=(0,t.byteSwap)(e[r])};const i=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));t.bytesToHex=function(e){(0,a.bytes)(e);let t="";for(let r=0;r<e.length;r++)t+=i[e[r]];return t};const s={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function o(e){return e>=s._0&&e<=s._9?e-s._0:e>=s._A&&e<=s._F?e-(s._A-10):e>=s._a&&e<=s._f?e-(s._a-10):void 0}t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,a=0;t<r;t++,a+=2){const r=o(e.charCodeAt(a)),i=o(e.charCodeAt(a+1));if(void 0===r||void 0===i){const t=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+a)}n[t]=16*r+i}return n};function c(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function d(e){return"string"==typeof e&&(e=c(e)),(0,a.bytes)(e),e}t.nextTick=async()=>{},t.asyncLoop=async function(e,r,n){let a=Date.now();for(let i=0;i<e;i++){n(i);const e=Date.now()-a;e>=0&&e<r||(await(0,t.nextTick)(),a+=e)}},t.utf8ToBytes=c,t.toBytes=d,t.concatBytes=function(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];(0,a.bytes)(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const a=e[t];r.set(a,n),n+=a.length}return r};t.Hash=class{clone(){return this._cloneInto()}};const f={}.toString;t.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!==f.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(d(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(d(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(d(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},6710:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function n(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function a(...e){const t=e=>e,r=(e,t)=>r=>e(t(r));return{encode:e.map((e=>e.encode)).reduceRight(r,t),decode:e.map((e=>e.decode)).reduce(r,t)}}function i(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map((t=>{if(r(t),t<0||t>=e.length)throw new Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]}))},decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map((t=>{if("string"!=typeof t)throw new Error(`alphabet.decode: not string element=${t}`);const r=e.indexOf(t);if(-1===r)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return r}))}}}function s(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return t.join(e)},decode:t=>{if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function o(e,t="="){if(r(e),"string"!=typeof t)throw new Error("padding chr should be string");return{encode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let e of r)if("string"!=typeof e)throw new Error(`padding.encode: non-string input=${e}`);for(;r.length*e%8;)r.push(t);return r},decode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let e of r)if("string"!=typeof e)throw new Error(`padding.decode: non-string input=${e}`);let n=r.length;if(n*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--)if(!((n-1)*e%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,n)}}}function c(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:e=>e,decode:t=>e(t)}}function d(e,t,n){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(n<2)throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let a=0;const i=[],s=Array.from(e);for(s.forEach((e=>{if(r(e),e<0||e>=t)throw new Error(`Wrong integer: ${e}`)}));;){let e=0,r=!0;for(let i=a;i<s.length;i++){const o=s[i],c=t*e+o;if(!Number.isSafeInteger(c)||t*e/t!==e||c-o!=t*e)throw new Error("convertRadix: carry overflow");e=c%n;const d=Math.floor(c/n);if(s[i]=d,!Number.isSafeInteger(d)||d*n+e!==c)throw new Error("convertRadix: carry overflow");r&&(d?r=!1:a=i)}if(i.push(e),r)break}for(let t=0;t<e.length-1&&0===e[t];t++)i.push(0);return i.reverse()}Object.defineProperty(t,"__esModule",{value:!0}),t.bytes=t.stringToBytes=t.str=t.bytesToString=t.hex=t.utf8=t.bech32m=t.bech32=t.base58check=t.createBase58check=t.base58xmr=t.base58xrp=t.base58flickr=t.base58=t.base64urlnopad=t.base64url=t.base64nopad=t.base64=t.base32crockford=t.base32hexnopad=t.base32hex=t.base32nopad=t.base32=t.base16=t.utils=t.assertNumber=void 0,t.assertNumber=r;const f=(e,t)=>t?f(t,e%t):e,u=(e,t)=>e+(t-f(e,t));function l(e,t,n,a){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(n<=0||n>32)throw new Error(`convertRadix2: wrong to=${n}`);if(u(t,n)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${n} carryBits=${u(t,n)}`);let i=0,s=0;const o=2**n-1,c=[];for(const a of e){if(r(a),a>=2**t)throw new Error(`convertRadix2: invalid data word=${a} from=${t}`);if(i=i<<t|a,s+t>32)throw new Error(`convertRadix2: carry overflow pos=${s} from=${t}`);for(s+=t;s>=n;s-=n)c.push((i>>s-n&o)>>>0);i&=2**s-1}if(i=i<<n-s&o,!a&&s>=t)throw new Error("Excess padding");if(!a&&i)throw new Error(`Non-zero padding: ${i}`);return a&&s>0&&c.push(i>>>0),c}function h(e){return r(e),{encode:t=>{if(!n(t))throw new Error("radix.encode input should be Uint8Array");return d(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(d(t,e,256))}}}function p(e,t=!1){if(r(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(u(8,e)>32||u(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!n(r))throw new Error("radix2.encode input should be Uint8Array");return l(Array.from(r),8,e,!t)},decode:r=>{if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(l(r,e,8,t))}}}function b(e){if("function"!=typeof e)throw new Error("unsafeWrapper fn should be function");return function(...t){try{return e.apply(null,t)}catch(e){}}}function g(e,t){if(r(e),"function"!=typeof t)throw new Error("checksum fn should be function");return{encode(r){if(!n(r))throw new Error("checksum.encode: input should be Uint8Array");const a=t(r).slice(0,e),i=new Uint8Array(r.length+e);return i.set(r),i.set(a,r.length),i},decode(r){if(!n(r))throw new Error("checksum.decode: input should be Uint8Array");const a=r.slice(0,-e),i=t(a).slice(0,e),s=r.slice(-e);for(let t=0;t<e;t++)if(i[t]!==s[t])throw new Error("Invalid checksum");return a}}}t.utils={alphabet:i,chain:a,checksum:g,convertRadix:d,convertRadix2:l,radix:h,radix2:p,join:s,padding:o},t.base16=a(p(4),i("0123456789ABCDEF"),s("")),t.base32=a(p(5),i("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),o(5),s("")),t.base32nopad=a(p(5),i("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),s("")),t.base32hex=a(p(5),i("0123456789ABCDEFGHIJKLMNOPQRSTUV"),o(5),s("")),t.base32hexnopad=a(p(5),i("0123456789ABCDEFGHIJKLMNOPQRSTUV"),s("")),t.base32crockford=a(p(5),i("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),s(""),c((e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")))),t.base64=a(p(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),o(6),s("")),t.base64nopad=a(p(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),s("")),t.base64url=a(p(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),o(6),s("")),t.base64urlnopad=a(p(6),i("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),s(""));const y=e=>a(h(58),i(e),s(""));t.base58=y("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),t.base58flickr=y("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),t.base58xrp=y("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");const m=[0,2,3,5,6,7,9,10,11];t.base58xmr={encode(e){let r="";for(let n=0;n<e.length;n+=8){const a=e.subarray(n,n+8);r+=t.base58.encode(a).padStart(m[a.length],"1")}return r},decode(e){let r=[];for(let n=0;n<e.length;n+=11){const a=e.slice(n,n+11),i=m.indexOf(a.length),s=t.base58.decode(a);for(let e=0;e<s.length-i;e++)if(0!==s[e])throw new Error("base58xmr: wrong padding");r=r.concat(Array.from(s.slice(s.length-i)))}return Uint8Array.from(r)}};t.createBase58check=e=>a(g(4,(t=>e(e(t)))),t.base58),t.base58check=t.createBase58check;const w=a(i("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),s("")),v=[996825010,642813549,513874426,1027748829,705979059];function E(e){const t=e>>25;let r=(33554431&e)<<5;for(let e=0;e<v.length;e++)1==(t>>e&1)&&(r^=v[e]);return r}function A(e,t,r=1){const n=e.length;let a=1;for(let t=0;t<n;t++){const r=e.charCodeAt(t);if(r<33||r>126)throw new Error(`Invalid prefix (${e})`);a=E(a)^r>>5}a=E(a);for(let t=0;t<n;t++)a=E(a)^31&e.charCodeAt(t);for(let e of t)a=E(a)^e;for(let e=0;e<6;e++)a=E(a);return a^=r,w.encode(l([a%2**30],30,5,!1))}function _(e){const t="bech32"===e?1:734539939,r=p(5),n=r.decode,a=r.encode,i=b(n);function s(e,r=90){if("string"!=typeof e)throw new Error("bech32.decode input should be string, not "+typeof e);if(e.length<8||!1!==r&&e.length>r)throw new TypeError(`Wrong string length: ${e.length} (${e}). Expected (8..${r})`);const n=e.toLowerCase();if(e!==n&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const a=n.lastIndexOf("1");if(0===a||-1===a)throw new Error('Letter "1" must be present between prefix and data only');const i=n.slice(0,a),s=n.slice(a+1);if(s.length<6)throw new Error("Data must be at least 6 characters long");const o=w.decode(s).slice(0,-6),c=A(i,o,t);if(!s.endsWith(c))throw new Error(`Invalid checksum in ${e}: expected "${c}"`);return{prefix:i,words:o}}return{encode:function(e,r,n=90){if("string"!=typeof e)throw new Error("bech32.encode prefix should be string, not "+typeof e);if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("bech32.encode words should be array of numbers, not "+typeof r);if(0===e.length)throw new TypeError(`Invalid prefix length ${e.length}`);const a=e.length+7+r.length;if(!1!==n&&a>n)throw new TypeError(`Length ${a} exceeds limit ${n}`);const i=e.toLowerCase(),s=A(i,r,t);return`${i}1${w.encode(r)}${s}`},decode:s,decodeToBytes:function(e){const{prefix:t,words:r}=s(e,!1);return{prefix:t,words:r,bytes:n(r)}},decodeUnsafe:b(s),fromWords:n,fromWordsUnsafe:i,toWords:a}}t.bech32=_("bech32"),t.bech32m=_("bech32m"),t.utf8={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)},t.hex=a(p(4),i("0123456789abcdef"),s(""),c((e=>{if("string"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})));const x={utf8:t.utf8,hex:t.hex,base16:t.base16,base32:t.base32,base64:t.base64,base64url:t.base64url,base58:t.base58,base58xmr:t.base58xmr},S="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr";t.bytesToString=(e,t)=>{if("string"!=typeof e||!x.hasOwnProperty(e))throw new TypeError(S);if(!n(t))throw new TypeError("bytesToString() expects Uint8Array");return x[e].encode(t)},t.str=t.bytesToString;t.stringToBytes=(e,t)=>{if(!x.hasOwnProperty(e))throw new TypeError(S);if("string"!=typeof t)throw new TypeError("stringToBytes() expects string");return x[e].decode(t)},t.bytes=t.stringToBytes},1183:function(e){"use strict";!function(t){function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t<e.length;t++)if(!r(e[t])||e[t]<0||e[t]>255)return!1;return!0}function a(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function i(e){return new Uint8Array(e)}function s(e,t,r,n,a){null==n&&null==a||(e=e.slice?e.slice(n,a):Array.prototype.slice.call(e,n,a)),t.set(e,r)}var o,c={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r<e.length;){var n=e.charCodeAt(r++);37===n?(t.push(parseInt(e.substr(r,2),16)),r+=2):t.push(n)}return a(t)},fromBytes:function(e){for(var t=[],r=0;r<e.length;){var n=e[r];n<128?(t.push(String.fromCharCode(n)),r++):n>191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},d=(o="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},fromBytes:function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(o[(240&n)>>4]+o[15&n])}return t.join("")}}),f={16:10,24:12,32:14},u=[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],l=[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],h=[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],p=[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],b=[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],g=[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],y=[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],m=[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],w=[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],v=[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],E=[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],A=[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],_=[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],x=[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],S=[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 I(e){for(var t=[],r=0;r<e.length;r+=4)t.push(e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3]);return t}var k=function(e){if(!(this instanceof k))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:a(e,!0)}),this._prepare()};k.prototype._prepare=function(){var e=f[this.key.length];if(null==e)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var r,n=4*(e+1),a=this.key.length/4,i=I(this.key);for(t=0;t<a;t++)r=t>>2,this._Ke[r][t%4]=i[t],this._Kd[e-r][t%4]=i[t];for(var s,o=0,c=a;c<n;){if(s=i[a-1],i[0]^=l[s>>16&255]<<24^l[s>>8&255]<<16^l[255&s]<<8^l[s>>24&255]^u[o]<<24,o+=1,8!=a)for(t=1;t<a;t++)i[t]^=i[t-1];else{for(t=1;t<a/2;t++)i[t]^=i[t-1];s=i[a/2-1],i[a/2]^=l[255&s]^l[s>>8&255]<<8^l[s>>16&255]<<16^l[s>>24&255]<<24;for(t=a/2+1;t<a;t++)i[t]^=i[t-1]}for(t=0;t<a&&c<n;)d=c>>2,h=c%4,this._Ke[d][h]=i[t],this._Kd[e-d][h]=i[t++],c++}for(var d=1;d<e;d++)for(var h=0;h<4;h++)s=this._Kd[d][h],this._Kd[d][h]=A[s>>24&255]^_[s>>16&255]^x[s>>8&255]^S[255&s]},k.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=I(e),a=0;a<4;a++)n[a]^=this._Ke[0][a];for(var s=1;s<t;s++){for(a=0;a<4;a++)r[a]=p[n[a]>>24&255]^b[n[(a+1)%4]>>16&255]^g[n[(a+2)%4]>>8&255]^y[255&n[(a+3)%4]]^this._Ke[s][a];n=r.slice()}var o,c=i(16);for(a=0;a<4;a++)o=this._Ke[t][a],c[4*a]=255&(l[n[a]>>24&255]^o>>24),c[4*a+1]=255&(l[n[(a+1)%4]>>16&255]^o>>16),c[4*a+2]=255&(l[n[(a+2)%4]>>8&255]^o>>8),c[4*a+3]=255&(l[255&n[(a+3)%4]]^o);return c},k.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=I(e),a=0;a<4;a++)n[a]^=this._Kd[0][a];for(var s=1;s<t;s++){for(a=0;a<4;a++)r[a]=m[n[a]>>24&255]^w[n[(a+3)%4]>>16&255]^v[n[(a+2)%4]>>8&255]^E[255&n[(a+1)%4]]^this._Kd[s][a];n=r.slice()}var o,c=i(16);for(a=0;a<4;a++)o=this._Kd[t][a],c[4*a]=255&(h[n[a]>>24&255]^o>>24),c[4*a+1]=255&(h[n[(a+3)%4]>>16&255]^o>>16),c[4*a+2]=255&(h[n[(a+2)%4]>>8&255]^o>>8),c[4*a+3]=255&(h[255&n[(a+1)%4]]^o);return c};var C=function(e){if(!(this instanceof C))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new k(e)};C.prototype.encrypt=function(e){if((e=a(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),n=0;n<e.length;n+=16)s(e,r,0,n,n+16),s(r=this._aes.encrypt(r),t,n);return t},C.prototype.decrypt=function(e){if((e=a(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),n=0;n<e.length;n+=16)s(e,r,0,n,n+16),s(r=this._aes.decrypt(r),t,n);return t};var T=function(e,t){if(!(this instanceof T))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=i(16);this._lastCipherblock=a(t,!0),this._aes=new k(e)};T.prototype.encrypt=function(e){if((e=a(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),n=0;n<e.length;n+=16){s(e,r,0,n,n+16);for(var o=0;o<16;o++)r[o]^=this._lastCipherblock[o];this._lastCipherblock=this._aes.encrypt(r),s(this._lastCipherblock,t,n)}return t},T.prototype.decrypt=function(e){if((e=a(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),n=0;n<e.length;n+=16){s(e,r,0,n,n+16),r=this._aes.decrypt(r);for(var o=0;o<16;o++)t[n+o]=r[o]^this._lastCipherblock[o];s(e,this._lastCipherblock,0,n,n+16)}return t};var B=function(e,t,r){if(!(this instanceof B))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 size)")}else t=i(16);r||(r=1),this.segmentSize=r,this._shiftRegister=a(t,!0),this._aes=new k(e)};B.prototype.encrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var t,r=a(e,!0),n=0;n<r.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var i=0;i<this.segmentSize;i++)r[n+i]^=t[i];s(this._shiftRegister,this._shiftRegister,0,this.segmentSize),s(r,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r},B.prototype.decrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var t,r=a(e,!0),n=0;n<r.length;n+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var i=0;i<this.segmentSize;i++)r[n+i]^=t[i];s(this._shiftRegister,this._shiftRegister,0,this.segmentSize),s(e,this._shiftRegister,16-this.segmentSize,n,n+this.segmentSize)}return r};var M=function(e,t){if(!(this instanceof M))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",t){if(16!=t.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=i(16);this._lastPrecipher=a(t,!0),this._lastPrecipherIndex=16,this._aes=new k(e)};M.prototype.encrypt=function(e){for(var t=a(e,!0),r=0;r<t.length;r++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),t[r]^=this._lastPrecipher[this._lastPrecipherIndex++];return t},M.prototype.decrypt=M.prototype.encrypt;var O=function(e){if(!(this instanceof O))throw Error("Counter must be instanitated with `new`");0===e||e||(e=1),"number"==typeof e?(this._counter=i(16),this.setValue(e)):this.setBytes(e)};O.prototype.setValue=function(e){if("number"!=typeof e||parseInt(e)!=e)throw new Error("invalid counter value (must be an integer)");for(var t=15;t>=0;--t)this._counter[t]=e%256,e>>=8},O.prototype.setBytes=function(e){if(16!=(e=a(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},O.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var R=function(e,t){if(!(this instanceof R))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof O||(t=new O(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new k(e)};R.prototype.encrypt=function(e){for(var t=a(e,!0),r=0;r<t.length;r++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),t[r]^=this._remainingCounter[this._remainingCounterIndex++];return t},R.prototype.decrypt=R.prototype.encrypt;var N={AES:k,Counter:O,ModeOfOperation:{ecb:C,cbc:T,cfb:B,ofb:M,ctr:R},utils:{hex:d,utf8:c},padding:{pkcs7:{pad:function(e){var t=16-(e=a(e,!0)).length%16,r=i(e.length+t);s(e,r);for(var n=e.length;n<r.length;n++)r[n]=t;return r},strip:function(e){if((e=a(e,!0)).length<16)throw new Error("PKCS#7 invalid length");var t=e[e.length-1];if(t>16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n<t;n++)if(e[r+n]!==t)throw new Error("PKCS#7 invalid padding byte");var o=i(r);return s(e,o,0,0,r),o}}},_arrayTest:{coerceArray:a,createArray:i,copyArray:s}};e.exports=N}()},7991:(e,t)=>{"use strict";t.byteLength=function(e){var t=o(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=o(e),s=i[0],c=i[1],d=new a(function(e,t,r){return 3*(t+r)/4-r}(0,s,c)),f=0,u=c>0?s-4:s;for(r=0;r<u;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],d[f++]=t>>16&255,d[f++]=t>>8&255,d[f++]=255&t;2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,d[f++]=255&t);1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,d[f++]=t>>8&255,d[f++]=255&t);return d},t.fromByteArray=function(e){for(var t,n=e.length,a=n%3,i=[],s=16383,o=0,d=n-a;o<d;o+=s)i.push(c(e,o,o+s>d?d:o+s));1===a?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===a&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return i.join("")};for(var r=[],n=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=i[s],n[i.charCodeAt(s)]=s;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var a,i,s=[],o=t;o<n;o+=3)a=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),s.push(r[(i=a)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},5553:function(e,t,r){var n;!function(a){"use strict";var i,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,c=Math.ceil,d=Math.floor,f="[BigNumber Error] ",u=f+"Number primitive has more than 15 significant digits: ",l=1e14,h=14,p=9007199254740991,b=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],g=1e7,y=1e9;function m(e){var t=0|e;return e>0||e===t?t:t-1}function w(e){for(var t,r,n=1,a=e.length,i=e[0]+"";n<a;){for(t=e[n++]+"",r=h-t.length;r--;t="0"+t);i+=t}for(a=i.length;48===i.charCodeAt(--a););return i.slice(0,a+1||1)}function v(e,t){var r,n,a=e.c,i=t.c,s=e.s,o=t.s,c=e.e,d=t.e;if(!s||!o)return null;if(r=a&&!a[0],n=i&&!i[0],r||n)return r?n?0:-o:s;if(s!=o)return s;if(r=s<0,n=c==d,!a||!i)return n?0:!a^r?1:-1;if(!n)return c>d^r?1:-1;for(o=(c=a.length)<(d=i.length)?c:d,s=0;s<o;s++)if(a[s]!=i[s])return a[s]>i[s]^r?1:-1;return c==d?0:c>d^r?1:-1}function E(e,t,r,n){if(e<t||e>r||e!==d(e))throw Error(f+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function A(e){var t=e.c.length-1;return m(e.e/h)==t&&e.c[t]%2!=0}function _(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function x(e,t,r){var n,a;if(t<0){for(a=r+".";++t;a+=r);e=a+e}else if(++t>(n=e.length)){for(a=r,t-=n;--t;a+=r);e+=a}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}i=function e(t){var r,n,a,i,S,I,k,C,T,B,M=z.prototype={constructor:z,toString:null,valueOf:null},O=new z(1),R=20,N=4,P=-7,L=21,F=-1e7,D=1e7,U=!1,H=1,j=0,V={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},$="0123456789abcdefghijklmnopqrstuvwxyz";function z(e,t){var r,i,o,c,f,l,b,g,y=this;if(!(y instanceof z))return new z(e,t);if(null==t){if(e&&!0===e._isBigNumber)return y.s=e.s,void(!e.c||e.e>D?y.c=y.e=null:e.e<F?y.c=[y.e=0]:(y.e=e.e,y.c=e.c.slice()));if((l="number"==typeof e)&&0*e==0){if(y.s=1/e<0?(e=-e,-1):1,e===~~e){for(c=0,f=e;f>=10;f/=10,c++);return void(c>D?y.c=y.e=null:(y.e=c,y.c=[e]))}g=String(e)}else{if(!s.test(g=String(e)))return a(y,g,l);y.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(c=g.indexOf("."))>-1&&(g=g.replace(".","")),(f=g.search(/e/i))>0?(c<0&&(c=f),c+=+g.slice(f+1),g=g.substring(0,f)):c<0&&(c=g.length)}else{if(E(t,2,$.length,"Base"),10==t)return J(y=new z(e),R+y.e+1,N);if(g=String(e),l="number"==typeof e){if(0*e!=0)return a(y,g,l,t);if(y.s=1/e<0?(g=g.slice(1),-1):1,z.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(u+e)}else y.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=$.slice(0,t),c=f=0,b=g.length;f<b;f++)if(r.indexOf(i=g.charAt(f))<0){if("."==i){if(f>c){c=b;continue}}else if(!o&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){o=!0,f=-1,c=0;continue}return a(y,String(e),l,t)}l=!1,(c=(g=n(g,t,10,y.s)).indexOf("."))>-1?g=g.replace(".",""):c=g.length}for(f=0;48===g.charCodeAt(f);f++);for(b=g.length;48===g.charCodeAt(--b););if(g=g.slice(f,++b)){if(b-=f,l&&z.DEBUG&&b>15&&(e>p||e!==d(e)))throw Error(u+y.s*e);if((c=c-f-1)>D)y.c=y.e=null;else if(c<F)y.c=[y.e=0];else{if(y.e=c,y.c=[],f=(c+1)%h,c<0&&(f+=h),f<b){for(f&&y.c.push(+g.slice(0,f)),b-=h;f<b;)y.c.push(+g.slice(f,f+=h));f=h-(g=g.slice(f)).length}else f-=b;for(;f--;g+="0");y.c.push(+g)}}else y.c=[y.e=0]}function q(e,t,r,n){var a,i,s,o,c;if(null==r?r=N:E(r,0,8),!e.c)return e.toString();if(a=e.c[0],s=e.e,null==t)c=w(e.c),c=1==n||2==n&&(s<=P||s>=L)?_(c,s):x(c,s,"0");else if(i=(e=J(new z(e),t,r)).e,o=(c=w(e.c)).length,1==n||2==n&&(t<=i||i<=P)){for(;o<t;c+="0",o++);c=_(c,i)}else if(t-=s,c=x(c,i,"0"),i+1>o){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=i-o)>0)for(i+1==o&&(c+=".");t--;c+="0");return e.s<0&&a?"-"+c:c}function K(e,t){for(var r,n=1,a=new z(e[0]);n<e.length;n++){if(!(r=new z(e[n])).s){a=r;break}t.call(a,r)&&(a=r)}return a}function G(e,t,r){for(var n=1,a=t.length;!t[--a];t.pop());for(a=t[0];a>=10;a/=10,n++);return(r=n+r*h-1)>D?e.c=e.e=null:r<F?e.c=[e.e=0]:(e.e=r,e.c=t),e}function J(e,t,r,n){var a,i,s,o,f,u,p,g=e.c,y=b;if(g){e:{for(a=1,o=g[0];o>=10;o/=10,a++);if((i=t-a)<0)i+=h,s=t,p=(f=g[u=0])/y[a-s-1]%10|0;else if((u=c((i+1)/h))>=g.length){if(!n)break e;for(;g.length<=u;g.push(0));f=p=0,a=1,s=(i%=h)-h+1}else{for(f=o=g[u],a=1;o>=10;o/=10,a++);p=(s=(i%=h)-h+a)<0?0:f/y[a-s-1]%10|0}if(n=n||t<0||null!=g[u+1]||(s<0?f:f%y[a-s-1]),n=r<4?(p||n)&&(0==r||r==(e.s<0?3:2)):p>5||5==p&&(4==r||n||6==r&&(i>0?s>0?f/y[a-s]:0:g[u-1])%10&1||r==(e.s<0?8:7)),t<1||!g[0])return g.length=0,n?(t-=e.e+1,g[0]=y[(h-t%h)%h],e.e=-t||0):g[0]=e.e=0,e;if(0==i?(g.length=u,o=1,u--):(g.length=u+1,o=y[h-i],g[u]=s>0?d(f/y[a-s]%y[s])*o:0),n)for(;;){if(0==u){for(i=1,s=g[0];s>=10;s/=10,i++);for(s=g[0]+=o,o=1;s>=10;s/=10,o++);i!=o&&(e.e++,g[0]==l&&(g[0]=1));break}if(g[u]+=o,g[u]!=l)break;g[u--]=0,o=1}for(i=g.length;0===g[--i];g.pop());}e.e>D?e.c=e.e=null:e.e<F&&(e.c=[e.e=0])}return e}function W(e){var t,r=e.e;return null===r?e.toString():(t=w(e.c),t=r<=P||r>=L?_(t,r):x(t,r,"0"),e.s<0?"-"+t:t)}return z.clone=e,z.ROUND_UP=0,z.ROUND_DOWN=1,z.ROUND_CEIL=2,z.ROUND_FLOOR=3,z.ROUND_HALF_UP=4,z.ROUND_HALF_DOWN=5,z.ROUND_HALF_EVEN=6,z.ROUND_HALF_CEIL=7,z.ROUND_HALF_FLOOR=8,z.EUCLID=9,z.config=z.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(f+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(E(r=e[t],0,y,t),R=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(E(r=e[t],0,8,t),N=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(E(r[0],-y,0,t),E(r[1],0,y,t),P=r[0],L=r[1]):(E(r,-y,y,t),P=-(L=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)E(r[0],-y,-1,t),E(r[1],1,y,t),F=r[0],D=r[1];else{if(E(r,-y,y,t),!r)throw Error(f+t+" cannot be zero: "+r);F=-(D=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(f+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!r,Error(f+"crypto unavailable");U=r}else U=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(E(r=e[t],0,9,t),H=r),e.hasOwnProperty(t="POW_PRECISION")&&(E(r=e[t],0,y,t),j=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(f+t+" not an object: "+r);V=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(f+t+" invalid: "+r);$=r}}return{DECIMAL_PLACES:R,ROUNDING_MODE:N,EXPONENTIAL_AT:[P,L],RANGE:[F,D],CRYPTO:U,MODULO_MODE:H,POW_PRECISION:j,FORMAT:V,ALPHABET:$}},z.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!z.DEBUG)return!0;var t,r,n=e.c,a=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===i||-1===i)&&a>=-y&&a<=y&&a===d(a)){if(0===n[0]){if(0===a&&1===n.length)return!0;break e}if((t=(a+1)%h)<1&&(t+=h),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=l||r!==d(r))break e;if(0!==r)return!0}}}else if(null===n&&null===a&&(null===i||1===i||-1===i))return!0;throw Error(f+"Invalid BigNumber: "+e)},z.maximum=z.max=function(){return K(arguments,M.lt)},z.minimum=z.min=function(){return K(arguments,M.gt)},z.random=(i=9007199254740992,S=Math.random()*i&2097151?function(){return d(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,a,i,s=0,o=[],u=new z(O);if(null==e?e=R:E(e,0,y),a=c(e/h),U)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(a*=2));s<a;)(i=131072*t[s]+(t[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(o.push(i%1e14),s+=2);s=a/2}else{if(!crypto.randomBytes)throw U=!1,Error(f+"crypto unavailable");for(t=crypto.randomBytes(a*=7);s<a;)(i=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(o.push(i%1e14),s+=7);s=a/7}if(!U)for(;s<a;)(i=S())<9e15&&(o[s++]=i%1e14);for(a=o[--s],e%=h,a&&e&&(i=b[h-e],o[s]=d(a/i)*i);0===o[s];o.pop(),s--);if(s<0)o=[n=0];else{for(n=-1;0===o[0];o.splice(0,1),n-=h);for(s=1,i=o[0];i>=10;i/=10,s++);s<h&&(n-=h-s)}return u.e=n,u.c=o,u}),z.sum=function(){for(var e=1,t=arguments,r=new z(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var a,i,s=[0],o=0,c=e.length;o<c;){for(i=s.length;i--;s[i]*=t);for(s[0]+=n.indexOf(e.charAt(o++)),a=0;a<s.length;a++)s[a]>r-1&&(null==s[a+1]&&(s[a+1]=0),s[a+1]+=s[a]/r|0,s[a]%=r)}return s.reverse()}return function(n,a,i,s,o){var c,d,f,u,l,h,p,b,g=n.indexOf("."),y=R,m=N;for(g>=0&&(u=j,j=0,n=n.replace(".",""),h=(b=new z(a)).pow(n.length-g),j=u,b.c=t(x(w(h.c),h.e,"0"),10,i,e),b.e=b.c.length),f=u=(p=t(n,a,i,o?(c=$,e):(c=e,$))).length;0==p[--u];p.pop());if(!p[0])return c.charAt(0);if(g<0?--f:(h.c=p,h.e=f,h.s=s,p=(h=r(h,b,y,m,i)).c,l=h.r,f=h.e),g=p[d=f+y+1],u=i/2,l=l||d<0||null!=p[d+1],l=m<4?(null!=g||l)&&(0==m||m==(h.s<0?3:2)):g>u||g==u&&(4==m||l||6==m&&1&p[d-1]||m==(h.s<0?8:7)),d<1||!p[0])n=l?x(c.charAt(1),-y,c.charAt(0)):c.charAt(0);else{if(p.length=d,l)for(--i;++p[--d]>i;)p[d]=0,d||(++f,p=[1].concat(p));for(u=p.length;!p[--u];);for(g=0,n="";g<=u;n+=c.charAt(p[g++]));n=x(n,f,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,a,i,s,o=0,c=e.length,d=t%g,f=t/g|0;for(e=e.slice();c--;)o=((a=d*(i=e[c]%g)+(n=f*i+(s=e[c]/g|0)*d)%g*g+o)/r|0)+(n/g|0)+f*s,e[c]=a%r;return o&&(e=[o].concat(e)),e}function t(e,t,r,n){var a,i;if(r!=n)i=r>n?1:-1;else for(a=i=0;a<r;a++)if(e[a]!=t[a]){i=e[a]>t[a]?1:-1;break}return i}function r(e,t,r,n){for(var a=0;r--;)e[r]-=a,a=e[r]<t[r]?1:0,e[r]=a*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,a,i,s,o){var c,f,u,p,b,g,y,w,v,E,A,_,x,S,I,k,C,T=n.s==a.s?1:-1,B=n.c,M=a.c;if(!(B&&B[0]&&M&&M[0]))return new z(n.s&&a.s&&(B?!M||B[0]!=M[0]:M)?B&&0==B[0]||!M?0*T:T/0:NaN);for(v=(w=new z(T)).c=[],T=i+(f=n.e-a.e)+1,o||(o=l,f=m(n.e/h)-m(a.e/h),T=T/h|0),u=0;M[u]==(B[u]||0);u++);if(M[u]>(B[u]||0)&&f--,T<0)v.push(1),p=!0;else{for(S=B.length,k=M.length,u=0,T+=2,(b=d(o/(M[0]+1)))>1&&(M=e(M,b,o),B=e(B,b,o),k=M.length,S=B.length),x=k,A=(E=B.slice(0,k)).length;A<k;E[A++]=0);C=M.slice(),C=[0].concat(C),I=M[0],M[1]>=o/2&&I++;do{if(b=0,(c=t(M,E,k,A))<0){if(_=E[0],k!=A&&(_=_*o+(E[1]||0)),(b=d(_/I))>1)for(b>=o&&(b=o-1),y=(g=e(M,b,o)).length,A=E.length;1==t(g,E,y,A);)b--,r(g,k<y?C:M,y,o),y=g.length,c=1;else 0==b&&(c=b=1),y=(g=M.slice()).length;if(y<A&&(g=[0].concat(g)),r(E,g,A,o),A=E.length,-1==c)for(;t(M,E,k,A)<1;)b++,r(E,k<A?C:M,A,o),A=E.length}else 0===c&&(b++,E=[0]);v[u++]=b,E[0]?E[A++]=B[x]||0:(E=[B[x]],A=1)}while((x++<S||null!=E[0])&&T--);p=null!=E[0],v[0]||v.splice(0,1)}if(o==l){for(u=1,T=v[0];T>=10;T/=10,u++);J(w,i+(w.e=u+f*h-1)+1,s,p)}else w.e=f,w.r=+p;return w}}(),I=/^(-?)0([xbo])(?=\w[\w.]*$)/i,k=/^([^.]+)\.$/,C=/^\.([^.]+)$/,T=/^-?(Infinity|NaN)$/,B=/^\s*\+(?=[\w.])|^\s+|\s+$/g,a=function(e,t,r,n){var a,i=r?t:t.replace(B,"");if(T.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!r&&(i=i.replace(I,(function(e,t,r){return a="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=a?e:t})),n&&(a=n,i=i.replace(k,"$1").replace(C,"0.$1")),t!=i))return new z(i,a);if(z.DEBUG)throw Error(f+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},M.absoluteValue=M.abs=function(){var e=new z(this);return e.s<0&&(e.s=1),e},M.comparedTo=function(e,t){return v(this,new z(e,t))},M.decimalPlaces=M.dp=function(e,t){var r,n,a,i=this;if(null!=e)return E(e,0,y),null==t?t=N:E(t,0,8),J(new z(i),e+i.e+1,t);if(!(r=i.c))return null;if(n=((a=r.length-1)-m(this.e/h))*h,a=r[a])for(;a%10==0;a/=10,n--);return n<0&&(n=0),n},M.dividedBy=M.div=function(e,t){return r(this,new z(e,t),R,N)},M.dividedToIntegerBy=M.idiv=function(e,t){return r(this,new z(e,t),0,1)},M.exponentiatedBy=M.pow=function(e,t){var r,n,a,i,s,o,u,l,p=this;if((e=new z(e)).c&&!e.isInteger())throw Error(f+"Exponent not an integer: "+W(e));if(null!=t&&(t=new z(t)),s=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return l=new z(Math.pow(+W(p),s?2-A(e):+W(e))),t?l.mod(t):l;if(o=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new z(NaN);(n=!o&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||s&&p.c[1]>=24e7:p.c[0]<8e13||s&&p.c[0]<=9999975e7)))return i=p.s<0&&A(e)?-0:0,p.e>-1&&(i=1/i),new z(o?1/i:i);j&&(i=c(j/h+2))}for(s?(r=new z(.5),o&&(e.s=1),u=A(e)):u=(a=Math.abs(+W(e)))%2,l=new z(O);;){if(u){if(!(l=l.times(p)).c)break;i?l.c.length>i&&(l.c.length=i):n&&(l=l.mod(t))}if(a){if(0===(a=d(a/2)))break;u=a%2}else if(J(e=e.times(r),e.e+1,1),e.e>14)u=A(e);else{if(0===(a=+W(e)))break;u=a%2}p=p.times(p),i?p.c&&p.c.length>i&&(p.c.length=i):n&&(p=p.mod(t))}return n?l:(o&&(l=O.div(l)),t?l.mod(t):i?J(l,j,N,undefined):l)},M.integerValue=function(e){var t=new z(this);return null==e?e=N:E(e,0,8),J(t,t.e+1,e)},M.isEqualTo=M.eq=function(e,t){return 0===v(this,new z(e,t))},M.isFinite=function(){return!!this.c},M.isGreaterThan=M.gt=function(e,t){return v(this,new z(e,t))>0},M.isGreaterThanOrEqualTo=M.gte=function(e,t){return 1===(t=v(this,new z(e,t)))||0===t},M.isInteger=function(){return!!this.c&&m(this.e/h)>this.c.length-2},M.isLessThan=M.lt=function(e,t){return v(this,new z(e,t))<0},M.isLessThanOrEqualTo=M.lte=function(e,t){return-1===(t=v(this,new z(e,t)))||0===t},M.isNaN=function(){return!this.s},M.isNegative=function(){return this.s<0},M.isPositive=function(){return this.s>0},M.isZero=function(){return!!this.c&&0==this.c[0]},M.minus=function(e,t){var r,n,a,i,s=this,o=s.s;if(t=(e=new z(e,t)).s,!o||!t)return new z(NaN);if(o!=t)return e.s=-t,s.plus(e);var c=s.e/h,d=e.e/h,f=s.c,u=e.c;if(!c||!d){if(!f||!u)return f?(e.s=-t,e):new z(u?s:NaN);if(!f[0]||!u[0])return u[0]?(e.s=-t,e):new z(f[0]?s:3==N?-0:0)}if(c=m(c),d=m(d),f=f.slice(),o=c-d){for((i=o<0)?(o=-o,a=f):(d=c,a=u),a.reverse(),t=o;t--;a.push(0));a.reverse()}else for(n=(i=(o=f.length)<(t=u.length))?o:t,o=t=0;t<n;t++)if(f[t]!=u[t]){i=f[t]<u[t];break}if(i&&(a=f,f=u,u=a,e.s=-e.s),(t=(n=u.length)-(r=f.length))>0)for(;t--;f[r++]=0);for(t=l-1;n>o;){if(f[--n]<u[n]){for(r=n;r&&!f[--r];f[r]=t);--f[r],f[n]+=l}f[n]-=u[n]}for(;0==f[0];f.splice(0,1),--d);return f[0]?G(e,f,d):(e.s=3==N?-1:1,e.c=[e.e=0],e)},M.modulo=M.mod=function(e,t){var n,a,i=this;return e=new z(e,t),!i.c||!e.s||e.c&&!e.c[0]?new z(NaN):!e.c||i.c&&!i.c[0]?new z(i):(9==H?(a=e.s,e.s=1,n=r(i,e,0,3),e.s=a,n.s*=a):n=r(i,e,0,H),(e=i.minus(n.times(e))).c[0]||1!=H||(e.s=i.s),e)},M.multipliedBy=M.times=function(e,t){var r,n,a,i,s,o,c,d,f,u,p,b,y,w,v,E=this,A=E.c,_=(e=new z(e,t)).c;if(!(A&&_&&A[0]&&_[0]))return!E.s||!e.s||A&&!A[0]&&!_||_&&!_[0]&&!A?e.c=e.e=e.s=null:(e.s*=E.s,A&&_?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=m(E.e/h)+m(e.e/h),e.s*=E.s,(c=A.length)<(u=_.length)&&(y=A,A=_,_=y,a=c,c=u,u=a),a=c+u,y=[];a--;y.push(0));for(w=l,v=g,a=u;--a>=0;){for(r=0,p=_[a]%v,b=_[a]/v|0,i=a+(s=c);i>a;)r=((d=p*(d=A[--s]%v)+(o=b*d+(f=A[s]/v|0)*p)%v*v+y[i]+r)/w|0)+(o/v|0)+b*f,y[i--]=d%w;y[i]=r}return r?++n:y.splice(0,1),G(e,y,n)},M.negated=function(){var e=new z(this);return e.s=-e.s||null,e},M.plus=function(e,t){var r,n=this,a=n.s;if(t=(e=new z(e,t)).s,!a||!t)return new z(NaN);if(a!=t)return e.s=-t,n.minus(e);var i=n.e/h,s=e.e/h,o=n.c,c=e.c;if(!i||!s){if(!o||!c)return new z(a/0);if(!o[0]||!c[0])return c[0]?e:new z(o[0]?n:0*a)}if(i=m(i),s=m(s),o=o.slice(),a=i-s){for(a>0?(s=i,r=c):(a=-a,r=o),r.reverse();a--;r.push(0));r.reverse()}for((a=o.length)-(t=c.length)<0&&(r=c,c=o,o=r,t=a),a=0;t;)a=(o[--t]=o[t]+c[t]+a)/l|0,o[t]=l===o[t]?0:o[t]%l;return a&&(o=[a].concat(o),++s),G(e,o,s)},M.precision=M.sd=function(e,t){var r,n,a,i=this;if(null!=e&&e!==!!e)return E(e,1,y),null==t?t=N:E(t,0,8),J(new z(i),e,t);if(!(r=i.c))return null;if(n=(a=r.length-1)*h+1,a=r[a]){for(;a%10==0;a/=10,n--);for(a=r[0];a>=10;a/=10,n++);}return e&&i.e+1>n&&(n=i.e+1),n},M.shiftedBy=function(e){return E(e,-9007199254740991,p),this.times("1e"+e)},M.squareRoot=M.sqrt=function(){var e,t,n,a,i,s=this,o=s.c,c=s.s,d=s.e,f=R+4,u=new z("0.5");if(1!==c||!o||!o[0])return new z(!c||c<0&&(!o||o[0])?NaN:o?s:1/0);if(0==(c=Math.sqrt(+W(s)))||c==1/0?(((t=w(o)).length+d)%2==0&&(t+="0"),c=Math.sqrt(+t),d=m((d+1)/2)-(d<0||d%2),n=new z(t=c==1/0?"1e"+d:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+d)):n=new z(c+""),n.c[0])for((c=(d=n.e)+f)<3&&(c=0);;)if(i=n,n=u.times(i.plus(r(s,i,f,1))),w(i.c).slice(0,c)===(t=w(n.c)).slice(0,c)){if(n.e<d&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(a||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(J(n,n.e+R+2,1),e=!n.times(n).eq(s));break}if(!a&&(J(i,i.e+R+2,0),i.times(i).eq(s))){n=i;break}f+=4,c+=4,a=1}return J(n,n.e+R+1,N,e)},M.toExponential=function(e,t){return null!=e&&(E(e,0,y),e++),q(this,e,t,1)},M.toFixed=function(e,t){return null!=e&&(E(e,0,y),e=e+this.e+1),q(this,e,t)},M.toFormat=function(e,t,r){var n,a=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=V;else if("object"!=typeof r)throw Error(f+"Argument not an object: "+r);if(n=a.toFixed(e,t),a.c){var i,s=n.split("."),o=+r.groupSize,c=+r.secondaryGroupSize,d=r.groupSeparator||"",u=s[0],l=s[1],h=a.s<0,p=h?u.slice(1):u,b=p.length;if(c&&(i=o,o=c,c=i,b-=i),o>0&&b>0){for(i=b%o||o,u=p.substr(0,i);i<b;i+=o)u+=d+p.substr(i,o);c>0&&(u+=d+p.slice(i)),h&&(u="-"+u)}n=l?u+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?l.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):l):u}return(r.prefix||"")+n+(r.suffix||"")},M.toFraction=function(e){var t,n,a,i,s,o,c,d,u,l,p,g,y=this,m=y.c;if(null!=e&&(!(c=new z(e)).isInteger()&&(c.c||1!==c.s)||c.lt(O)))throw Error(f+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+W(c));if(!m)return new z(y);for(t=new z(O),u=n=new z(O),a=d=new z(O),g=w(m),s=t.e=g.length-y.e-1,t.c[0]=b[(o=s%h)<0?h+o:o],e=!e||c.comparedTo(t)>0?s>0?t:u:c,o=D,D=1/0,c=new z(g),d.c[0]=0;l=r(c,t,0,1),1!=(i=n.plus(l.times(a))).comparedTo(e);)n=a,a=i,u=d.plus(l.times(i=u)),d=i,t=c.minus(l.times(i=t)),c=i;return i=r(e.minus(n),a,0,1),d=d.plus(i.times(u)),n=n.plus(i.times(a)),d.s=u.s=y.s,p=r(u,a,s*=2,N).minus(y).abs().comparedTo(r(d,n,s,N).minus(y).abs())<1?[u,a]:[d,n],D=o,p},M.toNumber=function(){return+W(this)},M.toPrecision=function(e,t){return null!=e&&E(e,1,y),q(this,e,t,2)},M.toString=function(e){var t,r=this,a=r.s,i=r.e;return null===i?a?(t="Infinity",a<0&&(t="-"+t)):t="NaN":(null==e?t=i<=P||i>=L?_(w(r.c),i):x(w(r.c),i,"0"):10===e?t=x(w((r=J(new z(r),R+i+1,N)).c),r.e,"0"):(E(e,2,$.length,"Base"),t=n(x(w(r.c),i,"0"),10,e,a,!0)),a<0&&r.c[0]&&(t="-"+t)),t},M.valueOf=M.toJSON=function(){return W(this)},M._isBigNumber=!0,o&&(M[Symbol.toStringTag]="BigNumber",M[Symbol.for("nodejs.util.inspect.custom")]=M.valueOf),null!=t&&z.set(t),z}(),i.default=i.BigNumber=i,void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)}()},2823:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function a(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(8379).Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function c(e,t,r){var n=o(e,r);return r-1>=t&&(n|=o(e,r-1)<<4),n}function d(e,t,r,a){for(var i=0,s=0,o=Math.min(e.length,r),c=t;c<o;c++){var d=e.charCodeAt(c)-48;i*=a,s=d>=49?d-49+10:d>=17?d-17+10:d,n(d>=0&&s<a,"Invalid character"),i+=s}return i}function f(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var a=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(a++,this.negative=1),a<e.length&&(16===t?this._parseHex(e,a,r):(this._parseBase(e,t,a),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var i,s,o=0;if("be"===r)for(a=e.length-1,i=0;a>=0;a-=3)s=e[a]|e[a-1]<<8|e[a-2]<<16,this.words[i]|=s<<o&67108863,this.words[i+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);else if("le"===r)for(a=0,i=0;a<e.length;a+=3)s=e[a]|e[a+1]<<8|e[a+2]<<16,this.words[i]|=s<<o&67108863,this.words[i+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);return this._strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var a,i=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)a=c(e,t,n)<<i,this.words[s]|=67108863&a,i>=18?(i-=18,s+=1,this.words[s]|=a>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)a=c(e,t,n)<<i,this.words[s]|=67108863&a,i>=18?(i-=18,s+=1,this.words[s]|=a>>>26):i+=8;this._strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=t)n++;n--,a=a/t|0;for(var i=e.length-r,s=i%n,o=Math.min(i,i-s)+r,c=0,f=r;f<o;f+=n)c=d(e,f,f+n,t),this.imuln(a),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var u=1;for(c=d(e,f,e.length,t),f=0;f<s;f++)u*=t;this.imuln(u),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype._move=function(e){f(e,this)},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch(e){i.prototype.inspect=u}else i.prototype.inspect=u;function u(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var a=0,i=0,s=0;s<this.length;s++){var o=this.words[s],c=(16777215&(o<<a|i)).toString(16);i=o>>>24-a&16777215,(a+=2)>=26&&(a-=26,s--),r=0!==i||s!==this.length-1?l[6-c.length]+c+r:c+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=h[e],f=p[e];r="";var u=this.clone();for(u.negative=0;!u.isZero();){var b=u.modrn(f).toString(e);r=(u=u.idivn(f)).isZero()?b+r:l[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},s&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function b(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var a=0|e.words[0],i=0|t.words[0],s=a*i,o=67108863&s,c=s/67108864|0;r.words[0]=o;for(var d=1;d<n;d++){for(var f=c>>>26,u=67108863&c,l=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=l;h++){var p=d-h|0;f+=(s=(a=0|e.words[p])*(i=0|t.words[h])+u)/67108864|0,u=67108863&s}r.words[d]=0|u,c=0|f}return 0!==c?r.words[d]=0|c:r.length--,r._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var a=this.byteLength(),i=r||Math.max(1,a);n(a<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,a),s},i.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,a=0,i=0;a<this.length;a++){var s=this.words[a]<<i|n;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===i?(r<e.length&&(e[r++]=s>>24&255),n=0,i=0):(n=s>>>24,i+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},i.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,a=0,i=0;a<this.length;a++){var s=this.words[a]<<i|n;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===i?(r>=0&&(e[r--]=s>>24&255),n=0,i=0):(n=s>>>24,i+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},i.prototype.ior=function(e){return n(!(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},i.prototype.iand=function(e){return n(!(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},i.prototype.ixor=function(e){return n(!(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var a=0;a<t;a++)this.words[a]=67108863&~this.words[a];return r>0&&(this.words[a]=~this.words[a]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,a=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<a:this.words[r]&~(1<<a),this._strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var a=0,i=0;i<n.length;i++)t=(0|r.words[i])+(0|n.words[i])+a,this.words[i]=67108863&t,a=t>>>26;for(;0!==a&&i<r.length;i++)t=(0|r.words[i])+a,this.words[i]=67108863&t,a=t>>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=e):(r=e,n=this);for(var i=0,s=0;s<n.length;s++)i=(t=(0|r.words[s])-(0|n.words[s])+i)>>26,this.words[s]=67108863&t;for(;0!==i&&s<r.length;s++)i=(t=(0|r.words[s])+i)>>26,this.words[s]=67108863&t;if(0===i&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var g=function(e,t,r){var n,a,i,s=e.words,o=t.words,c=r.words,d=0,f=0|s[0],u=8191&f,l=f>>>13,h=0|s[1],p=8191&h,b=h>>>13,g=0|s[2],y=8191&g,m=g>>>13,w=0|s[3],v=8191&w,E=w>>>13,A=0|s[4],_=8191&A,x=A>>>13,S=0|s[5],I=8191&S,k=S>>>13,C=0|s[6],T=8191&C,B=C>>>13,M=0|s[7],O=8191&M,R=M>>>13,N=0|s[8],P=8191&N,L=N>>>13,F=0|s[9],D=8191&F,U=F>>>13,H=0|o[0],j=8191&H,V=H>>>13,$=0|o[1],z=8191&$,q=$>>>13,K=0|o[2],G=8191&K,J=K>>>13,W=0|o[3],Y=8191&W,Z=W>>>13,X=0|o[4],Q=8191&X,ee=X>>>13,te=0|o[5],re=8191&te,ne=te>>>13,ae=0|o[6],ie=8191&ae,se=ae>>>13,oe=0|o[7],ce=8191&oe,de=oe>>>13,fe=0|o[8],ue=8191&fe,le=fe>>>13,he=0|o[9],pe=8191&he,be=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(d+(n=Math.imul(u,j))|0)+((8191&(a=(a=Math.imul(u,V))+Math.imul(l,j)|0))<<13)|0;d=((i=Math.imul(l,V))+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,j),a=(a=Math.imul(p,V))+Math.imul(b,j)|0,i=Math.imul(b,V);var ye=(d+(n=n+Math.imul(u,z)|0)|0)+((8191&(a=(a=a+Math.imul(u,q)|0)+Math.imul(l,z)|0))<<13)|0;d=((i=i+Math.imul(l,q)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,j),a=(a=Math.imul(y,V))+Math.imul(m,j)|0,i=Math.imul(m,V),n=n+Math.imul(p,z)|0,a=(a=a+Math.imul(p,q)|0)+Math.imul(b,z)|0,i=i+Math.imul(b,q)|0;var me=(d+(n=n+Math.imul(u,G)|0)|0)+((8191&(a=(a=a+Math.imul(u,J)|0)+Math.imul(l,G)|0))<<13)|0;d=((i=i+Math.imul(l,J)|0)+(a>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(v,j),a=(a=Math.imul(v,V))+Math.imul(E,j)|0,i=Math.imul(E,V),n=n+Math.imul(y,z)|0,a=(a=a+Math.imul(y,q)|0)+Math.imul(m,z)|0,i=i+Math.imul(m,q)|0,n=n+Math.imul(p,G)|0,a=(a=a+Math.imul(p,J)|0)+Math.imul(b,G)|0,i=i+Math.imul(b,J)|0;var we=(d+(n=n+Math.imul(u,Y)|0)|0)+((8191&(a=(a=a+Math.imul(u,Z)|0)+Math.imul(l,Y)|0))<<13)|0;d=((i=i+Math.imul(l,Z)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(_,j),a=(a=Math.imul(_,V))+Math.imul(x,j)|0,i=Math.imul(x,V),n=n+Math.imul(v,z)|0,a=(a=a+Math.imul(v,q)|0)+Math.imul(E,z)|0,i=i+Math.imul(E,q)|0,n=n+Math.imul(y,G)|0,a=(a=a+Math.imul(y,J)|0)+Math.imul(m,G)|0,i=i+Math.imul(m,J)|0,n=n+Math.imul(p,Y)|0,a=(a=a+Math.imul(p,Z)|0)+Math.imul(b,Y)|0,i=i+Math.imul(b,Z)|0;var ve=(d+(n=n+Math.imul(u,Q)|0)|0)+((8191&(a=(a=a+Math.imul(u,ee)|0)+Math.imul(l,Q)|0))<<13)|0;d=((i=i+Math.imul(l,ee)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(I,j),a=(a=Math.imul(I,V))+Math.imul(k,j)|0,i=Math.imul(k,V),n=n+Math.imul(_,z)|0,a=(a=a+Math.imul(_,q)|0)+Math.imul(x,z)|0,i=i+Math.imul(x,q)|0,n=n+Math.imul(v,G)|0,a=(a=a+Math.imul(v,J)|0)+Math.imul(E,G)|0,i=i+Math.imul(E,J)|0,n=n+Math.imul(y,Y)|0,a=(a=a+Math.imul(y,Z)|0)+Math.imul(m,Y)|0,i=i+Math.imul(m,Z)|0,n=n+Math.imul(p,Q)|0,a=(a=a+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0;var Ee=(d+(n=n+Math.imul(u,re)|0)|0)+((8191&(a=(a=a+Math.imul(u,ne)|0)+Math.imul(l,re)|0))<<13)|0;d=((i=i+Math.imul(l,ne)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(T,j),a=(a=Math.imul(T,V))+Math.imul(B,j)|0,i=Math.imul(B,V),n=n+Math.imul(I,z)|0,a=(a=a+Math.imul(I,q)|0)+Math.imul(k,z)|0,i=i+Math.imul(k,q)|0,n=n+Math.imul(_,G)|0,a=(a=a+Math.imul(_,J)|0)+Math.imul(x,G)|0,i=i+Math.imul(x,J)|0,n=n+Math.imul(v,Y)|0,a=(a=a+Math.imul(v,Z)|0)+Math.imul(E,Y)|0,i=i+Math.imul(E,Z)|0,n=n+Math.imul(y,Q)|0,a=(a=a+Math.imul(y,ee)|0)+Math.imul(m,Q)|0,i=i+Math.imul(m,ee)|0,n=n+Math.imul(p,re)|0,a=(a=a+Math.imul(p,ne)|0)+Math.imul(b,re)|0,i=i+Math.imul(b,ne)|0;var Ae=(d+(n=n+Math.imul(u,ie)|0)|0)+((8191&(a=(a=a+Math.imul(u,se)|0)+Math.imul(l,ie)|0))<<13)|0;d=((i=i+Math.imul(l,se)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(O,j),a=(a=Math.imul(O,V))+Math.imul(R,j)|0,i=Math.imul(R,V),n=n+Math.imul(T,z)|0,a=(a=a+Math.imul(T,q)|0)+Math.imul(B,z)|0,i=i+Math.imul(B,q)|0,n=n+Math.imul(I,G)|0,a=(a=a+Math.imul(I,J)|0)+Math.imul(k,G)|0,i=i+Math.imul(k,J)|0,n=n+Math.imul(_,Y)|0,a=(a=a+Math.imul(_,Z)|0)+Math.imul(x,Y)|0,i=i+Math.imul(x,Z)|0,n=n+Math.imul(v,Q)|0,a=(a=a+Math.imul(v,ee)|0)+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,n=n+Math.imul(y,re)|0,a=(a=a+Math.imul(y,ne)|0)+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0,n=n+Math.imul(p,ie)|0,a=(a=a+Math.imul(p,se)|0)+Math.imul(b,ie)|0,i=i+Math.imul(b,se)|0;var _e=(d+(n=n+Math.imul(u,ce)|0)|0)+((8191&(a=(a=a+Math.imul(u,de)|0)+Math.imul(l,ce)|0))<<13)|0;d=((i=i+Math.imul(l,de)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(P,j),a=(a=Math.imul(P,V))+Math.imul(L,j)|0,i=Math.imul(L,V),n=n+Math.imul(O,z)|0,a=(a=a+Math.imul(O,q)|0)+Math.imul(R,z)|0,i=i+Math.imul(R,q)|0,n=n+Math.imul(T,G)|0,a=(a=a+Math.imul(T,J)|0)+Math.imul(B,G)|0,i=i+Math.imul(B,J)|0,n=n+Math.imul(I,Y)|0,a=(a=a+Math.imul(I,Z)|0)+Math.imul(k,Y)|0,i=i+Math.imul(k,Z)|0,n=n+Math.imul(_,Q)|0,a=(a=a+Math.imul(_,ee)|0)+Math.imul(x,Q)|0,i=i+Math.imul(x,ee)|0,n=n+Math.imul(v,re)|0,a=(a=a+Math.imul(v,ne)|0)+Math.imul(E,re)|0,i=i+Math.imul(E,ne)|0,n=n+Math.imul(y,ie)|0,a=(a=a+Math.imul(y,se)|0)+Math.imul(m,ie)|0,i=i+Math.imul(m,se)|0,n=n+Math.imul(p,ce)|0,a=(a=a+Math.imul(p,de)|0)+Math.imul(b,ce)|0,i=i+Math.imul(b,de)|0;var xe=(d+(n=n+Math.imul(u,ue)|0)|0)+((8191&(a=(a=a+Math.imul(u,le)|0)+Math.imul(l,ue)|0))<<13)|0;d=((i=i+Math.imul(l,le)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,j),a=(a=Math.imul(D,V))+Math.imul(U,j)|0,i=Math.imul(U,V),n=n+Math.imul(P,z)|0,a=(a=a+Math.imul(P,q)|0)+Math.imul(L,z)|0,i=i+Math.imul(L,q)|0,n=n+Math.imul(O,G)|0,a=(a=a+Math.imul(O,J)|0)+Math.imul(R,G)|0,i=i+Math.imul(R,J)|0,n=n+Math.imul(T,Y)|0,a=(a=a+Math.imul(T,Z)|0)+Math.imul(B,Y)|0,i=i+Math.imul(B,Z)|0,n=n+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,ee)|0)+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(_,re)|0,a=(a=a+Math.imul(_,ne)|0)+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,n=n+Math.imul(v,ie)|0,a=(a=a+Math.imul(v,se)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,se)|0,n=n+Math.imul(y,ce)|0,a=(a=a+Math.imul(y,de)|0)+Math.imul(m,ce)|0,i=i+Math.imul(m,de)|0,n=n+Math.imul(p,ue)|0,a=(a=a+Math.imul(p,le)|0)+Math.imul(b,ue)|0,i=i+Math.imul(b,le)|0;var Se=(d+(n=n+Math.imul(u,pe)|0)|0)+((8191&(a=(a=a+Math.imul(u,be)|0)+Math.imul(l,pe)|0))<<13)|0;d=((i=i+Math.imul(l,be)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,z),a=(a=Math.imul(D,q))+Math.imul(U,z)|0,i=Math.imul(U,q),n=n+Math.imul(P,G)|0,a=(a=a+Math.imul(P,J)|0)+Math.imul(L,G)|0,i=i+Math.imul(L,J)|0,n=n+Math.imul(O,Y)|0,a=(a=a+Math.imul(O,Z)|0)+Math.imul(R,Y)|0,i=i+Math.imul(R,Z)|0,n=n+Math.imul(T,Q)|0,a=(a=a+Math.imul(T,ee)|0)+Math.imul(B,Q)|0,i=i+Math.imul(B,ee)|0,n=n+Math.imul(I,re)|0,a=(a=a+Math.imul(I,ne)|0)+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(_,ie)|0,a=(a=a+Math.imul(_,se)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,se)|0,n=n+Math.imul(v,ce)|0,a=(a=a+Math.imul(v,de)|0)+Math.imul(E,ce)|0,i=i+Math.imul(E,de)|0,n=n+Math.imul(y,ue)|0,a=(a=a+Math.imul(y,le)|0)+Math.imul(m,ue)|0,i=i+Math.imul(m,le)|0;var Ie=(d+(n=n+Math.imul(p,pe)|0)|0)+((8191&(a=(a=a+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;d=((i=i+Math.imul(b,be)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,G),a=(a=Math.imul(D,J))+Math.imul(U,G)|0,i=Math.imul(U,J),n=n+Math.imul(P,Y)|0,a=(a=a+Math.imul(P,Z)|0)+Math.imul(L,Y)|0,i=i+Math.imul(L,Z)|0,n=n+Math.imul(O,Q)|0,a=(a=a+Math.imul(O,ee)|0)+Math.imul(R,Q)|0,i=i+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,a=(a=a+Math.imul(T,ne)|0)+Math.imul(B,re)|0,i=i+Math.imul(B,ne)|0,n=n+Math.imul(I,ie)|0,a=(a=a+Math.imul(I,se)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,se)|0,n=n+Math.imul(_,ce)|0,a=(a=a+Math.imul(_,de)|0)+Math.imul(x,ce)|0,i=i+Math.imul(x,de)|0,n=n+Math.imul(v,ue)|0,a=(a=a+Math.imul(v,le)|0)+Math.imul(E,ue)|0,i=i+Math.imul(E,le)|0;var ke=(d+(n=n+Math.imul(y,pe)|0)|0)+((8191&(a=(a=a+Math.imul(y,be)|0)+Math.imul(m,pe)|0))<<13)|0;d=((i=i+Math.imul(m,be)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,Y),a=(a=Math.imul(D,Z))+Math.imul(U,Y)|0,i=Math.imul(U,Z),n=n+Math.imul(P,Q)|0,a=(a=a+Math.imul(P,ee)|0)+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(O,re)|0,a=(a=a+Math.imul(O,ne)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,n=n+Math.imul(T,ie)|0,a=(a=a+Math.imul(T,se)|0)+Math.imul(B,ie)|0,i=i+Math.imul(B,se)|0,n=n+Math.imul(I,ce)|0,a=(a=a+Math.imul(I,de)|0)+Math.imul(k,ce)|0,i=i+Math.imul(k,de)|0,n=n+Math.imul(_,ue)|0,a=(a=a+Math.imul(_,le)|0)+Math.imul(x,ue)|0,i=i+Math.imul(x,le)|0;var Ce=(d+(n=n+Math.imul(v,pe)|0)|0)+((8191&(a=(a=a+Math.imul(v,be)|0)+Math.imul(E,pe)|0))<<13)|0;d=((i=i+Math.imul(E,be)|0)+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(D,Q),a=(a=Math.imul(D,ee))+Math.imul(U,Q)|0,i=Math.imul(U,ee),n=n+Math.imul(P,re)|0,a=(a=a+Math.imul(P,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(O,ie)|0,a=(a=a+Math.imul(O,se)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,se)|0,n=n+Math.imul(T,ce)|0,a=(a=a+Math.imul(T,de)|0)+Math.imul(B,ce)|0,i=i+Math.imul(B,de)|0,n=n+Math.imul(I,ue)|0,a=(a=a+Math.imul(I,le)|0)+Math.imul(k,ue)|0,i=i+Math.imul(k,le)|0;var Te=(d+(n=n+Math.imul(_,pe)|0)|0)+((8191&(a=(a=a+Math.imul(_,be)|0)+Math.imul(x,pe)|0))<<13)|0;d=((i=i+Math.imul(x,be)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,re),a=(a=Math.imul(D,ne))+Math.imul(U,re)|0,i=Math.imul(U,ne),n=n+Math.imul(P,ie)|0,a=(a=a+Math.imul(P,se)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,se)|0,n=n+Math.imul(O,ce)|0,a=(a=a+Math.imul(O,de)|0)+Math.imul(R,ce)|0,i=i+Math.imul(R,de)|0,n=n+Math.imul(T,ue)|0,a=(a=a+Math.imul(T,le)|0)+Math.imul(B,ue)|0,i=i+Math.imul(B,le)|0;var Be=(d+(n=n+Math.imul(I,pe)|0)|0)+((8191&(a=(a=a+Math.imul(I,be)|0)+Math.imul(k,pe)|0))<<13)|0;d=((i=i+Math.imul(k,be)|0)+(a>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(D,ie),a=(a=Math.imul(D,se))+Math.imul(U,ie)|0,i=Math.imul(U,se),n=n+Math.imul(P,ce)|0,a=(a=a+Math.imul(P,de)|0)+Math.imul(L,ce)|0,i=i+Math.imul(L,de)|0,n=n+Math.imul(O,ue)|0,a=(a=a+Math.imul(O,le)|0)+Math.imul(R,ue)|0,i=i+Math.imul(R,le)|0;var Me=(d+(n=n+Math.imul(T,pe)|0)|0)+((8191&(a=(a=a+Math.imul(T,be)|0)+Math.imul(B,pe)|0))<<13)|0;d=((i=i+Math.imul(B,be)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,ce),a=(a=Math.imul(D,de))+Math.imul(U,ce)|0,i=Math.imul(U,de),n=n+Math.imul(P,ue)|0,a=(a=a+Math.imul(P,le)|0)+Math.imul(L,ue)|0,i=i+Math.imul(L,le)|0;var Oe=(d+(n=n+Math.imul(O,pe)|0)|0)+((8191&(a=(a=a+Math.imul(O,be)|0)+Math.imul(R,pe)|0))<<13)|0;d=((i=i+Math.imul(R,be)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,ue),a=(a=Math.imul(D,le))+Math.imul(U,ue)|0,i=Math.imul(U,le);var Re=(d+(n=n+Math.imul(P,pe)|0)|0)+((8191&(a=(a=a+Math.imul(P,be)|0)+Math.imul(L,pe)|0))<<13)|0;d=((i=i+Math.imul(L,be)|0)+(a>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ne=(d+(n=Math.imul(D,pe))|0)+((8191&(a=(a=Math.imul(D,be))+Math.imul(U,pe)|0))<<13)|0;return d=((i=Math.imul(U,be))+(a>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c[0]=ge,c[1]=ye,c[2]=me,c[3]=we,c[4]=ve,c[5]=Ee,c[6]=Ae,c[7]=_e,c[8]=xe,c[9]=Se,c[10]=Ie,c[11]=ke,c[12]=Ce,c[13]=Te,c[14]=Be,c[15]=Me,c[16]=Oe,c[17]=Re,c[18]=Ne,0!==d&&(c[19]=d,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,a=0,i=0;i<r.length-1;i++){var s=a;a=0;for(var o=67108863&n,c=Math.min(i,t.length-1),d=Math.max(0,i-e.length+1);d<=c;d++){var f=i-d,u=(0|e.words[f])*(0|t.words[d]),l=67108863&u;o=67108863&(l=l+o|0),a+=(s=(s=s+(u/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[i]=o,n=s,s=a}return 0!==n?r.words[i]=n:r.length--,r._strip()}function m(e,t,r){return y(e,t,r)}function w(e,t){this.x=e,this.y=t}Math.imul||(g=b),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):r<63?b(this,e,t):r<1024?y(this,e,t):m(this,e,t)},w.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},w.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,a=0;a<t;a++)n|=(1&e)<<t-a-1,e>>=1;return n},w.prototype.permute=function(e,t,r,n,a,i){for(var s=0;s<i;s++)n[s]=t[e[s]],a[s]=r[e[s]]},w.prototype.transform=function(e,t,r,n,a,i){this.permute(i,e,t,r,n,a);for(var s=1;s<a;s<<=1)for(var o=s<<1,c=Math.cos(2*Math.PI/o),d=Math.sin(2*Math.PI/o),f=0;f<a;f+=o)for(var u=c,l=d,h=0;h<s;h++){var p=r[f+h],b=n[f+h],g=r[f+h+s],y=n[f+h+s],m=u*g-l*y;y=u*y+l*g,g=m,r[f+h]=p+g,n[f+h]=b+y,r[f+h+s]=p-g,n[f+h+s]=b-y,h!==o&&(m=c*u-d*l,l=c*l+d*u,u=m)}},w.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,a=0;for(r=r/2|0;r;r>>>=1)a++;return 1<<a+1+n},w.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var a=e[n];e[n]=e[r-n-1],e[r-n-1]=a,a=t[n],t[n]=-t[r-n-1],t[r-n-1]=-a}},w.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var a=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&a,r=a<67108864?0:a/67108864|0}return e},w.prototype.convert13b=function(e,t,r,a){for(var i=0,s=0;s<t;s++)i+=0|e[s],r[2*s]=8191&i,i>>>=13,r[2*s+1]=8191&i,i>>>=13;for(s=2*t;s<a;++s)r[s]=0;n(0===i),n(!(-8192&i))},w.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},w.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),a=this.makeRBT(n),i=this.stub(n),s=new Array(n),o=new Array(n),c=new Array(n),d=new Array(n),f=new Array(n),u=new Array(n),l=r.words;l.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,d,n),this.transform(s,i,o,c,n,a),this.transform(d,i,f,u,n,a);for(var h=0;h<n;h++){var p=o[h]*f[h]-c[h]*u[h];c[h]=o[h]*u[h]+c[h]*f[h],o[h]=p}return this.conjugate(o,c,n),this.transform(o,c,l,i,n,a),this.conjugate(l,i,n),this.normalize13b(l,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),m(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,a=0;a<this.length;a++){var i=(0|this.words[a])*e,s=(67108863&i)+(67108863&r);r>>=26,r+=i/67108864|0,r+=s>>>26,this.words[a]=67108863&s}return 0!==r&&(this.words[a]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,a=r%26;t[r]=e.words[n]>>>a&1}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var a=r.sqr();n<t.length;n++,a=a.sqr())0!==t[n]&&(r=r.mul(a));return r},i.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,a=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var o=this.words[t]&i,c=(0|this.words[t])-o<<r;this.words[t]=c|s,s=o>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==a){for(t=this.length-1;t>=0;t--)this.words[t+a]=this.words[t];for(t=0;t<a;t++)this.words[t]=0;this.length+=a}return this._strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var a;n("number"==typeof e&&e>=0),a=t?(t-t%26)/26:0;var i=e%26,s=Math.min((e-i)/26,this.length),o=67108863^67108863>>>i<<i,c=r;if(a-=s,a=Math.max(0,a),c){for(var d=0;d<s;d++)c.words[d]=this.words[d];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,d=0;d<this.length;d++)this.words[d]=this.words[d+s];else this.words[0]=0,this.length=1;var f=0;for(d=this.length-1;d>=0&&(0!==f||d>=a);d--){var u=0|this.words[d];this.words[d]=f<<26-i|u>>>i,f=u&o}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,a=1<<t;return!(this.length<=r)&&!!(this.words[r]&a)},i.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var a=67108863^67108863>>>t<<t;this.words[this.length-1]&=a}return this._strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var a,i,s=e.length+r;this._expand(s);var o=0;for(a=0;a<e.length;a++){i=(0|this.words[a+r])+o;var c=(0|e.words[a])*t;o=((i-=67108863&c)>>26)-(c/67108864|0),this.words[a+r]=67108863&i}for(;a<this.length-r;a++)o=(i=(0|this.words[a+r])+o)>>26,this.words[a+r]=67108863&i;if(0===o)return this._strip();for(n(-1===o),o=0,a=0;a<this.length;a++)o=(i=-(0|this.words[a])+o)>>26,this.words[a]=67108863&i;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,s=0|a.words[a.length-1];0!==(r=26-this._countBits(s))&&(a=a.ushln(r),n.iushln(r),s=0|a.words[a.length-1]);var o,c=n.length-a.length;if("mod"!==t){(o=new i(null)).length=c+1,o.words=new Array(o.length);for(var d=0;d<o.length;d++)o.words[d]=0}var f=n.clone()._ishlnsubmul(a,1,c);0===f.negative&&(n=f,o&&(o.words[c]=1));for(var u=c-1;u>=0;u--){var l=67108864*(0|n.words[a.length+u])+(0|n.words[a.length+u-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(a,l,u);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(a,1,u),n.isZero()||(n.negative^=1);o&&(o.words[u]=l)}return o&&o._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:o||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(a=o.div.neg()),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:a,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(a=o.div.neg()),{div:a,mod:o.mod}):this.negative&e.negative?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:o.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var a,s,o},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),a=e.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,a=0,i=this.length-1;i>=0;i--)a=(r*a+(0|this.words[i]))%e;return t?-a:a},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,a=this.length-1;a>=0;a--){var i=(0|this.words[a])+67108864*r;this.words[a]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),s=new i(0),o=new i(0),c=new i(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var f=r.clone(),u=t.clone();!t.isZero();){for(var l=0,h=1;!(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(f),s.isub(u)),a.iushrn(1),s.iushrn(1);for(var p=0,b=1;!(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(f),c.isub(u)),o.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(o),s.isub(c)):(r.isub(t),o.isub(a),c.isub(s))}return{a:o,b:c,gcd:r.iushln(d)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,s=new i(1),o=new i(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,f=1;!(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var u=0,l=1;!(r.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(r.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(o)):(r.isub(t),o.isub(s))}return(a=0===t.cmpn(1)?s:o).cmpn(0)<0&&a.iadd(e),a},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var i=t;t=r,r=i}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return!(1&this.words[0])},i.prototype.isOdd=function(){return!(1&~this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,a=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=a,this;for(var i=a,s=r;0!==i&&s<this.length;s++){var o=0|this.words[s];i=(o+=i)>>>26,o&=67108863,this.words[s]=o}return 0!==i&&(this.words[s]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var a=0|this.words[0];t=a===e?0:a<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],a=0|e.words[r];if(n!==a){n<a?t=-1:n>a&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new I(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function E(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function I(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){I.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}E.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},E.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},E.prototype.split=function(e,t){e.iushrn(this.n,0,t)},E.prototype.imulK=function(e){return e.imul(this.k)},a(A,E),A.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),a=0;a<n;a++)t.words[a]=e.words[a];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&r,a=10;a<e.length;a++){var s=0|e.words[a];e.words[a-10]=(s&r)<<4|i>>>22,i=s}i>>>=22,e.words[a-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},A.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},a(_,E),a(x,E),a(S,E),S.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,a=67108863&n;n>>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new A;else if("p224"===e)t=new _;else if("p192"===e)t=new x;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return v[e]=t,t},I.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},I.prototype._verify2=function(e,t){n(!(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},I.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(f(e,e.umod(this.m)._forceRed(this)),e)},I.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},I.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},I.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},I.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},I.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},I.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},I.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},I.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},I.prototype.isqr=function(e){return this.imul(e,e.clone())},I.prototype.sqr=function(e){return this.mul(e,e)},I.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);n(!a.isZero());var o=new i(1).toRed(this),c=o.redNeg(),d=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,d).cmp(c);)f.redIAdd(c);for(var u=this.pow(f,a),l=this.pow(e,a.addn(1).iushrn(1)),h=this.pow(e,a),p=s;0!==h.cmp(o);){for(var b=h,g=0;0!==b.cmp(o);g++)b=b.redSqr();n(g<p);var y=this.pow(u,new i(1).iushln(p-g-1));l=l.redMul(y),u=y.redSqr(),h=h.redMul(u),p=g}return l},I.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},I.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var a=r[0],s=0,o=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var d=t.words[n],f=c-1;f>=0;f--){var u=d>>f&1;a!==r[0]&&(a=this.sqr(a)),0!==u||0!==s?(s<<=1,s|=u,(4===++o||0===n&&0===f)&&(a=this.mul(a,r[s]),o=0,s=0)):o=0}c=26}return a},I.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},I.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new k(e)},a(k,I),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),s=a;return a.cmp(this.m)>=0?s=a.isub(this.m):a.cmpn(0)<0&&(s=a.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},7048:(e,t,r)=>{var n;function a(e){this.rand=e}if(e.exports=function(e){return n||(n=new a(null)),n.generate(e)},e.exports.Rand=a,a.prototype.generate=function(e){return this._rand(e)},a.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?a.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?a.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(a.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var i=r(3553);if("function"!=typeof i.randomBytes)throw new Error("Not supported");a.prototype._rand=function(e){return i.randomBytes(e)}}catch(e){}},1048:(e,t,r)=>{"use strict";const n=r(7991),a=r(9318),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.hp=c,t.IS=50;const s=2147483647;function o(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return d(e,t,r)}function d(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|b(e,t);let n=o(r);const a=n.write(e,t);a!==r&&(n=n.slice(0,a));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(W(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return l(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(W(e,SharedArrayBuffer)||e&&W(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const a=function(e){if(c.isBuffer(e)){const t=0|p(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||Y(e.length)?o(0):l(e);if("Buffer"===e.type&&Array.isArray(e.data))return l(e.data)}(e);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return f(e),o(e<0?0:0|p(e))}function l(e){const t=e.length<0?0:0|p(e.length),r=o(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function b(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let a=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(a)return n?-1:K(e).length;t=(""+t).toLowerCase(),a=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return C(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,a){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(a)return-1;r=e.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,a);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,a);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,a){let i,s=1,o=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,o/=2,c/=2,r/=2}function d(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(a){let n=-1;for(i=r;i<o;i++)if(d(e,i)===d(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===c)return n*s}else-1!==n&&(i-=i-n),n=-1}else for(r+c>o&&(r=o-c),i=r;i>=0;i--){let r=!0;for(let n=0;n<c;n++)if(d(e,i+n)!==d(t,n)){r=!1;break}if(r)return i}return-1}function v(e,t,r,n){r=Number(r)||0;const a=e.length-r;n?(n=Number(n))>a&&(n=a):n=a;const i=t.length;let s;for(n>i/2&&(n=i/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(Y(n))return s;e[r+s]=n}return s}function E(e,t,r,n){return J(K(t,e.length-r),e,r,n)}function A(e,t,r,n){return J(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function _(e,t,r,n){return J(G(t),e,r,n)}function x(e,t,r,n){return J(function(e,t){let r,n,a;const i=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,a=r%256,i.push(a),i.push(n);return i}(t,e.length-r),e,r,n)}function S(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function I(e,t,r){r=Math.min(e.length,r);const n=[];let a=t;for(;a<r;){const t=e[a];let i=null,s=t>239?4:t>223?3:t>191?2:1;if(a+s<=r){let r,n,o,c;switch(s){case 1:t<128&&(i=t);break;case 2:r=e[a+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(i=c));break;case 3:r=e[a+1],n=e[a+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(i=c));break;case 4:r=e[a+1],n=e[a+2],o=e[a+3],128==(192&r)&&128==(192&n)&&128==(192&o)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&o,c>65535&&c<1114112&&(i=c))}}null===i?(i=65533,s=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),a+=s}return function(e){const t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=k));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return d(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return f(e),e<=0?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)}(e,t,r)},c.allocUnsafe=function(e){return u(e)},c.allocUnsafeSlow=function(e){return u(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(W(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),W(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let a=0,i=Math.min(r,n);a<i;++a)if(e[a]!==t[a]){r=e[a],n=t[a];break}return r<n?-1:n<r?1:0},c.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}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let a=0;for(r=0;r<e.length;++r){let t=e[r];if(W(t,Uint8Array))a+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,a)):Uint8Array.prototype.set.call(n,t,a);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,a)}a+=t.length}return n},c.byteLength=b,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)y(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?I(this,0,e):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.IS;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},i&&(c.prototype[i]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,a){if(W(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),t<0||r>e.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&t>=r)return 0;if(n>=a)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(a>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const o=Math.min(i,s),d=this.slice(n,a),f=e.slice(t,r);for(let e=0;e<o;++e)if(d[e]!==f[e]){i=d[e],s=f[e];break}return i<s?-1:s<i?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const a=this.length-t;if((void 0===r||r>a)&&(r=a),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return E(this,e,t,r);case"ascii":case"latin1":case"binary":return A(this,e,t,r);case"base64":return _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function C(e,t,r){let n="";r=Math.min(e.length,r);for(let a=t;a<r;++a)n+=String.fromCharCode(127&e[a]);return n}function T(e,t,r){let n="";r=Math.min(e.length,r);for(let a=t;a<r;++a)n+=String.fromCharCode(e[a]);return n}function B(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let a="";for(let n=t;n<r;++n)a+=Z[e[n]];return a}function M(e,t,r){const n=e.slice(t,r);let a="";for(let e=0;e<n.length-1;e+=2)a+=String.fromCharCode(n[e]+256*n[e+1]);return a}function O(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,n,a,i){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function N(e,t,r,n,a){V(t,n,a,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function P(e,t,r,n,a){V(t,n,a,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function L(e,t,r,n,a,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,i){return t=+t,r>>>=0,i||L(e,0,r,4),a.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,i){return t=+t,r>>>=0,i||L(e,0,r,8),a.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e],a=1,i=0;for(;++i<t&&(a*=256);)n+=this[e+i]*a;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e+--t],a=1;for(;t>0&&(a*=256);)n+=this[e+--t]*a;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,a=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(a)<<BigInt(32))})),c.prototype.readBigUInt64BE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],a=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(a)})),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e],a=1,i=0;for(;++i<t&&(a*=256);)n+=this[e+i]*a;return a*=128,n>=a&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=t,a=1,i=this[e+--n];for(;n>0&&(a*=256);)i+=this[e+--n]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*t)),i},c.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),c.prototype.readBigInt64BE=X((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||O(e,4,this.length),a.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),a.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),a.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),a.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){R(this,e,t,r,Math.pow(2,8*r)-1,0)}let a=1,i=0;for(this[t]=255&e;++i<r&&(a*=256);)this[t+i]=e/a&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){R(this,e,t,r,Math.pow(2,8*r)-1,0)}let a=r-1,i=1;for(this[t+a]=255&e;--a>=0&&(i*=256);)this[t+a]=e/i&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=X((function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=X((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let a=0,i=1,s=0;for(this[t]=255&e;++a<r&&(i*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/i|0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let a=r-1,i=1,s=0;for(this[t+a]=255&e;--a>=0&&(i*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/i|0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(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]=255&e,t+4},c.prototype.writeBigInt64LE=X((function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=X((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const a=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),a},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{const i=c.isBuffer(e)?e:c.from(e,n),s=i.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<r-t;++a)this[a+t]=i[a%s]}return this};const U={};function H(e,t,r){U[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function j(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function V(e,t,r,n,a,i){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let a;throw a=i>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new U.ERR_OUT_OF_RANGE("value",a,e)}!function(e,t,r){$(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||z(t,e.length-(r+1))}(n,a,i)}function $(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function z(e,t,r){if(Math.floor(e)!==e)throw $(e,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}H("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),H("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),H("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,a=r;return Number.isInteger(r)&&Math.abs(r)>2**32?a=j(String(r)):"bigint"==typeof r&&(a=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(a=j(a)),a+="n"),n+=` It must be ${t}. Received ${a}`,n}),RangeError);const q=/[^+/0-9A-Za-z-_]/g;function K(e,t){let r;t=t||1/0;const n=e.length;let a=null;const i=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),a=r;continue}r=65536+(a-55296<<10|r-56320)}else a&&(t-=3)>-1&&i.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function J(e,t,r,n){let a;for(a=0;a<n&&!(a+r>=t.length||a>=e.length);++a)t[a+r]=e[a];return a}function W(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let a=0;a<16;++a)t[n+a]=e[r]+e[a]}return t}();function X(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},8437:e=>{var t=1e3,r=60*t,n=60*r,a=24*n,i=7*a,s=365.25*a;function o(e,t,r,n){var a=t>=1.5*r;return Math.round(e/r)+" "+n+(a?"s":"")}e.exports=function(e,c){c=c||{};var d=typeof e;if("string"===d&&e.length>0)return function(e){if((e=String(e)).length>100)return;var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!o)return;var c=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*s;case"weeks":case"week":case"w":return c*i;case"days":case"day":case"d":return c*a;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*r;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(e);if("number"===d&&isFinite(e))return c.long?function(e){var i=Math.abs(e);if(i>=a)return o(e,i,a,"day");if(i>=n)return o(e,i,n,"hour");if(i>=r)return o(e,i,r,"minute");if(i>=t)return o(e,i,t,"second");return e+" ms"}(e):function(e){var i=Math.abs(e);if(i>=a)return Math.round(e/a)+"d";if(i>=n)return Math.round(e/n)+"h";if(i>=r)return Math.round(e/r)+"m";if(i>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},124:(e,t,r)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,a=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(a=n))})),t.splice(a,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e="false");return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(7891)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},7891:(e,t,r)=>{e.exports=function(e){function t(e){let r,a,i,s=null;function o(...e){if(!o.enabled)return;const n=o,a=Number(new Date),i=a-(r||a);n.diff=i,n.prev=r,n.curr=a,r=a,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,a)=>{if("%%"===r)return"%";s++;const i=t.formatters[a];if("function"==typeof i){const t=e[s];r=i.call(n,t),e.splice(s,1),s--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return o.namespace=e,o.useColors=t.useColors(),o.color=t.selectColor(e),o.extend=n,o.destroy=t.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(a!==t.namespaces&&(a=t.namespaces,i=t.enabled(e)),i),set:e=>{s=e}}),"function"==typeof t.init&&t.init(o),o}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function a(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(a),...t.skips.map(a).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),a=n.length;for(r=0;r<a;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(8437),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},3360:(e,t,r)=>{"use strict";var n=t;n.version=r(183).rE,n.utils=r(1874),n.rand=r(7048),n.curve=r(7131),n.curves=r(6443),n.ec=r(5064),n.eddsa=r(4807)},5174:(e,t,r)=>{"use strict";var n=r(4845),a=r(1874),i=a.getNAF,s=a.getJSF,o=a.assert;function c(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function d(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){o(e.precomputed);var r=e._getDoubles(),n=i(t,1,this._bitLength),a=(1<<r.step+1)-(r.step%2==0?2:1);a/=3;var s,c,d=[];for(s=0;s<n.length;s+=r.step){c=0;for(var f=s+r.step-1;f>=s;f--)c=(c<<1)+n[f];d.push(c)}for(var u=this.jpoint(null,null,null),l=this.jpoint(null,null,null),h=a;h>0;h--){for(s=0;s<d.length;s++)(c=d[s])===h?l=l.mixedAdd(r.points[s]):c===-h&&(l=l.mixedAdd(r.points[s].neg()));u=u.add(l)}return u.toP()},c.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var a=n.points,s=i(t,r,this._bitLength),c=this.jpoint(null,null,null),d=s.length-1;d>=0;d--){for(var f=0;d>=0&&0===s[d];d--)f++;if(d>=0&&f++,c=c.dblp(f),d<0)break;var u=s[d];o(0!==u),c="affine"===e.type?u>0?c.mixedAdd(a[u-1>>1]):c.mixedAdd(a[-u-1>>1].neg()):u>0?c.add(a[u-1>>1]):c.add(a[-u-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,r,n,a){var o,c,d,f=this._wnafT1,u=this._wnafT2,l=this._wnafT3,h=0;for(o=0;o<n;o++){var p=(d=t[o])._getNAFPoints(e);f[o]=p.wnd,u[o]=p.points}for(o=n-1;o>=1;o-=2){var b=o-1,g=o;if(1===f[b]&&1===f[g]){var y=[t[b],null,null,t[g]];0===t[b].y.cmp(t[g].y)?(y[1]=t[b].add(t[g]),y[2]=t[b].toJ().mixedAdd(t[g].neg())):0===t[b].y.cmp(t[g].y.redNeg())?(y[1]=t[b].toJ().mixedAdd(t[g]),y[2]=t[b].add(t[g].neg())):(y[1]=t[b].toJ().mixedAdd(t[g]),y[2]=t[b].toJ().mixedAdd(t[g].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],w=s(r[b],r[g]);for(h=Math.max(w[0].length,h),l[b]=new Array(h),l[g]=new Array(h),c=0;c<h;c++){var v=0|w[0][c],E=0|w[1][c];l[b][c]=m[3*(v+1)+(E+1)],l[g][c]=0,u[b]=y}}else l[b]=i(r[b],f[b],this._bitLength),l[g]=i(r[g],f[g],this._bitLength),h=Math.max(l[b].length,h),h=Math.max(l[g].length,h)}var A=this.jpoint(null,null,null),_=this._wnafT4;for(o=h;o>=0;o--){for(var x=0;o>=0;){var S=!0;for(c=0;c<n;c++)_[c]=0|l[c][o],0!==_[c]&&(S=!1);if(!S)break;x++,o--}if(o>=0&&x++,A=A.dblp(x),o<0)break;for(c=0;c<n;c++){var I=_[c];0!==I&&(I>0?d=u[c][I-1>>1]:I<0&&(d=u[c][-I-1>>1].neg()),A="affine"===d.type?A.mixedAdd(d):A.add(d))}}for(o=0;o<n;o++)u[o]=null;return a?A:A.toP()},c.BasePoint=d,d.prototype.eq=function(){throw new Error("Not implemented")},d.prototype.validate=function(){return this.curve.validate(this)},c.prototype.decodePoint=function(e,t){e=a.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?o(e[e.length-1]%2==0):7===e[0]&&o(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},d.prototype.encodeCompressed=function(e){return this.encode(e,!0)},d.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},d.prototype.encode=function(e,t){return a.encode(this._encode(t),e)},d.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},d.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},d.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,a=0;a<t;a+=e){for(var i=0;i<e;i++)n=n.dbl();r.push(n)}return{step:e,points:r}},d.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),a=1;a<r;a++)t[a]=t[a-1].add(n);return{wnd:e,points:t}},d.prototype._getBeta=function(){return null},d.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},1547:(e,t,r)=>{"use strict";var n=r(1874),a=r(4845),i=r(5615),s=r(5174),o=n.assert;function c(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new a(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new a(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new a(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),o(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function d(e,t,r,n,i){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new a(t,16),this.y=new a(r,16),this.z=n?new a(n,16):this.curve.one,this.t=i&&new a(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}i(c,s),e.exports=c,c.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},c.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},c.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},c.prototype.pointFromX=function(e,t){(e=new a(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(i.redInvm()),o=s.redSqrt();if(0!==o.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var c=o.fromRed().isOdd();return(t&&!c||!t&&c)&&(o=o.redNeg()),this.point(e,o)},c.prototype.pointFromY=function(e,t){(e=new a(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(i.redInvm());if(0===s.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var o=s.redSqrt();if(0!==o.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return o.fromRed().isOdd()!==t&&(o=o.redNeg()),this.point(o,e)},c.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),a=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(a)},i(d,s.BasePoint),c.prototype.pointFromJSON=function(e){return d.fromJSON(this,e)},c.prototype.point=function(e,t,r,n){return new d(this,e,t,r,n)},d.fromJSON=function(e,t){return new d(e,t[0],t[1],t[2])},d.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},d.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},d.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),i=n.redAdd(t),s=i.redSub(r),o=n.redSub(t),c=a.redMul(s),d=i.redMul(o),f=a.redMul(o),u=s.redMul(i);return this.curve.point(c,d,u,f)},d.prototype._projDbl=function(){var e,t,r,n,a,i,s=this.x.redAdd(this.y).redSqr(),o=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var d=(n=this.curve._mulA(o)).redAdd(c);this.zOne?(e=s.redSub(o).redSub(c).redMul(d.redSub(this.curve.two)),t=d.redMul(n.redSub(c)),r=d.redSqr().redSub(d).redSub(d)):(a=this.z.redSqr(),i=d.redSub(a).redISub(a),e=s.redSub(o).redISub(c).redMul(i),t=d.redMul(n.redSub(c)),r=d.redMul(i))}else n=o.redAdd(c),a=this.curve._mulC(this.z).redSqr(),i=n.redSub(a).redSub(a),e=this.curve._mulC(s.redISub(n)).redMul(i),t=this.curve._mulC(n).redMul(o.redISub(c)),r=n.redMul(i);return this.curve.point(e,t,r)},d.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},d.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),a=this.z.redMul(e.z.redAdd(e.z)),i=r.redSub(t),s=a.redSub(n),o=a.redAdd(n),c=r.redAdd(t),d=i.redMul(s),f=o.redMul(c),u=i.redMul(c),l=s.redMul(o);return this.curve.point(d,f,l,u)},d.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),a=n.redSqr(),i=this.x.redMul(e.x),s=this.y.redMul(e.y),o=this.curve.d.redMul(i).redMul(s),c=a.redSub(o),d=a.redAdd(o),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),u=n.redMul(c).redMul(f);return this.curve.twisted?(t=n.redMul(d).redMul(s.redSub(this.curve._mulA(i))),r=c.redMul(d)):(t=n.redMul(d).redMul(s.redSub(i)),r=this.curve._mulC(c).redMul(d)),this.curve.point(u,t,r)},d.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},d.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},d.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},d.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},d.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},d.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},d.prototype.getX=function(){return this.normalize(),this.x.fromRed()},d.prototype.getY=function(){return this.normalize(),this.y.fromRed()},d.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},d.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},d.prototype.toP=d.prototype.normalize,d.prototype.mixedAdd=d.prototype.add},7131:(e,t,r)=>{"use strict";var n=t;n.base=r(5174),n.short=r(277),n.mont=r(3245),n.edwards=r(1547)},3245:(e,t,r)=>{"use strict";var n=r(4845),a=r(5615),i=r(5174),s=r(1874);function o(e){i.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){i.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(o,i),e.exports=o,o.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},a(c,i.BasePoint),o.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},o.prototype.point=function(e,t){return new c(this,e,t)},o.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),a=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,a)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),a=e.x.redAdd(e.z),i=e.x.redSub(e.z).redMul(r),s=a.redMul(n),o=t.z.redMul(i.redAdd(s).redSqr()),c=t.x.redMul(i.redISub(s).redSqr());return this.curve.point(o,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),a=[];0!==t.cmpn(0);t.iushrn(1))a.push(t.andln(1));for(var i=a.length-1;i>=0;i--)0===a[i]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},277:(e,t,r)=>{"use strict";var n=r(1874),a=r(4845),i=r(5615),s=r(5174),o=n.assert;function c(e){s.call(this,"short",e),this.a=new a(e.a,16).toRed(this.red),this.b=new a(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function d(e,t,r,n){s.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new a(t,16),this.y=new a(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function f(e,t,r,n){s.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new a(0)):(this.x=new a(t,16),this.y=new a(r,16),this.z=new a(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}i(c,s),e.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new a(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new a(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],o(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new a(e.a,16),b:new a(e.b,16)}})):this._getEndoBasis(r)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:a.mont(e),r=new a(2).toRed(t).redInvm(),n=r.redNeg(),i=new a(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,n,i,s,o,c,d,f,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,h=this.n.clone(),p=new a(1),b=new a(0),g=new a(0),y=new a(1),m=0;0!==l.cmpn(0);){var w=h.div(l);d=h.sub(w.mul(l)),f=g.sub(w.mul(p));var v=y.sub(w.mul(b));if(!n&&d.cmp(u)<0)t=c.neg(),r=p,n=d.neg(),i=f;else if(n&&2==++m)break;c=d,h=l,l=d,g=p,p=f,y=b,b=v}s=d.neg(),o=f;var E=n.sqr().add(i.sqr());return s.sqr().add(o.sqr()).cmp(E)>=0&&(s=t,o=r),n.negative&&(n=n.neg(),i=i.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:n,b:i},{a:s,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],a=n.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),s=a.mul(r.a),o=i.mul(n.a),c=a.mul(r.b),d=i.mul(n.b);return{k1:e.sub(s).sub(o),k2:c.add(d).neg()}},c.prototype.pointFromX=function(e,t){(e=new a(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),a=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(a).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,a=this._endoWnafT2,i=0;i<e.length;i++){var s=this._endoSplit(t[i]),o=e[i],c=o._getBeta();s.k1.negative&&(s.k1.ineg(),o=o.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),n[2*i]=o,n[2*i+1]=c,a[2*i]=s.k1,a[2*i+1]=s.k2}for(var d=this._wnafMulAdd(1,n,a,2*i,r),f=0;f<2*i;f++)n[f]=null,a[f]=null;return d},i(d,s.BasePoint),c.prototype.point=function(e,t,r){return new d(this,e,t,r)},c.prototype.pointFromJSON=function(e,t){return d.fromJSON(this,e,t)},d.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},d.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},d.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function a(t){return e.point(t[0],t[1],r)}var i=t[2];return n.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[n].concat(i.doubles.points.map(a))},naf:i.naf&&{wnd:i.naf.wnd,points:[n].concat(i.naf.points.map(a))}},n},d.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},d.prototype.isInfinity=function(){return this.inf},d.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},d.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),a=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),i=a.redSqr().redISub(this.x.redAdd(this.x)),s=a.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,s)},d.prototype.getX=function(){return this.x.fromRed()},d.prototype.getY=function(){return this.y.fromRed()},d.prototype.mul=function(e){return e=new a(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},d.prototype.mulAdd=function(e,t,r){var n=[this,t],a=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,a):this.curve._wnafMulAdd(1,n,a,2)},d.prototype.jmulAdd=function(e,t,r){var n=[this,t],a=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,a,!0):this.curve._wnafMulAdd(1,n,a,2,!0)},d.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},d.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},d.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},i(f,s.BasePoint),c.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),a=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),o=n.redSub(a),c=i.redSub(s);if(0===o.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var d=o.redSqr(),f=d.redMul(o),u=n.redMul(d),l=c.redSqr().redIAdd(f).redISub(u).redISub(u),h=c.redMul(u.redISub(l)).redISub(i.redMul(f)),p=this.z.redMul(e.z).redMul(o);return this.curve.jpoint(l,h,p)},f.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),a=this.y,i=e.y.redMul(t).redMul(this.z),s=r.redSub(n),o=a.redSub(i);if(0===s.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),d=c.redMul(s),f=r.redMul(c),u=o.redSqr().redIAdd(d).redISub(f).redISub(f),l=o.redMul(f.redISub(u)).redISub(a.redMul(d)),h=this.z.redMul(s);return this.curve.jpoint(u,l,h)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,a=this.curve.tinv,i=this.x,s=this.y,o=this.z,c=o.redSqr().redSqr(),d=s.redAdd(s);for(t=0;t<e;t++){var f=i.redSqr(),u=d.redSqr(),l=u.redSqr(),h=f.redAdd(f).redIAdd(f).redIAdd(n.redMul(c)),p=i.redMul(u),b=h.redSqr().redISub(p.redAdd(p)),g=p.redISub(b),y=h.redMul(g);y=y.redIAdd(y).redISub(l);var m=d.redMul(o);t+1<e&&(c=c.redMul(l)),i=b,o=m,d=y}return this.curve.jpoint(i,d.redMul(a),o)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},f.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),a=this.y.redSqr(),i=a.redSqr(),s=this.x.redAdd(a).redSqr().redISub(n).redISub(i);s=s.redIAdd(s);var o=n.redAdd(n).redIAdd(n),c=o.redSqr().redISub(s).redISub(s),d=i.redIAdd(i);d=(d=d.redIAdd(d)).redIAdd(d),e=c,t=o.redMul(s.redISub(c)).redISub(d),r=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),u=this.y.redSqr(),l=u.redSqr(),h=this.x.redAdd(u).redSqr().redISub(f).redISub(l);h=h.redIAdd(h);var p=f.redAdd(f).redIAdd(f),b=p.redSqr(),g=l.redIAdd(l);g=(g=g.redIAdd(g)).redIAdd(g),e=b.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},f.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),a=this.y.redSqr(),i=a.redSqr(),s=this.x.redAdd(a).redSqr().redISub(n).redISub(i);s=s.redIAdd(s);var o=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=o.redSqr().redISub(s).redISub(s);e=c;var d=i.redIAdd(i);d=(d=d.redIAdd(d)).redIAdd(d),t=o.redMul(s.redISub(c)).redISub(d),r=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),u=this.y.redSqr(),l=this.x.redMul(u),h=this.x.redSub(f).redMul(this.x.redAdd(f));h=h.redAdd(h).redIAdd(h);var p=l.redIAdd(l),b=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(u).redISub(f);var g=u.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=h.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},f.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,a=n.redSqr().redSqr(),i=t.redSqr(),s=r.redSqr(),o=i.redAdd(i).redIAdd(i).redIAdd(e.redMul(a)),c=t.redAdd(t),d=(c=c.redIAdd(c)).redMul(s),f=o.redSqr().redISub(d.redAdd(d)),u=d.redISub(f),l=s.redSqr();l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var h=o.redMul(u).redISub(l),p=r.redAdd(r).redMul(n);return this.curve.jpoint(f,h,p)},f.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),a=e.redAdd(e).redIAdd(e),i=a.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),o=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(i)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var d=a.redIAdd(s).redSqr().redISub(i).redISub(o).redISub(c),f=t.redMul(d);f=(f=f.redIAdd(f)).redIAdd(f);var u=this.x.redMul(o).redISub(f);u=(u=u.redIAdd(u)).redIAdd(u);var l=this.y.redMul(d.redMul(c.redISub(d)).redISub(s.redMul(o)));l=(l=(l=l.redIAdd(l)).redIAdd(l)).redIAdd(l);var h=this.z.redAdd(s).redSqr().redISub(r).redISub(o);return this.curve.jpoint(u,l,h)},f.prototype.mul=function(e,t){return e=new a(e,t),this.curve._wnafMul(this,e)},f.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),a=r.redMul(e.z);return 0===this.y.redMul(a).redISub(e.y.redMul(n)).cmpn(0)},f.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),a=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(a),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},6443:(e,t,r)=>{"use strict";var n,a=t,i=r(9499),s=r(7131),o=r(1874).assert;function c(e){"short"===e.type?this.curve=new s.short(e):"edwards"===e.type?this.curve=new s.edwards(e):this.curve=new s.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function d(e,t){Object.defineProperty(a,e,{configurable:!0,enumerable:!0,get:function(){var r=new c(t);return Object.defineProperty(a,e,{configurable:!0,enumerable:!0,value:r}),r}})}a.PresetCurve=c,d("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:i.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),d("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:i.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),d("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:i.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),d("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:i.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),d("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:i.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),d("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["9"]}),d("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(3986)}catch(e){n=void 0}d("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},5064:(e,t,r)=>{"use strict";var n=r(4845),a=r(4742),i=r(1874),s=r(6443),o=r(7048),c=i.assert,d=r(7531),f=r(7782);function u(e){if(!(this instanceof u))return new u(e);"string"==typeof e&&(c(Object.prototype.hasOwnProperty.call(s,e),"Unknown curve "+e),e=s[e]),e instanceof s.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=u,u.prototype.keyPair=function(e){return new d(this,e)},u.prototype.keyFromPrivate=function(e,t){return d.fromPrivate(this,e,t)},u.prototype.keyFromPublic=function(e,t){return d.fromPublic(this,e,t)},u.prototype.genKeyPair=function(e){e||(e={});for(var t=new a({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new n(2));;){var s=new n(t.generate(r));if(!(s.cmp(i)>0))return s.iaddn(1),this.keyFromPrivate(s)}},u.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},u.prototype.sign=function(e,t,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var s=this.n.byteLength(),o=t.getPrivate().toArray("be",s),c=e.toArray("be",s),d=new a({hash:this.hash,entropy:o,nonce:c,pers:i.pers,persEnc:i.persEnc||"utf8"}),u=this.n.sub(new n(1)),l=0;;l++){var h=i.k?i.k(l):new n(d.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(u)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var b=p.getX(),g=b.umod(this.n);if(0!==g.cmpn(0)){var y=h.invm(this.n).mul(g.mul(t.getPrivate()).iadd(e));if(0!==(y=y.umod(this.n)).cmpn(0)){var m=(p.getY().isOdd()?1:0)|(0!==b.cmp(g)?2:0);return i.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),m^=1),new f({r:g,s:y,recoveryParam:m})}}}}}},u.prototype.verify=function(e,t,r,a){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,a);var i=(t=new f(t,"hex")).r,s=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var o,c=s.invm(this.n),d=c.mul(e).umod(this.n),u=c.mul(i).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(d,r.getPublic(),u)).isInfinity()&&o.eqXToP(i):!(o=this.g.mulAdd(d,r.getPublic(),u)).isInfinity()&&0===o.getX().umod(this.n).cmp(i)},u.prototype.recoverPubKey=function(e,t,r,a){c((3&r)===r,"The recovery param is more than two bits"),t=new f(t,a);var i=this.n,s=new n(e),o=t.r,d=t.s,u=1&r,l=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");o=l?this.curve.pointFromX(o.add(this.curve.n),u):this.curve.pointFromX(o,u);var h=t.r.invm(i),p=i.sub(s).mul(h).umod(i),b=d.mul(h).umod(i);return this.g.mulAdd(p,o,b)},u.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new f(t,n)).recoveryParam)return t.recoveryParam;for(var a=0;a<4;a++){var i;try{i=this.recoverPubKey(e,t,a)}catch(e){continue}if(i.eq(r))return a}throw new Error("Unable to find valid recovery factor")}},7531:(e,t,r)=>{"use strict";var n=r(4845),a=r(1874).assert;function i(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=i,i.fromPublic=function(e,t,r){return t instanceof i?t:new i(e,{pub:t,pubEnc:r})},i.fromPrivate=function(e,t,r){return t instanceof i?t:new i(e,{priv:t,privEnc:r})},i.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},i.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},i.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},i.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},i.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?a(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||a(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},i.prototype.derive=function(e){return e.validate()||a(e.validate(),"public point not validated"),e.mul(this.priv).getX()},i.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},i.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},i.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},7782:(e,t,r)=>{"use strict";var n=r(4845),a=r(1874),i=a.assert;function s(e,t){if(e instanceof s)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function o(){this.place=0}function c(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var a=0,i=0,s=t.place;i<n;i++,s++)a<<=8,a|=e[s],a>>>=0;return!(a<=127)&&(t.place=s,a)}function d(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function f(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=s,s.prototype._importDER=function(e,t){e=a.toArray(e,t);var r=new o;if(48!==e[r.place++])return!1;var i=c(e,r);if(!1===i)return!1;if(i+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var s=c(e,r);if(!1===s)return!1;var d=e.slice(r.place,s+r.place);if(r.place+=s,2!==e[r.place++])return!1;var f=c(e,r);if(!1===f)return!1;if(e.length!==f+r.place)return!1;var u=e.slice(r.place,f+r.place);if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new n(d),this.s=new n(u),this.recoveryParam=null,!0},s.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=d(t),r=d(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,t.length),(n=n.concat(t)).push(2),f(n,r.length);var i=n.concat(r),s=[48];return f(s,i.length),s=s.concat(i),a.encode(s,e)}},4807:(e,t,r)=>{"use strict";var n=r(9499),a=r(6443),i=r(1874),s=i.assert,o=i.parseBytes,c=r(4672),d=r(8401);function f(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=a[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=f,f.prototype.sign=function(e,t){e=o(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),a=this.g.mul(n),i=this.encodePoint(a),s=this.hashInt(i,r.pubBytes(),e).mul(r.priv()),c=n.add(s).umod(this.curve.n);return this.makeSignature({R:a,S:c,Rencoded:i})},f.prototype.verify=function(e,t,r){e=o(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),a=this.hashInt(t.Rencoded(),n.pubBytes(),e),i=this.g.mul(t.S());return t.R().add(n.pub().mul(a)).eq(i)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return i.intFromLE(e.digest()).umod(this.curve.n)},f.prototype.keyFromPublic=function(e){return c.fromPublic(this,e)},f.prototype.keyFromSecret=function(e){return c.fromSecret(this,e)},f.prototype.makeSignature=function(e){return e instanceof d?e:new d(this,e)},f.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},f.prototype.decodePoint=function(e){var t=(e=i.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=!!(128&e[t]),a=i.intFromLE(r);return this.curve.pointFromY(a,n)},f.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},f.prototype.decodeInt=function(e){return i.intFromLE(e)},f.prototype.isPoint=function(e){return e instanceof this.pointClass}},4672:(e,t,r)=>{"use strict";var n=r(1874),a=n.assert,i=n.parseBytes,s=n.cachedProperty;function o(e,t){this.eddsa=e,this._secret=i(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=i(t.pub)}o.fromPublic=function(e,t){return t instanceof o?t:new o(e,{pub:t})},o.fromSecret=function(e,t){return t instanceof o?t:new o(e,{secret:t})},o.prototype.secret=function(){return this._secret},s(o,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(o,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(o,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),s(o,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(o,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(o,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),o.prototype.sign=function(e){return a(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},o.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},o.prototype.getSecret=function(e){return a(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},o.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=o},8401:(e,t,r)=>{"use strict";var n=r(4845),a=r(1874),i=a.assert,s=a.cachedProperty,o=a.parseBytes;function c(e,t){this.eddsa=e,"object"!=typeof t&&(t=o(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),i(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(c,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(c,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(c,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(c,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return a.encode(this.toBytes(),"hex").toUpperCase()},e.exports=c},3986:e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},1874:(e,t,r)=>{"use strict";var n=t,a=r(4845),i=r(7784),s=r(9042);n.assert=i,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(e,t,r){var n,a=new Array(Math.max(e.bitLength(),r)+1);for(n=0;n<a.length;n+=1)a[n]=0;var i=1<<t+1,s=e.clone();for(n=0;n<a.length;n++){var o,c=s.andln(i-1);s.isOdd()?(o=c>(i>>1)-1?(i>>1)-c:c,s.isubn(o)):o=0,a[n]=o,s.iushrn(1)}return a},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,a=0,i=0;e.cmpn(-a)>0||t.cmpn(-i)>0;){var s,o,c=e.andln(3)+a&3,d=t.andln(3)+i&3;3===c&&(c=-1),3===d&&(d=-1),s=1&c?3!==(n=e.andln(7)+a&7)&&5!==n||2!==d?c:-c:0,r[0].push(s),o=1&d?3!==(n=t.andln(7)+i&7)&&5!==n||2!==c?d:-d:0,r[1].push(o),2*a===s+1&&(a=1-a),2*i===o+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new a(e,"hex","le")}},4845:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function a(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2661).Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function c(e,t,r){var n=o(e,r);return r-1>=t&&(n|=o(e,r-1)<<4),n}function d(e,t,r,n){for(var a=0,i=Math.min(e.length,r),s=t;s<i;s++){var o=e.charCodeAt(s)-48;a*=n,a+=o>=49?o-49+10:o>=17?o-17+10:o}return a}i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var a=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(a++,this.negative=1),a<e.length&&(16===t?this._parseHex(e,a,r):(this._parseBase(e,t,a),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var a=0;a<this.length;a++)this.words[a]=0;var i,s,o=0;if("be"===r)for(a=e.length-1,i=0;a>=0;a-=3)s=e[a]|e[a-1]<<8|e[a-2]<<16,this.words[i]|=s<<o&67108863,this.words[i+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);else if("le"===r)for(a=0,i=0;a<e.length;a+=3)s=e[a]|e[a+1]<<8|e[a+2]<<16,this.words[i]|=s<<o&67108863,this.words[i+1]=s>>>26-o&67108863,(o+=24)>=26&&(o-=26,i++);return this.strip()},i.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var a,i=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)a=c(e,t,n)<<i,this.words[s]|=67108863&a,i>=18?(i-=18,s+=1,this.words[s]|=a>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)a=c(e,t,n)<<i,this.words[s]|=67108863&a,i>=18?(i-=18,s+=1,this.words[s]|=a>>>26):i+=8;this.strip()},i.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=t)n++;n--,a=a/t|0;for(var i=e.length-r,s=i%n,o=Math.min(i,i-s)+r,c=0,f=r;f<o;f+=n)c=d(e,f,f+n,t),this.imuln(a),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var u=1;for(c=d(e,f,e.length,t),f=0;f<s;f++)u*=t;this.imuln(u),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var a=0|e.words[0],i=0|t.words[0],s=a*i,o=67108863&s,c=s/67108864|0;r.words[0]=o;for(var d=1;d<n;d++){for(var f=c>>>26,u=67108863&c,l=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=l;h++){var p=d-h|0;f+=(s=(a=0|e.words[p])*(i=0|t.words[h])+u)/67108864|0,u=67108863&s}r.words[d]=0|u,c=0|f}return 0!==c?r.words[d]=0|c:r.length--,r.strip()}i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var a=0,i=0,s=0;s<this.length;s++){var o=this.words[s],c=(16777215&(o<<a|i)).toString(16);r=0!==(i=o>>>24-a&16777215)||s!==this.length-1?f[6-c.length]+c+r:c+r,(a+=2)>=26&&(a-=26,s--)}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=u[e],h=l[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?b+r:f[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},i.prototype.toArrayLike=function(e,t,r){var a=this.byteLength(),i=r||Math.max(1,a);n(a<=i,"byte array longer than desired length"),n(i>0,"Requested array length <= 0"),this.strip();var s,o,c="le"===t,d=new e(i),f=this.clone();if(c){for(o=0;!f.isZero();o++)s=f.andln(255),f.iushrn(8),d[o]=s;for(;o<i;o++)d[o]=0}else{for(o=0;o<i-a;o++)d[o]=0;for(o=0;!f.isZero();o++)s=f.andln(255),f.iushrn(8),d[i-o-1]=s}return d},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 8191&t||(r+=13,t>>>=13),127&t||(r+=7,t>>>=7),15&t||(r+=4,t>>>=4),3&t||(r+=2,t>>>=2),1&t||r++,r},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},i.prototype.ior=function(e){return n(!(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},i.prototype.iand=function(e){return n(!(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},i.prototype.ixor=function(e){return n(!(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var a=0;a<t;a++)this.words[a]=67108863&~this.words[a];return r>0&&(this.words[a]=~this.words[a]&67108863>>26-r),this.strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,a=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<a:this.words[r]&~(1<<a),this.strip()},i.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var a=0,i=0;i<n.length;i++)t=(0|r.words[i])+(0|n.words[i])+a,this.words[i]=67108863&t,a=t>>>26;for(;0!==a&&i<r.length;i++)t=(0|r.words[i])+a,this.words[i]=67108863&t,a=t>>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;i<r.length;i++)this.words[i]=r.words[i];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=e):(r=e,n=this);for(var i=0,s=0;s<n.length;s++)i=(t=(0|r.words[s])-(0|n.words[s])+i)>>26,this.words[s]=67108863&t;for(;0!==i&&s<r.length;s++)i=(t=(0|r.words[s])+i)>>26,this.words[s]=67108863&t;if(0===i&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,a,i,s=e.words,o=t.words,c=r.words,d=0,f=0|s[0],u=8191&f,l=f>>>13,h=0|s[1],p=8191&h,b=h>>>13,g=0|s[2],y=8191&g,m=g>>>13,w=0|s[3],v=8191&w,E=w>>>13,A=0|s[4],_=8191&A,x=A>>>13,S=0|s[5],I=8191&S,k=S>>>13,C=0|s[6],T=8191&C,B=C>>>13,M=0|s[7],O=8191&M,R=M>>>13,N=0|s[8],P=8191&N,L=N>>>13,F=0|s[9],D=8191&F,U=F>>>13,H=0|o[0],j=8191&H,V=H>>>13,$=0|o[1],z=8191&$,q=$>>>13,K=0|o[2],G=8191&K,J=K>>>13,W=0|o[3],Y=8191&W,Z=W>>>13,X=0|o[4],Q=8191&X,ee=X>>>13,te=0|o[5],re=8191&te,ne=te>>>13,ae=0|o[6],ie=8191&ae,se=ae>>>13,oe=0|o[7],ce=8191&oe,de=oe>>>13,fe=0|o[8],ue=8191&fe,le=fe>>>13,he=0|o[9],pe=8191&he,be=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(d+(n=Math.imul(u,j))|0)+((8191&(a=(a=Math.imul(u,V))+Math.imul(l,j)|0))<<13)|0;d=((i=Math.imul(l,V))+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,j),a=(a=Math.imul(p,V))+Math.imul(b,j)|0,i=Math.imul(b,V);var ye=(d+(n=n+Math.imul(u,z)|0)|0)+((8191&(a=(a=a+Math.imul(u,q)|0)+Math.imul(l,z)|0))<<13)|0;d=((i=i+Math.imul(l,q)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,j),a=(a=Math.imul(y,V))+Math.imul(m,j)|0,i=Math.imul(m,V),n=n+Math.imul(p,z)|0,a=(a=a+Math.imul(p,q)|0)+Math.imul(b,z)|0,i=i+Math.imul(b,q)|0;var me=(d+(n=n+Math.imul(u,G)|0)|0)+((8191&(a=(a=a+Math.imul(u,J)|0)+Math.imul(l,G)|0))<<13)|0;d=((i=i+Math.imul(l,J)|0)+(a>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(v,j),a=(a=Math.imul(v,V))+Math.imul(E,j)|0,i=Math.imul(E,V),n=n+Math.imul(y,z)|0,a=(a=a+Math.imul(y,q)|0)+Math.imul(m,z)|0,i=i+Math.imul(m,q)|0,n=n+Math.imul(p,G)|0,a=(a=a+Math.imul(p,J)|0)+Math.imul(b,G)|0,i=i+Math.imul(b,J)|0;var we=(d+(n=n+Math.imul(u,Y)|0)|0)+((8191&(a=(a=a+Math.imul(u,Z)|0)+Math.imul(l,Y)|0))<<13)|0;d=((i=i+Math.imul(l,Z)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(_,j),a=(a=Math.imul(_,V))+Math.imul(x,j)|0,i=Math.imul(x,V),n=n+Math.imul(v,z)|0,a=(a=a+Math.imul(v,q)|0)+Math.imul(E,z)|0,i=i+Math.imul(E,q)|0,n=n+Math.imul(y,G)|0,a=(a=a+Math.imul(y,J)|0)+Math.imul(m,G)|0,i=i+Math.imul(m,J)|0,n=n+Math.imul(p,Y)|0,a=(a=a+Math.imul(p,Z)|0)+Math.imul(b,Y)|0,i=i+Math.imul(b,Z)|0;var ve=(d+(n=n+Math.imul(u,Q)|0)|0)+((8191&(a=(a=a+Math.imul(u,ee)|0)+Math.imul(l,Q)|0))<<13)|0;d=((i=i+Math.imul(l,ee)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(I,j),a=(a=Math.imul(I,V))+Math.imul(k,j)|0,i=Math.imul(k,V),n=n+Math.imul(_,z)|0,a=(a=a+Math.imul(_,q)|0)+Math.imul(x,z)|0,i=i+Math.imul(x,q)|0,n=n+Math.imul(v,G)|0,a=(a=a+Math.imul(v,J)|0)+Math.imul(E,G)|0,i=i+Math.imul(E,J)|0,n=n+Math.imul(y,Y)|0,a=(a=a+Math.imul(y,Z)|0)+Math.imul(m,Y)|0,i=i+Math.imul(m,Z)|0,n=n+Math.imul(p,Q)|0,a=(a=a+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,i=i+Math.imul(b,ee)|0;var Ee=(d+(n=n+Math.imul(u,re)|0)|0)+((8191&(a=(a=a+Math.imul(u,ne)|0)+Math.imul(l,re)|0))<<13)|0;d=((i=i+Math.imul(l,ne)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(T,j),a=(a=Math.imul(T,V))+Math.imul(B,j)|0,i=Math.imul(B,V),n=n+Math.imul(I,z)|0,a=(a=a+Math.imul(I,q)|0)+Math.imul(k,z)|0,i=i+Math.imul(k,q)|0,n=n+Math.imul(_,G)|0,a=(a=a+Math.imul(_,J)|0)+Math.imul(x,G)|0,i=i+Math.imul(x,J)|0,n=n+Math.imul(v,Y)|0,a=(a=a+Math.imul(v,Z)|0)+Math.imul(E,Y)|0,i=i+Math.imul(E,Z)|0,n=n+Math.imul(y,Q)|0,a=(a=a+Math.imul(y,ee)|0)+Math.imul(m,Q)|0,i=i+Math.imul(m,ee)|0,n=n+Math.imul(p,re)|0,a=(a=a+Math.imul(p,ne)|0)+Math.imul(b,re)|0,i=i+Math.imul(b,ne)|0;var Ae=(d+(n=n+Math.imul(u,ie)|0)|0)+((8191&(a=(a=a+Math.imul(u,se)|0)+Math.imul(l,ie)|0))<<13)|0;d=((i=i+Math.imul(l,se)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(O,j),a=(a=Math.imul(O,V))+Math.imul(R,j)|0,i=Math.imul(R,V),n=n+Math.imul(T,z)|0,a=(a=a+Math.imul(T,q)|0)+Math.imul(B,z)|0,i=i+Math.imul(B,q)|0,n=n+Math.imul(I,G)|0,a=(a=a+Math.imul(I,J)|0)+Math.imul(k,G)|0,i=i+Math.imul(k,J)|0,n=n+Math.imul(_,Y)|0,a=(a=a+Math.imul(_,Z)|0)+Math.imul(x,Y)|0,i=i+Math.imul(x,Z)|0,n=n+Math.imul(v,Q)|0,a=(a=a+Math.imul(v,ee)|0)+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,n=n+Math.imul(y,re)|0,a=(a=a+Math.imul(y,ne)|0)+Math.imul(m,re)|0,i=i+Math.imul(m,ne)|0,n=n+Math.imul(p,ie)|0,a=(a=a+Math.imul(p,se)|0)+Math.imul(b,ie)|0,i=i+Math.imul(b,se)|0;var _e=(d+(n=n+Math.imul(u,ce)|0)|0)+((8191&(a=(a=a+Math.imul(u,de)|0)+Math.imul(l,ce)|0))<<13)|0;d=((i=i+Math.imul(l,de)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(P,j),a=(a=Math.imul(P,V))+Math.imul(L,j)|0,i=Math.imul(L,V),n=n+Math.imul(O,z)|0,a=(a=a+Math.imul(O,q)|0)+Math.imul(R,z)|0,i=i+Math.imul(R,q)|0,n=n+Math.imul(T,G)|0,a=(a=a+Math.imul(T,J)|0)+Math.imul(B,G)|0,i=i+Math.imul(B,J)|0,n=n+Math.imul(I,Y)|0,a=(a=a+Math.imul(I,Z)|0)+Math.imul(k,Y)|0,i=i+Math.imul(k,Z)|0,n=n+Math.imul(_,Q)|0,a=(a=a+Math.imul(_,ee)|0)+Math.imul(x,Q)|0,i=i+Math.imul(x,ee)|0,n=n+Math.imul(v,re)|0,a=(a=a+Math.imul(v,ne)|0)+Math.imul(E,re)|0,i=i+Math.imul(E,ne)|0,n=n+Math.imul(y,ie)|0,a=(a=a+Math.imul(y,se)|0)+Math.imul(m,ie)|0,i=i+Math.imul(m,se)|0,n=n+Math.imul(p,ce)|0,a=(a=a+Math.imul(p,de)|0)+Math.imul(b,ce)|0,i=i+Math.imul(b,de)|0;var xe=(d+(n=n+Math.imul(u,ue)|0)|0)+((8191&(a=(a=a+Math.imul(u,le)|0)+Math.imul(l,ue)|0))<<13)|0;d=((i=i+Math.imul(l,le)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,j),a=(a=Math.imul(D,V))+Math.imul(U,j)|0,i=Math.imul(U,V),n=n+Math.imul(P,z)|0,a=(a=a+Math.imul(P,q)|0)+Math.imul(L,z)|0,i=i+Math.imul(L,q)|0,n=n+Math.imul(O,G)|0,a=(a=a+Math.imul(O,J)|0)+Math.imul(R,G)|0,i=i+Math.imul(R,J)|0,n=n+Math.imul(T,Y)|0,a=(a=a+Math.imul(T,Z)|0)+Math.imul(B,Y)|0,i=i+Math.imul(B,Z)|0,n=n+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,ee)|0)+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(_,re)|0,a=(a=a+Math.imul(_,ne)|0)+Math.imul(x,re)|0,i=i+Math.imul(x,ne)|0,n=n+Math.imul(v,ie)|0,a=(a=a+Math.imul(v,se)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,se)|0,n=n+Math.imul(y,ce)|0,a=(a=a+Math.imul(y,de)|0)+Math.imul(m,ce)|0,i=i+Math.imul(m,de)|0,n=n+Math.imul(p,ue)|0,a=(a=a+Math.imul(p,le)|0)+Math.imul(b,ue)|0,i=i+Math.imul(b,le)|0;var Se=(d+(n=n+Math.imul(u,pe)|0)|0)+((8191&(a=(a=a+Math.imul(u,be)|0)+Math.imul(l,pe)|0))<<13)|0;d=((i=i+Math.imul(l,be)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(D,z),a=(a=Math.imul(D,q))+Math.imul(U,z)|0,i=Math.imul(U,q),n=n+Math.imul(P,G)|0,a=(a=a+Math.imul(P,J)|0)+Math.imul(L,G)|0,i=i+Math.imul(L,J)|0,n=n+Math.imul(O,Y)|0,a=(a=a+Math.imul(O,Z)|0)+Math.imul(R,Y)|0,i=i+Math.imul(R,Z)|0,n=n+Math.imul(T,Q)|0,a=(a=a+Math.imul(T,ee)|0)+Math.imul(B,Q)|0,i=i+Math.imul(B,ee)|0,n=n+Math.imul(I,re)|0,a=(a=a+Math.imul(I,ne)|0)+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(_,ie)|0,a=(a=a+Math.imul(_,se)|0)+Math.imul(x,ie)|0,i=i+Math.imul(x,se)|0,n=n+Math.imul(v,ce)|0,a=(a=a+Math.imul(v,de)|0)+Math.imul(E,ce)|0,i=i+Math.imul(E,de)|0,n=n+Math.imul(y,ue)|0,a=(a=a+Math.imul(y,le)|0)+Math.imul(m,ue)|0,i=i+Math.imul(m,le)|0;var Ie=(d+(n=n+Math.imul(p,pe)|0)|0)+((8191&(a=(a=a+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;d=((i=i+Math.imul(b,be)|0)+(a>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,G),a=(a=Math.imul(D,J))+Math.imul(U,G)|0,i=Math.imul(U,J),n=n+Math.imul(P,Y)|0,a=(a=a+Math.imul(P,Z)|0)+Math.imul(L,Y)|0,i=i+Math.imul(L,Z)|0,n=n+Math.imul(O,Q)|0,a=(a=a+Math.imul(O,ee)|0)+Math.imul(R,Q)|0,i=i+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,a=(a=a+Math.imul(T,ne)|0)+Math.imul(B,re)|0,i=i+Math.imul(B,ne)|0,n=n+Math.imul(I,ie)|0,a=(a=a+Math.imul(I,se)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,se)|0,n=n+Math.imul(_,ce)|0,a=(a=a+Math.imul(_,de)|0)+Math.imul(x,ce)|0,i=i+Math.imul(x,de)|0,n=n+Math.imul(v,ue)|0,a=(a=a+Math.imul(v,le)|0)+Math.imul(E,ue)|0,i=i+Math.imul(E,le)|0;var ke=(d+(n=n+Math.imul(y,pe)|0)|0)+((8191&(a=(a=a+Math.imul(y,be)|0)+Math.imul(m,pe)|0))<<13)|0;d=((i=i+Math.imul(m,be)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,Y),a=(a=Math.imul(D,Z))+Math.imul(U,Y)|0,i=Math.imul(U,Z),n=n+Math.imul(P,Q)|0,a=(a=a+Math.imul(P,ee)|0)+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(O,re)|0,a=(a=a+Math.imul(O,ne)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,n=n+Math.imul(T,ie)|0,a=(a=a+Math.imul(T,se)|0)+Math.imul(B,ie)|0,i=i+Math.imul(B,se)|0,n=n+Math.imul(I,ce)|0,a=(a=a+Math.imul(I,de)|0)+Math.imul(k,ce)|0,i=i+Math.imul(k,de)|0,n=n+Math.imul(_,ue)|0,a=(a=a+Math.imul(_,le)|0)+Math.imul(x,ue)|0,i=i+Math.imul(x,le)|0;var Ce=(d+(n=n+Math.imul(v,pe)|0)|0)+((8191&(a=(a=a+Math.imul(v,be)|0)+Math.imul(E,pe)|0))<<13)|0;d=((i=i+Math.imul(E,be)|0)+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(D,Q),a=(a=Math.imul(D,ee))+Math.imul(U,Q)|0,i=Math.imul(U,ee),n=n+Math.imul(P,re)|0,a=(a=a+Math.imul(P,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(O,ie)|0,a=(a=a+Math.imul(O,se)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,se)|0,n=n+Math.imul(T,ce)|0,a=(a=a+Math.imul(T,de)|0)+Math.imul(B,ce)|0,i=i+Math.imul(B,de)|0,n=n+Math.imul(I,ue)|0,a=(a=a+Math.imul(I,le)|0)+Math.imul(k,ue)|0,i=i+Math.imul(k,le)|0;var Te=(d+(n=n+Math.imul(_,pe)|0)|0)+((8191&(a=(a=a+Math.imul(_,be)|0)+Math.imul(x,pe)|0))<<13)|0;d=((i=i+Math.imul(x,be)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,re),a=(a=Math.imul(D,ne))+Math.imul(U,re)|0,i=Math.imul(U,ne),n=n+Math.imul(P,ie)|0,a=(a=a+Math.imul(P,se)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,se)|0,n=n+Math.imul(O,ce)|0,a=(a=a+Math.imul(O,de)|0)+Math.imul(R,ce)|0,i=i+Math.imul(R,de)|0,n=n+Math.imul(T,ue)|0,a=(a=a+Math.imul(T,le)|0)+Math.imul(B,ue)|0,i=i+Math.imul(B,le)|0;var Be=(d+(n=n+Math.imul(I,pe)|0)|0)+((8191&(a=(a=a+Math.imul(I,be)|0)+Math.imul(k,pe)|0))<<13)|0;d=((i=i+Math.imul(k,be)|0)+(a>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(D,ie),a=(a=Math.imul(D,se))+Math.imul(U,ie)|0,i=Math.imul(U,se),n=n+Math.imul(P,ce)|0,a=(a=a+Math.imul(P,de)|0)+Math.imul(L,ce)|0,i=i+Math.imul(L,de)|0,n=n+Math.imul(O,ue)|0,a=(a=a+Math.imul(O,le)|0)+Math.imul(R,ue)|0,i=i+Math.imul(R,le)|0;var Me=(d+(n=n+Math.imul(T,pe)|0)|0)+((8191&(a=(a=a+Math.imul(T,be)|0)+Math.imul(B,pe)|0))<<13)|0;d=((i=i+Math.imul(B,be)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,ce),a=(a=Math.imul(D,de))+Math.imul(U,ce)|0,i=Math.imul(U,de),n=n+Math.imul(P,ue)|0,a=(a=a+Math.imul(P,le)|0)+Math.imul(L,ue)|0,i=i+Math.imul(L,le)|0;var Oe=(d+(n=n+Math.imul(O,pe)|0)|0)+((8191&(a=(a=a+Math.imul(O,be)|0)+Math.imul(R,pe)|0))<<13)|0;d=((i=i+Math.imul(R,be)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,ue),a=(a=Math.imul(D,le))+Math.imul(U,ue)|0,i=Math.imul(U,le);var Re=(d+(n=n+Math.imul(P,pe)|0)|0)+((8191&(a=(a=a+Math.imul(P,be)|0)+Math.imul(L,pe)|0))<<13)|0;d=((i=i+Math.imul(L,be)|0)+(a>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ne=(d+(n=Math.imul(D,pe))|0)+((8191&(a=(a=Math.imul(D,be))+Math.imul(U,pe)|0))<<13)|0;return d=((i=Math.imul(U,be))+(a>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c[0]=ge,c[1]=ye,c[2]=me,c[3]=we,c[4]=ve,c[5]=Ee,c[6]=Ae,c[7]=_e,c[8]=xe,c[9]=Se,c[10]=Ie,c[11]=ke,c[12]=Ce,c[13]=Te,c[14]=Be,c[15]=Me,c[16]=Oe,c[17]=Re,c[18]=Ne,0!==d&&(c[19]=d,r.length++),r};function b(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=h),i.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?h(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,a=0,i=0;i<r.length-1;i++){var s=a;a=0;for(var o=67108863&n,c=Math.min(i,t.length-1),d=Math.max(0,i-e.length+1);d<=c;d++){var f=i-d,u=(0|e.words[f])*(0|t.words[d]),l=67108863&u;o=67108863&(l=l+o|0),a+=(s=(s=s+(u/67108864|0)|0)+(l>>>26)|0)>>>26,s&=67108863}r.words[i]=o,n=s,s=a}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,e,t):b(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,a=0;a<t;a++)n|=(1&e)<<t-a-1,e>>=1;return n},g.prototype.permute=function(e,t,r,n,a,i){for(var s=0;s<i;s++)n[s]=t[e[s]],a[s]=r[e[s]]},g.prototype.transform=function(e,t,r,n,a,i){this.permute(i,e,t,r,n,a);for(var s=1;s<a;s<<=1)for(var o=s<<1,c=Math.cos(2*Math.PI/o),d=Math.sin(2*Math.PI/o),f=0;f<a;f+=o)for(var u=c,l=d,h=0;h<s;h++){var p=r[f+h],b=n[f+h],g=r[f+h+s],y=n[f+h+s],m=u*g-l*y;y=u*y+l*g,g=m,r[f+h]=p+g,n[f+h]=b+y,r[f+h+s]=p-g,n[f+h+s]=b-y,h!==o&&(m=c*u-d*l,l=c*l+d*u,u=m)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,a=0;for(r=r/2|0;r;r>>>=1)a++;return 1<<a+1+n},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var a=e[n];e[n]=e[r-n-1],e[r-n-1]=a,a=t[n],t[n]=-t[r-n-1],t[r-n-1]=-a}},g.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var a=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&a,r=a<67108864?0:a/67108864|0}return e},g.prototype.convert13b=function(e,t,r,a){for(var i=0,s=0;s<t;s++)i+=0|e[s],r[2*s]=8191&i,i>>>=13,r[2*s+1]=8191&i,i>>>=13;for(s=2*t;s<a;++s)r[s]=0;n(0===i),n(!(-8192&i))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),a=this.makeRBT(n),i=this.stub(n),s=new Array(n),o=new Array(n),c=new Array(n),d=new Array(n),f=new Array(n),u=new Array(n),l=r.words;l.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,d,n),this.transform(s,i,o,c,n,a),this.transform(d,i,f,u,n,a);for(var h=0;h<n;h++){var p=o[h]*f[h]-c[h]*u[h];c[h]=o[h]*u[h]+c[h]*f[h],o[h]=p}return this.conjugate(o,c,n),this.transform(o,c,l,i,n,a),this.conjugate(l,i,n),this.normalize13b(l,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),b(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var a=(0|this.words[r])*e,i=(67108863&a)+(67108863&t);t>>=26,t+=a/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=t,this.length++),this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,a=r%26;t[r]=(e.words[n]&1<<a)>>>a}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var a=r.sqr();n<t.length;n++,a=a.sqr())0!==t[n]&&(r=r.mul(a));return r},i.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,a=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var o=this.words[t]&i,c=(0|this.words[t])-o<<r;this.words[t]=c|s,s=o>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==a){for(t=this.length-1;t>=0;t--)this.words[t+a]=this.words[t];for(t=0;t<a;t++)this.words[t]=0;this.length+=a}return this.strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var a;n("number"==typeof e&&e>=0),a=t?(t-t%26)/26:0;var i=e%26,s=Math.min((e-i)/26,this.length),o=67108863^67108863>>>i<<i,c=r;if(a-=s,a=Math.max(0,a),c){for(var d=0;d<s;d++)c.words[d]=this.words[d];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,d=0;d<this.length;d++)this.words[d]=this.words[d+s];else this.words[0]=0,this.length=1;var f=0;for(d=this.length-1;d>=0&&(0!==f||d>=a);d--){var u=0|this.words[d];this.words[d]=f<<26-i|u>>>i,f=u&o}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,a=1<<t;return!(this.length<=r)&&!!(this.words[r]&a)},i.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var a=67108863^67108863>>>t<<t;this.words[this.length-1]&=a}return this.strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var a,i,s=e.length+r;this._expand(s);var o=0;for(a=0;a<e.length;a++){i=(0|this.words[a+r])+o;var c=(0|e.words[a])*t;o=((i-=67108863&c)>>26)-(c/67108864|0),this.words[a+r]=67108863&i}for(;a<this.length-r;a++)o=(i=(0|this.words[a+r])+o)>>26,this.words[a+r]=67108863&i;if(0===o)return this.strip();for(n(-1===o),o=0,a=0;a<this.length;a++)o=(i=-(0|this.words[a])+o)>>26,this.words[a]=67108863&i;return this.negative=1,this.strip()},i.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,s=0|a.words[a.length-1];0!==(r=26-this._countBits(s))&&(a=a.ushln(r),n.iushln(r),s=0|a.words[a.length-1]);var o,c=n.length-a.length;if("mod"!==t){(o=new i(null)).length=c+1,o.words=new Array(o.length);for(var d=0;d<o.length;d++)o.words[d]=0}var f=n.clone()._ishlnsubmul(a,1,c);0===f.negative&&(n=f,o&&(o.words[c]=1));for(var u=c-1;u>=0;u--){var l=67108864*(0|n.words[a.length+u])+(0|n.words[a.length+u-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(a,l,u);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(a,1,u),n.isZero()||(n.negative^=1);o&&(o.words[u]=l)}return o&&o.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:o||null,mod:n}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(a=o.div.neg()),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:a,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(a=o.div.neg()),{div:a,mod:o.mod}):this.negative&e.negative?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:o.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var a,s,o},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),a=e.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,a=this.length-1;a>=0;a--)r=(t*r+(0|this.words[a]))%e;return r},i.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var a=(0|this.words[r])+67108864*t;this.words[r]=a/e|0,t=a%e}return this.strip()},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),s=new i(0),o=new i(0),c=new i(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var f=r.clone(),u=t.clone();!t.isZero();){for(var l=0,h=1;!(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(f),s.isub(u)),a.iushrn(1),s.iushrn(1);for(var p=0,b=1;!(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(f),c.isub(u)),o.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(o),s.isub(c)):(r.isub(t),o.isub(a),c.isub(s))}return{a:o,b:c,gcd:r.iushln(d)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,s=new i(1),o=new i(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,f=1;!(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var u=0,l=1;!(r.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(r.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(o)):(r.isub(t),o.isub(s))}return(a=0===t.cmpn(1)?s:o).cmpn(0)<0&&a.iadd(e),a},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var i=t;t=r,r=i}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return!(1&this.words[0])},i.prototype.isOdd=function(){return!(1&~this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,a=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=a,this;for(var i=a,s=r;0!==i&&s<this.length;s++){var o=0|this.words[s];i=(o+=i)>>>26,o&=67108863,this.words[s]=o}return 0!==i&&(this.words[s]=i,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var a=0|this.words[0];t=a===e?0:a<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],a=0|e.words[r];if(n!==a){n<a?t=-1:n>a&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new _(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function m(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function v(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function x(e){_.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},m.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(e,t){e.iushrn(this.n,0,t)},m.prototype.imulK=function(e){return e.imul(this.k)},a(w,m),w.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),a=0;a<n;a++)t.words[a]=e.words[a];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=i&r,a=10;a<e.length;a++){var s=0|e.words[a];e.words[a-10]=(s&r)<<4|i>>>22,i=s}i>>>=22,e.words[a-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},a(v,m),a(E,m),a(A,m),A.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,a=67108863&n;n>>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new v;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return y[e]=t,t},_.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},_.prototype._verify2=function(e,t){n(!(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},_.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},_.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},_.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},_.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},_.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},_.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},_.prototype.isqr=function(e){return this.imul(e,e.clone())},_.prototype.sqr=function(e){return this.mul(e,e)},_.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);n(!a.isZero());var o=new i(1).toRed(this),c=o.redNeg(),d=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,d).cmp(c);)f.redIAdd(c);for(var u=this.pow(f,a),l=this.pow(e,a.addn(1).iushrn(1)),h=this.pow(e,a),p=s;0!==h.cmp(o);){for(var b=h,g=0;0!==b.cmp(o);g++)b=b.redSqr();n(g<p);var y=this.pow(u,new i(1).iushln(p-g-1));l=l.redMul(y),u=y.redSqr(),h=h.redMul(u),p=g}return l},_.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},_.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var a=r[0],s=0,o=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var d=t.words[n],f=c-1;f>=0;f--){var u=d>>f&1;a!==r[0]&&(a=this.sqr(a)),0!==u||0!==s?(s<<=1,s|=u,(4===++o||0===n&&0===f)&&(a=this.mul(a,r[s]),o=0,s=0)):o=0}c=26}return a},_.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},_.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new x(e)},a(x,_),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),s=a;return a.cmp(this.m)>=0?s=a.isub(this.m):a.cmpn(0)<0&&(s=a.iadd(this.m)),s._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},4890:(e,t,r)=>{"use strict";var n=r(5553);function a(e){return"string"==typeof e&&(e=e.trim().toLowerCase()),void 0===e||isNaN(e)||(e={"-18":"wei","-15":"kwei","-12":"mwei","-9":"gwei","-6":"szabo","-3":"finney",1:"ether",3:"kether",6:"mether",9:"gether",12:"tether"}[e]),e}e.exports=function(e,t,r){t=a(t),r=a(r);var i=function(e,t){if(void 0===e)throw TypeError("value is required");if(void 0===(t=a(t)))throw TypeError("unit is required");var r=new n(e);if("eth"===t&&(t="ether"),"wei"===t)return r.times(new n(1e-18));if("kwei"===t)return r.times(new n(1e-15));if("mwei"===t)return r.times(new n(1e-12));if("gwei"===t)return r.times(new n(1e-9));if("szabo"===t)return r.times(new n(1e-6));if("finney"===t)return r.times(new n(.001));if("ether"===t)return r.times(new n(1));if("kether"===t)return r.times(new n(1e3));if("mether"===t)return r.times(new n(1e6));if("gether"===t)return r.times(new n(1e9));if("tether"===t)return r.times(new n(1e12));throw TypeError("Invalid unit")}(e,t);"eth"===t&&(t="ether"),"eth"===r&&(r="ether");var s={wei:null,kwei:null,mwei:null,gwei:null,szabo:null,finney:null,ether:null,kether:null,mether:null,gether:null,tether:null};if(s[t]=new n(e).toString(10),"wei"!==t&&(s.wei=i.times(new n(1e18)).toString(10)),"kwei"!==t&&(s.kwei=i.times(new n(1e15)).toString(10)),"mwei"!==t&&(s.mwei=i.times(new n(1e12)).toString(10)),"gwei"!==t&&(s.gwei=i.times(new n(1e9)).toString(10)),"szabo"!==t&&(s.szabo=i.times(new n(1e6)).toString(10)),"finney"!==t&&(s.finney=i.times(new n(1e3)).toString(10)),"ether"!==t&&(s.ether=i.times(new n(1)).toString(10)),"kether"!==t&&(s.kether=i.times(new n(.001)).toString(10)),"mether"!==t&&(s.mether=i.times(new n(1e-6)).toString(10)),"gether"!==t&&(s.gether=i.times(new n(1e-9)).toString(10)),"tether"!==t&&(s.tether=i.times(new n(1e-12)).toString(10)),r){if(void 0===s[r])throw TypeError("Invalid unit");return s[r]}return s}},9454:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.formatBytes32String=t.Utf8ErrorFuncs=t.toUtf8String=t.toUtf8CodePoints=t.toUtf8Bytes=t._toEscapedUtf8String=t.nameprep=t.hexDataSlice=t.hexDataLength=t.hexZeroPad=t.hexValue=t.hexStripZeros=t.hexConcat=t.isHexString=t.hexlify=t.base64=t.base58=t.TransactionDescription=t.LogDescription=t.Interface=t.SigningKey=t.HDNode=t.defaultPath=t.isBytesLike=t.isBytes=t.zeroPad=t.stripZeros=t.concat=t.arrayify=t.shallowCopy=t.resolveProperties=t.getStatic=t.defineReadOnly=t.deepCopy=t.checkProperties=t.poll=t.fetchJson=t._fetchData=t.RLP=t.Logger=t.checkResultErrors=t.FormatTypes=t.ParamType=t.FunctionFragment=t.EventFragment=t.ErrorFragment=t.ConstructorFragment=t.Fragment=t.defaultAbiCoder=t.AbiCoder=void 0,t.Indexed=t.Utf8ErrorReason=t.UnicodeNormalizationForm=t.SupportedAlgorithm=t.mnemonicToSeed=t.isValidMnemonic=t.entropyToMnemonic=t.mnemonicToEntropy=t.getAccountPath=t.verifyTypedData=t.verifyMessage=t.recoverPublicKey=t.computePublicKey=t.recoverAddress=t.computeAddress=t.getJsonWalletAddress=t.TransactionTypes=t.serializeTransaction=t.parseTransaction=t.accessListify=t.joinSignature=t.splitSignature=t.soliditySha256=t.solidityKeccak256=t.solidityPack=t.shuffled=t.randomBytes=t.sha512=t.sha256=t.ripemd160=t.keccak256=t.computeHmac=t.commify=t.parseUnits=t.formatUnits=t.parseEther=t.formatEther=t.isAddress=t.getCreate2Address=t.getContractAddress=t.getIcapAddress=t.getAddress=t._TypedDataEncoder=t.id=t.isValidName=t.namehash=t.hashMessage=t.dnsEncode=t.parseBytes32String=void 0;var s=r(8246);Object.defineProperty(t,"AbiCoder",{enumerable:!0,get:function(){return s.AbiCoder}}),Object.defineProperty(t,"checkResultErrors",{enumerable:!0,get:function(){return s.checkResultErrors}}),Object.defineProperty(t,"ConstructorFragment",{enumerable:!0,get:function(){return s.ConstructorFragment}}),Object.defineProperty(t,"defaultAbiCoder",{enumerable:!0,get:function(){return s.defaultAbiCoder}}),Object.defineProperty(t,"ErrorFragment",{enumerable:!0,get:function(){return s.ErrorFragment}}),Object.defineProperty(t,"EventFragment",{enumerable:!0,get:function(){return s.EventFragment}}),Object.defineProperty(t,"FormatTypes",{enumerable:!0,get:function(){return s.FormatTypes}}),Object.defineProperty(t,"Fragment",{enumerable:!0,get:function(){return s.Fragment}}),Object.defineProperty(t,"FunctionFragment",{enumerable:!0,get:function(){return s.FunctionFragment}}),Object.defineProperty(t,"Indexed",{enumerable:!0,get:function(){return s.Indexed}}),Object.defineProperty(t,"Interface",{enumerable:!0,get:function(){return s.Interface}}),Object.defineProperty(t,"LogDescription",{enumerable:!0,get:function(){return s.LogDescription}}),Object.defineProperty(t,"ParamType",{enumerable:!0,get:function(){return s.ParamType}}),Object.defineProperty(t,"TransactionDescription",{enumerable:!0,get:function(){return s.TransactionDescription}});var o=r(1277);Object.defineProperty(t,"getAddress",{enumerable:!0,get:function(){return o.getAddress}}),Object.defineProperty(t,"getCreate2Address",{enumerable:!0,get:function(){return o.getCreate2Address}}),Object.defineProperty(t,"getContractAddress",{enumerable:!0,get:function(){return o.getContractAddress}}),Object.defineProperty(t,"getIcapAddress",{enumerable:!0,get:function(){return o.getIcapAddress}}),Object.defineProperty(t,"isAddress",{enumerable:!0,get:function(){return o.isAddress}});var c=i(r(7423));t.base64=c;var d=r(6593);Object.defineProperty(t,"base58",{enumerable:!0,get:function(){return d.Base58}});var f=r(5372);Object.defineProperty(t,"arrayify",{enumerable:!0,get:function(){return f.arrayify}}),Object.defineProperty(t,"concat",{enumerable:!0,get:function(){return f.concat}}),Object.defineProperty(t,"hexConcat",{enumerable:!0,get:function(){return f.hexConcat}}),Object.defineProperty(t,"hexDataSlice",{enumerable:!0,get:function(){return f.hexDataSlice}}),Object.defineProperty(t,"hexDataLength",{enumerable:!0,get:function(){return f.hexDataLength}}),Object.defineProperty(t,"hexlify",{enumerable:!0,get:function(){return f.hexlify}}),Object.defineProperty(t,"hexStripZeros",{enumerable:!0,get:function(){return f.hexStripZeros}}),Object.defineProperty(t,"hexValue",{enumerable:!0,get:function(){return f.hexValue}}),Object.defineProperty(t,"hexZeroPad",{enumerable:!0,get:function(){return f.hexZeroPad}}),Object.defineProperty(t,"isBytes",{enumerable:!0,get:function(){return f.isBytes}}),Object.defineProperty(t,"isBytesLike",{enumerable:!0,get:function(){return f.isBytesLike}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return f.isHexString}}),Object.defineProperty(t,"joinSignature",{enumerable:!0,get:function(){return f.joinSignature}}),Object.defineProperty(t,"zeroPad",{enumerable:!0,get:function(){return f.zeroPad}}),Object.defineProperty(t,"splitSignature",{enumerable:!0,get:function(){return f.splitSignature}}),Object.defineProperty(t,"stripZeros",{enumerable:!0,get:function(){return f.stripZeros}});var u=r(8677);Object.defineProperty(t,"_TypedDataEncoder",{enumerable:!0,get:function(){return u._TypedDataEncoder}}),Object.defineProperty(t,"dnsEncode",{enumerable:!0,get:function(){return u.dnsEncode}}),Object.defineProperty(t,"hashMessage",{enumerable:!0,get:function(){return u.hashMessage}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return u.id}}),Object.defineProperty(t,"isValidName",{enumerable:!0,get:function(){return u.isValidName}}),Object.defineProperty(t,"namehash",{enumerable:!0,get:function(){return u.namehash}});var l=r(2294);Object.defineProperty(t,"defaultPath",{enumerable:!0,get:function(){return l.defaultPath}}),Object.defineProperty(t,"entropyToMnemonic",{enumerable:!0,get:function(){return l.entropyToMnemonic}}),Object.defineProperty(t,"getAccountPath",{enumerable:!0,get:function(){return l.getAccountPath}}),Object.defineProperty(t,"HDNode",{enumerable:!0,get:function(){return l.HDNode}}),Object.defineProperty(t,"isValidMnemonic",{enumerable:!0,get:function(){return l.isValidMnemonic}}),Object.defineProperty(t,"mnemonicToEntropy",{enumerable:!0,get:function(){return l.mnemonicToEntropy}}),Object.defineProperty(t,"mnemonicToSeed",{enumerable:!0,get:function(){return l.mnemonicToSeed}});var h=r(1095);Object.defineProperty(t,"getJsonWalletAddress",{enumerable:!0,get:function(){return h.getJsonWalletAddress}});var p=r(9729);Object.defineProperty(t,"keccak256",{enumerable:!0,get:function(){return p.keccak256}});var b=r(7587);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return b.Logger}});var g=r(9712);Object.defineProperty(t,"computeHmac",{enumerable:!0,get:function(){return g.computeHmac}}),Object.defineProperty(t,"ripemd160",{enumerable:!0,get:function(){return g.ripemd160}}),Object.defineProperty(t,"sha256",{enumerable:!0,get:function(){return g.sha256}}),Object.defineProperty(t,"sha512",{enumerable:!0,get:function(){return g.sha512}});var y=r(440);Object.defineProperty(t,"solidityKeccak256",{enumerable:!0,get:function(){return y.keccak256}}),Object.defineProperty(t,"solidityPack",{enumerable:!0,get:function(){return y.pack}}),Object.defineProperty(t,"soliditySha256",{enumerable:!0,get:function(){return y.sha256}});var m=r(8846);Object.defineProperty(t,"randomBytes",{enumerable:!0,get:function(){return m.randomBytes}}),Object.defineProperty(t,"shuffled",{enumerable:!0,get:function(){return m.shuffled}});var w=r(2428);Object.defineProperty(t,"checkProperties",{enumerable:!0,get:function(){return w.checkProperties}}),Object.defineProperty(t,"deepCopy",{enumerable:!0,get:function(){return w.deepCopy}}),Object.defineProperty(t,"defineReadOnly",{enumerable:!0,get:function(){return w.defineReadOnly}}),Object.defineProperty(t,"getStatic",{enumerable:!0,get:function(){return w.getStatic}}),Object.defineProperty(t,"resolveProperties",{enumerable:!0,get:function(){return w.resolveProperties}}),Object.defineProperty(t,"shallowCopy",{enumerable:!0,get:function(){return w.shallowCopy}});var v=i(r(5205));t.RLP=v;var E=r(379);Object.defineProperty(t,"computePublicKey",{enumerable:!0,get:function(){return E.computePublicKey}}),Object.defineProperty(t,"recoverPublicKey",{enumerable:!0,get:function(){return E.recoverPublicKey}}),Object.defineProperty(t,"SigningKey",{enumerable:!0,get:function(){return E.SigningKey}});var A=r(5413);Object.defineProperty(t,"formatBytes32String",{enumerable:!0,get:function(){return A.formatBytes32String}}),Object.defineProperty(t,"nameprep",{enumerable:!0,get:function(){return A.nameprep}}),Object.defineProperty(t,"parseBytes32String",{enumerable:!0,get:function(){return A.parseBytes32String}}),Object.defineProperty(t,"_toEscapedUtf8String",{enumerable:!0,get:function(){return A._toEscapedUtf8String}}),Object.defineProperty(t,"toUtf8Bytes",{enumerable:!0,get:function(){return A.toUtf8Bytes}}),Object.defineProperty(t,"toUtf8CodePoints",{enumerable:!0,get:function(){return A.toUtf8CodePoints}}),Object.defineProperty(t,"toUtf8String",{enumerable:!0,get:function(){return A.toUtf8String}}),Object.defineProperty(t,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return A.Utf8ErrorFuncs}});var _=r(7808);Object.defineProperty(t,"accessListify",{enumerable:!0,get:function(){return _.accessListify}}),Object.defineProperty(t,"computeAddress",{enumerable:!0,get:function(){return _.computeAddress}}),Object.defineProperty(t,"parseTransaction",{enumerable:!0,get:function(){return _.parse}}),Object.defineProperty(t,"recoverAddress",{enumerable:!0,get:function(){return _.recoverAddress}}),Object.defineProperty(t,"serializeTransaction",{enumerable:!0,get:function(){return _.serialize}}),Object.defineProperty(t,"TransactionTypes",{enumerable:!0,get:function(){return _.TransactionTypes}});var x=r(9967);Object.defineProperty(t,"commify",{enumerable:!0,get:function(){return x.commify}}),Object.defineProperty(t,"formatEther",{enumerable:!0,get:function(){return x.formatEther}}),Object.defineProperty(t,"parseEther",{enumerable:!0,get:function(){return x.parseEther}}),Object.defineProperty(t,"formatUnits",{enumerable:!0,get:function(){return x.formatUnits}}),Object.defineProperty(t,"parseUnits",{enumerable:!0,get:function(){return x.parseUnits}});var S=r(1196);Object.defineProperty(t,"verifyMessage",{enumerable:!0,get:function(){return S.verifyMessage}}),Object.defineProperty(t,"verifyTypedData",{enumerable:!0,get:function(){return S.verifyTypedData}});var I=r(3546);Object.defineProperty(t,"_fetchData",{enumerable:!0,get:function(){return I._fetchData}}),Object.defineProperty(t,"fetchJson",{enumerable:!0,get:function(){return I.fetchJson}}),Object.defineProperty(t,"poll",{enumerable:!0,get:function(){return I.poll}});var k=r(9712);Object.defineProperty(t,"SupportedAlgorithm",{enumerable:!0,get:function(){return k.SupportedAlgorithm}});var C=r(5413);Object.defineProperty(t,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return C.UnicodeNormalizationForm}}),Object.defineProperty(t,"Utf8ErrorReason",{enumerable:!0,get:function(){return C.Utf8ErrorReason}})},282:e=>{e.exports=s,s.default=s,s.stable=f,s.stableStringify=f;var t="[...]",r="[Circular]",n=[],a=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function s(e,t,r,s){var o;void 0===s&&(s=i()),c(e,"",0,[],void 0,0,s);try{o=0===a.length?JSON.stringify(e,t,r):JSON.stringify(e,l(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var d=n.pop();4===d.length?Object.defineProperty(d[0],d[1],d[3]):d[0][d[1]]=d[2]}}return o}function o(e,t,r,i){var s=Object.getOwnPropertyDescriptor(i,r);void 0!==s.get?s.configurable?(Object.defineProperty(i,r,{value:e}),n.push([i,r,t,s])):a.push([t,r,e]):(i[r]=e,n.push([i,r,t]))}function c(e,n,a,i,s,d,f){var u;if(d+=1,"object"==typeof e&&null!==e){for(u=0;u<i.length;u++)if(i[u]===e)return void o(r,e,n,s);if(void 0!==f.depthLimit&&d>f.depthLimit)return void o(t,e,n,s);if(void 0!==f.edgesLimit&&a+1>f.edgesLimit)return void o(t,e,n,s);if(i.push(e),Array.isArray(e))for(u=0;u<e.length;u++)c(e[u],u,u,i,e,d,f);else{var l=Object.keys(e);for(u=0;u<l.length;u++){var h=l[u];c(e[h],h,u,i,e,d,f)}}i.pop()}}function d(e,t){return e<t?-1:e>t?1:0}function f(e,t,r,s){void 0===s&&(s=i());var o,c=u(e,"",0,[],void 0,0,s)||e;try{o=0===a.length?JSON.stringify(c,t,r):JSON.stringify(c,l(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==n.length;){var d=n.pop();4===d.length?Object.defineProperty(d[0],d[1],d[3]):d[0][d[1]]=d[2]}}return o}function u(e,a,i,s,c,f,l){var h;if(f+=1,"object"==typeof e&&null!==e){for(h=0;h<s.length;h++)if(s[h]===e)return void o(r,e,a,c);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==l.depthLimit&&f>l.depthLimit)return void o(t,e,a,c);if(void 0!==l.edgesLimit&&i+1>l.edgesLimit)return void o(t,e,a,c);if(s.push(e),Array.isArray(e))for(h=0;h<e.length;h++)u(e[h],h,h,s,e,f,l);else{var p={},b=Object.keys(e).sort(d);for(h=0;h<b.length;h++){var g=b[h];u(e[g],g,h,s,e,f,l),p[g]=e[g]}if(void 0===c)return p;n.push([c,a,e]),c[a]=p}s.pop()}}function l(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(a.length>0)for(var n=0;n<a.length;n++){var i=a[n];if(i[1]===t&&i[0]===r){r=i[2],a.splice(n,1);break}}return e.call(this,t,r)}}},9499:(e,t,r)=>{var n=t;n.utils=r(461),n.common=r(2191),n.sha=r(5746),n.ripemd=r(4169),n.hmac=r(1825),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},2191:(e,t,r)=>{"use strict";var n=r(461),a=r(7784);function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=i,i.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var a=0;a<e.length;a+=this._delta32)this._update(e,a,a+this._delta32)}return this},i.prototype.digest=function(e){return this.update(this._pad()),a(null===this.pending),this._digest(e)},i.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var a=1;a<r;a++)n[a]=0;if(e<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)n[a++]=0;n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=e>>>24&255,n[a++]=e>>>16&255,n[a++]=e>>>8&255,n[a++]=255&e}else for(n[a++]=255&e,n[a++]=e>>>8&255,n[a++]=e>>>16&255,n[a++]=e>>>24&255,n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=0,i=8;i<this.padLength;i++)n[a++]=0;return n}},1825:(e,t,r)=>{"use strict";var n=r(461),a=r(7784);function i(e,t,r){if(!(this instanceof i))return new i(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=i,i.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),a(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},i.prototype.update=function(e,t){return this.inner.update(e,t),this},i.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},4169:(e,t,r)=>{"use strict";var n=r(461),a=r(2191),i=n.rotl32,s=n.sum32,o=n.sum32_3,c=n.sum32_4,d=a.BlockHash;function f(){if(!(this instanceof f))return new f;d.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function u(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function l(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(f,d),t.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],a=this.h[2],d=this.h[3],f=this.h[4],m=r,w=n,v=a,E=d,A=f,_=0;_<80;_++){var x=s(i(c(r,u(_,n,a,d),e[p[_]+t],l(_)),g[_]),f);r=f,f=d,d=i(a,10),a=n,n=x,x=s(i(c(m,u(79-_,w,v,E),e[b[_]+t],h(_)),y[_]),A),m=A,A=E,E=i(v,10),v=w,w=x}x=o(this.h[1],a,E),this.h[1]=o(this.h[2],d,A),this.h[2]=o(this.h[3],f,m),this.h[3]=o(this.h[4],r,w),this.h[4]=o(this.h[0],n,v),this.h[0]=x},f.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],b=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],y=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},5746:(e,t,r)=>{"use strict";t.sha1=r(2986),t.sha224=r(5393),t.sha256=r(536),t.sha384=r(2348),t.sha512=r(2157)},2986:(e,t,r)=>{"use strict";var n=r(461),a=r(2191),i=r(600),s=n.rotl32,o=n.sum32,c=n.sum32_5,d=i.ft_1,f=a.BlockHash,u=[1518500249,1859775393,2400959708,3395469782];function l(){if(!(this instanceof l))return new l;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(l,f),e.exports=l,l.blockSize=512,l.outSize=160,l.hmacStrength=80,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var a=this.h[0],i=this.h[1],f=this.h[2],l=this.h[3],h=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),b=c(s(a,5),d(p,i,f,l),h,r[n],u[p]);h=l,l=f,f=s(i,30),i=a,a=b}this.h[0]=o(this.h[0],a),this.h[1]=o(this.h[1],i),this.h[2]=o(this.h[2],f),this.h[3]=o(this.h[3],l),this.h[4]=o(this.h[4],h)},l.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},5393:(e,t,r)=>{"use strict";var n=r(461),a=r(536);function i(){if(!(this instanceof i))return new i;a.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(i,a),e.exports=i,i.blockSize=512,i.outSize=224,i.hmacStrength=192,i.padLength=64,i.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},536:(e,t,r)=>{"use strict";var n=r(461),a=r(2191),i=r(600),s=r(7784),o=n.sum32,c=n.sum32_4,d=n.sum32_5,f=i.ch32,u=i.maj32,l=i.s0_256,h=i.s1_256,p=i.g0_256,b=i.g1_256,g=a.BlockHash,y=[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];function m(){if(!(this instanceof m))return new m;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}n.inherits(m,g),e.exports=m,m.blockSize=512,m.outSize=256,m.hmacStrength=192,m.padLength=64,m.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=c(b(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var a=this.h[0],i=this.h[1],g=this.h[2],y=this.h[3],m=this.h[4],w=this.h[5],v=this.h[6],E=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var A=d(E,h(m),f(m,w,v),this.k[n],r[n]),_=o(l(a),u(a,i,g));E=v,v=w,w=m,m=o(y,A),y=g,g=i,i=a,a=o(A,_)}this.h[0]=o(this.h[0],a),this.h[1]=o(this.h[1],i),this.h[2]=o(this.h[2],g),this.h[3]=o(this.h[3],y),this.h[4]=o(this.h[4],m),this.h[5]=o(this.h[5],w),this.h[6]=o(this.h[6],v),this.h[7]=o(this.h[7],E)},m.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},2348:(e,t,r)=>{"use strict";var n=r(461),a=r(2157);function i(){if(!(this instanceof i))return new i;a.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(i,a),e.exports=i,i.blockSize=1024,i.outSize=384,i.hmacStrength=192,i.padLength=128,i.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},2157:(e,t,r)=>{"use strict";var n=r(461),a=r(2191),i=r(7784),s=n.rotr64_hi,o=n.rotr64_lo,c=n.shr64_hi,d=n.shr64_lo,f=n.sum64,u=n.sum64_hi,l=n.sum64_lo,h=n.sum64_4_hi,p=n.sum64_4_lo,b=n.sum64_5_hi,g=n.sum64_5_lo,y=a.BlockHash,m=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function w(){if(!(this instanceof w))return new w;y.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=m,this.W=new Array(160)}function v(e,t,r,n,a){var i=e&r^~e&a;return i<0&&(i+=4294967296),i}function E(e,t,r,n,a,i){var s=t&n^~t&i;return s<0&&(s+=4294967296),s}function A(e,t,r,n,a){var i=e&r^e&a^r&a;return i<0&&(i+=4294967296),i}function _(e,t,r,n,a,i){var s=t&n^t&i^n&i;return s<0&&(s+=4294967296),s}function x(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function S(e,t){var r=o(e,t,28)^o(t,e,2)^o(t,e,7);return r<0&&(r+=4294967296),r}function I(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function k(e,t){var r=o(e,t,14)^o(e,t,18)^o(t,e,9);return r<0&&(r+=4294967296),r}function C(e,t){var r=s(e,t,1)^s(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function T(e,t){var r=o(e,t,1)^o(e,t,8)^d(e,t,7);return r<0&&(r+=4294967296),r}function B(e,t){var r=s(e,t,19)^s(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}function M(e,t){var r=o(e,t,19)^o(t,e,29)^d(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(w,y),e.exports=w,w.blockSize=1024,w.outSize=512,w.hmacStrength=192,w.padLength=128,w.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var a=B(r[n-4],r[n-3]),i=M(r[n-4],r[n-3]),s=r[n-14],o=r[n-13],c=C(r[n-30],r[n-29]),d=T(r[n-30],r[n-29]),f=r[n-32],u=r[n-31];r[n]=h(a,i,s,o,c,d,f,u),r[n+1]=p(a,i,s,o,c,d,f,u)}},w.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],a=this.h[1],s=this.h[2],o=this.h[3],c=this.h[4],d=this.h[5],h=this.h[6],p=this.h[7],y=this.h[8],m=this.h[9],w=this.h[10],C=this.h[11],T=this.h[12],B=this.h[13],M=this.h[14],O=this.h[15];i(this.k.length===r.length);for(var R=0;R<r.length;R+=2){var N=M,P=O,L=I(y,m),F=k(y,m),D=v(y,m,w,C,T),U=E(y,m,w,C,T,B),H=this.k[R],j=this.k[R+1],V=r[R],$=r[R+1],z=b(N,P,L,F,D,U,H,j,V,$),q=g(N,P,L,F,D,U,H,j,V,$);N=x(n,a),P=S(n,a),L=A(n,a,s,o,c),F=_(n,a,s,o,c,d);var K=u(N,P,L,F),G=l(N,P,L,F);M=T,O=B,T=w,B=C,w=y,C=m,y=u(h,p,z,q),m=l(p,p,z,q),h=c,p=d,c=s,d=o,s=n,o=a,n=u(z,q,K,G),a=l(z,q,K,G)}f(this.h,0,n,a),f(this.h,2,s,o),f(this.h,4,c,d),f(this.h,6,h,p),f(this.h,8,y,m),f(this.h,10,w,C),f(this.h,12,T,B),f(this.h,14,M,O)},w.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},600:(e,t,r)=>{"use strict";var n=r(461).rotr32;function a(e,t,r){return e&t^~e&r}function i(e,t,r){return e&t^e&r^t&r}function s(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?a(t,r,n):1===e||3===e?s(t,r,n):2===e?i(t,r,n):void 0},t.ch32=a,t.maj32=i,t.p32=s,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},461:(e,t,r)=>{"use strict";var n=r(7784),a=r(5615);function i(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=a,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),a=0;a<e.length;a+=2)r.push(parseInt(e[a]+e[a+1],16))}else for(var n=0,a=0;a<e.length;a++){var s=e.charCodeAt(a);s<128?r[n++]=s:s<2048?(r[n++]=s>>6|192,r[n++]=63&s|128):i(e,a)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++a)),r[n++]=s>>18|240,r[n++]=s>>12&63|128,r[n++]=s>>6&63|128,r[n++]=63&s|128):(r[n++]=s>>12|224,r[n++]=s>>6&63|128,r[n++]=63&s|128)}else for(a=0;a<e.length;a++)r[a]=0|e[a];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=o(e[r].toString(16));return t},t.htonl=s,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var a=e[n];"little"===t&&(a=s(a)),r+=c(a.toString(16))}return r},t.zero2=o,t.zero8=c,t.join32=function(e,t,r,a){var i=r-t;n(i%4==0);for(var s=new Array(i/4),o=0,c=t;o<s.length;o++,c+=4){var d;d="big"===a?e[c]<<24|e[c+1]<<16|e[c+2]<<8|e[c+3]:e[c+3]<<24|e[c+2]<<16|e[c+1]<<8|e[c],s[o]=d>>>0}return s},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,a=0;n<e.length;n++,a+=4){var i=e[n];"big"===t?(r[a]=i>>>24,r[a+1]=i>>>16&255,r[a+2]=i>>>8&255,r[a+3]=255&i):(r[a+3]=i>>>24,r[a+2]=i>>>16&255,r[a+1]=i>>>8&255,r[a]=255&i)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,a){return e+t+r+n+a>>>0},t.sum64=function(e,t,r,n){var a=e[t],i=n+e[t+1]>>>0,s=(i<n?1:0)+r+a;e[t]=s>>>0,e[t+1]=i},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,a,i,s,o){var c=0,d=t;return c+=(d=d+n>>>0)<t?1:0,c+=(d=d+i>>>0)<i?1:0,e+r+a+s+(c+=(d=d+o>>>0)<o?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,a,i,s,o){return t+n+i+o>>>0},t.sum64_5_hi=function(e,t,r,n,a,i,s,o,c,d){var f=0,u=t;return f+=(u=u+n>>>0)<t?1:0,f+=(u=u+i>>>0)<i?1:0,f+=(u=u+o>>>0)<o?1:0,e+r+a+s+c+(f+=(u=u+d>>>0)<d?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,a,i,s,o,c,d){return t+n+i+o+d>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},4742:(e,t,r)=>{"use strict";var n=r(9499),a=r(9042),i=r(7784);function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=a.toArray(e.entropy,e.entropyEnc||"hex"),r=a.toArray(e.nonce,e.nonceEnc||"hex"),n=a.toArray(e.pers,e.persEnc||"hex");i(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=s,s.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a<this.V.length;a++)this.K[a]=0,this.V[a]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=a.toArray(e,t),r=a.toArray(r,n),i(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=a.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var s=i.slice(0,e);return this._update(r),this._reseed++,a.encode(s,t)}},9318:(e,t)=>{t.read=function(e,t,r,n,a){var i,s,o=8*a-n-1,c=(1<<o)-1,d=c>>1,f=-7,u=r?a-1:0,l=r?-1:1,h=e[t+u];for(u+=l,i=h&(1<<-f)-1,h>>=-f,f+=o;f>0;i=256*i+e[t+u],u+=l,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=n;f>0;s=256*s+e[t+u],u+=l,f-=8);if(0===i)i=1-d;else{if(i===c)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),i-=d}return(h?-1:1)*s*Math.pow(2,i-n)},t.write=function(e,t,r,n,a,i){var s,o,c,d=8*i-a-1,f=(1<<d)-1,u=f>>1,l=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+u>=1?l/c:l*Math.pow(2,1-u))*c>=2&&(s++,c/=2),s+u>=f?(o=0,s=f):s+u>=1?(o=(t*c-1)*Math.pow(2,a),s+=u):(o=t*Math.pow(2,u-1)*Math.pow(2,a),s=0));a>=8;e[r+h]=255&o,h+=p,o/=256,a-=8);for(s=s<<a|o,d+=a;d>0;e[r+h]=255&s,h+=p,s/=256,d-=8);e[r+h-p]|=128*b}},5615:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},3493:(e,t,r)=>{r(6603),e.exports=self.fetch.bind(self)},4352:(e,t,r)=>{var n=r(9601).stringify,a=r(1615);e.exports=function(e){return{parse:a(e),stringify:n}},e.exports.parse=a(),e.exports.stringify=n},1615:(e,t,r)=>{var n=null;const a=/(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/,i=/(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;e.exports=function(e){"use strict";var t={strict:!1,storeAsString:!1,alwaysParseAsBig:!1,useNativeBigInt:!1,protoAction:"error",constructorAction:"error"};if(null!=e){if(!0===e.strict&&(t.strict=!0),!0===e.storeAsString&&(t.storeAsString=!0),t.alwaysParseAsBig=!0===e.alwaysParseAsBig&&e.alwaysParseAsBig,t.useNativeBigInt=!0===e.useNativeBigInt&&e.useNativeBigInt,void 0!==e.constructorAction){if("error"!==e.constructorAction&&"ignore"!==e.constructorAction&&"preserve"!==e.constructorAction)throw new Error(`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${e.constructorAction}`);t.constructorAction=e.constructorAction}if(void 0!==e.protoAction){if("error"!==e.protoAction&&"ignore"!==e.protoAction&&"preserve"!==e.protoAction)throw new Error(`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${e.protoAction}`);t.protoAction=e.protoAction}}var s,o,c,d,f={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},u=function(e){throw{name:"SyntaxError",message:e,at:s,text:c}},l=function(e){return e&&e!==o&&u("Expected '"+e+"' instead of '"+o+"'"),o=c.charAt(s),s+=1,o},h=function(){var e,a="";for("-"===o&&(a="-",l("-"));o>="0"&&o<="9";)a+=o,l();if("."===o)for(a+=".";l()&&o>="0"&&o<="9";)a+=o;if("e"===o||"E"===o)for(a+=o,l(),"-"!==o&&"+"!==o||(a+=o,l());o>="0"&&o<="9";)a+=o,l();if(e=+a,isFinite(e))return null==n&&(n=r(899)),a.length>15?t.storeAsString?a:t.useNativeBigInt?BigInt(a):new n(a):t.alwaysParseAsBig?t.useNativeBigInt?BigInt(e):new n(e):e;u("Bad number")},p=function(){var e,t,r,n="";if('"'===o)for(var a=s;l();){if('"'===o)return s-1>a&&(n+=c.substring(a,s-1)),l(),n;if("\\"===o){if(s-1>a&&(n+=c.substring(a,s-1)),l(),"u"===o){for(r=0,t=0;t<4&&(e=parseInt(l(),16),isFinite(e));t+=1)r=16*r+e;n+=String.fromCharCode(r)}else{if("string"!=typeof f[o])break;n+=f[o]}a=s}}u("Bad string")},b=function(){for(;o&&o<=" ";)l()};return d=function(){switch(b(),o){case"{":return function(){var e,r=Object.create(null);if("{"===o){if(l("{"),b(),"}"===o)return l("}"),r;for(;o;){if(e=p(),b(),l(":"),!0===t.strict&&Object.hasOwnProperty.call(r,e)&&u('Duplicate key "'+e+'"'),!0===a.test(e)?"error"===t.protoAction?u("Object contains forbidden prototype property"):"ignore"===t.protoAction?d():r[e]=d():!0===i.test(e)?"error"===t.constructorAction?u("Object contains forbidden constructor property"):"ignore"===t.constructorAction?d():r[e]=d():r[e]=d(),b(),"}"===o)return l("}"),r;l(","),b()}}u("Bad object")}();case"[":return function(){var e=[];if("["===o){if(l("["),b(),"]"===o)return l("]"),e;for(;o;){if(e.push(d()),b(),"]"===o)return l("]"),e;l(","),b()}}u("Bad array")}();case'"':return p();case"-":return h();default:return o>="0"&&o<="9"?h():function(){switch(o){case"t":return l("t"),l("r"),l("u"),l("e"),!0;case"f":return l("f"),l("a"),l("l"),l("s"),l("e"),!1;case"n":return l("n"),l("u"),l("l"),l("l"),null}u("Unexpected '"+o+"'")}()}},function(e,t){var r;return c=e+"",s=0,o=" ",r=d(),b(),o&&u("Syntax error"),"function"==typeof t?function e(r,n){var a,i=r[n];return i&&"object"==typeof i&&Object.keys(i).forEach((function(t){void 0!==(a=e(i,t))?i[t]=a:delete i[t]})),t.call(r,n,i)}({"":r},""):r}}},9601:(e,t,r)=>{var n=r(899),a=e.exports;!function(){"use strict";var e,t,r,i=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function o(e){return i.lastIndex=0,i.test(e)?'"'+e.replace(i,(function(e){var t=s[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function c(a,i){var s,d,f,u,l,h=e,p=i[a],b=null!=p&&(p instanceof n||n.isBigNumber(p));switch(p&&"object"==typeof p&&"function"==typeof p.toJSON&&(p=p.toJSON(a)),"function"==typeof r&&(p=r.call(i,a,p)),typeof p){case"string":return b?p:o(p);case"number":return isFinite(p)?String(p):"null";case"boolean":case"null":case"bigint":return String(p);case"object":if(!p)return"null";if(e+=t,l=[],"[object Array]"===Object.prototype.toString.apply(p)){for(u=p.length,s=0;s<u;s+=1)l[s]=c(s,p)||"null";return f=0===l.length?"[]":e?"[\n"+e+l.join(",\n"+e)+"\n"+h+"]":"["+l.join(",")+"]",e=h,f}if(r&&"object"==typeof r)for(u=r.length,s=0;s<u;s+=1)"string"==typeof r[s]&&(f=c(d=r[s],p))&&l.push(o(d)+(e?": ":":")+f);else Object.keys(p).forEach((function(t){var r=c(t,p);r&&l.push(o(t)+(e?": ":":")+r)}));return f=0===l.length?"{}":e?"{\n"+e+l.join(",\n"+e)+"\n"+h+"}":"{"+l.join(",")+"}",e=h,f}}"function"!=typeof a.stringify&&(a.stringify=function(n,a,i){var s;if(e="",t="","number"==typeof i)for(s=0;s<i;s+=1)t+=" ";else"string"==typeof i&&(t=i);if(r=a,a&&"function"!=typeof a&&("object"!=typeof a||"number"!=typeof a.length))throw new Error("JSON.stringify");return c("",{"":n})})}()},899:function(e,t,r){var n;!function(a){"use strict";var i,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,o=Math.ceil,c=Math.floor,d="[BigNumber Error] ",f=d+"Number primitive has more than 15 significant digits: ",u=1e14,l=14,h=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],b=1e7,g=1e9;function y(e){var t=0|e;return e>0||e===t?t:t-1}function m(e){for(var t,r,n=1,a=e.length,i=e[0]+"";n<a;){for(t=e[n++]+"",r=l-t.length;r--;t="0"+t);i+=t}for(a=i.length;48===i.charCodeAt(--a););return i.slice(0,a+1||1)}function w(e,t){var r,n,a=e.c,i=t.c,s=e.s,o=t.s,c=e.e,d=t.e;if(!s||!o)return null;if(r=a&&!a[0],n=i&&!i[0],r||n)return r?n?0:-o:s;if(s!=o)return s;if(r=s<0,n=c==d,!a||!i)return n?0:!a^r?1:-1;if(!n)return c>d^r?1:-1;for(o=(c=a.length)<(d=i.length)?c:d,s=0;s<o;s++)if(a[s]!=i[s])return a[s]>i[s]^r?1:-1;return c==d?0:c>d^r?1:-1}function v(e,t,r,n){if(e<t||e>r||e!==c(e))throw Error(d+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function E(e){var t=e.c.length-1;return y(e.e/l)==t&&e.c[t]%2!=0}function A(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function _(e,t,r){var n,a;if(t<0){for(a=r+".";++t;a+=r);e=a+e}else if(++t>(n=e.length)){for(a=r,t-=n;--t;a+=r);e+=a}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}i=function e(t){var r,n,a,i,x,S,I,k,C,T,B=z.prototype={constructor:z,toString:null,valueOf:null},M=new z(1),O=20,R=4,N=-7,P=21,L=-1e7,F=1e7,D=!1,U=1,H=0,j={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},V="0123456789abcdefghijklmnopqrstuvwxyz",$=!0;function z(e,t){var r,i,o,d,u,p,b,g,y=this;if(!(y instanceof z))return new z(e,t);if(null==t){if(e&&!0===e._isBigNumber)return y.s=e.s,void(!e.c||e.e>F?y.c=y.e=null:e.e<L?y.c=[y.e=0]:(y.e=e.e,y.c=e.c.slice()));if((p="number"==typeof e)&&0*e==0){if(y.s=1/e<0?(e=-e,-1):1,e===~~e){for(d=0,u=e;u>=10;u/=10,d++);return void(d>F?y.c=y.e=null:(y.e=d,y.c=[e]))}g=String(e)}else{if(!s.test(g=String(e)))return a(y,g,p);y.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(d=g.indexOf("."))>-1&&(g=g.replace(".","")),(u=g.search(/e/i))>0?(d<0&&(d=u),d+=+g.slice(u+1),g=g.substring(0,u)):d<0&&(d=g.length)}else{if(v(t,2,V.length,"Base"),10==t&&$)return J(y=new z(e),O+y.e+1,R);if(g=String(e),p="number"==typeof e){if(0*e!=0)return a(y,g,p,t);if(y.s=1/e<0?(g=g.slice(1),-1):1,z.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(f+e)}else y.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=V.slice(0,t),d=u=0,b=g.length;u<b;u++)if(r.indexOf(i=g.charAt(u))<0){if("."==i){if(u>d){d=b;continue}}else if(!o&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){o=!0,u=-1,d=0;continue}return a(y,String(e),p,t)}p=!1,(d=(g=n(g,t,10,y.s)).indexOf("."))>-1?g=g.replace(".",""):d=g.length}for(u=0;48===g.charCodeAt(u);u++);for(b=g.length;48===g.charCodeAt(--b););if(g=g.slice(u,++b)){if(b-=u,p&&z.DEBUG&&b>15&&(e>h||e!==c(e)))throw Error(f+y.s*e);if((d=d-u-1)>F)y.c=y.e=null;else if(d<L)y.c=[y.e=0];else{if(y.e=d,y.c=[],u=(d+1)%l,d<0&&(u+=l),u<b){for(u&&y.c.push(+g.slice(0,u)),b-=l;u<b;)y.c.push(+g.slice(u,u+=l));u=l-(g=g.slice(u)).length}else u-=b;for(;u--;g+="0");y.c.push(+g)}}else y.c=[y.e=0]}function q(e,t,r,n){var a,i,s,o,c;if(null==r?r=R:v(r,0,8),!e.c)return e.toString();if(a=e.c[0],s=e.e,null==t)c=m(e.c),c=1==n||2==n&&(s<=N||s>=P)?A(c,s):_(c,s,"0");else if(i=(e=J(new z(e),t,r)).e,o=(c=m(e.c)).length,1==n||2==n&&(t<=i||i<=N)){for(;o<t;c+="0",o++);c=A(c,i)}else if(t-=s,c=_(c,i,"0"),i+1>o){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=i-o)>0)for(i+1==o&&(c+=".");t--;c+="0");return e.s<0&&a?"-"+c:c}function K(e,t){for(var r,n,a=1,i=new z(e[0]);a<e.length;a++)(!(n=new z(e[a])).s||(r=w(i,n))===t||0===r&&i.s===t)&&(i=n);return i}function G(e,t,r){for(var n=1,a=t.length;!t[--a];t.pop());for(a=t[0];a>=10;a/=10,n++);return(r=n+r*l-1)>F?e.c=e.e=null:r<L?e.c=[e.e=0]:(e.e=r,e.c=t),e}function J(e,t,r,n){var a,i,s,d,f,h,b,g=e.c,y=p;if(g){e:{for(a=1,d=g[0];d>=10;d/=10,a++);if((i=t-a)<0)i+=l,s=t,f=g[h=0],b=c(f/y[a-s-1]%10);else if((h=o((i+1)/l))>=g.length){if(!n)break e;for(;g.length<=h;g.push(0));f=b=0,a=1,s=(i%=l)-l+1}else{for(f=d=g[h],a=1;d>=10;d/=10,a++);b=(s=(i%=l)-l+a)<0?0:c(f/y[a-s-1]%10)}if(n=n||t<0||null!=g[h+1]||(s<0?f:f%y[a-s-1]),n=r<4?(b||n)&&(0==r||r==(e.s<0?3:2)):b>5||5==b&&(4==r||n||6==r&&(i>0?s>0?f/y[a-s]:0:g[h-1])%10&1||r==(e.s<0?8:7)),t<1||!g[0])return g.length=0,n?(t-=e.e+1,g[0]=y[(l-t%l)%l],e.e=-t||0):g[0]=e.e=0,e;if(0==i?(g.length=h,d=1,h--):(g.length=h+1,d=y[l-i],g[h]=s>0?c(f/y[a-s]%y[s])*d:0),n)for(;;){if(0==h){for(i=1,s=g[0];s>=10;s/=10,i++);for(s=g[0]+=d,d=1;s>=10;s/=10,d++);i!=d&&(e.e++,g[0]==u&&(g[0]=1));break}if(g[h]+=d,g[h]!=u)break;g[h--]=0,d=1}for(i=g.length;0===g[--i];g.pop());}e.e>F?e.c=e.e=null:e.e<L&&(e.c=[e.e=0])}return e}function W(e){var t,r=e.e;return null===r?e.toString():(t=m(e.c),t=r<=N||r>=P?A(t,r):_(t,r,"0"),e.s<0?"-"+t:t)}return z.clone=e,z.ROUND_UP=0,z.ROUND_DOWN=1,z.ROUND_CEIL=2,z.ROUND_FLOOR=3,z.ROUND_HALF_UP=4,z.ROUND_HALF_DOWN=5,z.ROUND_HALF_EVEN=6,z.ROUND_HALF_CEIL=7,z.ROUND_HALF_FLOOR=8,z.EUCLID=9,z.config=z.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(d+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(v(r=e[t],0,g,t),O=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(v(r=e[t],0,8,t),R=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(v(r[0],-g,0,t),v(r[1],0,g,t),N=r[0],P=r[1]):(v(r,-g,g,t),N=-(P=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)v(r[0],-g,-1,t),v(r[1],1,g,t),L=r[0],F=r[1];else{if(v(r,-g,g,t),!r)throw Error(d+t+" cannot be zero: "+r);L=-(F=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(d+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw D=!r,Error(d+"crypto unavailable");D=r}else D=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(v(r=e[t],0,9,t),U=r),e.hasOwnProperty(t="POW_PRECISION")&&(v(r=e[t],0,g,t),H=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(d+t+" not an object: "+r);j=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(d+t+" invalid: "+r);$="0123456789"==r.slice(0,10),V=r}}return{DECIMAL_PLACES:O,ROUNDING_MODE:R,EXPONENTIAL_AT:[N,P],RANGE:[L,F],CRYPTO:D,MODULO_MODE:U,POW_PRECISION:H,FORMAT:j,ALPHABET:V}},z.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!z.DEBUG)return!0;var t,r,n=e.c,a=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===i||-1===i)&&a>=-g&&a<=g&&a===c(a)){if(0===n[0]){if(0===a&&1===n.length)return!0;break e}if((t=(a+1)%l)<1&&(t+=l),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=u||r!==c(r))break e;if(0!==r)return!0}}}else if(null===n&&null===a&&(null===i||1===i||-1===i))return!0;throw Error(d+"Invalid BigNumber: "+e)},z.maximum=z.max=function(){return K(arguments,-1)},z.minimum=z.min=function(){return K(arguments,1)},z.random=(i=9007199254740992,x=Math.random()*i&2097151?function(){return c(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,a,i,s=0,f=[],u=new z(M);if(null==e?e=O:v(e,0,g),a=o(e/l),D)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(a*=2));s<a;)(i=131072*t[s]+(t[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(f.push(i%1e14),s+=2);s=a/2}else{if(!crypto.randomBytes)throw D=!1,Error(d+"crypto unavailable");for(t=crypto.randomBytes(a*=7);s<a;)(i=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(f.push(i%1e14),s+=7);s=a/7}if(!D)for(;s<a;)(i=x())<9e15&&(f[s++]=i%1e14);for(a=f[--s],e%=l,a&&e&&(i=p[l-e],f[s]=c(a/i)*i);0===f[s];f.pop(),s--);if(s<0)f=[n=0];else{for(n=-1;0===f[0];f.splice(0,1),n-=l);for(s=1,i=f[0];i>=10;i/=10,s++);s<l&&(n-=l-s)}return u.e=n,u.c=f,u}),z.sum=function(){for(var e=1,t=arguments,r=new z(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){var e="0123456789";function t(e,t,r,n){for(var a,i,s=[0],o=0,c=e.length;o<c;){for(i=s.length;i--;s[i]*=t);for(s[0]+=n.indexOf(e.charAt(o++)),a=0;a<s.length;a++)s[a]>r-1&&(null==s[a+1]&&(s[a+1]=0),s[a+1]+=s[a]/r|0,s[a]%=r)}return s.reverse()}return function(n,a,i,s,o){var c,d,f,u,l,h,p,b,g=n.indexOf("."),y=O,w=R;for(g>=0&&(u=H,H=0,n=n.replace(".",""),h=(b=new z(a)).pow(n.length-g),H=u,b.c=t(_(m(h.c),h.e,"0"),10,i,e),b.e=b.c.length),f=u=(p=t(n,a,i,o?(c=V,e):(c=e,V))).length;0==p[--u];p.pop());if(!p[0])return c.charAt(0);if(g<0?--f:(h.c=p,h.e=f,h.s=s,p=(h=r(h,b,y,w,i)).c,l=h.r,f=h.e),g=p[d=f+y+1],u=i/2,l=l||d<0||null!=p[d+1],l=w<4?(null!=g||l)&&(0==w||w==(h.s<0?3:2)):g>u||g==u&&(4==w||l||6==w&&1&p[d-1]||w==(h.s<0?8:7)),d<1||!p[0])n=l?_(c.charAt(1),-y,c.charAt(0)):c.charAt(0);else{if(p.length=d,l)for(--i;++p[--d]>i;)p[d]=0,d||(++f,p=[1].concat(p));for(u=p.length;!p[--u];);for(g=0,n="";g<=u;n+=c.charAt(p[g++]));n=_(n,f,c.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,a,i,s,o=0,c=e.length,d=t%b,f=t/b|0;for(e=e.slice();c--;)o=((a=d*(i=e[c]%b)+(n=f*i+(s=e[c]/b|0)*d)%b*b+o)/r|0)+(n/b|0)+f*s,e[c]=a%r;return o&&(e=[o].concat(e)),e}function t(e,t,r,n){var a,i;if(r!=n)i=r>n?1:-1;else for(a=i=0;a<r;a++)if(e[a]!=t[a]){i=e[a]>t[a]?1:-1;break}return i}function r(e,t,r,n){for(var a=0;r--;)e[r]-=a,a=e[r]<t[r]?1:0,e[r]=a*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,a,i,s,o){var d,f,h,p,b,g,m,w,v,E,A,_,x,S,I,k,C,T=n.s==a.s?1:-1,B=n.c,M=a.c;if(!(B&&B[0]&&M&&M[0]))return new z(n.s&&a.s&&(B?!M||B[0]!=M[0]:M)?B&&0==B[0]||!M?0*T:T/0:NaN);for(v=(w=new z(T)).c=[],T=i+(f=n.e-a.e)+1,o||(o=u,f=y(n.e/l)-y(a.e/l),T=T/l|0),h=0;M[h]==(B[h]||0);h++);if(M[h]>(B[h]||0)&&f--,T<0)v.push(1),p=!0;else{for(S=B.length,k=M.length,h=0,T+=2,(b=c(o/(M[0]+1)))>1&&(M=e(M,b,o),B=e(B,b,o),k=M.length,S=B.length),x=k,A=(E=B.slice(0,k)).length;A<k;E[A++]=0);C=M.slice(),C=[0].concat(C),I=M[0],M[1]>=o/2&&I++;do{if(b=0,(d=t(M,E,k,A))<0){if(_=E[0],k!=A&&(_=_*o+(E[1]||0)),(b=c(_/I))>1)for(b>=o&&(b=o-1),m=(g=e(M,b,o)).length,A=E.length;1==t(g,E,m,A);)b--,r(g,k<m?C:M,m,o),m=g.length,d=1;else 0==b&&(d=b=1),m=(g=M.slice()).length;if(m<A&&(g=[0].concat(g)),r(E,g,A,o),A=E.length,-1==d)for(;t(M,E,k,A)<1;)b++,r(E,k<A?C:M,A,o),A=E.length}else 0===d&&(b++,E=[0]);v[h++]=b,E[0]?E[A++]=B[x]||0:(E=[B[x]],A=1)}while((x++<S||null!=E[0])&&T--);p=null!=E[0],v[0]||v.splice(0,1)}if(o==u){for(h=1,T=v[0];T>=10;T/=10,h++);J(w,i+(w.e=h+f*l-1)+1,s,p)}else w.e=f,w.r=+p;return w}}(),S=/^(-?)0([xbo])(?=\w[\w.]*$)/i,I=/^([^.]+)\.$/,k=/^\.([^.]+)$/,C=/^-?(Infinity|NaN)$/,T=/^\s*\+(?=[\w.])|^\s+|\s+$/g,a=function(e,t,r,n){var a,i=r?t:t.replace(T,"");if(C.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!r&&(i=i.replace(S,(function(e,t,r){return a="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=a?e:t})),n&&(a=n,i=i.replace(I,"$1").replace(k,"0.$1")),t!=i))return new z(i,a);if(z.DEBUG)throw Error(d+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},B.absoluteValue=B.abs=function(){var e=new z(this);return e.s<0&&(e.s=1),e},B.comparedTo=function(e,t){return w(this,new z(e,t))},B.decimalPlaces=B.dp=function(e,t){var r,n,a,i=this;if(null!=e)return v(e,0,g),null==t?t=R:v(t,0,8),J(new z(i),e+i.e+1,t);if(!(r=i.c))return null;if(n=((a=r.length-1)-y(this.e/l))*l,a=r[a])for(;a%10==0;a/=10,n--);return n<0&&(n=0),n},B.dividedBy=B.div=function(e,t){return r(this,new z(e,t),O,R)},B.dividedToIntegerBy=B.idiv=function(e,t){return r(this,new z(e,t),0,1)},B.exponentiatedBy=B.pow=function(e,t){var r,n,a,i,s,f,u,h,p=this;if((e=new z(e)).c&&!e.isInteger())throw Error(d+"Exponent not an integer: "+W(e));if(null!=t&&(t=new z(t)),s=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return h=new z(Math.pow(+W(p),s?e.s*(2-E(e)):+W(e))),t?h.mod(t):h;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new z(NaN);(n=!f&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||s&&p.c[1]>=24e7:p.c[0]<8e13||s&&p.c[0]<=9999975e7)))return i=p.s<0&&E(e)?-0:0,p.e>-1&&(i=1/i),new z(f?1/i:i);H&&(i=o(H/l+2))}for(s?(r=new z(.5),f&&(e.s=1),u=E(e)):u=(a=Math.abs(+W(e)))%2,h=new z(M);;){if(u){if(!(h=h.times(p)).c)break;i?h.c.length>i&&(h.c.length=i):n&&(h=h.mod(t))}if(a){if(0===(a=c(a/2)))break;u=a%2}else if(J(e=e.times(r),e.e+1,1),e.e>14)u=E(e);else{if(0===(a=+W(e)))break;u=a%2}p=p.times(p),i?p.c&&p.c.length>i&&(p.c.length=i):n&&(p=p.mod(t))}return n?h:(f&&(h=M.div(h)),t?h.mod(t):i?J(h,H,R,undefined):h)},B.integerValue=function(e){var t=new z(this);return null==e?e=R:v(e,0,8),J(t,t.e+1,e)},B.isEqualTo=B.eq=function(e,t){return 0===w(this,new z(e,t))},B.isFinite=function(){return!!this.c},B.isGreaterThan=B.gt=function(e,t){return w(this,new z(e,t))>0},B.isGreaterThanOrEqualTo=B.gte=function(e,t){return 1===(t=w(this,new z(e,t)))||0===t},B.isInteger=function(){return!!this.c&&y(this.e/l)>this.c.length-2},B.isLessThan=B.lt=function(e,t){return w(this,new z(e,t))<0},B.isLessThanOrEqualTo=B.lte=function(e,t){return-1===(t=w(this,new z(e,t)))||0===t},B.isNaN=function(){return!this.s},B.isNegative=function(){return this.s<0},B.isPositive=function(){return this.s>0},B.isZero=function(){return!!this.c&&0==this.c[0]},B.minus=function(e,t){var r,n,a,i,s=this,o=s.s;if(t=(e=new z(e,t)).s,!o||!t)return new z(NaN);if(o!=t)return e.s=-t,s.plus(e);var c=s.e/l,d=e.e/l,f=s.c,h=e.c;if(!c||!d){if(!f||!h)return f?(e.s=-t,e):new z(h?s:NaN);if(!f[0]||!h[0])return h[0]?(e.s=-t,e):new z(f[0]?s:3==R?-0:0)}if(c=y(c),d=y(d),f=f.slice(),o=c-d){for((i=o<0)?(o=-o,a=f):(d=c,a=h),a.reverse(),t=o;t--;a.push(0));a.reverse()}else for(n=(i=(o=f.length)<(t=h.length))?o:t,o=t=0;t<n;t++)if(f[t]!=h[t]){i=f[t]<h[t];break}if(i&&(a=f,f=h,h=a,e.s=-e.s),(t=(n=h.length)-(r=f.length))>0)for(;t--;f[r++]=0);for(t=u-1;n>o;){if(f[--n]<h[n]){for(r=n;r&&!f[--r];f[r]=t);--f[r],f[n]+=u}f[n]-=h[n]}for(;0==f[0];f.splice(0,1),--d);return f[0]?G(e,f,d):(e.s=3==R?-1:1,e.c=[e.e=0],e)},B.modulo=B.mod=function(e,t){var n,a,i=this;return e=new z(e,t),!i.c||!e.s||e.c&&!e.c[0]?new z(NaN):!e.c||i.c&&!i.c[0]?new z(i):(9==U?(a=e.s,e.s=1,n=r(i,e,0,3),e.s=a,n.s*=a):n=r(i,e,0,U),(e=i.minus(n.times(e))).c[0]||1!=U||(e.s=i.s),e)},B.multipliedBy=B.times=function(e,t){var r,n,a,i,s,o,c,d,f,h,p,g,m,w,v,E=this,A=E.c,_=(e=new z(e,t)).c;if(!(A&&_&&A[0]&&_[0]))return!E.s||!e.s||A&&!A[0]&&!_||_&&!_[0]&&!A?e.c=e.e=e.s=null:(e.s*=E.s,A&&_?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=y(E.e/l)+y(e.e/l),e.s*=E.s,(c=A.length)<(h=_.length)&&(m=A,A=_,_=m,a=c,c=h,h=a),a=c+h,m=[];a--;m.push(0));for(w=u,v=b,a=h;--a>=0;){for(r=0,p=_[a]%v,g=_[a]/v|0,i=a+(s=c);i>a;)r=((d=p*(d=A[--s]%v)+(o=g*d+(f=A[s]/v|0)*p)%v*v+m[i]+r)/w|0)+(o/v|0)+g*f,m[i--]=d%w;m[i]=r}return r?++n:m.splice(0,1),G(e,m,n)},B.negated=function(){var e=new z(this);return e.s=-e.s||null,e},B.plus=function(e,t){var r,n=this,a=n.s;if(t=(e=new z(e,t)).s,!a||!t)return new z(NaN);if(a!=t)return e.s=-t,n.minus(e);var i=n.e/l,s=e.e/l,o=n.c,c=e.c;if(!i||!s){if(!o||!c)return new z(a/0);if(!o[0]||!c[0])return c[0]?e:new z(o[0]?n:0*a)}if(i=y(i),s=y(s),o=o.slice(),a=i-s){for(a>0?(s=i,r=c):(a=-a,r=o),r.reverse();a--;r.push(0));r.reverse()}for((a=o.length)-(t=c.length)<0&&(r=c,c=o,o=r,t=a),a=0;t;)a=(o[--t]=o[t]+c[t]+a)/u|0,o[t]=u===o[t]?0:o[t]%u;return a&&(o=[a].concat(o),++s),G(e,o,s)},B.precision=B.sd=function(e,t){var r,n,a,i=this;if(null!=e&&e!==!!e)return v(e,1,g),null==t?t=R:v(t,0,8),J(new z(i),e,t);if(!(r=i.c))return null;if(n=(a=r.length-1)*l+1,a=r[a]){for(;a%10==0;a/=10,n--);for(a=r[0];a>=10;a/=10,n++);}return e&&i.e+1>n&&(n=i.e+1),n},B.shiftedBy=function(e){return v(e,-9007199254740991,h),this.times("1e"+e)},B.squareRoot=B.sqrt=function(){var e,t,n,a,i,s=this,o=s.c,c=s.s,d=s.e,f=O+4,u=new z("0.5");if(1!==c||!o||!o[0])return new z(!c||c<0&&(!o||o[0])?NaN:o?s:1/0);if(0==(c=Math.sqrt(+W(s)))||c==1/0?(((t=m(o)).length+d)%2==0&&(t+="0"),c=Math.sqrt(+t),d=y((d+1)/2)-(d<0||d%2),n=new z(t=c==1/0?"5e"+d:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+d)):n=new z(c+""),n.c[0])for((c=(d=n.e)+f)<3&&(c=0);;)if(i=n,n=u.times(i.plus(r(s,i,f,1))),m(i.c).slice(0,c)===(t=m(n.c)).slice(0,c)){if(n.e<d&&--c,"9999"!=(t=t.slice(c-3,c+1))&&(a||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(J(n,n.e+O+2,1),e=!n.times(n).eq(s));break}if(!a&&(J(i,i.e+O+2,0),i.times(i).eq(s))){n=i;break}f+=4,c+=4,a=1}return J(n,n.e+O+1,R,e)},B.toExponential=function(e,t){return null!=e&&(v(e,0,g),e++),q(this,e,t,1)},B.toFixed=function(e,t){return null!=e&&(v(e,0,g),e=e+this.e+1),q(this,e,t)},B.toFormat=function(e,t,r){var n,a=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=j;else if("object"!=typeof r)throw Error(d+"Argument not an object: "+r);if(n=a.toFixed(e,t),a.c){var i,s=n.split("."),o=+r.groupSize,c=+r.secondaryGroupSize,f=r.groupSeparator||"",u=s[0],l=s[1],h=a.s<0,p=h?u.slice(1):u,b=p.length;if(c&&(i=o,o=c,c=i,b-=i),o>0&&b>0){for(i=b%o||o,u=p.substr(0,i);i<b;i+=o)u+=f+p.substr(i,o);c>0&&(u+=f+p.slice(i)),h&&(u="-"+u)}n=l?u+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?l.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):l):u}return(r.prefix||"")+n+(r.suffix||"")},B.toFraction=function(e){var t,n,a,i,s,o,c,f,u,h,b,g,y=this,w=y.c;if(null!=e&&(!(c=new z(e)).isInteger()&&(c.c||1!==c.s)||c.lt(M)))throw Error(d+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+W(c));if(!w)return new z(y);for(t=new z(M),u=n=new z(M),a=f=new z(M),g=m(w),s=t.e=g.length-y.e-1,t.c[0]=p[(o=s%l)<0?l+o:o],e=!e||c.comparedTo(t)>0?s>0?t:u:c,o=F,F=1/0,c=new z(g),f.c[0]=0;h=r(c,t,0,1),1!=(i=n.plus(h.times(a))).comparedTo(e);)n=a,a=i,u=f.plus(h.times(i=u)),f=i,t=c.minus(h.times(i=t)),c=i;return i=r(e.minus(n),a,0,1),f=f.plus(i.times(u)),n=n.plus(i.times(a)),f.s=u.s=y.s,b=r(u,a,s*=2,R).minus(y).abs().comparedTo(r(f,n,s,R).minus(y).abs())<1?[u,a]:[f,n],F=o,b},B.toNumber=function(){return+W(this)},B.toPrecision=function(e,t){return null!=e&&v(e,1,g),q(this,e,t,2)},B.toString=function(e){var t,r=this,a=r.s,i=r.e;return null===i?a?(t="Infinity",a<0&&(t="-"+t)):t="NaN":(null==e?t=i<=N||i>=P?A(m(r.c),i):_(m(r.c),i,"0"):10===e&&$?t=_(m((r=J(new z(r),O+i+1,R)).c),r.e,"0"):(v(e,2,V.length,"Base"),t=n(_(m(r.c),i,"0"),10,e,a,!0)),a<0&&r.c[0]&&(t="-"+t)),t},B.valueOf=B.toJSON=function(){return W(this)},B._isBigNumber=!0,null!=t&&z.set(t),z}(),i.default=i.BigNumber=i,void 0===(n=function(){return i}.call(t,r,t,e))||(e.exports=n)}()},7784:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},9042:(e,t)=>{"use strict";var r=t;function n(e){return 1===e.length?"0"+e:e}function a(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var a=e.charCodeAt(n),i=a>>8,s=255&a;i?r.push(i,s):r.push(s)}return r},r.zero2=n,r.toHex=a,r.encode=function(e,t){return"hex"===t?a(e):e}},3432:function(e){"use strict";!function(t){const r=2147483647;function n(e){const t=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]);let r=1779033703,n=3144134277,a=1013904242,i=2773480762,s=1359893119,o=2600822924,c=528734635,d=1541459225;const f=new Uint32Array(64);function u(e){let u=0,l=e.length;for(;l>=64;){let h,p,b,g,y,m=r,w=n,v=a,E=i,A=s,_=o,x=c,S=d;for(p=0;p<16;p++)b=u+4*p,f[p]=(255&e[b])<<24|(255&e[b+1])<<16|(255&e[b+2])<<8|255&e[b+3];for(p=16;p<64;p++)h=f[p-2],g=(h>>>17|h<<15)^(h>>>19|h<<13)^h>>>10,h=f[p-15],y=(h>>>7|h<<25)^(h>>>18|h<<14)^h>>>3,f[p]=(g+f[p-7]|0)+(y+f[p-16]|0)|0;for(p=0;p<64;p++)g=(((A>>>6|A<<26)^(A>>>11|A<<21)^(A>>>25|A<<7))+(A&_^~A&x)|0)+(S+(t[p]+f[p]|0)|0)|0,y=((m>>>2|m<<30)^(m>>>13|m<<19)^(m>>>22|m<<10))+(m&w^m&v^w&v)|0,S=x,x=_,_=A,A=E+g|0,E=v,v=w,w=m,m=g+y|0;r=r+m|0,n=n+w|0,a=a+v|0,i=i+E|0,s=s+A|0,o=o+_|0,c=c+x|0,d=d+S|0,u+=64,l-=64}}u(e);let l,h=e.length%64,p=e.length/536870912|0,b=e.length<<3,g=h<56?56:120,y=e.slice(e.length-h,e.length);for(y.push(128),l=h+1;l<g;l++)y.push(0);return y.push(p>>>24&255),y.push(p>>>16&255),y.push(p>>>8&255),y.push(p>>>0&255),y.push(b>>>24&255),y.push(b>>>16&255),y.push(b>>>8&255),y.push(b>>>0&255),u(y),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255,d>>>24&255,d>>>16&255,d>>>8&255,d>>>0&255]}function a(e,t,r){e=e.length<=64?e:n(e);const a=64+t.length+4,i=new Array(a),s=new Array(64);let o,c=[];for(o=0;o<64;o++)i[o]=54;for(o=0;o<e.length;o++)i[o]^=e[o];for(o=0;o<t.length;o++)i[64+o]=t[o];for(o=a-4;o<a;o++)i[o]=0;for(o=0;o<64;o++)s[o]=92;for(o=0;o<e.length;o++)s[o]^=e[o];function d(){for(let e=a-1;e>=a-4;e--){if(i[e]++,i[e]<=255)return;i[e]=0}}for(;r>=32;)d(),c=c.concat(n(s.concat(n(i)))),r-=32;return r>0&&(d(),c=c.concat(n(s.concat(n(i))).slice(0,r))),c}function i(e,t,r,n,a){let i;for(d(e,16*(2*r-1),a,0,16),i=0;i<2*r;i++)c(e,16*i,a,16),o(a,n),d(a,0,e,t+16*i,16);for(i=0;i<r;i++)d(e,t+2*i*16,e,16*i,16);for(i=0;i<r;i++)d(e,t+16*(2*i+1),e,16*(i+r),16)}function s(e,t){return e<<t|e>>>32-t}function o(e,t){d(e,0,t,0,16);for(let e=8;e>0;e-=2)t[4]^=s(t[0]+t[12],7),t[8]^=s(t[4]+t[0],9),t[12]^=s(t[8]+t[4],13),t[0]^=s(t[12]+t[8],18),t[9]^=s(t[5]+t[1],7),t[13]^=s(t[9]+t[5],9),t[1]^=s(t[13]+t[9],13),t[5]^=s(t[1]+t[13],18),t[14]^=s(t[10]+t[6],7),t[2]^=s(t[14]+t[10],9),t[6]^=s(t[2]+t[14],13),t[10]^=s(t[6]+t[2],18),t[3]^=s(t[15]+t[11],7),t[7]^=s(t[3]+t[15],9),t[11]^=s(t[7]+t[3],13),t[15]^=s(t[11]+t[7],18),t[1]^=s(t[0]+t[3],7),t[2]^=s(t[1]+t[0],9),t[3]^=s(t[2]+t[1],13),t[0]^=s(t[3]+t[2],18),t[6]^=s(t[5]+t[4],7),t[7]^=s(t[6]+t[5],9),t[4]^=s(t[7]+t[6],13),t[5]^=s(t[4]+t[7],18),t[11]^=s(t[10]+t[9],7),t[8]^=s(t[11]+t[10],9),t[9]^=s(t[8]+t[11],13),t[10]^=s(t[9]+t[8],18),t[12]^=s(t[15]+t[14],7),t[13]^=s(t[12]+t[15],9),t[14]^=s(t[13]+t[12],13),t[15]^=s(t[14]+t[13],18);for(let r=0;r<16;++r)e[r]+=t[r]}function c(e,t,r,n){for(let a=0;a<n;a++)r[a]^=e[t+a]}function d(e,t,r,n,a){for(;a--;)r[n++]=e[t++]}function f(e){if(!e||"number"!=typeof e.length)return!1;for(let t=0;t<e.length;t++){const r=e[t];if("number"!=typeof r||r%1||r<0||r>=256)return!1}return!0}function u(e,t){if("number"!=typeof e||e%1)throw new Error("invalid "+t);return e}function l(e,t,n,s,o,l,h){if(n=u(n,"N"),s=u(s,"r"),o=u(o,"p"),l=u(l,"dkLen"),0===n||n&n-1)throw new Error("N must be power of 2");if(n>r/128/s)throw new Error("N too large");if(s>r/128/o)throw new Error("r too large");if(!f(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!f(t))throw new Error("salt must be an array or buffer");t=Array.prototype.slice.call(t);let p=a(e,t,128*o*s);const b=new Uint32Array(32*o*s);for(let e=0;e<b.length;e++){const t=4*e;b[e]=(255&p[t+3])<<24|(255&p[t+2])<<16|(255&p[t+1])<<8|255&p[t+0]}const g=new Uint32Array(64*s),y=new Uint32Array(32*s*n),m=32*s,w=new Uint32Array(16),v=new Uint32Array(16),E=o*n*2;let A,_,x=0,S=null,I=!1,k=0,C=0;const T=h?parseInt(1e3/s):4294967295,B="undefined"!=typeof setImmediate?setImmediate:setTimeout,M=function(){if(I)return h(new Error("cancelled"),x/E);let t;switch(k){case 0:_=32*C*s,d(b,_,g,0,m),k=1,A=0;case 1:t=n-A,t>T&&(t=T);for(let e=0;e<t;e++)d(g,0,y,(A+e)*m,m),i(g,m,s,w,v);if(A+=t,x+=t,h){const e=parseInt(1e3*x/E);if(e!==S){if(I=h(null,x/E),I)break;S=e}}if(A<n)break;A=0,k=2;case 2:t=n-A,t>T&&(t=T);for(let e=0;e<t;e++){const e=g[16*(2*s-1)]&n-1;c(y,e*m,g,m),i(g,m,s,w,v)}if(A+=t,x+=t,h){const e=parseInt(1e3*x/E);if(e!==S){if(I=h(null,x/E),I)break;S=e}}if(A<n)break;if(d(g,0,b,_,m),C++,C<o){k=0;break}p=[];for(let e=0;e<b.length;e++)p.push(255&b[e]),p.push(b[e]>>8&255),p.push(b[e]>>16&255),p.push(b[e]>>24&255);const r=a(e,p,l);return h&&h(null,1,r),r}h&&B(M)};if(!h)for(;;){const e=M();if(null!=e)return e}M()}const h={scrypt:function(e,t,r,n,a,i,s){return new Promise((function(o,c){let d=0;s&&s(0),l(e,t,r,n,a,i,(function(e,t,r){if(e)c(e);else if(r)s&&1!==d&&s(1),o(new Uint8Array(r));else if(s&&t!==d)return d=t,s(t)}))}))},syncScrypt:function(e,t,r,n,a,i){return new Uint8Array(l(e,t,r,n,a,i))}};e.exports=h}()},1565:(e,t,r)=>{const n=Symbol("SemVer ANY");class a{static get ANY(){return n}constructor(e,t){if(t=i(t),e instanceof a){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),d("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,d("comp",this)}parse(e){const t=this.options.loose?s[o.COMPARATORLOOSE]:s[o.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new f(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(d("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new f(e,this.options)}catch(e){return!1}return c(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof a))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new u(e.value,t).test(this.value):""===e.operator?""===e.value||new u(this.value,t).test(e.semver):(!(t=i(t)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(c(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(c(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}e.exports=a;const i=r(3990),{safeRe:s,t:o}=r(2841),c=r(4004),d=r(1361),f=r(4517),u=r(7476)},7476:(e,t,r)=>{class n{constructor(e,t){if(t=i(t),e instanceof n)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new n(e.raw,t);if(e instanceof s)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!g(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&p)|(this.options.loose&&b))+":"+e,r=a.get(t);if(r)return r;const n=this.options.loose,i=n?d[f.HYPHENRANGELOOSE]:d[f.HYPHENRANGE];e=e.replace(i,T(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(d[f.COMPARATORTRIM],u),o("comparator trim",e),e=e.replace(d[f.TILDETRIM],l),o("tilde trim",e),e=e.replace(d[f.CARETTRIM],h),o("caret trim",e);let c=e.split(" ").map((e=>w(e,this.options))).join(" ").split(/\s+/).map((e=>C(e,this.options)));n&&(c=c.filter((e=>(o("loose invalid filter",e,this.options),!!e.match(d[f.COMPARATORLOOSE]))))),o("range list",c);const y=new Map,m=c.map((e=>new s(e,this.options)));for(const e of m){if(g(e))return[e];y.set(e.value,e)}y.size>1&&y.has("")&&y.delete("");const v=[...y.values()];return a.set(t,v),v}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Range is required");return this.set.some((r=>m(r,t)&&e.set.some((e=>m(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(B(this.set[t],e,this.options))return!0;return!1}}e.exports=n;const a=new(r(8953)),i=r(3990),s=r(1565),o=r(1361),c=r(4517),{safeRe:d,t:f,comparatorTrimReplace:u,tildeTrimReplace:l,caretTrimReplace:h}=r(2841),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:b}=r(9543),g=e=>"<0.0.0-0"===e.value,y=e=>""===e.value,m=(e,t)=>{let r=!0;const n=e.slice();let a=n.pop();for(;r&&n.length;)r=n.every((e=>a.intersects(e,t))),a=n.pop();return r},w=(e,t)=>(o("comp",e,t),e=_(e,t),o("caret",e),e=E(e,t),o("tildes",e),e=S(e,t),o("xrange",e),e=k(e,t),o("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,E=(e,t)=>e.trim().split(/\s+/).map((e=>A(e,t))).join(" "),A=(e,t)=>{const r=t.loose?d[f.TILDELOOSE]:d[f.TILDE];return e.replace(r,((t,r,n,a,i)=>{let s;return o("tilde",e,t,r,n,a,i),v(r)?s="":v(n)?s=`>=${r}.0.0 <${+r+1}.0.0-0`:v(a)?s=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:i?(o("replaceTilde pr",i),s=`>=${r}.${n}.${a}-${i} <${r}.${+n+1}.0-0`):s=`>=${r}.${n}.${a} <${r}.${+n+1}.0-0`,o("tilde return",s),s}))},_=(e,t)=>e.trim().split(/\s+/).map((e=>x(e,t))).join(" "),x=(e,t)=>{o("caret",e,t);const r=t.loose?d[f.CARETLOOSE]:d[f.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,a,i,s)=>{let c;return o("caret",e,t,r,a,i,s),v(r)?c="":v(a)?c=`>=${r}.0.0${n} <${+r+1}.0.0-0`:v(i)?c="0"===r?`>=${r}.${a}.0${n} <${r}.${+a+1}.0-0`:`>=${r}.${a}.0${n} <${+r+1}.0.0-0`:s?(o("replaceCaret pr",s),c="0"===r?"0"===a?`>=${r}.${a}.${i}-${s} <${r}.${a}.${+i+1}-0`:`>=${r}.${a}.${i}-${s} <${r}.${+a+1}.0-0`:`>=${r}.${a}.${i}-${s} <${+r+1}.0.0-0`):(o("no pr"),c="0"===r?"0"===a?`>=${r}.${a}.${i}${n} <${r}.${a}.${+i+1}-0`:`>=${r}.${a}.${i}${n} <${r}.${+a+1}.0-0`:`>=${r}.${a}.${i} <${+r+1}.0.0-0`),o("caret return",c),c}))},S=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map((e=>I(e,t))).join(" ")),I=(e,t)=>{e=e.trim();const r=t.loose?d[f.XRANGELOOSE]:d[f.XRANGE];return e.replace(r,((r,n,a,i,s,c)=>{o("xRange",e,r,n,a,i,s,c);const d=v(a),f=d||v(i),u=f||v(s),l=u;return"="===n&&l&&(n=""),c=t.includePrerelease?"-0":"",d?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&l?(f&&(i=0),s=0,">"===n?(n=">=",f?(a=+a+1,i=0,s=0):(i=+i+1,s=0)):"<="===n&&(n="<",f?a=+a+1:i=+i+1),"<"===n&&(c="-0"),r=`${n+a}.${i}.${s}${c}`):f?r=`>=${a}.0.0${c} <${+a+1}.0.0-0`:u&&(r=`>=${a}.${i}.0${c} <${a}.${+i+1}.0-0`),o("xRange return",r),r}))},k=(e,t)=>(o("replaceStars",e,t),e.trim().replace(d[f.STAR],"")),C=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(d[t.includePrerelease?f.GTE0PRE:f.GTE0],"")),T=e=>(t,r,n,a,i,s,o,c,d,f,u,l)=>`${r=v(n)?"":v(a)?`>=${n}.0.0${e?"-0":""}`:v(i)?`>=${n}.${a}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`} ${c=v(d)?"":v(f)?`<${+d+1}.0.0-0`:v(u)?`<${d}.${+f+1}.0-0`:l?`<=${d}.${f}.${u}-${l}`:e?`<${d}.${f}.${+u+1}-0`:`<=${c}`}`.trim(),B=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(o(e[r].semver),e[r].semver!==s.ANY&&e[r].semver.prerelease.length>0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},4517:(e,t,r)=>{const n=r(1361),{MAX_LENGTH:a,MAX_SAFE_INTEGER:i}=r(9543),{safeRe:s,t:o}=r(2841),c=r(3990),{compareIdentifiers:d}=r(3806);class f{constructor(e,t){if(t=c(t),e instanceof f){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>a)throw new TypeError(`version is longer than ${a} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?s[o.LOOSE]:s[o.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<i)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof f)){if("string"==typeof e&&e===this.version)return 0;e=new f(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof f||(e=new f(e,this.options)),d(this.major,e.major)||d(this.minor,e.minor)||d(this.patch,e.patch)}comparePre(e){if(e instanceof f||(e=new f(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],a=e.prerelease[t];if(n("prerelease compare",t,r,a),void 0===r&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===r)return-1;if(r!==a)return d(r,a)}while(++t)}compareBuild(e){e instanceof f||(e=new f(e,this.options));let t=0;do{const r=this.build[t],a=e.build[t];if(n("build compare",t,r,a),void 0===r&&void 0===a)return 0;if(void 0===a)return 1;if(void 0===r)return-1;if(r!==a)return d(r,a)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===d(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=f},2281:(e,t,r)=>{const n=r(3955);e.exports=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},4004:(e,t,r)=>{const n=r(8848),a=r(8220),i=r(9761),s=r(2386),o=r(1262),c=r(9639);e.exports=(e,t,r,d)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,d);case"!=":return a(e,r,d);case">":return i(e,r,d);case">=":return s(e,r,d);case"<":return o(e,r,d);case"<=":return c(e,r,d);default:throw new TypeError(`Invalid operator: ${t}`)}}},6783:(e,t,r)=>{const n=r(4517),a=r(3955),{safeRe:i,t:s}=r(2841);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){const n=t.includePrerelease?i[s.COERCERTLFULL]:i[s.COERCERTL];let a;for(;(a=n.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&a.index+a[0].length===r.index+r[0].length||(r=a),n.lastIndex=a.index+a[1].length+a[2].length;n.lastIndex=-1}else r=e.match(t.includePrerelease?i[s.COERCEFULL]:i[s.COERCE]);if(null===r)return null;const o=r[2],c=r[3]||"0",d=r[4]||"0",f=t.includePrerelease&&r[5]?`-${r[5]}`:"",u=t.includePrerelease&&r[6]?`+${r[6]}`:"";return a(`${o}.${c}.${d}${f}${u}`,t)}},6106:(e,t,r)=>{const n=r(4517);e.exports=(e,t,r)=>{const a=new n(e,r),i=new n(t,r);return a.compare(i)||a.compareBuild(i)}},2132:(e,t,r)=>{const n=r(7851);e.exports=(e,t)=>n(e,t,!0)},7851:(e,t,r)=>{const n=r(4517);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},3269:(e,t,r)=>{const n=r(3955);e.exports=(e,t)=>{const r=n(e,null,!0),a=n(t,null,!0),i=r.compare(a);if(0===i)return null;const s=i>0,o=s?r:a,c=s?a:r,d=!!o.prerelease.length;if(!!c.prerelease.length&&!d)return c.patch||c.minor?o.patch?"patch":o.minor?"minor":"major":"major";const f=d?"pre":"";return r.major!==a.major?f+"major":r.minor!==a.minor?f+"minor":r.patch!==a.patch?f+"patch":"prerelease"}},8848:(e,t,r)=>{const n=r(7851);e.exports=(e,t,r)=>0===n(e,t,r)},9761:(e,t,r)=>{const n=r(7851);e.exports=(e,t,r)=>n(e,t,r)>0},2386:(e,t,r)=>{const n=r(7851);e.exports=(e,t,r)=>n(e,t,r)>=0},8868:(e,t,r)=>{const n=r(4517);e.exports=(e,t,r,a,i)=>{"string"==typeof r&&(i=a,a=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,a,i).version}catch(e){return null}}},1262:(e,t,r)=>{const n=r(7851);e.exports=(e,t,r)=>n(e,t,r)<0},9639:(e,t,r)=>{const n=r(7851);e.exports=(e,t,r)=>n(e,t,r)<=0},6381:(e,t,r)=>{const n=r(4517);e.exports=(e,t)=>new n(e,t).major},1353:(e,t,r)=>{const n=r(4517);e.exports=(e,t)=>new n(e,t).minor},8220:(e,t,r)=>{const n=r(7851);e.exports=(e,t,r)=>0!==n(e,t,r)},3955:(e,t,r)=>{const n=r(4517);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},6082:(e,t,r)=>{const n=r(4517);e.exports=(e,t)=>new n(e,t).patch},9428:(e,t,r)=>{const n=r(3955);e.exports=(e,t)=>{const r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},7555:(e,t,r)=>{const n=r(7851);e.exports=(e,t,r)=>n(t,e,r)},3810:(e,t,r)=>{const n=r(6106);e.exports=(e,t)=>e.sort(((e,r)=>n(r,e,t)))},7229:(e,t,r)=>{const n=r(7476);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},4042:(e,t,r)=>{const n=r(6106);e.exports=(e,t)=>e.sort(((e,r)=>n(e,r,t)))},8474:(e,t,r)=>{const n=r(3955);e.exports=(e,t)=>{const r=n(e,t);return r?r.version:null}},2722:(e,t,r)=>{const n=r(2841),a=r(9543),i=r(4517),s=r(3806),o=r(3955),c=r(8474),d=r(2281),f=r(8868),u=r(3269),l=r(6381),h=r(1353),p=r(6082),b=r(9428),g=r(7851),y=r(7555),m=r(2132),w=r(6106),v=r(4042),E=r(3810),A=r(9761),_=r(1262),x=r(8848),S=r(8220),I=r(2386),k=r(9639),C=r(4004),T=r(6783),B=r(1565),M=r(7476),O=r(7229),R=r(6364),N=r(5039),P=r(5357),L=r(1280),F=r(7403),D=r(8854),U=r(7226),H=r(7183),j=r(8623),V=r(6486),$=r(583);e.exports={parse:o,valid:c,clean:d,inc:f,diff:u,major:l,minor:h,patch:p,prerelease:b,compare:g,rcompare:y,compareLoose:m,compareBuild:w,sort:v,rsort:E,gt:A,lt:_,eq:x,neq:S,gte:I,lte:k,cmp:C,coerce:T,Comparator:B,Range:M,satisfies:O,toComparators:R,maxSatisfying:N,minSatisfying:P,minVersion:L,validRange:F,outside:D,gtr:U,ltr:H,intersects:j,simplifyRange:V,subset:$,SemVer:i,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:a.SEMVER_SPEC_VERSION,RELEASE_TYPES:a.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers}},9543:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},1361:e=>{const t="object"==typeof process&&process.env&&/\bsemver\b/i.test("false")?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},3806:e=>{const t=/^[0-9]+$/,r=(e,r)=>{const n=t.test(e),a=t.test(r);return n&&a&&(e=+e,r=+r),e===r?0:n&&!a?-1:a&&!n?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},8953:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},3990:e=>{const t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},2841:(e,t,r)=>{const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:a,MAX_LENGTH:i}=r(9543),s=r(1361),o=(t=e.exports={}).re=[],c=t.safeRe=[],d=t.src=[],f=t.t={};let u=0;const l="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",i],[l,a]],p=(e,t,r)=>{const n=(e=>{for(const[t,r]of h)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),a=u++;s(e,a,t),f[e]=a,d[a]=t,o[a]=new RegExp(t,r?"g":void 0),c[a]=new RegExp(n,r?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${l}*`),p("MAINVERSION",`(${d[f.NUMERICIDENTIFIER]})\\.(${d[f.NUMERICIDENTIFIER]})\\.(${d[f.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${d[f.NUMERICIDENTIFIERLOOSE]})\\.(${d[f.NUMERICIDENTIFIERLOOSE]})\\.(${d[f.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${d[f.NUMERICIDENTIFIER]}|${d[f.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${d[f.NUMERICIDENTIFIERLOOSE]}|${d[f.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${d[f.PRERELEASEIDENTIFIER]}(?:\\.${d[f.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${d[f.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${d[f.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${l}+`),p("BUILD",`(?:\\+(${d[f.BUILDIDENTIFIER]}(?:\\.${d[f.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${d[f.MAINVERSION]}${d[f.PRERELEASE]}?${d[f.BUILD]}?`),p("FULL",`^${d[f.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${d[f.MAINVERSIONLOOSE]}${d[f.PRERELEASELOOSE]}?${d[f.BUILD]}?`),p("LOOSE",`^${d[f.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${d[f.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${d[f.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${d[f.XRANGEIDENTIFIER]})(?:\\.(${d[f.XRANGEIDENTIFIER]})(?:\\.(${d[f.XRANGEIDENTIFIER]})(?:${d[f.PRERELEASE]})?${d[f.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${d[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[f.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[f.XRANGEIDENTIFIERLOOSE]})(?:${d[f.PRERELEASELOOSE]})?${d[f.BUILD]}?)?)?`),p("XRANGE",`^${d[f.GTLT]}\\s*${d[f.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${d[f.GTLT]}\\s*${d[f.XRANGEPLAINLOOSE]}$`),p("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),p("COERCE",`${d[f.COERCEPLAIN]}(?:$|[^\\d])`),p("COERCEFULL",d[f.COERCEPLAIN]+`(?:${d[f.PRERELEASE]})?`+`(?:${d[f.BUILD]})?(?:$|[^\\d])`),p("COERCERTL",d[f.COERCE],!0),p("COERCERTLFULL",d[f.COERCEFULL],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${d[f.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${d[f.LONETILDE]}${d[f.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${d[f.LONETILDE]}${d[f.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${d[f.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${d[f.LONECARET]}${d[f.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${d[f.LONECARET]}${d[f.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${d[f.GTLT]}\\s*(${d[f.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${d[f.GTLT]}\\s*(${d[f.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${d[f.GTLT]}\\s*(${d[f.LOOSEPLAIN]}|${d[f.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${d[f.XRANGEPLAIN]})\\s+-\\s+(${d[f.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${d[f.XRANGEPLAINLOOSE]})\\s+-\\s+(${d[f.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},7226:(e,t,r)=>{const n=r(8854);e.exports=(e,t,r)=>n(e,t,">",r)},8623:(e,t,r)=>{const n=r(7476);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))},7183:(e,t,r)=>{const n=r(8854);e.exports=(e,t,r)=>n(e,t,"<",r)},5039:(e,t,r)=>{const n=r(4517),a=r(7476);e.exports=(e,t,r)=>{let i=null,s=null,o=null;try{o=new a(t,r)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(i&&-1!==s.compare(e)||(i=e,s=new n(i,r)))})),i}},5357:(e,t,r)=>{const n=r(4517),a=r(7476);e.exports=(e,t,r)=>{let i=null,s=null,o=null;try{o=new a(t,r)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(i&&1!==s.compare(e)||(i=e,s=new n(i,r)))})),i}},1280:(e,t,r)=>{const n=r(4517),a=r(7476),i=r(9761);e.exports=(e,t)=>{e=new a(e,t);let r=new n("0.0.0");if(e.test(r))return r;if(r=new n("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const a=e.set[t];let s=null;a.forEach((e=>{const t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":s&&!i(t,s)||(s=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!s||r&&!i(r,s)||(r=s)}return r&&e.test(r)?r:null}},8854:(e,t,r)=>{const n=r(4517),a=r(1565),{ANY:i}=a,s=r(7476),o=r(7229),c=r(9761),d=r(1262),f=r(9639),u=r(2386);e.exports=(e,t,r,l)=>{let h,p,b,g,y;switch(e=new n(e,l),t=new s(t,l),r){case">":h=c,p=f,b=d,g=">",y=">=";break;case"<":h=d,p=u,b=c,g="<",y="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(e,t,l))return!1;for(let r=0;r<t.set.length;++r){const n=t.set[r];let s=null,o=null;if(n.forEach((e=>{e.semver===i&&(e=new a(">=0.0.0")),s=s||e,o=o||e,h(e.semver,s.semver,l)?s=e:b(e.semver,o.semver,l)&&(o=e)})),s.operator===g||s.operator===y)return!1;if((!o.operator||o.operator===g)&&p(e,o.semver))return!1;if(o.operator===y&&b(e,o.semver))return!1}return!0}},6486:(e,t,r)=>{const n=r(7229),a=r(7851);e.exports=(e,t,r)=>{const i=[];let s=null,o=null;const c=e.sort(((e,t)=>a(e,t,r)));for(const e of c){n(e,t,r)?(o=e,s||(s=e)):(o&&i.push([s,o]),o=null,s=null)}s&&i.push([s,null]);const d=[];for(const[e,t]of i)e===t?d.push(e):t||e!==c[0]?t?e===c[0]?d.push(`<=${t}`):d.push(`${e} - ${t}`):d.push(`>=${e}`):d.push("*");const f=d.join(" || "),u="string"==typeof t.raw?t.raw:String(t);return f.length<u.length?f:t}},583:(e,t,r)=>{const n=r(7476),a=r(1565),{ANY:i}=a,s=r(7229),o=r(7851),c=[new a(">=0.0.0-0")],d=[new a(">=0.0.0")],f=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===i){if(1===t.length&&t[0].semver===i)return!0;e=r.includePrerelease?c:d}if(1===t.length&&t[0].semver===i){if(r.includePrerelease)return!0;t=d}const n=new Set;let a,f,h,p,b,g,y;for(const t of e)">"===t.operator||">="===t.operator?a=u(a,t,r):"<"===t.operator||"<="===t.operator?f=l(f,t,r):n.add(t.semver);if(n.size>1)return null;if(a&&f){if(h=o(a.semver,f.semver,r),h>0)return null;if(0===h&&(">="!==a.operator||"<="!==f.operator))return null}for(const e of n){if(a&&!s(e,String(a),r))return null;if(f&&!s(e,String(f),r))return null;for(const n of t)if(!s(e,String(n),r))return!1;return!0}let m=!(!f||r.includePrerelease||!f.semver.prerelease.length)&&f.semver,w=!(!a||r.includePrerelease||!a.semver.prerelease.length)&&a.semver;m&&1===m.prerelease.length&&"<"===f.operator&&0===m.prerelease[0]&&(m=!1);for(const e of t){if(y=y||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,a)if(w&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===w.major&&e.semver.minor===w.minor&&e.semver.patch===w.patch&&(w=!1),">"===e.operator||">="===e.operator){if(p=u(a,e,r),p===e&&p!==a)return!1}else if(">="===a.operator&&!s(a.semver,String(e),r))return!1;if(f)if(m&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===m.major&&e.semver.minor===m.minor&&e.semver.patch===m.patch&&(m=!1),"<"===e.operator||"<="===e.operator){if(b=l(f,e,r),b===e&&b!==f)return!1}else if("<="===f.operator&&!s(f.semver,String(e),r))return!1;if(!e.operator&&(f||a)&&0!==h)return!1}return!(a&&g&&!f&&0!==h)&&(!(f&&y&&!a&&0!==h)&&(!w&&!m))},u=(e,t,r)=>{if(!e)return t;const n=o(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},l=(e,t,r)=>{if(!e)return t;const n=o(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let a=!1;e:for(const n of e.set){for(const e of t.set){const t=f(n,e,r);if(a=a||null!==t,t)continue e}if(a)return!1}return!0}},6364:(e,t,r)=>{const n=r(7476);e.exports=(e,t)=>new n(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},7403:(e,t,r)=>{const n=r(7476);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},839:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function a(e,...t){if(!(e instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new TypeError(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function i(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function o(e,t){a(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=r,t.bool=n,t.bytes=a,t.hash=i,t.exists=s,t.output=o;const c={number:r,bool:n,bytes:a,hash:i,exists:s,output:o};t.default=c},340:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add=t.toBig=t.split=t.fromBig=void 0;const r=BigInt(2**32-1),n=BigInt(32);function a(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function i(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:s,l:o}=a(e[i],t);[r[i],n[i]]=[s,o]}return[r,n]}t.fromBig=a,t.split=i;t.toBig=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0);function s(e,t,r,n){const a=(t>>>0)+(n>>>0);return{h:e+r+(a/2**32|0)|0,l:0|a}}t.add=s;const o={fromBig:a,split:i,toBig:t.toBig,shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:(e,t,r)=>e<<r|t>>>32-r,rotlSL:(e,t,r)=>t<<r|e>>>32-r,rotlBH:(e,t,r)=>t<<r-32|e>>>64-r,rotlBL:(e,t,r)=>e<<r-32|t>>>64-r,add:s,add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,a)=>t+r+n+a+(e/2**32|0)|0,add5H:(e,t,r,n,a,i)=>t+r+n+a+i+(e/2**32|0)|0,add5L:(e,t,r,n,a)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(a>>>0)};t.default=o},5203:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto={node:void 0,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0}},1305:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shake256=t.shake128=t.keccak_512=t.keccak_384=t.keccak_256=t.keccak_224=t.sha3_512=t.sha3_384=t.sha3_256=t.sha3_224=t.Keccak=t.keccakP=void 0;const n=r(839),a=r(340),i=r(1157),[s,o,c]=[[],[],[]],d=BigInt(0),f=BigInt(1),u=BigInt(2),l=BigInt(7),h=BigInt(256),p=BigInt(113);for(let e=0,t=f,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],s.push(2*(5*n+r)),o.push((e+1)*(e+2)/2%64);let a=d;for(let e=0;e<7;e++)t=(t<<f^(t>>l)*p)%h,t&u&&(a^=f<<(f<<BigInt(e))-f);c.push(a)}const[b,g]=a.default.split(c,!0),y=(e,t,r)=>r>32?a.default.rotlBH(e,t,r):a.default.rotlSH(e,t,r),m=(e,t,r)=>r>32?a.default.rotlBL(e,t,r):a.default.rotlSL(e,t,r);function w(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,a=(t+2)%10,i=r[a],s=r[a+1],o=y(i,s,1)^r[n],c=m(i,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=o,e[t+r+1]^=c}let t=e[2],a=e[3];for(let r=0;r<24;r++){const n=o[r],i=y(t,a,n),c=m(t,a,n),d=s[r];t=e[d],a=e[d+1],e[d]=i,e[d+1]=c}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=b[n],e[1]^=g[n]}r.fill(0)}t.keccakP=w;class v extends i.Hash{constructor(e,t,r,a=!1,s=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=a,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,n.default.number(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,i.u32)(this.state)}keccak(){w(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){n.default.exists(this);const{blockLen:t,state:r}=this,a=(e=(0,i.toBytes)(e)).length;for(let n=0;n<a;){const i=Math.min(t-this.pos,a-n);for(let t=0;t<i;t++)r[this.pos++]^=e[n++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,128&t&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){n.default.exists(this,!1),n.default.bytes(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,a=e.length;n<a;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,a-n);e.set(t.subarray(this.posOut,this.posOut+i),n),this.posOut+=i,n+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return n.default.number(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(n.default.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){const{blockLen:t,suffix:r,outputLen:n,rounds:a,enableXOF:i}=this;return e||(e=new v(t,r,n,i,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=r,e.outputLen=n,e.enableXOF=i,e.destroyed=this.destroyed,e}}t.Keccak=v;const E=(e,t,r)=>(0,i.wrapConstructor)((()=>new v(t,e,r)));t.sha3_224=E(6,144,28),t.sha3_256=E(6,136,32),t.sha3_384=E(6,104,48),t.sha3_512=E(6,72,64),t.keccak_224=E(1,144,28),t.keccak_256=E(1,136,32),t.keccak_384=E(1,104,48),t.keccak_512=E(1,72,64);const A=(e,t,r)=>(0,i.wrapConstructorWithOpts)(((n={})=>new v(t,e,void 0===n.dkLen?r:n.dkLen,!0)));t.shake128=A(31,168,16),t.shake256=A(31,136,32)},1157:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const n=r(5203);t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const a=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));t.bytesToHex=function(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=a[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,a=e.slice(n,n+2),i=Number.parseInt(a,16);if(Number.isNaN(i)||i<0)throw new Error("Invalid byte sequence");t[r]=i}return t};function i(e){if("string"!=typeof e)throw new TypeError("utf8ToBytes expected string, got "+typeof e);return(new TextEncoder).encode(e)}function s(e){if("string"==typeof e&&(e=i(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}t.nextTick=async()=>{},t.asyncLoop=async function(e,r,n){let a=Date.now();for(let i=0;i<e;i++){n(i);const e=Date.now()-a;e>=0&&e<r||(await(0,t.nextTick)(),a+=e)}},t.utf8ToBytes=i,t.toBytes=s,t.concatBytes=function(...e){if(!e.every((e=>e instanceof Uint8Array)))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const a=e[t];r.set(a,n),n+=a.length}return r};t.Hash=class{clone(){return this._cloneInto()}};t.checkOpts=function(e,t){if(void 0!==t&&("object"!=typeof t||(r=t,"[object Object]"!==Object.prototype.toString.call(r)||r.constructor!==Object)))throw new TypeError("Options should be object or undefined");var r;return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(s(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(s(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(n.crypto.web)return n.crypto.web.getRandomValues(new Uint8Array(e));if(n.crypto.node)return new Uint8Array(n.crypto.node.randomBytes(e).buffer);throw new Error("The environment doesn't have randomBytes function")}},6729:(e,t,r)=>{"use strict";t.So=void 0;const n=r(1305),a=r(8470);(0,a.wrapHash)(n.keccak_224),t.So=(()=>{const e=(0,a.wrapHash)(n.keccak_256);return e.create=n.keccak_256.create,e})(),(0,a.wrapHash)(n.keccak_384),(0,a.wrapHash)(n.keccak_512)},8470:function(e,t,r){"use strict";e=r.nmd(e);var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=t.wrapHash=t.equalsBytes=t.hexToBytes=t.bytesToUtf8=t.utf8ToBytes=t.createView=t.concatBytes=t.toHex=t.bytesToHex=t.assertBytes=t.assertBool=void 0;const a=n(r(839)),i=r(1157),s=a.default.bool;t.assertBool=s;const o=a.default.bytes;t.assertBytes=o;var c=r(1157);Object.defineProperty(t,"bytesToHex",{enumerable:!0,get:function(){return c.bytesToHex}}),Object.defineProperty(t,"toHex",{enumerable:!0,get:function(){return c.bytesToHex}}),Object.defineProperty(t,"concatBytes",{enumerable:!0,get:function(){return c.concatBytes}}),Object.defineProperty(t,"createView",{enumerable:!0,get:function(){return c.createView}}),Object.defineProperty(t,"utf8ToBytes",{enumerable:!0,get:function(){return c.utf8ToBytes}}),t.bytesToUtf8=function(e){if(!(e instanceof Uint8Array))throw new TypeError("bytesToUtf8 expected Uint8Array, got "+typeof e);return(new TextDecoder).decode(e)},t.hexToBytes=function(e){const t=e.startsWith("0x")?e.substring(2):e;return(0,i.hexToBytes)(t)},t.equalsBytes=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0},t.wrapHash=function(e){return t=>(a.default.bytes(t),e(t))},t.crypto=(()=>{const t="object"==typeof self&&"crypto"in self?self.crypto:void 0,r="function"==typeof e.require&&e.require.bind(e);return{node:r&&!t?r("crypto"):void 0,web:t}})()},665:function(e,t,r){var n=r(6928).Buffer;!function(t,r){"use strict";e.exports?e.exports=r():(t.nacl||(t.nacl={}),t.nacl.util=r())}(this,(function(){"use strict";var e={};function t(e){if(!/^(?:[A-Za-z0-9+\/]{2}[A-Za-z0-9+\/]{2})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e))throw new TypeError("invalid encoding")}return e.decodeUTF8=function(e){if("string"!=typeof e)throw new TypeError("expected string");var t,r=unescape(encodeURIComponent(e)),n=new Uint8Array(r.length);for(t=0;t<r.length;t++)n[t]=r.charCodeAt(t);return n},e.encodeUTF8=function(e){var t,r=[];for(t=0;t<e.length;t++)r.push(String.fromCharCode(e[t]));return decodeURIComponent(escape(r.join("")))},"undefined"==typeof atob?void 0!==n.from?(e.encodeBase64=function(e){return n.from(e).toString("base64")},e.decodeBase64=function(e){return t(e),new Uint8Array(Array.prototype.slice.call(n.from(e,"base64"),0))}):(e.encodeBase64=function(e){return new n(e).toString("base64")},e.decodeBase64=function(e){return t(e),new Uint8Array(Array.prototype.slice.call(new n(e,"base64"),0))}):(e.encodeBase64=function(e){var t,r=[],n=e.length;for(t=0;t<n;t++)r.push(String.fromCharCode(e[t]));return btoa(r.join(""))},e.decodeBase64=function(e){t(e);var r,n=atob(e),a=new Uint8Array(n.length);for(r=0;r<n.length;r++)a[r]=n.charCodeAt(r);return a}),e}))},2926:(e,t,r)=>{!function(e){"use strict";var t=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t<e.length;t++)r[t]=e[t];return r},n=function(){throw new Error("no PRNG")},a=new Uint8Array(16),i=new Uint8Array(32);i[0]=9;var s=t(),o=t([1]),c=t([56129,1]),d=t([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),f=t([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),u=t([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),l=t([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),h=t([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(e,t,r,n){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function b(e,t,r,n,a){var i,s=0;for(i=0;i<a;i++)s|=e[t+i]^r[n+i];return(1&s-1>>>8)-1}function g(e,t,r,n){return b(e,t,r,n,16)}function y(e,t,r,n){return b(e,t,r,n,32)}function m(e,t,r,n){!function(e,t,r,n){for(var a,i=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,o=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,d=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,u=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,l=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,h=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,b=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,y=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,m=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,w=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,v=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,E=i,A=s,_=o,x=c,S=d,I=f,k=u,C=l,T=h,B=p,M=b,O=g,R=y,N=m,P=w,L=v,F=0;F<20;F+=2)E^=(a=(R^=(a=(T^=(a=(S^=(a=E+R|0)<<7|a>>>25)+E|0)<<9|a>>>23)+S|0)<<13|a>>>19)+T|0)<<18|a>>>14,I^=(a=(A^=(a=(N^=(a=(B^=(a=I+A|0)<<7|a>>>25)+I|0)<<9|a>>>23)+B|0)<<13|a>>>19)+N|0)<<18|a>>>14,M^=(a=(k^=(a=(_^=(a=(P^=(a=M+k|0)<<7|a>>>25)+M|0)<<9|a>>>23)+P|0)<<13|a>>>19)+_|0)<<18|a>>>14,L^=(a=(O^=(a=(C^=(a=(x^=(a=L+O|0)<<7|a>>>25)+L|0)<<9|a>>>23)+x|0)<<13|a>>>19)+C|0)<<18|a>>>14,E^=(a=(x^=(a=(_^=(a=(A^=(a=E+x|0)<<7|a>>>25)+E|0)<<9|a>>>23)+A|0)<<13|a>>>19)+_|0)<<18|a>>>14,I^=(a=(S^=(a=(C^=(a=(k^=(a=I+S|0)<<7|a>>>25)+I|0)<<9|a>>>23)+k|0)<<13|a>>>19)+C|0)<<18|a>>>14,M^=(a=(B^=(a=(T^=(a=(O^=(a=M+B|0)<<7|a>>>25)+M|0)<<9|a>>>23)+O|0)<<13|a>>>19)+T|0)<<18|a>>>14,L^=(a=(P^=(a=(N^=(a=(R^=(a=L+P|0)<<7|a>>>25)+L|0)<<9|a>>>23)+R|0)<<13|a>>>19)+N|0)<<18|a>>>14;E=E+i|0,A=A+s|0,_=_+o|0,x=x+c|0,S=S+d|0,I=I+f|0,k=k+u|0,C=C+l|0,T=T+h|0,B=B+p|0,M=M+b|0,O=O+g|0,R=R+y|0,N=N+m|0,P=P+w|0,L=L+v|0,e[0]=E>>>0&255,e[1]=E>>>8&255,e[2]=E>>>16&255,e[3]=E>>>24&255,e[4]=A>>>0&255,e[5]=A>>>8&255,e[6]=A>>>16&255,e[7]=A>>>24&255,e[8]=_>>>0&255,e[9]=_>>>8&255,e[10]=_>>>16&255,e[11]=_>>>24&255,e[12]=x>>>0&255,e[13]=x>>>8&255,e[14]=x>>>16&255,e[15]=x>>>24&255,e[16]=S>>>0&255,e[17]=S>>>8&255,e[18]=S>>>16&255,e[19]=S>>>24&255,e[20]=I>>>0&255,e[21]=I>>>8&255,e[22]=I>>>16&255,e[23]=I>>>24&255,e[24]=k>>>0&255,e[25]=k>>>8&255,e[26]=k>>>16&255,e[27]=k>>>24&255,e[28]=C>>>0&255,e[29]=C>>>8&255,e[30]=C>>>16&255,e[31]=C>>>24&255,e[32]=T>>>0&255,e[33]=T>>>8&255,e[34]=T>>>16&255,e[35]=T>>>24&255,e[36]=B>>>0&255,e[37]=B>>>8&255,e[38]=B>>>16&255,e[39]=B>>>24&255,e[40]=M>>>0&255,e[41]=M>>>8&255,e[42]=M>>>16&255,e[43]=M>>>24&255,e[44]=O>>>0&255,e[45]=O>>>8&255,e[46]=O>>>16&255,e[47]=O>>>24&255,e[48]=R>>>0&255,e[49]=R>>>8&255,e[50]=R>>>16&255,e[51]=R>>>24&255,e[52]=N>>>0&255,e[53]=N>>>8&255,e[54]=N>>>16&255,e[55]=N>>>24&255,e[56]=P>>>0&255,e[57]=P>>>8&255,e[58]=P>>>16&255,e[59]=P>>>24&255,e[60]=L>>>0&255,e[61]=L>>>8&255,e[62]=L>>>16&255,e[63]=L>>>24&255}(e,t,r,n)}function w(e,t,r,n){!function(e,t,r,n){for(var a,i=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,s=255&r[0]|(255&r[1])<<8|(255&r[2])<<16|(255&r[3])<<24,o=255&r[4]|(255&r[5])<<8|(255&r[6])<<16|(255&r[7])<<24,c=255&r[8]|(255&r[9])<<8|(255&r[10])<<16|(255&r[11])<<24,d=255&r[12]|(255&r[13])<<8|(255&r[14])<<16|(255&r[15])<<24,f=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,u=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,l=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,h=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,p=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,b=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,g=255&r[16]|(255&r[17])<<8|(255&r[18])<<16|(255&r[19])<<24,y=255&r[20]|(255&r[21])<<8|(255&r[22])<<16|(255&r[23])<<24,m=255&r[24]|(255&r[25])<<8|(255&r[26])<<16|(255&r[27])<<24,w=255&r[28]|(255&r[29])<<8|(255&r[30])<<16|(255&r[31])<<24,v=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,E=0;E<20;E+=2)i^=(a=(y^=(a=(h^=(a=(d^=(a=i+y|0)<<7|a>>>25)+i|0)<<9|a>>>23)+d|0)<<13|a>>>19)+h|0)<<18|a>>>14,f^=(a=(s^=(a=(m^=(a=(p^=(a=f+s|0)<<7|a>>>25)+f|0)<<9|a>>>23)+p|0)<<13|a>>>19)+m|0)<<18|a>>>14,b^=(a=(u^=(a=(o^=(a=(w^=(a=b+u|0)<<7|a>>>25)+b|0)<<9|a>>>23)+w|0)<<13|a>>>19)+o|0)<<18|a>>>14,v^=(a=(g^=(a=(l^=(a=(c^=(a=v+g|0)<<7|a>>>25)+v|0)<<9|a>>>23)+c|0)<<13|a>>>19)+l|0)<<18|a>>>14,i^=(a=(c^=(a=(o^=(a=(s^=(a=i+c|0)<<7|a>>>25)+i|0)<<9|a>>>23)+s|0)<<13|a>>>19)+o|0)<<18|a>>>14,f^=(a=(d^=(a=(l^=(a=(u^=(a=f+d|0)<<7|a>>>25)+f|0)<<9|a>>>23)+u|0)<<13|a>>>19)+l|0)<<18|a>>>14,b^=(a=(p^=(a=(h^=(a=(g^=(a=b+p|0)<<7|a>>>25)+b|0)<<9|a>>>23)+g|0)<<13|a>>>19)+h|0)<<18|a>>>14,v^=(a=(w^=(a=(m^=(a=(y^=(a=v+w|0)<<7|a>>>25)+v|0)<<9|a>>>23)+y|0)<<13|a>>>19)+m|0)<<18|a>>>14;e[0]=i>>>0&255,e[1]=i>>>8&255,e[2]=i>>>16&255,e[3]=i>>>24&255,e[4]=f>>>0&255,e[5]=f>>>8&255,e[6]=f>>>16&255,e[7]=f>>>24&255,e[8]=b>>>0&255,e[9]=b>>>8&255,e[10]=b>>>16&255,e[11]=b>>>24&255,e[12]=v>>>0&255,e[13]=v>>>8&255,e[14]=v>>>16&255,e[15]=v>>>24&255,e[16]=u>>>0&255,e[17]=u>>>8&255,e[18]=u>>>16&255,e[19]=u>>>24&255,e[20]=l>>>0&255,e[21]=l>>>8&255,e[22]=l>>>16&255,e[23]=l>>>24&255,e[24]=h>>>0&255,e[25]=h>>>8&255,e[26]=h>>>16&255,e[27]=h>>>24&255,e[28]=p>>>0&255,e[29]=p>>>8&255,e[30]=p>>>16&255,e[31]=p>>>24&255}(e,t,r,n)}var v=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function E(e,t,r,n,a,i,s){var o,c,d=new Uint8Array(16),f=new Uint8Array(64);for(c=0;c<16;c++)d[c]=0;for(c=0;c<8;c++)d[c]=i[c];for(;a>=64;){for(m(f,d,s,v),c=0;c<64;c++)e[t+c]=r[n+c]^f[c];for(o=1,c=8;c<16;c++)o=o+(255&d[c])|0,d[c]=255&o,o>>>=8;a-=64,t+=64,n+=64}if(a>0)for(m(f,d,s,v),c=0;c<a;c++)e[t+c]=r[n+c]^f[c];return 0}function A(e,t,r,n,a){var i,s,o=new Uint8Array(16),c=new Uint8Array(64);for(s=0;s<16;s++)o[s]=0;for(s=0;s<8;s++)o[s]=n[s];for(;r>=64;){for(m(c,o,a,v),s=0;s<64;s++)e[t+s]=c[s];for(i=1,s=8;s<16;s++)i=i+(255&o[s])|0,o[s]=255&i,i>>>=8;r-=64,t+=64}if(r>0)for(m(c,o,a,v),s=0;s<r;s++)e[t+s]=c[s];return 0}function _(e,t,r,n,a){var i=new Uint8Array(32);w(i,n,a,v);for(var s=new Uint8Array(8),o=0;o<8;o++)s[o]=n[o+16];return A(e,t,r,s,i)}function x(e,t,r,n,a,i,s){var o=new Uint8Array(32);w(o,i,s,v);for(var c=new Uint8Array(8),d=0;d<8;d++)c[d]=i[d+16];return E(e,t,r,n,a,c,o)}var S=function(e){var t,r,n,a,i,s,o,c;this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.leftover=0,this.fin=0,t=255&e[0]|(255&e[1])<<8,this.r[0]=8191&t,r=255&e[2]|(255&e[3])<<8,this.r[1]=8191&(t>>>13|r<<3),n=255&e[4]|(255&e[5])<<8,this.r[2]=7939&(r>>>10|n<<6),a=255&e[6]|(255&e[7])<<8,this.r[3]=8191&(n>>>7|a<<9),i=255&e[8]|(255&e[9])<<8,this.r[4]=255&(a>>>4|i<<12),this.r[5]=i>>>1&8190,s=255&e[10]|(255&e[11])<<8,this.r[6]=8191&(i>>>14|s<<2),o=255&e[12]|(255&e[13])<<8,this.r[7]=8065&(s>>>11|o<<5),c=255&e[14]|(255&e[15])<<8,this.r[8]=8191&(o>>>8|c<<8),this.r[9]=c>>>5&127,this.pad[0]=255&e[16]|(255&e[17])<<8,this.pad[1]=255&e[18]|(255&e[19])<<8,this.pad[2]=255&e[20]|(255&e[21])<<8,this.pad[3]=255&e[22]|(255&e[23])<<8,this.pad[4]=255&e[24]|(255&e[25])<<8,this.pad[5]=255&e[26]|(255&e[27])<<8,this.pad[6]=255&e[28]|(255&e[29])<<8,this.pad[7]=255&e[30]|(255&e[31])<<8};function I(e,t,r,n,a,i){var s=new S(i);return s.update(r,n,a),s.finish(e,t),0}function k(e,t,r,n,a,i){var s=new Uint8Array(16);return I(s,0,r,n,a,i),g(e,t,s,0)}function C(e,t,r,n,a){var i;if(r<32)return-1;for(x(e,0,t,0,r,n,a),I(e,16,e,32,r-32,e),i=0;i<16;i++)e[i]=0;return 0}function T(e,t,r,n,a){var i,s=new Uint8Array(32);if(r<32)return-1;if(_(s,0,32,n,a),0!==k(t,16,t,32,r-32,s))return-1;for(x(e,0,t,0,r,n,a),i=0;i<32;i++)e[i]=0;return 0}function B(e,t){var r;for(r=0;r<16;r++)e[r]=0|t[r]}function M(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function O(e,t,r){for(var n,a=~(r-1),i=0;i<16;i++)n=a&(e[i]^t[i]),e[i]^=n,t[i]^=n}function R(e,r){var n,a,i,s=t(),o=t();for(n=0;n<16;n++)o[n]=r[n];for(M(o),M(o),M(o),a=0;a<2;a++){for(s[0]=o[0]-65517,n=1;n<15;n++)s[n]=o[n]-65535-(s[n-1]>>16&1),s[n-1]&=65535;s[15]=o[15]-32767-(s[14]>>16&1),i=s[15]>>16&1,s[14]&=65535,O(o,s,1-i)}for(n=0;n<16;n++)e[2*n]=255&o[n],e[2*n+1]=o[n]>>8}function N(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return R(r,e),R(n,t),y(r,0,n,0)}function P(e){var t=new Uint8Array(32);return R(t,e),1&t[0]}function L(e,t){var r;for(r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function F(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function D(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function U(e,t,r){var n,a,i=0,s=0,o=0,c=0,d=0,f=0,u=0,l=0,h=0,p=0,b=0,g=0,y=0,m=0,w=0,v=0,E=0,A=0,_=0,x=0,S=0,I=0,k=0,C=0,T=0,B=0,M=0,O=0,R=0,N=0,P=0,L=r[0],F=r[1],D=r[2],U=r[3],H=r[4],j=r[5],V=r[6],$=r[7],z=r[8],q=r[9],K=r[10],G=r[11],J=r[12],W=r[13],Y=r[14],Z=r[15];i+=(n=t[0])*L,s+=n*F,o+=n*D,c+=n*U,d+=n*H,f+=n*j,u+=n*V,l+=n*$,h+=n*z,p+=n*q,b+=n*K,g+=n*G,y+=n*J,m+=n*W,w+=n*Y,v+=n*Z,s+=(n=t[1])*L,o+=n*F,c+=n*D,d+=n*U,f+=n*H,u+=n*j,l+=n*V,h+=n*$,p+=n*z,b+=n*q,g+=n*K,y+=n*G,m+=n*J,w+=n*W,v+=n*Y,E+=n*Z,o+=(n=t[2])*L,c+=n*F,d+=n*D,f+=n*U,u+=n*H,l+=n*j,h+=n*V,p+=n*$,b+=n*z,g+=n*q,y+=n*K,m+=n*G,w+=n*J,v+=n*W,E+=n*Y,A+=n*Z,c+=(n=t[3])*L,d+=n*F,f+=n*D,u+=n*U,l+=n*H,h+=n*j,p+=n*V,b+=n*$,g+=n*z,y+=n*q,m+=n*K,w+=n*G,v+=n*J,E+=n*W,A+=n*Y,_+=n*Z,d+=(n=t[4])*L,f+=n*F,u+=n*D,l+=n*U,h+=n*H,p+=n*j,b+=n*V,g+=n*$,y+=n*z,m+=n*q,w+=n*K,v+=n*G,E+=n*J,A+=n*W,_+=n*Y,x+=n*Z,f+=(n=t[5])*L,u+=n*F,l+=n*D,h+=n*U,p+=n*H,b+=n*j,g+=n*V,y+=n*$,m+=n*z,w+=n*q,v+=n*K,E+=n*G,A+=n*J,_+=n*W,x+=n*Y,S+=n*Z,u+=(n=t[6])*L,l+=n*F,h+=n*D,p+=n*U,b+=n*H,g+=n*j,y+=n*V,m+=n*$,w+=n*z,v+=n*q,E+=n*K,A+=n*G,_+=n*J,x+=n*W,S+=n*Y,I+=n*Z,l+=(n=t[7])*L,h+=n*F,p+=n*D,b+=n*U,g+=n*H,y+=n*j,m+=n*V,w+=n*$,v+=n*z,E+=n*q,A+=n*K,_+=n*G,x+=n*J,S+=n*W,I+=n*Y,k+=n*Z,h+=(n=t[8])*L,p+=n*F,b+=n*D,g+=n*U,y+=n*H,m+=n*j,w+=n*V,v+=n*$,E+=n*z,A+=n*q,_+=n*K,x+=n*G,S+=n*J,I+=n*W,k+=n*Y,C+=n*Z,p+=(n=t[9])*L,b+=n*F,g+=n*D,y+=n*U,m+=n*H,w+=n*j,v+=n*V,E+=n*$,A+=n*z,_+=n*q,x+=n*K,S+=n*G,I+=n*J,k+=n*W,C+=n*Y,T+=n*Z,b+=(n=t[10])*L,g+=n*F,y+=n*D,m+=n*U,w+=n*H,v+=n*j,E+=n*V,A+=n*$,_+=n*z,x+=n*q,S+=n*K,I+=n*G,k+=n*J,C+=n*W,T+=n*Y,B+=n*Z,g+=(n=t[11])*L,y+=n*F,m+=n*D,w+=n*U,v+=n*H,E+=n*j,A+=n*V,_+=n*$,x+=n*z,S+=n*q,I+=n*K,k+=n*G,C+=n*J,T+=n*W,B+=n*Y,M+=n*Z,y+=(n=t[12])*L,m+=n*F,w+=n*D,v+=n*U,E+=n*H,A+=n*j,_+=n*V,x+=n*$,S+=n*z,I+=n*q,k+=n*K,C+=n*G,T+=n*J,B+=n*W,M+=n*Y,O+=n*Z,m+=(n=t[13])*L,w+=n*F,v+=n*D,E+=n*U,A+=n*H,_+=n*j,x+=n*V,S+=n*$,I+=n*z,k+=n*q,C+=n*K,T+=n*G,B+=n*J,M+=n*W,O+=n*Y,R+=n*Z,w+=(n=t[14])*L,v+=n*F,E+=n*D,A+=n*U,_+=n*H,x+=n*j,S+=n*V,I+=n*$,k+=n*z,C+=n*q,T+=n*K,B+=n*G,M+=n*J,O+=n*W,R+=n*Y,N+=n*Z,v+=(n=t[15])*L,s+=38*(A+=n*D),o+=38*(_+=n*U),c+=38*(x+=n*H),d+=38*(S+=n*j),f+=38*(I+=n*V),u+=38*(k+=n*$),l+=38*(C+=n*z),h+=38*(T+=n*q),p+=38*(B+=n*K),b+=38*(M+=n*G),g+=38*(O+=n*J),y+=38*(R+=n*W),m+=38*(N+=n*Y),w+=38*(P+=n*Z),i=(n=(i+=38*(E+=n*F))+(a=1)+65535)-65536*(a=Math.floor(n/65536)),s=(n=s+a+65535)-65536*(a=Math.floor(n/65536)),o=(n=o+a+65535)-65536*(a=Math.floor(n/65536)),c=(n=c+a+65535)-65536*(a=Math.floor(n/65536)),d=(n=d+a+65535)-65536*(a=Math.floor(n/65536)),f=(n=f+a+65535)-65536*(a=Math.floor(n/65536)),u=(n=u+a+65535)-65536*(a=Math.floor(n/65536)),l=(n=l+a+65535)-65536*(a=Math.floor(n/65536)),h=(n=h+a+65535)-65536*(a=Math.floor(n/65536)),p=(n=p+a+65535)-65536*(a=Math.floor(n/65536)),b=(n=b+a+65535)-65536*(a=Math.floor(n/65536)),g=(n=g+a+65535)-65536*(a=Math.floor(n/65536)),y=(n=y+a+65535)-65536*(a=Math.floor(n/65536)),m=(n=m+a+65535)-65536*(a=Math.floor(n/65536)),w=(n=w+a+65535)-65536*(a=Math.floor(n/65536)),v=(n=v+a+65535)-65536*(a=Math.floor(n/65536)),i=(n=(i+=a-1+37*(a-1))+(a=1)+65535)-65536*(a=Math.floor(n/65536)),s=(n=s+a+65535)-65536*(a=Math.floor(n/65536)),o=(n=o+a+65535)-65536*(a=Math.floor(n/65536)),c=(n=c+a+65535)-65536*(a=Math.floor(n/65536)),d=(n=d+a+65535)-65536*(a=Math.floor(n/65536)),f=(n=f+a+65535)-65536*(a=Math.floor(n/65536)),u=(n=u+a+65535)-65536*(a=Math.floor(n/65536)),l=(n=l+a+65535)-65536*(a=Math.floor(n/65536)),h=(n=h+a+65535)-65536*(a=Math.floor(n/65536)),p=(n=p+a+65535)-65536*(a=Math.floor(n/65536)),b=(n=b+a+65535)-65536*(a=Math.floor(n/65536)),g=(n=g+a+65535)-65536*(a=Math.floor(n/65536)),y=(n=y+a+65535)-65536*(a=Math.floor(n/65536)),m=(n=m+a+65535)-65536*(a=Math.floor(n/65536)),w=(n=w+a+65535)-65536*(a=Math.floor(n/65536)),v=(n=v+a+65535)-65536*(a=Math.floor(n/65536)),i+=a-1+37*(a-1),e[0]=i,e[1]=s,e[2]=o,e[3]=c,e[4]=d,e[5]=f,e[6]=u,e[7]=l,e[8]=h,e[9]=p,e[10]=b,e[11]=g,e[12]=y,e[13]=m,e[14]=w,e[15]=v}function H(e,t){U(e,t,t)}function j(e,r){var n,a=t();for(n=0;n<16;n++)a[n]=r[n];for(n=253;n>=0;n--)H(a,a),2!==n&&4!==n&&U(a,a,r);for(n=0;n<16;n++)e[n]=a[n]}function V(e,r){var n,a=t();for(n=0;n<16;n++)a[n]=r[n];for(n=250;n>=0;n--)H(a,a),1!==n&&U(a,a,r);for(n=0;n<16;n++)e[n]=a[n]}function $(e,r,n){var a,i,s=new Uint8Array(32),o=new Float64Array(80),d=t(),f=t(),u=t(),l=t(),h=t(),p=t();for(i=0;i<31;i++)s[i]=r[i];for(s[31]=127&r[31]|64,s[0]&=248,L(o,n),i=0;i<16;i++)f[i]=o[i],l[i]=d[i]=u[i]=0;for(d[0]=l[0]=1,i=254;i>=0;--i)O(d,f,a=s[i>>>3]>>>(7&i)&1),O(u,l,a),F(h,d,u),D(d,d,u),F(u,f,l),D(f,f,l),H(l,h),H(p,d),U(d,u,d),U(u,f,h),F(h,d,u),D(d,d,u),H(f,d),D(u,l,p),U(d,u,c),F(d,d,l),U(u,u,d),U(d,l,p),U(l,f,o),H(f,h),O(d,f,a),O(u,l,a);for(i=0;i<16;i++)o[i+16]=d[i],o[i+32]=u[i],o[i+48]=f[i],o[i+64]=l[i];var b=o.subarray(32),g=o.subarray(16);return j(b,b),U(g,g,b),R(e,g),0}function z(e,t){return $(e,t,i)}function q(e,t){return n(t,32),z(e,t)}function K(e,t,r){var n=new Uint8Array(32);return $(n,r,t),w(e,a,n,v)}S.prototype.blocks=function(e,t,r){for(var n,a,i,s,o,c,d,f,u,l,h,p,b,g,y,m,w,v,E,A=this.fin?0:2048,_=this.h[0],x=this.h[1],S=this.h[2],I=this.h[3],k=this.h[4],C=this.h[5],T=this.h[6],B=this.h[7],M=this.h[8],O=this.h[9],R=this.r[0],N=this.r[1],P=this.r[2],L=this.r[3],F=this.r[4],D=this.r[5],U=this.r[6],H=this.r[7],j=this.r[8],V=this.r[9];r>=16;)l=u=0,l+=(_+=8191&(n=255&e[t+0]|(255&e[t+1])<<8))*R,l+=(x+=8191&(n>>>13|(a=255&e[t+2]|(255&e[t+3])<<8)<<3))*(5*V),l+=(S+=8191&(a>>>10|(i=255&e[t+4]|(255&e[t+5])<<8)<<6))*(5*j),l+=(I+=8191&(i>>>7|(s=255&e[t+6]|(255&e[t+7])<<8)<<9))*(5*H),u=(l+=(k+=8191&(s>>>4|(o=255&e[t+8]|(255&e[t+9])<<8)<<12))*(5*U))>>>13,l&=8191,l+=(C+=o>>>1&8191)*(5*D),l+=(T+=8191&(o>>>14|(c=255&e[t+10]|(255&e[t+11])<<8)<<2))*(5*F),l+=(B+=8191&(c>>>11|(d=255&e[t+12]|(255&e[t+13])<<8)<<5))*(5*L),l+=(M+=8191&(d>>>8|(f=255&e[t+14]|(255&e[t+15])<<8)<<8))*(5*P),h=u+=(l+=(O+=f>>>5|A)*(5*N))>>>13,h+=_*N,h+=x*R,h+=S*(5*V),h+=I*(5*j),u=(h+=k*(5*H))>>>13,h&=8191,h+=C*(5*U),h+=T*(5*D),h+=B*(5*F),h+=M*(5*L),u+=(h+=O*(5*P))>>>13,h&=8191,p=u,p+=_*P,p+=x*N,p+=S*R,p+=I*(5*V),u=(p+=k*(5*j))>>>13,p&=8191,p+=C*(5*H),p+=T*(5*U),p+=B*(5*D),p+=M*(5*F),b=u+=(p+=O*(5*L))>>>13,b+=_*L,b+=x*P,b+=S*N,b+=I*R,u=(b+=k*(5*V))>>>13,b&=8191,b+=C*(5*j),b+=T*(5*H),b+=B*(5*U),b+=M*(5*D),g=u+=(b+=O*(5*F))>>>13,g+=_*F,g+=x*L,g+=S*P,g+=I*N,u=(g+=k*R)>>>13,g&=8191,g+=C*(5*V),g+=T*(5*j),g+=B*(5*H),g+=M*(5*U),y=u+=(g+=O*(5*D))>>>13,y+=_*D,y+=x*F,y+=S*L,y+=I*P,u=(y+=k*N)>>>13,y&=8191,y+=C*R,y+=T*(5*V),y+=B*(5*j),y+=M*(5*H),m=u+=(y+=O*(5*U))>>>13,m+=_*U,m+=x*D,m+=S*F,m+=I*L,u=(m+=k*P)>>>13,m&=8191,m+=C*N,m+=T*R,m+=B*(5*V),m+=M*(5*j),w=u+=(m+=O*(5*H))>>>13,w+=_*H,w+=x*U,w+=S*D,w+=I*F,u=(w+=k*L)>>>13,w&=8191,w+=C*P,w+=T*N,w+=B*R,w+=M*(5*V),v=u+=(w+=O*(5*j))>>>13,v+=_*j,v+=x*H,v+=S*U,v+=I*D,u=(v+=k*F)>>>13,v&=8191,v+=C*L,v+=T*P,v+=B*N,v+=M*R,E=u+=(v+=O*(5*V))>>>13,E+=_*V,E+=x*j,E+=S*H,E+=I*U,u=(E+=k*D)>>>13,E&=8191,E+=C*F,E+=T*L,E+=B*P,E+=M*N,_=l=8191&(u=(u=((u+=(E+=O*R)>>>13)<<2)+u|0)+(l&=8191)|0),x=h+=u>>>=13,S=p&=8191,I=b&=8191,k=g&=8191,C=y&=8191,T=m&=8191,B=w&=8191,M=v&=8191,O=E&=8191,t+=16,r-=16;this.h[0]=_,this.h[1]=x,this.h[2]=S,this.h[3]=I,this.h[4]=k,this.h[5]=C,this.h[6]=T,this.h[7]=B,this.h[8]=M,this.h[9]=O},S.prototype.finish=function(e,t){var r,n,a,i,s=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;i<16;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(r=this.h[1]>>>13,this.h[1]&=8191,i=2;i<10;i++)this.h[i]+=r,r=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*r,r=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=r,r=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=r,s[0]=this.h[0]+5,r=s[0]>>>13,s[0]&=8191,i=1;i<10;i++)s[i]=this.h[i]+r,r=s[i]>>>13,s[i]&=8191;for(s[9]-=8192,n=(1^r)-1,i=0;i<10;i++)s[i]&=n;for(n=~n,i=0;i<10;i++)this.h[i]=this.h[i]&n|s[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),a=this.h[0]+this.pad[0],this.h[0]=65535&a,i=1;i<8;i++)a=(this.h[i]+this.pad[i]|0)+(a>>>16)|0,this.h[i]=65535&a;e[t+0]=this.h[0]>>>0&255,e[t+1]=this.h[0]>>>8&255,e[t+2]=this.h[1]>>>0&255,e[t+3]=this.h[1]>>>8&255,e[t+4]=this.h[2]>>>0&255,e[t+5]=this.h[2]>>>8&255,e[t+6]=this.h[3]>>>0&255,e[t+7]=this.h[3]>>>8&255,e[t+8]=this.h[4]>>>0&255,e[t+9]=this.h[4]>>>8&255,e[t+10]=this.h[5]>>>0&255,e[t+11]=this.h[5]>>>8&255,e[t+12]=this.h[6]>>>0&255,e[t+13]=this.h[6]>>>8&255,e[t+14]=this.h[7]>>>0&255,e[t+15]=this.h[7]>>>8&255},S.prototype.update=function(e,t,r){var n,a;if(this.leftover){for((a=16-this.leftover)>r&&(a=r),n=0;n<a;n++)this.buffer[this.leftover+n]=e[t+n];if(r-=a,t+=a,this.leftover+=a,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(r>=16&&(a=r-r%16,this.blocks(e,t,a),t+=a,r-=a),r){for(n=0;n<r;n++)this.buffer[this.leftover+n]=e[t+n];this.leftover+=r}};var G=C,J=T;var W=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Y(e,t,r,n){for(var a,i,s,o,c,d,f,u,l,h,p,b,g,y,m,w,v,E,A,_,x,S,I,k,C,T,B=new Int32Array(16),M=new Int32Array(16),O=e[0],R=e[1],N=e[2],P=e[3],L=e[4],F=e[5],D=e[6],U=e[7],H=t[0],j=t[1],V=t[2],$=t[3],z=t[4],q=t[5],K=t[6],G=t[7],J=0;n>=128;){for(A=0;A<16;A++)_=8*A+J,B[A]=r[_+0]<<24|r[_+1]<<16|r[_+2]<<8|r[_+3],M[A]=r[_+4]<<24|r[_+5]<<16|r[_+6]<<8|r[_+7];for(A=0;A<80;A++)if(a=O,i=R,s=N,o=P,c=L,d=F,f=D,U,l=H,h=j,p=V,b=$,g=z,y=q,m=K,G,I=65535&(S=G),k=S>>>16,C=65535&(x=U),T=x>>>16,I+=65535&(S=(z>>>14|L<<18)^(z>>>18|L<<14)^(L>>>9|z<<23)),k+=S>>>16,C+=65535&(x=(L>>>14|z<<18)^(L>>>18|z<<14)^(z>>>9|L<<23)),T+=x>>>16,I+=65535&(S=z&q^~z&K),k+=S>>>16,C+=65535&(x=L&F^~L&D),T+=x>>>16,x=W[2*A],I+=65535&(S=W[2*A+1]),k+=S>>>16,C+=65535&x,T+=x>>>16,x=B[A%16],k+=(S=M[A%16])>>>16,C+=65535&x,T+=x>>>16,C+=(k+=(I+=65535&S)>>>16)>>>16,I=65535&(S=E=65535&I|k<<16),k=S>>>16,C=65535&(x=v=65535&C|(T+=C>>>16)<<16),T=x>>>16,I+=65535&(S=(H>>>28|O<<4)^(O>>>2|H<<30)^(O>>>7|H<<25)),k+=S>>>16,C+=65535&(x=(O>>>28|H<<4)^(H>>>2|O<<30)^(H>>>7|O<<25)),T+=x>>>16,k+=(S=H&j^H&V^j&V)>>>16,C+=65535&(x=O&R^O&N^R&N),T+=x>>>16,u=65535&(C+=(k+=(I+=65535&S)>>>16)>>>16)|(T+=C>>>16)<<16,w=65535&I|k<<16,I=65535&(S=b),k=S>>>16,C=65535&(x=o),T=x>>>16,k+=(S=E)>>>16,C+=65535&(x=v),T+=x>>>16,R=a,N=i,P=s,L=o=65535&(C+=(k+=(I+=65535&S)>>>16)>>>16)|(T+=C>>>16)<<16,F=c,D=d,U=f,O=u,j=l,V=h,$=p,z=b=65535&I|k<<16,q=g,K=y,G=m,H=w,A%16==15)for(_=0;_<16;_++)x=B[_],I=65535&(S=M[_]),k=S>>>16,C=65535&x,T=x>>>16,x=B[(_+9)%16],I+=65535&(S=M[(_+9)%16]),k+=S>>>16,C+=65535&x,T+=x>>>16,v=B[(_+1)%16],I+=65535&(S=((E=M[(_+1)%16])>>>1|v<<31)^(E>>>8|v<<24)^(E>>>7|v<<25)),k+=S>>>16,C+=65535&(x=(v>>>1|E<<31)^(v>>>8|E<<24)^v>>>7),T+=x>>>16,v=B[(_+14)%16],k+=(S=((E=M[(_+14)%16])>>>19|v<<13)^(v>>>29|E<<3)^(E>>>6|v<<26))>>>16,C+=65535&(x=(v>>>19|E<<13)^(E>>>29|v<<3)^v>>>6),T+=x>>>16,T+=(C+=(k+=(I+=65535&S)>>>16)>>>16)>>>16,B[_]=65535&C|T<<16,M[_]=65535&I|k<<16;I=65535&(S=H),k=S>>>16,C=65535&(x=O),T=x>>>16,x=e[0],k+=(S=t[0])>>>16,C+=65535&x,T+=x>>>16,T+=(C+=(k+=(I+=65535&S)>>>16)>>>16)>>>16,e[0]=O=65535&C|T<<16,t[0]=H=65535&I|k<<16,I=65535&(S=j),k=S>>>16,C=65535&(x=R),T=x>>>16,x=e[1],k+=(S=t[1])>>>16,C+=65535&x,T+=x>>>16,T+=(C+=(k+=(I+=65535&S)>>>16)>>>16)>>>16,e[1]=R=65535&C|T<<16,t[1]=j=65535&I|k<<16,I=65535&(S=V),k=S>>>16,C=65535&(x=N),T=x>>>16,x=e[2],k+=(S=t[2])>>>16,C+=65535&x,T+=x>>>16,T+=(C+=(k+=(I+=65535&S)>>>16)>>>16)>>>16,e[2]=N=65535&C|T<<16,t[2]=V=65535&I|k<<16,I=65535&(S=$),k=S>>>16,C=65535&(x=P),T=x>>>16,x=e[3],k+=(S=t[3])>>>16,C+=65535&x,T+=x>>>16,T+=(C+=(k+=(I+=65535&S)>>>16)>>>16)>>>16,e[3]=P=65535&C|T<<16,t[3]=$=65535&I|k<<16,I=65535&(S=z),k=S>>>16,C=65535&(x=L),T=x>>>16,x=e[4],k+=(S=t[4])>>>16,C+=65535&x,T+=x>>>16,T+=(C+=(k+=(I+=65535&S)>>>16)>>>16)>>>16,e[4]=L=65535&C|T<<16,t[4]=z=65535&I|k<<16,I=65535&(S=q),k=S>>>16,C=65535&(x=F),T=x>>>16,x=e[5],k+=(S=t[5])>>>16,C+=65535&x,T+=x>>>16,T+=(C+=(k+=(I+=65535&S)>>>16)>>>16)>>>16,e[5]=F=65535&C|T<<16,t[5]=q=65535&I|k<<16,I=65535&(S=K),k=S>>>16,C=65535&(x=D),T=x>>>16,x=e[6],k+=(S=t[6])>>>16,C+=65535&x,T+=x>>>16,T+=(C+=(k+=(I+=65535&S)>>>16)>>>16)>>>16,e[6]=D=65535&C|T<<16,t[6]=K=65535&I|k<<16,I=65535&(S=G),k=S>>>16,C=65535&(x=U),T=x>>>16,x=e[7],k+=(S=t[7])>>>16,C+=65535&x,T+=x>>>16,T+=(C+=(k+=(I+=65535&S)>>>16)>>>16)>>>16,e[7]=U=65535&C|T<<16,t[7]=G=65535&I|k<<16,J+=128,n-=128}return n}function Z(e,t,r){var n,a=new Int32Array(8),i=new Int32Array(8),s=new Uint8Array(256),o=r;for(a[0]=1779033703,a[1]=3144134277,a[2]=1013904242,a[3]=2773480762,a[4]=1359893119,a[5]=2600822924,a[6]=528734635,a[7]=1541459225,i[0]=4089235720,i[1]=2227873595,i[2]=4271175723,i[3]=1595750129,i[4]=2917565137,i[5]=725511199,i[6]=4215389547,i[7]=327033209,Y(a,i,t,r),r%=128,n=0;n<r;n++)s[n]=t[o-r+n];for(s[r]=128,s[(r=256-128*(r<112?1:0))-9]=0,p(s,r-8,o/536870912|0,o<<3),Y(a,i,s,r),n=0;n<8;n++)p(e,8*n,a[n],i[n]);return 0}function X(e,r){var n=t(),a=t(),i=t(),s=t(),o=t(),c=t(),d=t(),u=t(),l=t();D(n,e[1],e[0]),D(l,r[1],r[0]),U(n,n,l),F(a,e[0],e[1]),F(l,r[0],r[1]),U(a,a,l),U(i,e[3],r[3]),U(i,i,f),U(s,e[2],r[2]),F(s,s,s),D(o,a,n),D(c,s,i),F(d,s,i),F(u,a,n),U(e[0],o,c),U(e[1],u,d),U(e[2],d,c),U(e[3],o,u)}function Q(e,t,r){var n;for(n=0;n<4;n++)O(e[n],t[n],r)}function ee(e,r){var n=t(),a=t(),i=t();j(i,r[2]),U(n,r[0],i),U(a,r[1],i),R(e,a),e[31]^=P(n)<<7}function te(e,t,r){var n,a;for(B(e[0],s),B(e[1],o),B(e[2],o),B(e[3],s),a=255;a>=0;--a)Q(e,t,n=r[a/8|0]>>(7&a)&1),X(t,e),X(e,e),Q(e,t,n)}function re(e,r){var n=[t(),t(),t(),t()];B(n[0],u),B(n[1],l),B(n[2],o),U(n[3],u,l),te(e,n,r)}function ne(e,r,a){var i,s=new Uint8Array(64),o=[t(),t(),t(),t()];for(a||n(r,32),Z(s,r,32),s[0]&=248,s[31]&=127,s[31]|=64,re(o,s),ee(e,o),i=0;i<32;i++)r[i+32]=e[i];return 0}var ae=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ie(e,t){var r,n,a,i;for(n=63;n>=32;--n){for(r=0,a=n-32,i=n-12;a<i;++a)t[a]+=r-16*t[n]*ae[a-(n-32)],r=Math.floor((t[a]+128)/256),t[a]-=256*r;t[a]+=r,t[n]=0}for(r=0,a=0;a<32;a++)t[a]+=r-(t[31]>>4)*ae[a],r=t[a]>>8,t[a]&=255;for(a=0;a<32;a++)t[a]-=r*ae[a];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function se(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;ie(e,r)}function oe(e,r,n,a){var i,s,o=new Uint8Array(64),c=new Uint8Array(64),d=new Uint8Array(64),f=new Float64Array(64),u=[t(),t(),t(),t()];Z(o,a,32),o[0]&=248,o[31]&=127,o[31]|=64;var l=n+64;for(i=0;i<n;i++)e[64+i]=r[i];for(i=0;i<32;i++)e[32+i]=o[32+i];for(Z(d,e.subarray(32),n+32),se(d),re(u,d),ee(e,u),i=32;i<64;i++)e[i]=a[i];for(Z(c,e,n+64),se(c),i=0;i<64;i++)f[i]=0;for(i=0;i<32;i++)f[i]=d[i];for(i=0;i<32;i++)for(s=0;s<32;s++)f[i+s]+=c[i]*o[s];return ie(e.subarray(32),f),l}function ce(e,r,n,a){var i,c=new Uint8Array(32),f=new Uint8Array(64),u=[t(),t(),t(),t()],l=[t(),t(),t(),t()];if(n<64)return-1;if(function(e,r){var n=t(),a=t(),i=t(),c=t(),f=t(),u=t(),l=t();return B(e[2],o),L(e[1],r),H(i,e[1]),U(c,i,d),D(i,i,e[2]),F(c,e[2],c),H(f,c),H(u,f),U(l,u,f),U(n,l,i),U(n,n,c),V(n,n),U(n,n,i),U(n,n,c),U(n,n,c),U(e[0],n,c),H(a,e[0]),U(a,a,c),N(a,i)&&U(e[0],e[0],h),H(a,e[0]),U(a,a,c),N(a,i)?-1:(P(e[0])===r[31]>>7&&D(e[0],s,e[0]),U(e[3],e[0],e[1]),0)}(l,a))return-1;for(i=0;i<n;i++)e[i]=r[i];for(i=0;i<32;i++)e[i+32]=a[i];if(Z(f,e,n),se(f),te(u,l,f),re(l,r.subarray(32)),X(u,l),ee(c,u),n-=64,y(r,0,c,0)){for(i=0;i<n;i++)e[i]=0;return-1}for(i=0;i<n;i++)e[i]=r[i+64];return n}var de=16,fe=64,ue=32,le=64;function he(e,t){if(32!==e.length)throw new Error("bad key size");if(24!==t.length)throw new Error("bad nonce size")}function pe(){for(var e=0;e<arguments.length;e++)if(!(arguments[e]instanceof Uint8Array))throw new TypeError("unexpected type, use Uint8Array")}function be(e){for(var t=0;t<e.length;t++)e[t]=0}e.lowlevel={crypto_core_hsalsa20:w,crypto_stream_xor:x,crypto_stream:_,crypto_stream_salsa20_xor:E,crypto_stream_salsa20:A,crypto_onetimeauth:I,crypto_onetimeauth_verify:k,crypto_verify_16:g,crypto_verify_32:y,crypto_secretbox:C,crypto_secretbox_open:T,crypto_scalarmult:$,crypto_scalarmult_base:z,crypto_box_beforenm:K,crypto_box_afternm:G,crypto_box:function(e,t,r,n,a,i){var s=new Uint8Array(32);return K(s,a,i),G(e,t,r,n,s)},crypto_box_open:function(e,t,r,n,a,i){var s=new Uint8Array(32);return K(s,a,i),J(e,t,r,n,s)},crypto_box_keypair:q,crypto_hash:Z,crypto_sign:oe,crypto_sign_keypair:ne,crypto_sign_open:ce,crypto_secretbox_KEYBYTES:32,crypto_secretbox_NONCEBYTES:24,crypto_secretbox_ZEROBYTES:32,crypto_secretbox_BOXZEROBYTES:de,crypto_scalarmult_BYTES:32,crypto_scalarmult_SCALARBYTES:32,crypto_box_PUBLICKEYBYTES:32,crypto_box_SECRETKEYBYTES:32,crypto_box_BEFORENMBYTES:32,crypto_box_NONCEBYTES:24,crypto_box_ZEROBYTES:32,crypto_box_BOXZEROBYTES:16,crypto_sign_BYTES:fe,crypto_sign_PUBLICKEYBYTES:ue,crypto_sign_SECRETKEYBYTES:le,crypto_sign_SEEDBYTES:32,crypto_hash_BYTES:64,gf:t,D:d,L:ae,pack25519:R,unpack25519:L,M:U,A:F,S:H,Z:D,pow2523:V,add:X,set25519:B,modL:ie,scalarmult:te,scalarbase:re},e.randomBytes=function(e){var t=new Uint8Array(e);return n(t,e),t},e.secretbox=function(e,t,r){pe(e,t,r),he(r,t);for(var n=new Uint8Array(32+e.length),a=new Uint8Array(n.length),i=0;i<e.length;i++)n[i+32]=e[i];return C(a,n,n.length,t,r),a.subarray(de)},e.secretbox.open=function(e,t,r){pe(e,t,r),he(r,t);for(var n=new Uint8Array(de+e.length),a=new Uint8Array(n.length),i=0;i<e.length;i++)n[i+de]=e[i];return n.length<32||0!==T(a,n,n.length,t,r)?null:a.subarray(32)},e.secretbox.keyLength=32,e.secretbox.nonceLength=24,e.secretbox.overheadLength=de,e.scalarMult=function(e,t){if(pe(e,t),32!==e.length)throw new Error("bad n size");if(32!==t.length)throw new Error("bad p size");var r=new Uint8Array(32);return $(r,e,t),r},e.scalarMult.base=function(e){if(pe(e),32!==e.length)throw new Error("bad n size");var t=new Uint8Array(32);return z(t,e),t},e.scalarMult.scalarLength=32,e.scalarMult.groupElementLength=32,e.box=function(t,r,n,a){var i=e.box.before(n,a);return e.secretbox(t,r,i)},e.box.before=function(e,t){pe(e,t),function(e,t){if(32!==e.length)throw new Error("bad public key size");if(32!==t.length)throw new Error("bad secret key size")}(e,t);var r=new Uint8Array(32);return K(r,e,t),r},e.box.after=e.secretbox,e.box.open=function(t,r,n,a){var i=e.box.before(n,a);return e.secretbox.open(t,r,i)},e.box.open.after=e.secretbox.open,e.box.keyPair=function(){var e=new Uint8Array(32),t=new Uint8Array(32);return q(e,t),{publicKey:e,secretKey:t}},e.box.keyPair.fromSecretKey=function(e){if(pe(e),32!==e.length)throw new Error("bad secret key size");var t=new Uint8Array(32);return z(t,e),{publicKey:t,secretKey:new Uint8Array(e)}},e.box.publicKeyLength=32,e.box.secretKeyLength=32,e.box.sharedKeyLength=32,e.box.nonceLength=24,e.box.overheadLength=e.secretbox.overheadLength,e.sign=function(e,t){if(pe(e,t),t.length!==le)throw new Error("bad secret key size");var r=new Uint8Array(fe+e.length);return oe(r,e,e.length,t),r},e.sign.open=function(e,t){if(pe(e,t),t.length!==ue)throw new Error("bad public key size");var r=new Uint8Array(e.length),n=ce(r,e,e.length,t);if(n<0)return null;for(var a=new Uint8Array(n),i=0;i<a.length;i++)a[i]=r[i];return a},e.sign.detached=function(t,r){for(var n=e.sign(t,r),a=new Uint8Array(fe),i=0;i<a.length;i++)a[i]=n[i];return a},e.sign.detached.verify=function(e,t,r){if(pe(e,t,r),t.length!==fe)throw new Error("bad signature size");if(r.length!==ue)throw new Error("bad public key size");var n,a=new Uint8Array(fe+e.length),i=new Uint8Array(fe+e.length);for(n=0;n<fe;n++)a[n]=t[n];for(n=0;n<e.length;n++)a[n+fe]=e[n];return ce(i,a,a.length,r)>=0},e.sign.keyPair=function(){var e=new Uint8Array(ue),t=new Uint8Array(le);return ne(e,t),{publicKey:e,secretKey:t}},e.sign.keyPair.fromSecretKey=function(e){if(pe(e),e.length!==le)throw new Error("bad secret key size");for(var t=new Uint8Array(ue),r=0;r<t.length;r++)t[r]=e[32+r];return{publicKey:t,secretKey:new Uint8Array(e)}},e.sign.keyPair.fromSeed=function(e){if(pe(e),32!==e.length)throw new Error("bad seed size");for(var t=new Uint8Array(ue),r=new Uint8Array(le),n=0;n<32;n++)r[n]=e[n];return ne(t,r,!0),{publicKey:t,secretKey:r}},e.sign.publicKeyLength=ue,e.sign.secretKeyLength=le,e.sign.seedLength=32,e.sign.signatureLength=fe,e.hash=function(e){pe(e);var t=new Uint8Array(64);return Z(t,e,e.length),t},e.hash.hashLength=64,e.verify=function(e,t){return pe(e,t),0!==e.length&&0!==t.length&&(e.length===t.length&&0===b(e,0,t,0,e.length))},e.setPRNG=function(e){n=e},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;if(t&&t.getRandomValues){e.setPRNG((function(e,r){var n,a=new Uint8Array(r);for(n=0;n<r;n+=65536)t.getRandomValues(a.subarray(n,n+Math.min(r-n,65536)));for(n=0;n<r;n++)e[n]=a[n];be(a)}))}else(t=r(7976))&&t.randomBytes&&e.setPRNG((function(e,r){var n,a=t.randomBytes(r);for(n=0;n<r;n++)e[n]=a[n];be(a)}))}()}(e.exports?e.exports:self.nacl=self.nacl||{})},8667:function(e,t,r){var n,a,i;i=function(){return function(){return function(e){var t=[];if(0===e.length)return"";if("string"!=typeof e[0])throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var r=e.shift();e[0]=r+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var n=0;n<e.length;n++){var a=e[n];if("string"!=typeof a)throw new TypeError("Url must be a string. Received "+a);""!==a&&(n>0&&(a=a.replace(/^[\/]+/,"")),a=n<e.length-1?a.replace(/[\/]+$/,""):a.replace(/[\/]+$/,"/"),t.push(a))}var i=t.join("/"),s=(i=i.replace(/\/(\?|&|#[^!])/g,"$1")).split("?");return s.shift()+(s.length>0?"?":"")+s.join("&")}("object"==typeof arguments[0]?arguments[0]:[].slice.call(arguments))}},e.exports?e.exports=i():void 0===(a="function"==typeof(n=i)?n.call(t,r,t,e):n)||(e.exports=a)},6603:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DOMException:()=>E,Headers:()=>f,Request:()=>y,Response:()=>w,fetch:()=>A});var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==r.g&&r.g||{},a={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};if(a.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function o(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function c(e){return"string"!=typeof e&&(e=String(e)),e}function d(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return a.iterable&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function u(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function l(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function h(e){var t=new FileReader,r=l(t);return t.readAsArrayBuffer(e),r}function p(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:a.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a.arrayBuffer&&a.blob&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=p(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||s(e))?this._bodyArrayBuffer=p(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var e=u(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=u(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(a.blob)return this.blob().then(h);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,r,n,a,i=u(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=l(t),n=/charset=([A-Za-z0-9_-]+)/.exec(e.type),a=n?n[1]:"utf-8",t.readAsText(e,a),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(m)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=o(e),t=c(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},f.prototype.delete=function(e){delete this.map[o(e)]},f.prototype.get=function(e){return e=o(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(o(e))},f.prototype.set=function(e,t){this.map[o(e)]=c(t)},f.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),d(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),d(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),d(e)},a.iterable&&(f.prototype[Symbol.iterator]=f.prototype.entries);var g=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function y(e,t){if(!(this instanceof y))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,a,i=(t=t||{}).body;if(e instanceof y){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(r=t.method||this.method||"GET",a=r.toUpperCase(),g.indexOf(a)>-1?a:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in n)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var s=/([?&])_=[^&]*/;if(s.test(this.url))this.url=this.url.replace(s,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function m(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),a=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(a))}})),t}function w(e,t){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},b.call(y.prototype),b.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var v=[301,302,303,307,308];w.redirect=function(e,t){if(-1===v.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})};var E=n.DOMException;try{new E}catch(e){(E=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack}).prototype=Object.create(Error.prototype),E.prototype.constructor=E}function A(e,t){return new Promise((function(r,i){var s=new y(e,t);if(s.signal&&s.signal.aborted)return i(new E("Aborted","AbortError"));var d=new XMLHttpRequest;function u(){d.abort()}if(d.onload=function(){var e,t,n={statusText:d.statusText,headers:(e=d.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var a=r.join(":").trim();try{t.append(n,a)}catch(e){console.warn("Response "+e.message)}}})),t)};0===s.url.indexOf("file://")&&(d.status<200||d.status>599)?n.status=200:n.status=d.status,n.url="responseURL"in d?d.responseURL:n.headers.get("X-Request-URL");var a="response"in d?d.response:d.responseText;setTimeout((function(){r(new w(a,n))}),0)},d.onerror=function(){setTimeout((function(){i(new TypeError("Network request failed"))}),0)},d.ontimeout=function(){setTimeout((function(){i(new TypeError("Network request timed out"))}),0)},d.onabort=function(){setTimeout((function(){i(new E("Aborted","AbortError"))}),0)},d.open(s.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(s.url),!0),"include"===s.credentials?d.withCredentials=!0:"omit"===s.credentials&&(d.withCredentials=!1),"responseType"in d&&(a.blob?d.responseType="blob":a.arrayBuffer&&(d.responseType="arraybuffer")),t&&"object"==typeof t.headers&&!(t.headers instanceof f||n.Headers&&t.headers instanceof n.Headers)){var l=[];Object.getOwnPropertyNames(t.headers).forEach((function(e){l.push(o(e)),d.setRequestHeader(e,c(t.headers[e]))})),s.headers.forEach((function(e,t){-1===l.indexOf(t)&&d.setRequestHeader(t,e)}))}else s.headers.forEach((function(e,t){d.setRequestHeader(t,e)}));s.signal&&(s.signal.addEventListener("abort",u),d.onreadystatechange=function(){4===d.readyState&&s.signal.removeEventListener("abort",u)}),d.send(void 0===s._bodyInit?null:s._bodyInit)}))}A.polyfill=!0,n.fetch||(n.fetch=A,n.Headers=f,n.Request=y,n.Response=w)},967:(e,t,r)=>{var n={"./en.json":517,"./fr.json":1254};function a(e){return Promise.resolve().then((()=>{if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}var a=n[e];return r.t(a,19)}))}a.keys=()=>Object.keys(n),a.id=967,e.exports=a},8993:()=>{},4976:()=>{},8379:()=>{},3553:()=>{},2661:()=>{},6928:()=>{},7976:()=>{},9999:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Struct:()=>f,StructError:()=>n,any:()=>S,array:()=>I,assert:()=>u,assign:()=>g,bigint:()=>k,boolean:()=>C,coerce:()=>Y,create:()=>l,date:()=>T,defaulted:()=>Z,define:()=>y,deprecated:()=>m,dynamic:()=>w,empty:()=>Q,enums:()=>B,func:()=>M,instance:()=>O,integer:()=>R,intersection:()=>N,is:()=>p,lazy:()=>v,literal:()=>P,map:()=>L,mask:()=>h,max:()=>te,min:()=>re,never:()=>F,nonempty:()=>ne,nullable:()=>D,number:()=>U,object:()=>H,omit:()=>E,optional:()=>j,partial:()=>A,pattern:()=>ae,pick:()=>_,record:()=>V,refine:()=>se,regexp:()=>$,set:()=>z,size:()=>ie,string:()=>q,struct:()=>x,trimmed:()=>X,tuple:()=>K,type:()=>G,union:()=>J,unknown:()=>W,validate:()=>b});class n extends TypeError{constructor(e,t){let r;const{message:n,explanation:a,...i}=e,{path:s}=e,o=0===s.length?n:`At path: ${s.join(".")} -- ${n}`;super(a??o),null!=a&&(this.cause=o),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}}function a(e){return"object"==typeof e&&null!=e}function i(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function s(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function o(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:a,branch:i}=t,{type:o}=r,{refinement:c,message:d=`Expected a value of type \`${o}\`${c?` with refinement \`${c}\``:""}, but received: \`${s(n)}\``}=e;return{value:n,type:o,refinement:c,key:a[a.length-1],path:a,branch:i,...e,message:d}}function*c(e,t,r,n){var i;a(i=e)&&"function"==typeof i[Symbol.iterator]||(e=[e]);for(const a of e){const e=o(a,t,r,n);e&&(yield e)}}function*d(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:o=!1}=r,c={path:n,branch:i};if(s&&(e=t.coercer(e,c),o&&"type"!==t.type&&a(t.schema)&&a(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let f="valid";for(const n of t.validator(e,c))n.explanation=r.message,f="not_valid",yield[n,void 0];for(let[u,l,h]of t.entries(e,c)){const t=d(l,h,{path:void 0===u?n:[...n,u],branch:void 0===u?i:[...i,l],coerce:s,mask:o,message:r.message});for(const r of t)r[0]?(f=null!=r[0].refinement?"not_refined":"not_valid",yield[r[0],void 0]):s&&(l=r[1],void 0===u?e=l:e instanceof Map?e.set(u,l):e instanceof Set?e.add(l):a(e)&&(void 0!==l||u in e)&&(e[u]=l))}if("not_valid"!==f)for(const n of t.refiner(e,c))n.explanation=r.message,f="not_refined",yield[n,void 0];"valid"===f&&(yield[void 0,e])}class f{constructor(e){const{type:t,schema:r,validator:n,refiner:a,coercer:i=(e=>e),entries:s=function*(){}}=e;this.type=t,this.schema=r,this.entries=s,this.coercer=i,this.validator=n?(e,t)=>c(n(e,t),t,this,e):()=>[],this.refiner=a?(e,t)=>c(a(e,t),t,this,e):()=>[]}assert(e,t){return u(e,this,t)}create(e,t){return l(e,this,t)}is(e){return p(e,this)}mask(e,t){return h(e,this,t)}validate(e,t={}){return b(e,this,t)}}function u(e,t,r){const n=b(e,t,{message:r});if(n[0])throw n[0]}function l(e,t,r){const n=b(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function h(e,t,r){const n=b(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function p(e,t){return!b(e,t)[0]}function b(e,t,r={}){const a=d(e,t,r),i=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(a);if(i[0]){return[new n(i[0],(function*(){for(const e of a)e[0]&&(yield e[0])})),void 0]}return[void 0,i[1]]}function g(...e){const t="type"===e[0].type,r=e.map((e=>e.schema)),n=Object.assign({},...r);return t?G(n):H(n)}function y(e,t){return new f({type:e,schema:null,validator:t})}function m(e,t){return new f({...e,refiner:(t,r)=>void 0===t||e.refiner(t,r),validator:(r,n)=>void 0===r||(t(r,n),e.validator(r,n))})}function w(e){return new f({type:"dynamic",schema:null,*entries(t,r){const n=e(t,r);yield*n.entries(t,r)},validator:(t,r)=>e(t,r).validator(t,r),coercer:(t,r)=>e(t,r).coercer(t,r),refiner:(t,r)=>e(t,r).refiner(t,r)})}function v(e){let t;return new f({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator:(r,n)=>(t??(t=e()),t.validator(r,n)),coercer:(r,n)=>(t??(t=e()),t.coercer(r,n)),refiner:(r,n)=>(t??(t=e()),t.refiner(r,n))})}function E(e,t){const{schema:r}=e,n={...r};for(const e of t)delete n[e];return"type"===e.type?G(n):H(n)}function A(e){const t=e instanceof f,r=t?{...e.schema}:{...e};for(const e in r)r[e]=j(r[e]);return t&&"type"===e.type?G(r):H(r)}function _(e,t){const{schema:r}=e,n={};for(const e of t)n[e]=r[e];return"type"===e.type?G(n):H(n)}function x(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),y(e,t)}function S(){return y("any",(()=>!0))}function I(e){return new f({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${s(e)}`})}function k(){return y("bigint",(e=>"bigint"==typeof e))}function C(){return y("boolean",(e=>"boolean"==typeof e))}function T(){return y("date",(e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${s(e)}`))}function B(e){const t={},r=e.map((e=>s(e))).join();for(const r of e)t[r]=r;return new f({type:"enums",schema:t,validator:t=>e.includes(t)||`Expected one of \`${r}\`, but received: ${s(t)}`})}function M(){return y("func",(e=>"function"==typeof e||`Expected a function, but received: ${s(e)}`))}function O(e){return y("instance",(t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${s(t)}`))}function R(){return y("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${s(e)}`))}function N(e){return new f({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function P(e){const t=s(e),r=typeof e;return new f({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||`Expected the literal \`${t}\`, but received: ${s(r)}`})}function L(e,t){return new f({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,a]of r.entries())yield[n,n,e],yield[n,a,t]},coercer:e=>e instanceof Map?new Map(e):e,validator:e=>e instanceof Map||`Expected a \`Map\` object, but received: ${s(e)}`})}function F(){return y("never",(()=>!1))}function D(e){return new f({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})}function U(){return y("number",(e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${s(e)}`))}function H(e){const t=e?Object.keys(e):[],r=F();return new f({type:"object",schema:e||null,*entries(n){if(e&&a(n)){const a=new Set(Object.keys(n));for(const r of t)a.delete(r),yield[r,n[r],e[r]];for(const e of a)yield[e,n[e],r]}},validator:e=>a(e)||`Expected an object, but received: ${s(e)}`,coercer:e=>a(e)?{...e}:e})}function j(e){return new f({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})}function V(e,t){return new f({type:"record",schema:null,*entries(r){if(a(r))for(const n in r){const a=r[n];yield[n,n,e],yield[n,a,t]}},validator:e=>a(e)||`Expected an object, but received: ${s(e)}`})}function $(){return y("regexp",(e=>e instanceof RegExp))}function z(e){return new f({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer:e=>e instanceof Set?new Set(e):e,validator:e=>e instanceof Set||`Expected a \`Set\` object, but received: ${s(e)}`})}function q(){return y("string",(e=>"string"==typeof e||`Expected a string, but received: ${s(e)}`))}function K(e){const t=F();return new f({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let a=0;a<n;a++)yield[a,r[a],e[a]||t]}},validator:e=>Array.isArray(e)||`Expected an array, but received: ${s(e)}`})}function G(e){const t=Object.keys(e);return new f({type:"type",schema:e,*entries(r){if(a(r))for(const n of t)yield[n,r[n],e[n]]},validator:e=>a(e)||`Expected an object, but received: ${s(e)}`,coercer:e=>a(e)?{...e}:e})}function J(e){const t=e.map((e=>e.type)).join(" | ");return new f({type:"union",schema:null,coercer(t){for(const r of e){const[e,n]=r.validate(t,{coerce:!0});if(!e)return n}return t},validator(r,n){const a=[];for(const t of e){const[...e]=d(r,t,n),[i]=e;if(!i[0])return[];for(const[t]of e)t&&a.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${s(r)}`,...a]}})}function W(){return y("unknown",(()=>!0))}function Y(e,t,r){return new f({...e,coercer:(n,a)=>p(n,t)?e.coercer(r(n,a),a):e.coercer(n,a)})}function Z(e,t,r={}){return Y(e,W(),(e=>{const n="function"==typeof t?t():t;if(void 0===e)return n;if(!r.strict&&i(e)&&i(n)){const t={...e};let r=!1;for(const e in n)void 0===t[e]&&(t[e]=n[e],r=!0);if(r)return t}return e}))}function X(e){return Y(e,q(),(e=>e.trim()))}function Q(e){return se(e,"empty",(t=>{const r=ee(t);return 0===r||`Expected an empty ${e.type} but received one with a size of \`${r}\``}))}function ee(e){return e instanceof Map||e instanceof Set?e.size:e.length}function te(e,t,r={}){const{exclusive:n}=r;return se(e,"max",(r=>n?r<t:r<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${r}\``))}function re(e,t,r={}){const{exclusive:n}=r;return se(e,"min",(r=>n?r>t:r>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${r}\``))}function ne(e){return se(e,"nonempty",(t=>ee(t)>0||`Expected a nonempty ${e.type} but received an empty one`))}function ae(e,t){return se(e,"pattern",(r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`))}function ie(e,t,r=t){const n=`Expected a ${e.type}`,a=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return se(e,"size",(e=>{if("number"==typeof e||e instanceof Date)return t<=e&&e<=r||`${n} ${a} but received \`${e}\``;if(e instanceof Map||e instanceof Set){const{size:i}=e;return t<=i&&i<=r||`${n} with a size ${a} but received one with a size of \`${i}\``}{const{length:i}=e;return t<=i&&i<=r||`${n} with a length ${a} but received one with a length of \`${i}\``}}))}function se(e,t,r){return new f({...e,*refiner(n,a){yield*e.refiner(n,a);const i=c(r(n,a),a,e,n);for(const e of i)yield{...e,refinement:t}}})}},183:e=>{"use strict";e.exports={rE:"6.5.5"}},517:e=>{"use strict";e.exports=JSON.parse('{"locale":"en","messages":{"accountDeploymentMandatory":{"message":"Account Deployment Mandatory!"},"accountDeploymentNotice":{"message":"The account will be deployed with this transaction."},"accountManagementIntro":{"message":"To manage your Canton account and send and receive funds, visit the"},"accountManagementReminder":{"message":"As usual, to manage your Canton account and send and receive funds, visit the"},"accountUpgradeMandatory":{"message":"Account Upgrade Mandatory!"},"addTokenPrompt":{"message":"Do you want to add this token?"},"address":{"message":"Address"},"amount":{"message":"Amount"},"amountWithSymbol":{"message":"Amount ({1})"},"autoSwitchToFundedToken":{"message":"If the chosen token has no funds, the system will automatically switch to a funded token."},"balance":{"message":"Balance"},"baseUrl":{"message":"Base URL"},"callData":{"message":"Call Data"},"call":{"message":"Call"},"chainId":{"message":"Chain ID"},"chainName":{"message":"Chain Name"},"classHash":{"message":"Class Hash"},"companionDapp":{"message":"companion dapp"},"compiledClassHash":{"message":"Compiled Class Hash"},"confirmPrivateKeyToDisplay":{"message":"Confirming this action will display your private key. Ensure you are in a secure environment."},"contract":{"message":"Contract"},"decimals":{"message":"Decimals"},"declareTransactionDetails":{"message":"Declare Transaction Details"},"estimatedGasFee":{"message":"Estimated Gas Fee"},"explorerUrl":{"message":"Explorer URL"},"feeToken":{"message":"Fee Token"},"message":{"message":"Message"},"maxFeeETH":{"message":"Max Fee (ETH)"},"name":{"message":"Name"},"network":{"message":"Network"},"networkFee":{"message":"network fee"},"recipientAddress":{"message":"Recipient Address"},"recipient":{"message":"Recipient"},"rpcUrl":{"message":"RPC URL"},"selectFeeToken":{"message":"Select Fee Token"},"senderAddress":{"message":"Sender Address"},"signMessagePrompt":{"message":"Do you want to sign this message?"},"signTransactionPrompt":{"message":"Do you want to sign this transaction?"},"signerAddress":{"message":"Signer Address"},"signer":{"message":"Signer"},"snapIsUpToDate":{"message":"Your CC Snap is now up-to-date!"},"starknetPrivateKeyConfidential":{"message":"Below is your Canton Account private key. Keep it confidential."},"starknetPrivateKey":{"message":"Canton Account Private Key"},"switchNetworkPrompt":{"message":"Do you want to switch to this network?"},"symbol":{"message":"Symbol"},"token":{"message":"Token"},"totalFor":{"message":"Total for"},"transaction":{"message":"Transaction"},"transactions":{"message":"Transactions"},"visitCompanionDappHomePage":{"message":"Visit the [companion dapp]({1}) to manage your account."},"visitCompanionDappAndDeploy":{"message":"Visit the [companion dapp]({1}) to deploy your account.\\nThank you!"},"visitCompanionDappAndUpgrade":{"message":"Visit the [companion dapp]({1}) and click “Upgrade”.\\nThank you!"},"walletIsCompatible":{"message":"Your MetaMask wallet is now compatible with Canton!"}}}')},1254:e=>{"use strict";e.exports=JSON.parse('{"locale":"fr","messages":{"accountDeploymentMandatory":{"message":"Déploiement du compte obligatoire !"},"accountDeploymentNotice":{"message":"Le compte sera déployé avec cette transaction."},"accountManagementIntro":{"message":"Pour gérer votre compte Starknet et envoyer ou recevoir des fonds, accédez à cette page"},"accountManagementReminder":{"message":"Comme d\'habitude, pour gérer votre compte Starknet et envoyer ou recevoir des fonds, accédez à cette page"},"accountUpgradeMandatory":{"message":"Mise à niveau du compte obligatoire !"},"addTokenPrompt":{"message":"Voulez-vous ajouter ce token ?"},"address":{"message":"Adresse"},"amount":{"message":"Montant"},"amountWithSymbol":{"message":"Montant ({1})"},"autoSwitchToFundedToken":{"message":"Si le jeton choisi n\'a pas de solde, le système passera automatiquement à un jeton avec solde."},"balance":{"message":"Solde"},"baseUrl":{"message":"URL de base"},"callData":{"message":"Données d\'appel"},"call":{"message":"Appel"},"chainId":{"message":"ID de la chaîne"},"chainName":{"message":"Nom de la chaîne"},"classHash":{"message":"Hash de la classe"},"companionDapp":{"message":"dapp compagnon pour Starknet"},"compiledClassHash":{"message":"Hash de la classe compilée"},"confirmPrivateKeyToDisplay":{"message":"Confirmer cette action affichera votre clé privée. Assurez-vous d\'être dans un environnement sécurisé."},"contract":{"message":"Contrat"},"decimals":{"message":"Décimales"},"declareTransactionDetails":{"message":"Détails de la transaction à déclarer"},"estimatedGasFee":{"message":"Frais de gaz estimés"},"explorerUrl":{"message":"URL de l\'explorateur"},"feeToken":{"message":"Jeton de frais"},"message":{"message":"Message"},"maxFeeETH":{"message":"Frais max (ETH)"},"name":{"message":"Nom"},"network":{"message":"Réseau"},"networkFee":{"message":"frais de réseau"},"recipientAddress":{"message":"Adresse du destinataire"},"recipient":{"message":"Destinataire"},"rpcUrl":{"message":"URL RPC"},"selectFeeToken":{"message":"Sélectionner le jeton de frais"},"senderAddress":{"message":"Adresse de l\'expéditeur"},"signMessagePrompt":{"message":"Voulez-vous signer ce message ?"},"signTransactionPrompt":{"message":"Voulez-vous signer cette transaction ?"},"signerAddress":{"message":"Adresse du signataire"},"signer":{"message":"Signataire"},"snapIsUpToDate":{"message":"Votre Starknet Snap est maintenant à jour !"},"starknetPrivateKeyConfidential":{"message":"Voici la clé privée de votre compte Starknet. Gardez-la confidentielle."},"starknetPrivateKey":{"message":"Clé privée du compte Starknet"},"switchNetworkPrompt":{"message":"Voulez-vous changer pour ce réseau ?"},"symbol":{"message":"Symbole"},"token":{"message":"Token"},"totalFor":{"message":"Total pour"},"transaction":{"message":"Transaction"},"transactions":{"message":"Transactions"},"visitCompanionDappHomePage":{"message":"Visitez la [dapp compagnon pour Starknet]({1}) pour gérer votre compte."},"visitCompanionDappAndDeploy":{"message":"Visitez la [dapp compagnon pour Starknet]({1}) pour déployer votre compte.\\nMerci !"},"visitCompanionDappAndUpgrade":{"message":"Visitez la [dapp compagnon pour Starknet]({1}) et cliquez sur “Upgrade”.\\nMerci !"},"walletIsCompatible":{"message":"Votre portefeuille MetaMask est désormais compatible avec Starknet !"}}}')}},n={};function a(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={id:e,loaded:!1,exports:{}};return r[e].call(i.exports,i,i.exports,a),i.loaded=!0,i.exports}a.amdO={},a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"==typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"==typeof r.then)return r}var i=Object.create(null);a.r(i);var s={};e=e||[null,t({}),t([]),t(t)];for(var o=2&n&&r;"object"==typeof o&&!~e.indexOf(o);o=t(o))Object.getOwnPropertyNames(o).forEach((e=>s[e]=()=>r[e]));return s.default=()=>r,a.d(i,s),i},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.e=()=>Promise.resolve(),a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var i={};(()=>{"use strict";a.r(i),a.d(i,{onHomePage:()=>ML,onInstall:()=>TL,onRpcRequest:()=>CL,onUpdate:()=>BL,onUserInput:()=>OL,signTransactionHash:()=>kL});var e={};a.r(e);var t={};a.r(t);var r={};a.r(r),a.d(r,{EBlockTag:()=>Ft,EDAMode:()=>Ut,EDataAvailabilityMode:()=>Dt,ESimulationFlag:()=>Rt,ETransactionExecutionStatus:()=>Lt,ETransactionFinalityStatus:()=>Pt,ETransactionStatus:()=>Nt,ETransactionType:()=>Ot,ETransactionVersion:()=>Ht,ETransactionVersion2:()=>jt,ETransactionVersion3:()=>Vt,Errors:()=>e,SPEC:()=>t});var n={};a.r(n),a.d(n,{Permission:()=>$t,TypedDataRevision:()=>zt});var s={};a.r(s),a.d(s,{API:()=>r,EBlockTag:()=>Ft,EDAMode:()=>Ut,EDataAvailabilityMode:()=>Dt,ESimulationFlag:()=>Rt,ETransactionExecutionStatus:()=>Lt,ETransactionFinalityStatus:()=>Pt,ETransactionStatus:()=>Nt,ETransactionType:()=>Ot,ETransactionVersion:()=>Ht,ETransactionVersion2:()=>jt,ETransactionVersion3:()=>Vt,Errors:()=>e,Permission:()=>$t,SPEC:()=>t,TypedDataRevision:()=>zt,WALLET_API:()=>n});var o={};a.r(o);var c={};a.r(c),a.d(c,{ABI_TYPE_CONSTRUCTOR:()=>sr,ABI_TYPE_ENUM:()=>cr,ABI_TYPE_FUNCTION:()=>ir,ABI_TYPE_L1_HANDLER:()=>or,CALL_TYPE:()=>pr,CONTRACT:()=>o,EBlockTag:()=>vr,EDAMode:()=>Ar,EDataAvailabilityMode:()=>Er,ESimulationFlag:()=>gr,ETransactionExecutionStatus:()=>wr,ETransactionFinalityStatus:()=>mr,ETransactionStatus:()=>yr,ETransactionType:()=>br,ETransactionVersion:()=>_r,ETransactionVersion2:()=>xr,ETransactionVersion3:()=>Sr,EVENT_ABI_TYPE:()=>ar,L1_DA_MODE:()=>hr,PRICE_UNIT_FRI:()=>lr,PRICE_UNIT_WEI:()=>ur,STATE_MUTABILITY_EXTERNAL:()=>fr,STATE_MUTABILITY_VIEW:()=>dr,STATUS_ACCEPTED_ON_L1:()=>Kt,STATUS_ACCEPTED_ON_L2:()=>qt,STATUS_PENDING:()=>Wt,STATUS_RECEIVED:()=>Zt,STATUS_REJECTED:()=>Yt,STATUS_REVERTED:()=>Jt,STATUS_SUCCEEDED:()=>Gt,STRUCT_ABI_TYPE:()=>nr,TXN_TYPE_DECLARE:()=>Xt,TXN_TYPE_DEPLOY:()=>Qt,TXN_TYPE_DEPLOY_ACCOUNT:()=>er,TXN_TYPE_INVOKE:()=>tr,TXN_TYPE_L1_HANDLER:()=>rr});var d={};a.r(d),a.d(d,{Permission:()=>Ir,TypedDataRevision:()=>kr});var f={};a.r(f);var u={};a.r(u),a.d(u,{ABI_TYPE_CONSTRUCTOR:()=>sr,ABI_TYPE_ENUM:()=>cr,ABI_TYPE_FUNCTION:()=>ir,ABI_TYPE_L1_HANDLER:()=>or,API:()=>c,CALL_TYPE:()=>pr,CONTRACT:()=>o,EBlockTag:()=>vr,EDAMode:()=>Ar,EDataAvailabilityMode:()=>Er,ESimulationFlag:()=>gr,ETransactionExecutionStatus:()=>wr,ETransactionFinalityStatus:()=>mr,ETransactionStatus:()=>yr,ETransactionType:()=>br,ETransactionVersion:()=>_r,ETransactionVersion2:()=>xr,ETransactionVersion3:()=>Sr,EVENT_ABI_TYPE:()=>ar,L1_DA_MODE:()=>hr,PAYMASTER_API:()=>f,PRICE_UNIT_FRI:()=>lr,PRICE_UNIT_WEI:()=>ur,Permission:()=>Ir,STATE_MUTABILITY_EXTERNAL:()=>fr,STATE_MUTABILITY_VIEW:()=>dr,STATUS_ACCEPTED_ON_L1:()=>Kt,STATUS_ACCEPTED_ON_L2:()=>qt,STATUS_PENDING:()=>Wt,STATUS_RECEIVED:()=>Zt,STATUS_REJECTED:()=>Yt,STATUS_REVERTED:()=>Jt,STATUS_SUCCEEDED:()=>Gt,STRUCT_ABI_TYPE:()=>nr,TXN_TYPE_DECLARE:()=>Xt,TXN_TYPE_DEPLOY:()=>Qt,TXN_TYPE_DEPLOY_ACCOUNT:()=>er,TXN_TYPE_INVOKE:()=>tr,TXN_TYPE_L1_HANDLER:()=>rr,TypedDataRevision:()=>kr,WALLET_API:()=>d});var l={};a.r(l),a.d(l,{aK:()=>_a,e8:()=>oa,DO:()=>sa,dJ:()=>xa,OG:()=>Sa,My:()=>da,Ph:()=>ba,lX:()=>ga,Id:()=>va,fg:()=>Ca,qj:()=>wa,aT:()=>pa,r4:()=>Aa,aY:()=>ia,x:()=>Ma,lq:()=>ya,z:()=>ma,zW:()=>fa,Q5:()=>Ba});var h={};a.r(h),a.d(h,{aK:()=>ls,e8:()=>Wi,DO:()=>Ji,dJ:()=>hs,OG:()=>ps,My:()=>Zi,Ph:()=>ns,lX:()=>as,Id:()=>ds,fg:()=>ys,qj:()=>cs,aT:()=>rs,ME:()=>Qi,r4:()=>us,aY:()=>Gi,x:()=>vs,lq:()=>is,z:()=>ss,zW:()=>Xi,IV:()=>os,Q5:()=>ws});var p={};a.r(p),a.d(p,{CURVE:()=>Mo,Fp251:()=>Xo,MAX_VALUE:()=>mo,ProjectivePoint:()=>Oo,Signature:()=>Ro,_poseidonMDS:()=>ec,_starkCurve:()=>Ao,computeHashOnElements:()=>Jo,ethSigToPrivate:()=>Uo,getAccountPath:()=>jo,getPublicKey:()=>So,getSharedSecret:()=>Io,getStarkKey:()=>Do,grindKey:()=>Fo,keccak:()=>Yo,normalizePrivateKey:()=>xo,pedersen:()=>Go,poseidonBasic:()=>rc,poseidonCreate:()=>nc,poseidonHash:()=>ic,poseidonHashFunc:()=>sc,poseidonHashMany:()=>cc,poseidonHashSingle:()=>oc,poseidonSmall:()=>ac,sign:()=>To,utils:()=>No,verify:()=>Bo});var b={};a.r(b),a.d(b,{poseidon:()=>ed,splitConstants:()=>Qc,validateOpts:()=>Xc});var g={};a.r(g),a.d(g,{DER:()=>bd,SWUFpSqrtRatio:()=>_d,mapToCurveSimpleSWU:()=>xd,weierstrass:()=>Ad,weierstrassPoints:()=>Ed});var y={};a.r(y),a.d(y,{compressPublicKey:()=>Qx,curve:()=>ax,decompressPublicKey:()=>eS,deriveUnhardenedKeys:()=>Wx,getPublicKey:()=>Zx,isValidPrivateKey:()=>Jx,name:()=>Kx,publicAdd:()=>Xx,publicKeyLength:()=>Yx,secret:()=>Gx});var m={};a.r(m),a.d(m,{compressPublicKey:()=>IS,curve:()=>rA,decompressPublicKey:()=>kS,deriveUnhardenedKeys:()=>ES,getPublicKey:()=>xS,isValidPrivateKey:()=>_S,name:()=>wS,publicAdd:()=>SS,publicKeyLength:()=>AS,secret:()=>vS});var w={};a.r(w),a.d(w,{deriveChildKey:()=>BI,privateKeyToEthAddress:()=>CI,publicKeyToEthAddress:()=>TI});var v={};a.r(v),a.d(v,{bip39MnemonicToMultipath:()=>RI,createBip39KeyFromSeed:()=>PI,deriveChildKey:()=>NI});var E={};a.r(E),a.d(E,{deriveChildKey:()=>LI});var A={};function _(e,t,r){if("string"==typeof e)throw new Error(`An HTML element ("${String(e)}") was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.`);if(!e)throw new Error("A JSX fragment was used in a Snap component, which is not supported by Snaps UI. Please use one of the supported Snap components.");return e({...t,key:r})}function x(e,t,r){return _(e,t,r)}function S(e){return Boolean(e)&&"object"==typeof e&&!Array.isArray(e)}a.r(A),a.d(A,{xn:()=>iO,LM:()=>sO,lE:()=>oO,k4:()=>dO,Y8:()=>OO,oz:()=>rO,xF:()=>IO,iJ:()=>_O,r3:()=>EO,X6:()=>vO,sO:()=>nO,d9:()=>hO,gg:()=>AO,Fm:()=>SO,_d:()=>xO,fD:()=>RO,IG:()=>BO,Rl:()=>CO,lT:()=>TO,j9:()=>kO,hQ:()=>MO,ri:()=>pO});const I=(e,t)=>Object.hasOwnProperty.call(e,t);var k;!function(e){e[e.Null=4]="Null",e[e.Comma=1]="Comma",e[e.Wrapper=1]="Wrapper",e[e.True=4]="True",e[e.False=5]="False",e[e.Quote=1]="Quote",e[e.Colon=1]="Colon",e[e.Date=24]="Date"}(k=k||(k={}));function C(e){if("object"!=typeof e||null===e)return!1;try{let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}catch(e){return!1}}var T=a(282);class B extends TypeError{constructor(e,t){let r;const{message:n,explanation:a,...i}=e,{path:s}=e,o=0===s.length?n:`At path: ${s.join(".")} -- ${n}`;super(a??o),null!=a&&(this.cause=o),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}}function M(e){return"object"==typeof e&&null!==e}function O(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function R(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:a,branch:i}=t,{type:s}=r,{refinement:o,message:c=`Expected a value of type \`${s}\`${o?` with refinement \`${o}\``:""}, but received: \`${O(n)}\``}=e;return{value:n,type:s,refinement:o,key:a[a.length-1],path:a,branch:i,...e,message:c}}function*N(e,t,r,n){(function(e){return M(e)&&"function"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const a of e){const e=R(a,t,r,n);e&&(yield e)}}function*P(e,t,r={}){const{path:n=[],branch:a=[e],coerce:i=!1,mask:s=!1}=r,o={path:n,branch:a};if(i&&(e=t.coercer(e,o),s&&"type"!==t.type&&M(t.schema)&&M(e)&&!Array.isArray(e)))for(const r in e)void 0===t.schema[r]&&delete e[r];let c="valid";for(const n of t.validator(e,o))n.explanation=r.message,c="not_valid",yield[n,void 0];for(let[d,f,u]of t.entries(e,o)){const t=P(f,u,{path:void 0===d?n:[...n,d],branch:void 0===d?a:[...a,f],coerce:i,mask:s,message:r.message});for(const r of t)r[0]?(c=null===r[0].refinement||void 0===r[0].refinement?"not_valid":"not_refined",yield[r[0],void 0]):i&&(f=r[1],void 0===d?e=f:e instanceof Map?e.set(d,f):e instanceof Set?e.add(f):M(e)&&(void 0!==f||d in e)&&(e[d]=f))}if("not_valid"!==c)for(const n of t.refiner(e,o))n.explanation=r.message,c="not_refined",yield[n,void 0];"valid"===c&&(yield[void 0,e])}class L{constructor(e){const{type:t,schema:r,validator:n,refiner:a,coercer:i=(e=>e),entries:s=function*(){}}=e;this.type=t,this.schema=r,this.entries=s,this.coercer=i,this.validator=n?(e,t)=>N(n(e,t),t,this,e):()=>[],this.refiner=a?(e,t)=>N(a(e,t),t,this,e):()=>[]}assert(e,t){return F(e,this,t)}create(e,t){return D(e,this,t)}is(e){return U(e,this)}mask(e,t){return function(e,t,r){const n=H(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}(e,this,t)}validate(e,t={}){return H(e,this,t)}}function F(e,t,r){const n=H(e,t,{message:r});if(n[0])throw n[0]}function D(e,t,r){const n=H(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function U(e,t){return!H(e,t)[0]}function H(e,t,r={}){const n=P(e,t,r),a=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);if(a[0]){return[new B(a[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]}return[void 0,a[1]]}function j(...e){const t="type"===e[0]?.type,r=e.map((({schema:e})=>e)),n=Object.assign({},...r);return t?function(e){const t=Object.keys(e);return new L({type:"type",schema:e,*entries(r){if(M(r))for(const n of t)yield[n,r[n],e[n]]},validator:e=>M(e)||`Expected an object, but received: ${O(e)}`,coercer:e=>M(e)?{...e}:e})}(n):W(n)}function V(e,t){return new L({type:e,schema:null,validator:t})}function $(e){return new L({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${O(e)}`})}function z(){return V("boolean",(e=>"boolean"==typeof e))}function q(e){const t=O(e),r=typeof e;return new L({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||`Expected the literal \`${t}\`, but received: ${O(r)}`})}function K(){return V("never",(()=>!1))}function G(e){return new L({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})}function J(){return V("number",(e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${O(e)}`))}function W(e){const t=e?Object.keys(e):[],r=K();return new L({type:"object",schema:e??null,*entries(n){if(e&&M(n)){const a=new Set(Object.keys(n));for(const r of t)a.delete(r),yield[r,n[r],e[r]];for(const e of a)yield[e,n[e],r]}},validator:e=>M(e)||`Expected an object, but received: ${O(e)}`,coercer:e=>M(e)?{...e}:e})}function Y(e){return new L({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})}function Z(e,t){return new L({type:"record",schema:null,*entries(r){if(M(r))for(const n in r){const a=r[n];yield[n,n,e],yield[n,a,t]}},validator:e=>M(e)||`Expected an object, but received: ${O(e)}`})}function X(){return V("string",(e=>"string"==typeof e||`Expected a string, but received: ${O(e)}`))}function Q(e){const t=e.map((e=>e.type)).join(" | ");return new L({type:"union",schema:null,coercer(t){for(const r of e){const[e,n]=r.validate(t,{coerce:!0});if(!e)return n}return t},validator(r,n){const a=[];for(const t of e){const[...e]=P(r,t,n),[i]=e;if(!i?.[0])return[];for(const[t]of e)t&&a.push(t)}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${O(r)}`,...a]}})}function ee(){return V("unknown",(()=>!0))}function te(e,t,r){return new L({...e,coercer:(n,a)=>U(n,t)?e.coercer(r(n,a),a):e.coercer(n,a)})}Error;function re(e){return function(e){return function(e){return"object"==typeof e&&null!==e&&"message"in e}(e)&&"string"==typeof e.message?e.message:null==e?"":String(e)}(e).replace(/\.$/u,"")}function ne(e,t){return r=e,Boolean("string"==typeof r?.prototype?.constructor?.name)?new e({message:t}):e({message:t});var r}class ae extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}function ie(e,t,r="Assertion failed",n=ae){try{F(e,t)}catch(e){throw ne(n,`${r}: ${re(e)}.`)}}const se=e=>W(e);function oe({path:e,branch:t}){const r=e[e.length-1];return I(t[t.length-2],r)}function ce(e){return new L({...e,type:`optional ${e.type}`,validator:(t,r)=>!oe(r)||e.validator(t,r),refiner:(t,r)=>!oe(r)||e.refiner(t,r)})}function de(e){if(null===e||"boolean"==typeof e||"string"==typeof e)return!0;if("number"==typeof e&&Number.isFinite(e))return!0;if("object"==typeof e){let t=!0;if(Array.isArray(e)){for(let r=0;r<e.length;r++)if(!de(e[r])){t=!1;break}return t}const r=Object.entries(e);for(let e=0;e<r.length;e++)if("string"!=typeof r[e][0]||!de(r[e][1])){t=!1;break}return t}return!1}const fe=V("JSON",(e=>de(e))),ue=te(fe,V("any",(()=>!0)),(e=>(ie(e,fe),JSON.parse(JSON.stringify(e,((e,t)=>{if("__proto__"!==e&&"constructor"!==e)return t}))))));function le(e){try{return function(e){D(e,ue)}(e),!0}catch{return!1}}const he=q("2.0"),pe=G(Q([J(),X()])),be=se({code:V("integer",(e=>"number"==typeof e&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${O(e)}`)),message:X(),data:ce(ue),stack:ce(X())}),ge=Q([Z(X(),ue),$(ue)]);se({id:pe,jsonrpc:he,method:X(),params:ce(ge)}),se({jsonrpc:he,method:X(),params:ce(ge)});W({id:pe,jsonrpc:he,result:Y(ee()),error:Y(be)});const ye=se({id:pe,jsonrpc:he,result:ue}),me=se({id:pe,jsonrpc:he,error:be});Q([ye,me]);const we={invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},ve={userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901},Ee={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}},Ae=we.internal,_e="Unspecified error message. This is a bug, please report it.",xe=(Se(Ae),"Unspecified server error.");function Se(e,t=_e){if(function(e){return Number.isInteger(e)}(e)){const t=e.toString();if(I(Ee,t))return Ee[t].message;if(function(e){return e>=-32099&&e<=-32e3}(e))return xe}return t}function Ie(e){return Array.isArray(e)?e.map((e=>le(e)?e:S(e)?ke(e):null)):S(e)?ke(e):le(e)?e:null}function ke(e){return Object.getOwnPropertyNames(e).reduce(((t,r)=>{const n=e[r];return le(n)&&(t[r]=n),t}),{})}const Ce=(Te=T,Te?.__esModule?Te.default:Te);var Te;class Be extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a non-empty string.');!function(e){return S(e)&&I(e,"cause")&&S(e.cause)}(r)?super(t):(super(t,{cause:r.cause}),I(this,"cause")||Object.assign(this,{cause:r.cause})),void 0!==r&&(this.data=r),this.code=e}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data,C(this.data)&&(e.data.cause=Ie(this.data.cause))),this.stack&&(e.stack=this.stack),e}toString(){return Ce(this.serialize(),Oe,2)}}class Me extends Be{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}function Oe(e,t){if("[Circular]"!==t)return t}const Re=e=>We(we.parse,e),Ne=e=>We(we.invalidRequest,e),Pe=e=>We(we.invalidParams,e),Le=e=>We(we.methodNotFound,e),Fe=e=>We(we.internal,e),De=e=>We(we.invalidInput,e),Ue=e=>We(we.resourceNotFound,e),He=e=>We(we.resourceUnavailable,e),je=e=>We(we.transactionRejected,e),Ve=e=>We(we.methodNotSupported,e),$e=e=>We(we.limitExceeded,e),ze=e=>Ye(ve.userRejectedRequest,e),qe=e=>Ye(ve.unauthorized,e),Ke=e=>Ye(ve.unsupportedMethod,e),Ge=e=>Ye(ve.disconnected,e),Je=e=>Ye(ve.chainDisconnected,e);function We(e,t){const[r,n]=Ze(t);return new Be(e,r??Se(e),n)}function Ye(e,t){const[r,n]=Ze(t);return new Me(e,r??Se(e),n)}function Ze(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t??void 0,r]}}return[]}function Xe(e){return S(e)&&I(e,"data")&&"object"==typeof e.data&&null!==e.data&&le(e.data)&&!Array.isArray(e.data)?e.data:{}}var Qe,et,tt,rt,nt=function(e,t,r,n,a){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?a.call(e,r):a?a.value=r:t.set(e,r),r},at=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class it extends Error{constructor(e,t={}){const r=function(e){return S(e)&&I(e,"message")&&"string"==typeof e.message?e.message:String(e)}(e);super(r),Qe.set(this,void 0),et.set(this,void 0),tt.set(this,void 0),rt.set(this,void 0),nt(this,et,r,"f"),nt(this,Qe,function(e){return S(e)&&I(e,"code")&&"number"==typeof e.code&&Number.isInteger(e.code)?e.code:-32603}(e),"f");const n={...Xe(e),...t};Object.keys(n).length>0&&nt(this,tt,n,"f"),nt(this,rt,super.stack,"f")}get name(){return"SnapError"}get code(){return at(this,Qe,"f")}get message(){return at(this,et,"f")}get data(){return at(this,tt,"f")}get stack(){return at(this,rt,"f")}toJSON(){return{code:-31002,message:"Snap Error",data:{cause:{code:this.code,message:this.message,stack:this.stack,...this.data?{data:this.data}:{}}}}}serialize(){return this.toJSON()}}function st(e){return class extends it{constructor(t,r){if("object"==typeof t){const r=e();return void super({code:r.code,message:r.message,data:t})}const n=e(t);super({code:n.code,message:n.message,data:r})}}}Qe=new WeakMap,et=new WeakMap,tt=new WeakMap,rt=new WeakMap;const ot=st(Fe),ct=st(De),dt=st(Pe),ft=st(Ne),ut=st($e),lt=st(Le),ht=st(Ve),pt=st(Re),bt=st(Ue),gt=st(He),yt=st(je),mt=st(Je),wt=st(Ge),vt=st(qe),Et=st(Ke),At=st(ze);function _t(e){return Object.fromEntries(Object.entries(e).filter((([,e])=>void 0!==e)))}function xt(e){return t=>{const{key:r=null,...n}=t;return{type:e,props:_t(n),key:r}}}const St=xt("Box"),It=xt("Text"),kt=xt("Link");var Ct=a(2926),Tt=a.n(Ct),Bt=a(665),Mt=a.n(Bt);const Ot={DECLARE:"DECLARE",DEPLOY:"DEPLOY",DEPLOY_ACCOUNT:"DEPLOY_ACCOUNT",INVOKE:"INVOKE",L1_HANDLER:"L1_HANDLER"},Rt={SKIP_VALIDATE:"SKIP_VALIDATE",SKIP_FEE_CHARGE:"SKIP_FEE_CHARGE"},Nt={RECEIVED:"RECEIVED",REJECTED:"REJECTED",ACCEPTED_ON_L2:"ACCEPTED_ON_L2",ACCEPTED_ON_L1:"ACCEPTED_ON_L1"},Pt={ACCEPTED_ON_L2:"ACCEPTED_ON_L2",ACCEPTED_ON_L1:"ACCEPTED_ON_L1"},Lt={SUCCEEDED:"SUCCEEDED",REVERTED:"REVERTED"},Ft={LATEST:"latest",PENDING:"pending"},Dt={L1:"L1",L2:"L2"},Ut={L1:0,L2:1},Ht={V0:"0x0",V1:"0x1",V2:"0x2",V3:"0x3",F0:"0x100000000000000000000000000000000",F1:"0x100000000000000000000000000000001",F2:"0x100000000000000000000000000000002",F3:"0x100000000000000000000000000000003"},jt={V0:"0x0",V1:"0x1",V2:"0x2",F0:"0x100000000000000000000000000000000",F1:"0x100000000000000000000000000000001",F2:"0x100000000000000000000000000000002"},Vt={V3:"0x3",F3:"0x100000000000000000000000000000003"},$t={ACCOUNTS:"accounts"},zt={ACTIVE:"1",LEGACY:"0"},qt="ACCEPTED_ON_L2",Kt="ACCEPTED_ON_L1",Gt="SUCCEEDED",Jt="REVERTED",Wt="PENDING",Yt="REJECTED",Zt="RECEIVED",Xt="DECLARE",Qt="DEPLOY",er="DEPLOY_ACCOUNT",tr="INVOKE",rr="L1_HANDLER",nr="struct",ar="event",ir="function",sr="constructor",or="l1_handler",cr="enum",dr="view",fr="external",ur="WEI",lr="FRI",hr={BLOB:"BLOB",CALLDATA:"CALLDATA"},pr={DELEGATE:"DELEGATE",LIBRARY_CALL:"LIBRARY_CALL",CALL:"CALL"},br={DECLARE:Xt,DEPLOY:Qt,DEPLOY_ACCOUNT:er,INVOKE:tr,L1_HANDLER:rr},gr={SKIP_VALIDATE:"SKIP_VALIDATE",SKIP_FEE_CHARGE:"SKIP_FEE_CHARGE"},yr={RECEIVED:Zt,REJECTED:Yt,ACCEPTED_ON_L2:qt,ACCEPTED_ON_L1:Kt},mr={ACCEPTED_ON_L2:qt,ACCEPTED_ON_L1:Kt},wr={SUCCEEDED:Gt,REVERTED:Jt},vr={LATEST:"latest",PENDING:"pending"},Er={L1:"L1",L2:"L2"},Ar={L1:0,L2:1},_r={V0:"0x0",V1:"0x1",V2:"0x2",V3:"0x3",F0:"0x100000000000000000000000000000000",F1:"0x100000000000000000000000000000001",F2:"0x100000000000000000000000000000002",F3:"0x100000000000000000000000000000003"},xr={V0:_r.V0,V1:_r.V1,V2:_r.V2,F0:_r.F0,F1:_r.F1,F2:_r.F2},Sr={V3:_r.V3,F3:_r.F3},Ir={ACCOUNTS:"accounts"},kr={ACTIVE:"1",LEGACY:"0"};function Cr(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function Tr(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every((e=>"string"==typeof e)):t.every((e=>Number.isSafeInteger(e)))))}function Br(e){if("function"!=typeof e)throw new Error("function expected");return!0}function Mr(e,t){if("string"!=typeof t)throw new Error(`${e}: string expected`);return!0}function Or(e){if(!Number.isSafeInteger(e))throw new Error(`invalid integer: ${e}`)}function Rr(e){if(!Array.isArray(e))throw new Error("array expected")}function Nr(e,t){if(!Tr(!0,t))throw new Error(`${e}: array of strings expected`)}function Pr(e,t){if(!Tr(!1,t))throw new Error(`${e}: array of numbers expected`)}function Lr(...e){const t=e=>e,r=(e,t)=>r=>e(t(r));return{encode:e.map((e=>e.encode)).reduceRight(r,t),decode:e.map((e=>e.decode)).reduce(r,t)}}function Fr(e){const t="string"==typeof e?e.split(""):e,r=t.length;Nr("alphabet",t);const n=new Map(t.map(((e,t)=>[e,t])));return{encode:n=>(Rr(n),n.map((n=>{if(!Number.isSafeInteger(n)||n<0||n>=r)throw new Error(`alphabet.encode: digit index outside alphabet "${n}". Allowed: ${e}`);return t[n]}))),decode:t=>(Rr(t),t.map((t=>{Mr("alphabet.decode",t);const r=n.get(t);if(void 0===r)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return r})))}}function Dr(e=""){return Mr("join",e),{encode:t=>(Nr("join.decode",t),t.join(e)),decode:t=>(Mr("join.decode",t),t.split(e))}}function Ur(e,t="="){return Or(e),Mr("padding",t),{encode(r){for(Nr("padding.encode",r);r.length*e%8;)r.push(t);return r},decode(r){Nr("padding.decode",r);let n=r.length;if(n*e%8)throw new Error("padding: invalid, string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--){if((n-1)*e%8==0)throw new Error("padding: invalid, string has too much padding")}return r.slice(0,n)}}}function Hr(e){return Br(e),{encode:e=>e,decode:t=>e(t)}}function jr(e,t,r){if(t<2)throw new Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(Rr(e),!e.length)return[];let n=0;const a=[],i=Array.from(e,(e=>{if(Or(e),e<0||e>=t)throw new Error(`invalid integer: ${e}`);return e})),s=i.length;for(;;){let e=0,o=!0;for(let a=n;a<s;a++){const s=i[a],c=t*e,d=c+s;if(!Number.isSafeInteger(d)||c/t!==e||d-s!==c)throw new Error("convertRadix: carry overflow");const f=d/r;e=d%r;const u=Math.floor(f);if(i[a]=u,!Number.isSafeInteger(u)||u*r+e!==d)throw new Error("convertRadix: carry overflow");o&&(u?o=!1:n=a)}if(a.push(e),o)break}for(let t=0;t<e.length-1&&0===e[t];t++)a.push(0);return a.reverse()}const Vr=(e,t)=>0===t?e:Vr(t,e%t),$r=(e,t)=>e+(t-Vr(e,t)),zr=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function qr(e,t,r,n){if(Rr(e),t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if($r(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${$r(t,r)}`);let a=0,i=0;const s=zr[t],o=zr[r]-1,c=[];for(const n of e){if(Or(n),n>=s)throw new Error(`convertRadix2: invalid data word=${n} from=${t}`);if(a=a<<t|n,i+t>32)throw new Error(`convertRadix2: carry overflow pos=${i} from=${t}`);for(i+=t;i>=r;i-=r)c.push((a>>i-r&o)>>>0);const e=zr[i];if(void 0===e)throw new Error("invalid carry");a&=e-1}if(a=a<<r-i&o,!n&&i>=t)throw new Error("Excess padding");if(!n&&a>0)throw new Error(`Non-zero padding: ${a}`);return n&&i>0&&c.push(a>>>0),c}function Kr(e){Or(e);return{encode:t=>{if(!Cr(t))throw new Error("radix.encode input should be Uint8Array");return jr(Array.from(t),256,e)},decode:t=>(Pr("radix.decode",t),Uint8Array.from(jr(t,e,256)))}}function Gr(e,t=!1){if(Or(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if($r(8,e)>32||$r(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!Cr(r))throw new Error("radix2.encode input should be Uint8Array");return qr(Array.from(r),8,e,!t)},decode:r=>(Pr("radix2.decode",r),Uint8Array.from(qr(r,e,8,t)))}}function Jr(e){return Br(e),function(...t){try{return e.apply(null,t)}catch(e){}}}const Wr=Lr(Gr(4),Fr("0123456789ABCDEF"),Dr("")),Yr=Lr(Gr(5),Fr("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Ur(5),Dr("")),Zr=(Lr(Gr(5),Fr("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Dr("")),Lr(Gr(5),Fr("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Ur(5),Dr("")),Lr(Gr(5),Fr("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Dr("")),Lr(Gr(5),Fr("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),Dr(""),Hr((e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")))),Lr(Gr(6),Fr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Ur(6),Dr(""))),Xr=(Lr(Gr(6),Fr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Dr("")),Lr(Gr(6),Fr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Ur(6),Dr(""))),Qr=(Lr(Gr(6),Fr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Dr("")),e=>Lr(Kr(58),Fr(e),Dr(""))),en=Qr("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),tn=(Qr("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),Qr("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"),[0,2,3,5,6,7,9,10,11]),rn={encode(e){let t="";for(let r=0;r<e.length;r+=8){const n=e.subarray(r,r+8);t+=en.encode(n).padStart(tn[n.length],"1")}return t},decode(e){let t=[];for(let r=0;r<e.length;r+=11){const n=e.slice(r,r+11),a=tn.indexOf(n.length),i=en.decode(n);for(let e=0;e<i.length-a;e++)if(0!==i[e])throw new Error("base58xmr: wrong padding");t=t.concat(Array.from(i.slice(i.length-a)))}return Uint8Array.from(t)}},nn=Lr(Fr("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),Dr("")),an=[996825010,642813549,513874426,1027748829,705979059];function sn(e){const t=e>>25;let r=(33554431&e)<<5;for(let e=0;e<an.length;e++)1==(t>>e&1)&&(r^=an[e]);return r}function on(e,t,r=1){const n=e.length;let a=1;for(let t=0;t<n;t++){const r=e.charCodeAt(t);if(r<33||r>126)throw new Error(`Invalid prefix (${e})`);a=sn(a)^r>>5}a=sn(a);for(let t=0;t<n;t++)a=sn(a)^31&e.charCodeAt(t);for(let e of t)a=sn(a)^e;for(let e=0;e<6;e++)a=sn(a);return a^=r,nn.encode(qr([a%zr[30]],30,5,!1))}function cn(e){const t="bech32"===e?1:734539939,r=Gr(5),n=r.decode,a=r.encode,i=Jr(n);function s(e,r,n=90){Mr("bech32.encode prefix",e),Cr(r)&&(r=Array.from(r)),Pr("bech32.encode",r);const a=e.length;if(0===a)throw new TypeError(`Invalid prefix length ${a}`);const i=a+7+r.length;if(!1!==n&&i>n)throw new TypeError(`Length ${i} exceeds limit ${n}`);const s=e.toLowerCase(),o=on(s,r,t);return`${s}1${nn.encode(r)}${o}`}function o(e,r=90){Mr("bech32.decode input",e);const n=e.length;if(n<8||!1!==r&&n>r)throw new TypeError(`invalid string length: ${n} (${e}). Expected (8..${r})`);const a=e.toLowerCase();if(e!==a&&e!==e.toUpperCase())throw new Error("String must be lowercase or uppercase");const i=a.lastIndexOf("1");if(0===i||-1===i)throw new Error('Letter "1" must be present between prefix and data only');const s=a.slice(0,i),o=a.slice(i+1);if(o.length<6)throw new Error("Data must be at least 6 characters long");const c=nn.decode(o).slice(0,-6),d=on(s,c,t);if(!o.endsWith(d))throw new Error(`Invalid checksum in ${e}: expected "${d}"`);return{prefix:s,words:c}}return{encode:s,decode:o,encodeFromBytes:function(e,t){return s(e,a(t))},decodeToBytes:function(e){const{prefix:t,words:r}=o(e,!1);return{prefix:t,words:r,bytes:n(r)}},decodeUnsafe:Jr(o),fromWords:n,fromWordsUnsafe:i,toWords:a}}cn("bech32"),cn("bech32m");const dn={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)};Lr(Gr(4),Fr("0123456789abcdef"),Dr(""),Hr((e=>{if("string"!=typeof e||e.length%2!=0)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})));function fn(e){return un.test(e)}const un=/^-?[0-9]+$/;function ln(e){return hn.test(e)}const hn=/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;let pn=function(e){return e.underflow="underflow",e.overflow="overflow",e.truncate_integer="truncate_integer",e.truncate_float="truncate_float",e}({});function bn(e){if(function(e,t){const r=parseFloat(e),n=String(r),a=gn(e),i=gn(n);if(a===i)return!0;if(!0===t?.approx){const t=14;if(!fn(e)&&i.length>=t&&a.startsWith(i.substring(0,t)))return!0}return!1}(e,{approx:!1}))return;if(fn(e))return pn.truncate_integer;const t=parseFloat(e);return isFinite(t)?0===t?pn.underflow:pn.truncate_float:pn.overflow}function gn(e){return e.replace(yn,"").replace(wn,"").replace(vn,"").replace(mn,"")}const yn=/[eE][+-]?\d+$/,mn=/^-?(0*)?/,wn=/\./,vn=/0+$/;class En{isLosslessNumber=!0;constructor(e){if(!ln(e))throw new Error('Invalid number (value: "'+e+'")');this.value=e}valueOf(){const e=bn(this.value);if(void 0===e||e===pn.truncate_float)return parseFloat(this.value);if(fn(this.value))return BigInt(this.value);throw new Error(`Cannot safely convert to number: the value '${this.value}' would ${e} and become ${parseFloat(this.value)}`)}toString(){return this.value}}function An(e){return new En(e)}function _n(e){return fn(e)?BigInt(e):parseFloat(e)}function xn(e,t,r,n){return Array.isArray(r)?n.call(e,t,function(e,t){for(let r=0;r<e.length;r++)e[r]=xn(e,r+"",e[r],t);return e}(r,n)):r&&"object"==typeof r&&!function(e){return e&&"object"==typeof e&&!0===e.isLosslessNumber||!1}(r)?n.call(e,t,function(e,t){return Object.keys(e).forEach((r=>{const n=xn(e,r,e[r],t);void 0!==n?e[r]=n:delete e[r]})),e}(r,n)):n.call(e,t,r)}function Sn(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:An,n=0;const a=o();return function(e){if(void 0===e)throw new SyntaxError(`JSON value expected ${A()}`)}(a),function(){if(n<e.length)throw new SyntaxError(`Expected end of input ${A()}`)}(),t?function(e,t){return xn({"":e},"",e,t)}(a,t):a;function i(){if(e.charCodeAt(n)===On){n++,d();const t={};let r=!0;for(;n<e.length&&e.charCodeAt(n)!==Rn;){r?r=!1:(u(),d());const e=n,a=f();if(void 0===a)return void b();d(),l();const i=o();if(void 0===i)return void w();Object.prototype.hasOwnProperty.call(t,a)&&!Cn(i,t[a])&&g(a,e+1),t[a]=i}return e.charCodeAt(n)!==Rn&&function(){throw new SyntaxError(`Quoted object key or end of object '}' expected ${A()}`)}(),n++,t}}function s(){if(e.charCodeAt(n)===Nn){n++,d();const t=[];let r=!0;for(;n<e.length&&e.charCodeAt(n)!==Pn;){r?r=!1:u();const e=o();h(e),t.push(e)}return e.charCodeAt(n)!==Pn&&function(){throw new SyntaxError(`Array item or end of array ']' expected ${A()}`)}(),n++,t}}function o(){d();const t=f()??function(){const t=n;e.charCodeAt(n)===Vn&&(n++,p(t));if(e.charCodeAt(n)===$n)n++;else if(a=e.charCodeAt(n),a>=zn&&a<=qn)for(n++;kn(e.charCodeAt(n));)n++;var a;if(e.charCodeAt(n)===Gn)for(n++,p(t);kn(e.charCodeAt(n));)n++;if(e.charCodeAt(n)===Xn||e.charCodeAt(n)===Zn)for(n++,e.charCodeAt(n)!==Vn&&e.charCodeAt(n)!==jn||n++,p(t);kn(e.charCodeAt(n));)n++;if(n>t)return r(e.slice(t,n))}()??i()??s()??c("true",!0)??c("false",!1)??c("null",null);return d(),t}function c(t,r){if(e.slice(n,n+t.length)===t)return n+=t.length,r}function d(){for(;(t=e.charCodeAt(n))===Ln||t===Fn||t===Dn||t===Un;)n++;var t}function f(){if(e.charCodeAt(n)===Hn){n++;let r="";for(;n<e.length&&e.charCodeAt(n)!==Hn;){if(e.charCodeAt(n)===Mn){const t=e[n+1],a=Bn[t];void 0!==a?(r+=a,n++):"u"===t?In(e.charCodeAt(n+2))&&In(e.charCodeAt(n+3))&&In(e.charCodeAt(n+4))&&In(e.charCodeAt(n+5))?(r+=String.fromCharCode(parseInt(e.slice(n+2,n+6),16)),n+=5):v(n):m(n)}else(t=e.charCodeAt(n))>=32&&t<=1114111?r+=e[n]:y(e[n]);n++}return function(){if(e.charCodeAt(n)!==Hn)throw new SyntaxError(`End of string '"' expected ${A()}`)}(),n++,r}var t}function u(){if(e.charCodeAt(n)!==Kn)throw new SyntaxError(`Comma ',' expected after value ${A()}`);n++}function l(){if(e.charCodeAt(n)!==Jn)throw new SyntaxError(`Colon ':' expected after property name ${A()}`);n++}function h(e){if(void 0===e)throw new SyntaxError(`Array item expected ${A()}`)}function p(t){if(!kn(e.charCodeAt(n))){const r=e.slice(t,n);throw new SyntaxError(`Invalid number '${r}', expecting a digit ${A()}`)}}function b(){throw new SyntaxError(`Quoted object key expected ${A()}`)}function g(e,t){throw new SyntaxError(`Duplicate key '${e}' encountered at position ${t}`)}function y(e){throw new SyntaxError(`Invalid character '${e}' ${E()}`)}function m(t){const r=e.slice(t,t+2);throw new SyntaxError(`Invalid escape character '${r}' ${E()}`)}function w(){throw new SyntaxError(`Object value expected after ':' ${E()}`)}function v(t){const r=e.slice(t,t+6);throw new SyntaxError(`Invalid unicode character '${r}' ${E()}`)}function E(){return`at position ${n}`}function A(){return(n<e.length?`but got '${e[n]}'`:"but reached end of input")+" "+E()}}function In(e){return e>=$n&&e<=qn||e>=Wn&&e<=Qn||e>=Yn&&e<=ea}function kn(e){return e>=$n&&e<=qn}function Cn(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every(((e,r)=>Cn(e,t[r])));if(Tn(e)&&Tn(t)){return[...new Set([...Object.keys(e),...Object.keys(t)])].every((r=>Cn(e[r],t[r])))}return!1}function Tn(e){return"object"==typeof e&&null!==e}const Bn={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},Mn=92,On=123,Rn=125,Nn=91,Pn=93,Ln=32,Fn=10,Dn=9,Un=13,Hn=34,jn=43,Vn=45,$n=48,zn=49,qn=57,Kn=44,Gn=46,Jn=58,Wn=65,Yn=97,Zn=69,Xn=101,Qn=70,ea=102;function ta(e,t,r,n){const a=function(e){if("number"==typeof e)return" ".repeat(e);if("string"==typeof e&&""!==e)return e;return}(r);return i("function"==typeof t?t.call({"":e},"",e):e,"");function i(e,s){if(Array.isArray(n)){const t=n.find((t=>t.test(e)));if(t){const r=t.stringify(e);if("string"!=typeof r||!ln(r))throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${r})`);return r}}return"boolean"==typeof e||"number"==typeof e||"string"==typeof e||null===e||e instanceof Date||e instanceof Boolean||e instanceof Number||e instanceof String?JSON.stringify(e):e&&e.isLosslessNumber||"bigint"==typeof e?e.toString():Array.isArray(e)?function(e,r){if(0===e.length)return"[]";const n=a?r+a:void 0;let s=a?"[\n":"[";for(let r=0;r<e.length;r++){const o="function"==typeof t?t.call(e,String(r),e[r]):e[r];a&&(s+=n),s+=void 0!==o&&"function"!=typeof o?i(o,n):"null",r<e.length-1&&(s+=a?",\n":",")}return s+=a?"\n"+r+"]":"]",s}(e,s):e&&"object"==typeof e?function(e,n){if("function"==typeof e.toJSON)return ta(e.toJSON(),t,r,void 0);const s=Array.isArray(t)?t.map(String):Object.keys(e);if(0===s.length)return"{}";const o=a?n+a:void 0;let c=!0,d=a?"{\n":"{";return s.forEach((r=>{const n="function"==typeof t?t.call(e,r,e[r]):e[r];if(function(e,t){return void 0!==t&&"function"!=typeof t&&"symbol"!=typeof t}(0,n)){c?c=!1:d+=a?",\n":",";const e=JSON.stringify(r);d+=a?o+e+": ":e+":",d+=i(n,o)}})),d+=a?"\n"+n+"}":"}",d}(e,s):void 0}}const ra=BigInt(0),na=BigInt(1),aa=BigInt(2);function ia(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function sa(e){if(!ia(e))throw new Error("Uint8Array expected")}function oa(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)}const ca=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function da(e){sa(e);let t="";for(let r=0;r<e.length;r++)t+=ca[e[r]];return t}function fa(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function ua(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?ra:BigInt("0x"+e)}const la={_0:48,_9:57,A:65,F:70,a:97,f:102};function ha(e){return e>=la._0&&e<=la._9?e-la._0:e>=la.A&&e<=la.F?e-(la.A-10):e>=la.a&&e<=la.f?e-(la.a-10):void 0}function pa(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,a=0;t<r;t++,a+=2){const r=ha(e.charCodeAt(a)),i=ha(e.charCodeAt(a+1));if(void 0===r||void 0===i){const t=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+a)}n[t]=16*r+i}return n}function ba(e){return ua(da(e))}function ga(e){return sa(e),ua(da(Uint8Array.from(e).reverse()))}function ya(e,t){return pa(e.toString(16).padStart(2*t,"0"))}function ma(e,t){return ya(e,t).reverse()}function wa(e,t,r){let n;if("string"==typeof t)try{n=pa(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!ia(t))throw new Error(e+" must be hex string or Uint8Array");n=Uint8Array.from(t)}const a=n.length;if("number"==typeof r&&a!==r)throw new Error(e+" of length "+r+" expected, got "+a);return n}function va(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];sa(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const a=e[t];r.set(a,n),n+=a.length}return r}const Ea=e=>"bigint"==typeof e&&ra<=e;function Aa(e,t,r){return Ea(e)&&Ea(t)&&Ea(r)&&t<=e&&e<r}function _a(e,t,r,n){if(!Aa(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function xa(e){let t;for(t=0;e>ra;e>>=na,t+=1);return t}const Sa=e=>(aa<<BigInt(e-1))-na,Ia=e=>new Uint8Array(e),ka=e=>Uint8Array.from(e);function Ca(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let n=Ia(e),a=Ia(e),i=0;const s=()=>{n.fill(1),a.fill(0),i=0},o=(...e)=>r(a,n,...e),c=(e=Ia())=>{a=o(ka([0]),e),n=o(),0!==e.length&&(a=o(ka([1]),e),n=o())},d=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e<t;){n=o();const t=n.slice();r.push(t),e+=n.length}return va(...r)};return(e,t)=>{let r;for(s(),c(e);!(r=t(d()));)c();return s(),r}}const Ta={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||ia(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function Ba(e,t,r={}){const n=(t,r,n)=>{const a=Ta[r];if("function"!=typeof a)throw new Error("invalid validator function");const i=e[t];if(!(n&&void 0===i||a(i,e)))throw new Error("param "+String(t)+" is invalid. Expected "+r+", got "+i)};for(const[e,r]of Object.entries(t))n(e,r,!1);for(const[e,t]of Object.entries(r))n(e,t,!0);return e}function Ma(e){const t=new WeakMap;return(r,...n)=>{const a=t.get(r);if(void 0!==a)return a;const i=e(r,...n);return t.set(r,i),i}}function Oa(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Ra(e,...t){if(!((r=e)instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name))throw new Error("Uint8Array expected");var r;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Na(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");Oa(e.outputLen),Oa(e.blockLen)}function Pa(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function La(e,t){Ra(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const Fa="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;const Da=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),Ua=(e,t)=>e<<32-t|e>>>t,Ha=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],ja=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function Va(e){for(let t=0;t<e.length;t++)e[t]=ja(e[t])}Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function $a(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),Ra(e),e}class za{clone(){return this._cloneInto()}}function qa(e){const t=t=>e().update($a(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Ka(e=32){if(Fa&&"function"==typeof Fa.getRandomValues)return Fa.getRandomValues(new Uint8Array(e));if(Fa&&"function"==typeof Fa.randomBytes)return Fa.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}const Ga=(e,t,r)=>e&t^e&r^t&r;class Ja extends za{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Da(this.buffer)}update(e){Pa(this);const{view:t,buffer:r,blockLen:n}=this,a=(e=$a(e)).length;for(let i=0;i<a;){const s=Math.min(n-this.pos,a-i);if(s!==n)r.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===n&&(this.process(t,0),this.pos=0);else{const t=Da(e);for(;n<=a-i;i+=n)this.process(t,i)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){Pa(this),La(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:a}=this;let{pos:i}=this;t[i++]=128,this.buffer.subarray(i).fill(0),this.padOffset>n-i&&(this.process(r,0),i=0);for(let e=i;e<n;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const a=BigInt(32),i=BigInt(4294967295),s=Number(r>>a&i),o=Number(r&i),c=n?4:0,d=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+d,o,n)}(r,n-8,BigInt(8*this.length),a),this.process(r,0);const s=Da(e),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=o/4,d=this.get();if(c>d.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)s.setUint32(4*e,d[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:a,destroyed:i,pos:s}=this;return e.length=n,e.pos=s,e.finished=a,e.destroyed=i,n%t&&e.buffer.set(r),e}}const Wa=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]),Ya=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Za=new Uint32Array(64);class Xa extends Ja{constructor(){super(64,32,8,!1),this.A=0|Ya[0],this.B=0|Ya[1],this.C=0|Ya[2],this.D=0|Ya[3],this.E=0|Ya[4],this.F=0|Ya[5],this.G=0|Ya[6],this.H=0|Ya[7]}get(){const{A:e,B:t,C:r,D:n,E:a,F:i,G:s,H:o}=this;return[e,t,r,n,a,i,s,o]}set(e,t,r,n,a,i,s,o){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|a,this.F=0|i,this.G=0|s,this.H=0|o}process(e,t){for(let r=0;r<16;r++,t+=4)Za[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=Za[e-15],r=Za[e-2],n=Ua(t,7)^Ua(t,18)^t>>>3,a=Ua(r,17)^Ua(r,19)^r>>>10;Za[e]=a+Za[e-7]+n+Za[e-16]|0}let{A:r,B:n,C:a,D:i,E:s,F:o,G:c,H:d}=this;for(let e=0;e<64;e++){const t=d+(Ua(s,6)^Ua(s,11)^Ua(s,25))+((f=s)&o^~f&c)+Wa[e]+Za[e]|0,u=(Ua(r,2)^Ua(r,13)^Ua(r,22))+Ga(r,n,a)|0;d=c,c=o,o=s,s=i+t|0,i=a,a=n,n=r,r=t+u|0}var f;r=r+this.A|0,n=n+this.B|0,a=a+this.C|0,i=i+this.D|0,s=s+this.E|0,o=o+this.F|0,c=c+this.G|0,d=d+this.H|0,this.set(r,n,a,i,s,o,c,d)}roundClean(){Za.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const Qa=qa((()=>new Xa));function ei(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function ti(e,...t){if(!((r=e)instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name))throw new Error("Uint8Array expected");var r;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function ri(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function ni(e,t){ti(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const ai=BigInt(2**32-1),ii=BigInt(32);function si(e,t=!1){return t?{h:Number(e&ai),l:Number(e>>ii&ai)}:{h:0|Number(e>>ii&ai),l:0|Number(e&ai)}}function oi(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let a=0;a<e.length;a++){const{h:i,l:s}=si(e[a],t);[r[a],n[a]]=[i,s]}return[r,n]}const ci=(e,t,r)=>e<<r|t>>>32-r,di=(e,t,r)=>t<<r|e>>>32-r,fi=(e,t,r)=>t<<r-32|e>>>64-r,ui=(e,t,r)=>e<<r-32|t>>>64-r;const li=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),hi=(e,t)=>e<<32-t|e>>>t,pi=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],bi=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function gi(e){for(let t=0;t<e.length;t++)e[t]=bi(e[t])}Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function yi(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function mi(e){return"string"==typeof e&&(e=yi(e)),ti(e),e}class wi{clone(){return this._cloneInto()}}function vi(e){const t=t=>e().update(mi(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}const Ei=[],Ai=[],_i=[],xi=BigInt(0),Si=BigInt(1),Ii=BigInt(2),ki=BigInt(7),Ci=BigInt(256),Ti=BigInt(113);for(let e=0,t=Si,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],Ei.push(2*(5*n+r)),Ai.push((e+1)*(e+2)/2%64);let a=xi;for(let e=0;e<7;e++)t=(t<<Si^(t>>ki)*Ti)%Ci,t&Ii&&(a^=Si<<(Si<<BigInt(e))-Si);_i.push(a)}const[Bi,Mi]=oi(_i,!0),Oi=(e,t,r)=>r>32?fi(e,t,r):ci(e,t,r),Ri=(e,t,r)=>r>32?ui(e,t,r):di(e,t,r);class Ni extends wi{constructor(e,t,r,n=!1,a=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,ei(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var i;this.state=new Uint8Array(200),this.state32=(i=this.state,new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.byteLength/4)))}keccak(){pi||gi(this.state32),function(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,a=(t+2)%10,i=r[a],s=r[a+1],o=Oi(i,s,1)^r[n],c=Ri(i,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=o,e[t+r+1]^=c}let t=e[2],a=e[3];for(let r=0;r<24;r++){const n=Ai[r],i=Oi(t,a,n),s=Ri(t,a,n),o=Ei[r];t=e[o],a=e[o+1],e[o]=i,e[o+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=Bi[n],e[1]^=Mi[n]}r.fill(0)}(this.state32,this.rounds),pi||gi(this.state32),this.posOut=0,this.pos=0}update(e){ri(this);const{blockLen:t,state:r}=this,n=(e=mi(e)).length;for(let a=0;a<n;){const i=Math.min(t-this.pos,n-a);for(let t=0;t<i;t++)r[this.pos++]^=e[a++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,128&t&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){ri(this,!1),ti(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,a=e.length;n<a;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,a-n);e.set(t.subarray(this.posOut,this.posOut+i),n),this.posOut+=i,n+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ei(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(ni(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){const{blockLen:t,suffix:r,outputLen:n,rounds:a,enableXOF:i}=this;return e||(e=new Ni(t,r,n,i,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=r,e.outputLen=n,e.enableXOF=i,e.destroyed=this.destroyed,e}}const Pi=(e,t,r)=>vi((()=>new Ni(t,e,r))),Li=Pi(1,136,32);const Fi=(e,t,r)=>e&t^e&r^t&r;class Di extends wi{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=li(this.buffer)}update(e){ri(this);const{view:t,buffer:r,blockLen:n}=this,a=(e=mi(e)).length;for(let i=0;i<a;){const s=Math.min(n-this.pos,a-i);if(s!==n)r.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===n&&(this.process(t,0),this.pos=0);else{const t=li(e);for(;n<=a-i;i+=n)this.process(t,i)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){ri(this),ni(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:a}=this;let{pos:i}=this;t[i++]=128,this.buffer.subarray(i).fill(0),this.padOffset>n-i&&(this.process(r,0),i=0);for(let e=i;e<n;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const a=BigInt(32),i=BigInt(4294967295),s=Number(r>>a&i),o=Number(r&i),c=n?4:0,d=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+d,o,n)}(r,n-8,BigInt(8*this.length),a),this.process(r,0);const s=li(e),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=o/4,d=this.get();if(c>d.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)s.setUint32(4*e,d[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:a,destroyed:i,pos:s}=this;return e.length=n,e.pos=s,e.finished=a,e.destroyed=i,n%t&&e.buffer.set(r),e}}const Ui=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]),Hi=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),ji=new Uint32Array(64);class Vi extends Di{constructor(){super(64,32,8,!1),this.A=0|Hi[0],this.B=0|Hi[1],this.C=0|Hi[2],this.D=0|Hi[3],this.E=0|Hi[4],this.F=0|Hi[5],this.G=0|Hi[6],this.H=0|Hi[7]}get(){const{A:e,B:t,C:r,D:n,E:a,F:i,G:s,H:o}=this;return[e,t,r,n,a,i,s,o]}set(e,t,r,n,a,i,s,o){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|a,this.F=0|i,this.G=0|s,this.H=0|o}process(e,t){for(let r=0;r<16;r++,t+=4)ji[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=ji[e-15],r=ji[e-2],n=hi(t,7)^hi(t,18)^t>>>3,a=hi(r,17)^hi(r,19)^r>>>10;ji[e]=a+ji[e-7]+n+ji[e-16]|0}let{A:r,B:n,C:a,D:i,E:s,F:o,G:c,H:d}=this;for(let e=0;e<64;e++){const t=d+(hi(s,6)^hi(s,11)^hi(s,25))+((f=s)&o^~f&c)+Ui[e]+ji[e]|0,u=(hi(r,2)^hi(r,13)^hi(r,22))+Fi(r,n,a)|0;d=c,c=o,o=s,s=i+t|0,i=a,a=n,n=r,r=t+u|0}var f;r=r+this.A|0,n=n+this.B|0,a=a+this.C|0,i=i+this.D|0,s=s+this.E|0,o=o+this.F|0,c=c+this.G|0,d=d+this.H|0,this.set(r,n,a,i,s,o,c,d)}roundClean(){ji.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const $i=vi((()=>new Vi)),zi=BigInt(0),qi=BigInt(1),Ki=BigInt(2);function Gi(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function Ji(e){if(!Gi(e))throw new Error("Uint8Array expected")}function Wi(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)}const Yi=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function Zi(e){Ji(e);let t="";for(let r=0;r<e.length;r++)t+=Yi[e[r]];return t}function Xi(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function Qi(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?zi:BigInt("0x"+e)}const es={_0:48,_9:57,A:65,F:70,a:97,f:102};function ts(e){return e>=es._0&&e<=es._9?e-es._0:e>=es.A&&e<=es.F?e-(es.A-10):e>=es.a&&e<=es.f?e-(es.a-10):void 0}function rs(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let t=0,a=0;t<r;t++,a+=2){const r=ts(e.charCodeAt(a)),i=ts(e.charCodeAt(a+1));if(void 0===r||void 0===i){const t=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+a)}n[t]=16*r+i}return n}function ns(e){return Qi(Zi(e))}function as(e){return Ji(e),Qi(Zi(Uint8Array.from(e).reverse()))}function is(e,t){return rs(e.toString(16).padStart(2*t,"0"))}function ss(e,t){return is(e,t).reverse()}function os(e){return rs(Xi(e))}function cs(e,t,r){let n;if("string"==typeof t)try{n=rs(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!Gi(t))throw new Error(e+" must be hex string or Uint8Array");n=Uint8Array.from(t)}const a=n.length;if("number"==typeof r&&a!==r)throw new Error(e+" of length "+r+" expected, got "+a);return n}function ds(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];Ji(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const a=e[t];r.set(a,n),n+=a.length}return r}const fs=e=>"bigint"==typeof e&&zi<=e;function us(e,t,r){return fs(e)&&fs(t)&&fs(r)&&t<=e&&e<r}function ls(e,t,r,n){if(!us(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function hs(e){let t;for(t=0;e>zi;e>>=qi,t+=1);return t}const ps=e=>(Ki<<BigInt(e-1))-qi,bs=e=>new Uint8Array(e),gs=e=>Uint8Array.from(e);function ys(e,t,r){if("number"!=typeof e||e<2)throw new Error("hashLen must be a number");if("number"!=typeof t||t<2)throw new Error("qByteLen must be a number");if("function"!=typeof r)throw new Error("hmacFn must be a function");let n=bs(e),a=bs(e),i=0;const s=()=>{n.fill(1),a.fill(0),i=0},o=(...e)=>r(a,n,...e),c=(e=bs())=>{a=o(gs([0]),e),n=o(),0!==e.length&&(a=o(gs([1]),e),n=o())},d=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let e=0;const r=[];for(;e<t;){n=o();const t=n.slice();r.push(t),e+=n.length}return ds(...r)};return(e,t)=>{let r;for(s(),c(e);!(r=t(d()));)c();return s(),r}}const ms={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||Gi(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function ws(e,t,r={}){const n=(t,r,n)=>{const a=ms[r];if("function"!=typeof a)throw new Error("invalid validator function");const i=e[t];if(!(n&&void 0===i||a(i,e)))throw new Error("param "+String(t)+" is invalid. Expected "+r+", got "+i)};for(const[e,r]of Object.entries(t))n(e,r,!1);for(const[e,t]of Object.entries(r))n(e,t,!0);return e}function vs(e){const t=new WeakMap;return(r,...n)=>{const a=t.get(r);if(void 0!==a)return a;const i=e(r,...n);return t.set(r,i),i}}const Es=BigInt(0),As=BigInt(1),_s=BigInt(2),xs=BigInt(3),Ss=BigInt(4),Is=BigInt(5),ks=BigInt(8);BigInt(9),BigInt(16);function Cs(e,t){const r=e%t;return r>=Es?r:t+r}function Ts(e,t,r){if(t<Es)throw new Error("invalid exponent, negatives unsupported");if(r<=Es)throw new Error("invalid modulus");if(r===As)return Es;let n=As;for(;t>Es;)t&As&&(n=n*e%r),e=e*e%r,t>>=As;return n}function Bs(e,t){if(e===Es)throw new Error("invert: expected non-zero number");if(t<=Es)throw new Error("invert: expected positive modulus, got "+t);let r=Cs(e,t),n=t,a=Es,i=As,s=As,o=Es;for(;r!==Es;){const e=n/r,t=n%r,c=a-s*e,d=i-o*e;n=r,r=t,a=s,i=o,s=c,o=d}if(n!==As)throw new Error("invert: does not exist");return Cs(a,t)}function Ms(e){if(e%Ss===xs){const t=(e+As)/Ss;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}if(e%ks===Is){const t=(e-Is)/ks;return function(e,r){const n=e.mul(r,_s),a=e.pow(n,t),i=e.mul(r,a),s=e.mul(e.mul(i,_s),a),o=e.mul(i,e.sub(s,e.ONE));if(!e.eql(e.sqr(o),r))throw new Error("Cannot find square root");return o}}return function(e){const t=(e-As)/_s;let r,n,a;for(r=e-As,n=0;r%_s===Es;r/=_s,n++);for(a=_s;a<e&&Ts(a,t,e)!==e-As;a++)if(a>1e3)throw new Error("Cannot find square root: likely non-prime P");if(1===n){const t=(e+As)/Ss;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}const i=(r+As)/_s;return function(e,s){if(e.pow(s,t)===e.neg(e.ONE))throw new Error("Cannot find square root");let o=n,c=e.pow(e.mul(e.ONE,a),r),d=e.pow(s,i),f=e.pow(s,r);for(;!e.eql(f,e.ONE);){if(e.eql(f,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(f);t<o&&!e.eql(r,e.ONE);t++)r=e.sqr(r);const r=e.pow(c,As<<BigInt(o-t-1));c=e.sqr(r),d=e.mul(d,r),f=e.mul(f,c),o=t}return d}}(e)}const Os=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Rs(e){const t=Os.reduce(((e,t)=>(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return ws(e,t)}function Ns(e,t,r){if(r<Es)throw new Error("invalid exponent, negatives unsupported");if(r===Es)return e.ONE;if(r===As)return t;let n=e.ONE,a=t;for(;r>Es;)r&As&&(n=e.mul(n,a)),a=e.sqr(a),r>>=As;return n}function Ps(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function Ls(e,t,r=!1,n={}){if(e<=Es)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:a,nByteLength:i}=Ps(e,t);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let s;const o=Object.freeze({ORDER:e,BITS:a,BYTES:i,MASK:ps(a),ZERO:Es,ONE:As,create:t=>Cs(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return Es<=t&&t<e},is0:e=>e===Es,isOdd:e=>(e&As)===As,neg:t=>Cs(-t,e),eql:(e,t)=>e===t,sqr:t=>Cs(t*t,e),add:(t,r)=>Cs(t+r,e),sub:(t,r)=>Cs(t-r,e),mul:(t,r)=>Cs(t*r,e),pow:(e,t)=>Ns(o,e,t),div:(t,r)=>Cs(t*Bs(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>Bs(t,e),sqrt:n.sqrt||(t=>(s||(s=Ms(e)),s(o,t))),invertBatch:e=>function(e,t){const r=new Array(t.length),n=t.reduce(((t,n,a)=>e.is0(n)?t:(r[a]=t,e.mul(t,n))),e.ONE),a=e.inv(n);return t.reduceRight(((t,n,a)=>e.is0(n)?t:(r[a]=e.mul(t,r[a]),e.mul(t,n))),a),r}(o,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?ss(e,i):is(e,i),fromBytes:e=>{if(e.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+e.length);return r?as(e):ns(e)}});return Object.freeze(o)}function Fs(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function Ds(e){const t=Fs(e);return t+Math.ceil(t/2)}function Us(e){const t=function(e){const{Fp:t,mds:r,reversePartialPowIdx:n,roundConstants:a}=e,{roundsFull:i,roundsPartial:s,sboxPower:o,t:c}=e;Rs(t);for(const t of["t","roundsFull","roundsPartial"])if("number"!=typeof e[t]||!Number.isSafeInteger(e[t]))throw new Error("invalid number "+t);if(!Array.isArray(r)||r.length!==c)throw new Error("Poseidon: invalid MDS matrix");const d=r.map((e=>{if(!Array.isArray(e)||e.length!==c)throw new Error("invalid MDS matrix row: "+e);return e.map((e=>{if("bigint"!=typeof e)throw new Error("invalid MDS matrix bigint: "+e);return t.create(e)}))}));if(void 0!==n&&"boolean"!=typeof n)throw new Error("invalid param reversePartialPowIdx="+n);if(1&i)throw new Error("roundsFull is not even"+i);const f=i+s;if(!Array.isArray(a)||a.length!==f)throw new Error("Poseidon: invalid round constants");const u=a.map((e=>{if(!Array.isArray(e)||e.length!==c)throw new Error("invalid round constants");return e.map((e=>{if("bigint"!=typeof e||!t.isValid(e))throw new Error("invalid round constant");return t.create(e)}))}));if(!o||![3,5,7].includes(o))throw new Error("invalid sboxPower");const l=BigInt(o);let h=e=>Ns(t,e,l);return 3===o?h=e=>t.mul(t.sqrN(e),e):5===o&&(h=e=>t.mul(t.sqrN(t.sqrN(e)),e)),Object.freeze({...e,rounds:f,sboxFn:h,roundConstants:u,mds:d})}(e),{Fp:r,mds:n,roundConstants:a,rounds:i,roundsPartial:s,sboxFn:o,t:c}=t,d=t.roundsFull/2,f=t.reversePartialPowIdx?c-1:0,u=(e,t,i)=>(e=e.map(((e,t)=>r.add(e,a[i][t]))),t?e=e.map((e=>o(e))):e[f]=o(e[f]),e=n.map((t=>t.reduce(((t,n,a)=>r.add(t,r.mulN(n,e[a]))),r.ZERO))),e),l=function(e){if(!Array.isArray(e)||e.length!==c)throw new Error("invalid values, expected array of bigints with length "+c);e=e.map((e=>{if("bigint"!=typeof e)throw new Error("invalid bigint="+e);return r.create(e)}));let t=0;for(let r=0;r<d;r++)e=u(e,!0,t++);for(let r=0;r<s;r++)e=u(e,!1,t++);for(let r=0;r<d;r++)e=u(e,!0,t++);if(t!==i)throw new Error("invalid number of rounds");return e};return l.roundConstants=a,l}const Hs=BigInt(0),js=BigInt(1);function Vs(e,t){const r=t.negate();return e?r:t}function $s(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function zs(e,t){$s(e,t);return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)}}function qs(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach(((e,r)=>{if(!(e instanceof t))throw new Error("invalid point at index "+r)}))}function Ks(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach(((e,r)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+r)}))}const Gs=new WeakMap,Js=new WeakMap;function Ws(e){return Js.get(e)||1}function Ys(e){return Rs(e.Fp),ws(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Ps(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function Zs(e){void 0!==e.lowS&&Wi("lowS",e.lowS),void 0!==e.prehash&&Wi("prehash",e.prehash)}const{Ph:Xs,aT:Qs}=h,eo={Err:class extends Error{constructor(e=""){super(e)}},_tlv:{encode:(e,t)=>{const{Err:r}=eo;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");const n=t.length/2,a=Xi(n);if(a.length/2&128)throw new r("tlv.encode: long form length too big");const i=n>127?Xi(a.length/2|128):"";return Xi(e)+i+a+t},decode(e,t){const{Err:r}=eo;let n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");const a=t[n++];let i=0;if(!!(128&a)){const e=127&a;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");const s=t.subarray(n,n+e);if(s.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(const e of s)i=i<<8|e;if(n+=e,i<128)throw new r("tlv.decode(long): not minimal encoding")}else i=a;const s=t.subarray(n,n+i);if(s.length!==i)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(n+i)}}},_int:{encode(e){const{Err:t}=eo;if(e<to)throw new t("integer: negative integers are not allowed");let r=Xi(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){const{Err:t}=eo;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return Xs(e)}},toSig(e){const{Err:t,_int:r,_tlv:n}=eo,a="string"==typeof e?Qs(e):e;Ji(a);const{v:i,l:s}=n.decode(48,a);if(s.length)throw new t("invalid signature: left bytes after parsing");const{v:o,l:c}=n.decode(2,i),{v:d,l:f}=n.decode(2,c);if(f.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(o),s:r.decode(d)}},hexFromSig(e){const{_tlv:t,_int:r}=eo,n=t.encode(2,r.encode(e.r))+t.encode(2,r.encode(e.s));return t.encode(48,n)}},to=BigInt(0),ro=BigInt(1),no=(BigInt(2),BigInt(3));BigInt(4);function ao(e){const t=function(e){const t=Ys(e);ws(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a}=t;if(r){if(!n.eql(a,n.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:r}=t,n=Ls(t.n,t.nBitLength),a=t.toBytes||((e,t,n)=>{const a=t.toAffine();return ds(Uint8Array.from([4]),r.toBytes(a.x),r.toBytes(a.y))}),i=t.fromBytes||(e=>{const t=e.subarray(1);return{x:r.fromBytes(t.subarray(0,r.BYTES)),y:r.fromBytes(t.subarray(r.BYTES,2*r.BYTES))}});function s(e){const{a:n,b:a}=t,i=r.sqr(e),s=r.mul(i,e);return r.add(r.add(s,r.mul(e,n)),a)}if(!r.eql(r.sqr(t.Gy),s(t.Gx)))throw new Error("bad generator point: equation left != right");function o(e){const{allowedPrivateKeyLengths:r,nByteLength:n,wrapPrivateKey:a,n:i}=t;if(r&&"bigint"!=typeof e){if(Gi(e)&&(e=Zi(e)),"string"!=typeof e||!r.includes(e.length))throw new Error("invalid private key");e=e.padStart(2*n,"0")}let s;try{s="bigint"==typeof e?e:ns(cs("private key",e,n))}catch(t){throw new Error("invalid private key, expected hex or "+n+" bytes, got "+typeof e)}return a&&(s=Cs(s,i)),ls("private key",s,ro,i),s}function c(e){if(!(e instanceof u))throw new Error("ProjectivePoint expected")}const d=vs(((e,t)=>{const{px:n,py:a,pz:i}=e;if(r.eql(i,r.ONE))return{x:n,y:a};const s=e.is0();null==t&&(t=s?r.ONE:r.inv(i));const o=r.mul(n,t),c=r.mul(a,t),d=r.mul(i,t);if(s)return{x:r.ZERO,y:r.ZERO};if(!r.eql(d,r.ONE))throw new Error("invZ was invalid");return{x:o,y:c}})),f=vs((e=>{if(e.is0()){if(t.allowInfinityPoint&&!r.is0(e.py))return;throw new Error("bad point: ZERO")}const{x:n,y:a}=e.toAffine();if(!r.isValid(n)||!r.isValid(a))throw new Error("bad point: x or y not FE");const i=r.sqr(a),o=s(n);if(!r.eql(i,o))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0}));class u{constructor(e,t,n){if(this.px=e,this.py=t,this.pz=n,null==e||!r.isValid(e))throw new Error("x required");if(null==t||!r.isValid(t))throw new Error("y required");if(null==n||!r.isValid(n))throw new Error("z required");Object.freeze(this)}static fromAffine(e){const{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw new Error("invalid affine point");if(e instanceof u)throw new Error("projective point not allowed");const a=e=>r.eql(e,r.ZERO);return a(t)&&a(n)?u.ZERO:new u(t,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=r.invertBatch(e.map((e=>e.pz)));return e.map(((e,r)=>e.toAffine(t[r]))).map(u.fromAffine)}static fromHex(e){const t=u.fromAffine(i(cs("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return u.BASE.multiply(o(e))}static msm(e,t){return function(e,t,r,n){if(qs(r,e),Ks(n,t),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const a=e.ZERO,i=hs(BigInt(r.length)),s=i>12?i-3:i>4?i-2:i?2:1,o=(1<<s)-1,c=new Array(o+1).fill(a);let d=a;for(let e=Math.floor((t.BITS-1)/s)*s;e>=0;e-=s){c.fill(a);for(let t=0;t<n.length;t++){const a=n[t],i=Number(a>>BigInt(e)&BigInt(o));c[i]=c[i].add(r[t])}let t=a;for(let e=c.length-1,r=a;e>0;e--)r=r.add(c[e]),t=t.add(r);if(d=d.add(t),0!==e)for(let e=0;e<s;e++)d=d.double()}return d}(u,n,e,t)}_setWindowSize(e){h.setWindowSize(this,e)}assertValidity(){f(this)}hasEvenY(){const{y:e}=this.toAffine();if(r.isOdd)return!r.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){c(e);const{px:t,py:n,pz:a}=this,{px:i,py:s,pz:o}=e,d=r.eql(r.mul(t,o),r.mul(i,a)),f=r.eql(r.mul(n,o),r.mul(s,a));return d&&f}negate(){return new u(this.px,r.neg(this.py),this.pz)}double(){const{a:e,b:n}=t,a=r.mul(n,no),{px:i,py:s,pz:o}=this;let c=r.ZERO,d=r.ZERO,f=r.ZERO,l=r.mul(i,i),h=r.mul(s,s),p=r.mul(o,o),b=r.mul(i,s);return b=r.add(b,b),f=r.mul(i,o),f=r.add(f,f),c=r.mul(e,f),d=r.mul(a,p),d=r.add(c,d),c=r.sub(h,d),d=r.add(h,d),d=r.mul(c,d),c=r.mul(b,c),f=r.mul(a,f),p=r.mul(e,p),b=r.sub(l,p),b=r.mul(e,b),b=r.add(b,f),f=r.add(l,l),l=r.add(f,l),l=r.add(l,p),l=r.mul(l,b),d=r.add(d,l),p=r.mul(s,o),p=r.add(p,p),l=r.mul(p,b),c=r.sub(c,l),f=r.mul(p,h),f=r.add(f,f),f=r.add(f,f),new u(c,d,f)}add(e){c(e);const{px:n,py:a,pz:i}=this,{px:s,py:o,pz:d}=e;let f=r.ZERO,l=r.ZERO,h=r.ZERO;const p=t.a,b=r.mul(t.b,no);let g=r.mul(n,s),y=r.mul(a,o),m=r.mul(i,d),w=r.add(n,a),v=r.add(s,o);w=r.mul(w,v),v=r.add(g,y),w=r.sub(w,v),v=r.add(n,i);let E=r.add(s,d);return v=r.mul(v,E),E=r.add(g,m),v=r.sub(v,E),E=r.add(a,i),f=r.add(o,d),E=r.mul(E,f),f=r.add(y,m),E=r.sub(E,f),h=r.mul(p,v),f=r.mul(b,m),h=r.add(f,h),f=r.sub(y,h),h=r.add(y,h),l=r.mul(f,h),y=r.add(g,g),y=r.add(y,g),m=r.mul(p,m),v=r.mul(b,v),y=r.add(y,m),m=r.sub(g,m),m=r.mul(p,m),v=r.add(v,m),g=r.mul(y,v),l=r.add(l,g),g=r.mul(E,v),f=r.mul(w,f),f=r.sub(f,g),g=r.mul(w,y),h=r.mul(E,h),h=r.add(h,g),new u(f,l,h)}subtract(e){return this.add(e.negate())}is0(){return this.equals(u.ZERO)}wNAF(e){return h.wNAFCached(this,e,u.normalizeZ)}multiplyUnsafe(e){const{endo:n,n:a}=t;ls("scalar",e,to,a);const i=u.ZERO;if(e===to)return i;if(this.is0()||e===ro)return this;if(!n||h.hasPrecomputes(this))return h.wNAFCachedUnsafe(this,e,u.normalizeZ);let{k1neg:s,k1:o,k2neg:c,k2:d}=n.splitScalar(e),f=i,l=i,p=this;for(;o>to||d>to;)o&ro&&(f=f.add(p)),d&ro&&(l=l.add(p)),p=p.double(),o>>=ro,d>>=ro;return s&&(f=f.negate()),c&&(l=l.negate()),l=new u(r.mul(l.px,n.beta),l.py,l.pz),f.add(l)}multiply(e){const{endo:n,n:a}=t;let i,s;if(ls("scalar",e,ro,a),n){const{k1neg:t,k1:a,k2neg:o,k2:c}=n.splitScalar(e);let{p:d,f}=this.wNAF(a),{p:l,f:p}=this.wNAF(c);d=h.constTimeNegate(t,d),l=h.constTimeNegate(o,l),l=new u(r.mul(l.px,n.beta),l.py,l.pz),i=d.add(l),s=f.add(p)}else{const{p:t,f:r}=this.wNAF(e);i=t,s=r}return u.normalizeZ([i,s])[0]}multiplyAndAddUnsafe(e,t,r){const n=u.BASE,a=(e,t)=>t!==to&&t!==ro&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),i=a(this,t).add(a(e,r));return i.is0()?void 0:i}toAffine(e){return d(this,e)}isTorsionFree(){const{h:e,isTorsionFree:r}=t;if(e===ro)return!0;if(r)return r(u,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:r}=t;return e===ro?this:r?r(u,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return Wi("isCompressed",e),this.assertValidity(),a(u,this,e)}toHex(e=!0){return Wi("isCompressed",e),Zi(this.toRawBytes(e))}}u.BASE=new u(t.Gx,t.Gy,r.ONE),u.ZERO=new u(r.ZERO,r.ONE,r.ZERO);const l=t.nBitLength,h=(p=u,b=t.endo?Math.ceil(l/2):l,{constTimeNegate:Vs,hasPrecomputes:e=>1!==Ws(e),unsafeLadder(e,t,r=p.ZERO){let n=e;for(;t>Hs;)t&js&&(r=r.add(n)),n=n.double(),t>>=js;return r},precomputeWindow(e,t){const{windows:r,windowSize:n}=zs(t,b),a=[];let i=e,s=i;for(let e=0;e<r;e++){s=i,a.push(s);for(let e=1;e<n;e++)s=s.add(i),a.push(s);i=s.double()}return a},wNAF(e,t,r){const{windows:n,windowSize:a}=zs(e,b);let i=p.ZERO,s=p.BASE;const o=BigInt(2**e-1),c=2**e,d=BigInt(e);for(let e=0;e<n;e++){const n=e*a;let f=Number(r&o);r>>=d,f>a&&(f-=c,r+=js);const u=n,l=n+Math.abs(f)-1,h=e%2!=0,p=f<0;0===f?s=s.add(Vs(h,t[u])):i=i.add(Vs(p,t[l]))}return{p:i,f:s}},wNAFUnsafe(e,t,r,n=p.ZERO){const{windows:a,windowSize:i}=zs(e,b),s=BigInt(2**e-1),o=2**e,c=BigInt(e);for(let e=0;e<a;e++){const a=e*i;if(r===Hs)break;let d=Number(r&s);if(r>>=c,d>i&&(d-=o,r+=js),0===d)continue;let f=t[a+Math.abs(d)-1];d<0&&(f=f.negate()),n=n.add(f)}return n},getPrecomputes(e,t,r){let n=Gs.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&Gs.set(t,r(n))),n},wNAFCached(e,t,r){const n=Ws(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){const a=Ws(e);return 1===a?this.unsafeLadder(e,t,n):this.wNAFUnsafe(a,this.getPrecomputes(a,e,r),t,n)},setWindowSize(e,t){$s(t,b),Js.set(e,t),Gs.delete(e)}});var p,b;return{CURVE:t,ProjectivePoint:u,normPrivateKeyToScalar:o,weierstrassEquation:s,isWithinCurveOrder:function(e){return us(e,ro,t.n)}}}function io(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function so(e,...t){if(!((r=e)instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name))throw new Error("Uint8Array expected");var r;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function oo(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");io(e.outputLen),io(e.blockLen)}function co(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}const fo="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function uo(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),so(e),e}class lo{clone(){return this._cloneInto()}}function ho(e=32){if(fo&&"function"==typeof fo.getRandomValues)return fo.getRandomValues(new Uint8Array(e));if(fo&&"function"==typeof fo.randomBytes)return fo.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}class po extends lo{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,oo(e);const r=uo(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const n=this.blockLen,a=new Uint8Array(n);a.set(r.length>n?e.create().update(r).digest():r);for(let e=0;e<a.length;e++)a[e]^=54;this.iHash.update(a),this.oHash=e.create();for(let e=0;e<a.length;e++)a[e]^=106;this.oHash.update(a),a.fill(0)}update(e){return co(this),this.iHash.update(e),this}digestInto(e){co(this),so(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:a,blockLen:i,outputLen:s}=this;return e.finished=n,e.destroyed=a,e.blockLen=i,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const bo=(e,t,r)=>new po(e,t).update(r).digest();function go(e){return{hash:e,hmac:(t,...r)=>bo(e,t,function(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];so(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const a=e[t];r.set(a,n),n+=a.length}return r}(...r)),randomBytes:ho}}bo.create=(e,t)=>new po(e,t);const yo=BigInt("3618502788666131213697322783095070105526743751716087489154079457884512865583"),mo=BigInt("0x800000000000000000000000000000000000000000000000000000000000000");function wo(e){for(;0===e[0];)e=e.subarray(1);const t=8*e.length-252,r=ns(e);return t>0?r>>BigInt(t):r}function vo(e){return"string"==typeof e&&1&(e=Lo(e)).length&&(e="0"+e),rs(e)}const Eo=function(e){const t=function(e){const t=Ys(e);return ws(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:r,n}=t,a=r.BYTES+1,i=2*r.BYTES+1;function s(e){return Cs(e,n)}function o(e){return Bs(e,n)}const{ProjectivePoint:c,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:u}=ao({...t,toBytes(e,t,n){const a=t.toAffine(),i=r.toBytes(a.x),s=ds;return Wi("isCompressed",n),n?s(Uint8Array.from([t.hasEvenY()?2:3]),i):s(Uint8Array.from([4]),i,r.toBytes(a.y))},fromBytes(e){const t=e.length,n=e[0],s=e.subarray(1);if(t!==a||2!==n&&3!==n){if(t===i&&4===n){return{x:r.fromBytes(s.subarray(0,r.BYTES)),y:r.fromBytes(s.subarray(r.BYTES,2*r.BYTES))}}throw new Error("invalid Point, expected length of "+a+", or uncompressed "+i+", got "+t)}{const e=ns(s);if(!us(e,ro,r.ORDER))throw new Error("Point is not on curve");const t=f(e);let a;try{a=r.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("Point is not on curve"+t)}return!(1&~n)!==((a&ro)===ro)&&(a=r.neg(a)),{x:e,y:a}}}}),l=e=>Zi(is(e,t.nByteLength));function h(e){return e>n>>ro}const p=(e,t,r)=>ns(e.slice(t,r));class b{constructor(e,t,r){this.r=e,this.s=t,this.recovery=r,this.assertValidity()}static fromCompact(e){const r=t.nByteLength;return e=cs("compactSignature",e,2*r),new b(p(e,0,r),p(e,r,2*r))}static fromDER(e){const{r:t,s:r}=eo.toSig(cs("DER",e));return new b(t,r)}assertValidity(){ls("r",this.r,ro,n),ls("s",this.s,ro,n)}addRecoveryBit(e){return new b(this.r,this.s,e)}recoverPublicKey(e){const{r:n,s:a,recovery:i}=this,d=w(cs("msgHash",e));if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");const f=2===i||3===i?n+t.n:n;if(f>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const u=1&i?"03":"02",h=c.fromHex(u+l(f)),p=o(f),b=s(-d*p),g=s(a*p),y=c.BASE.multiplyAndAddUnsafe(h,b,g);if(!y)throw new Error("point at infinify");return y.assertValidity(),y}hasHighS(){return h(this.s)}normalizeS(){return this.hasHighS()?new b(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return rs(this.toDERHex())}toDERHex(){return eo.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return rs(this.toCompactHex())}toCompactHex(){return l(this.r)+l(this.s)}}const g={isValidPrivateKey(e){try{return d(e),!0}catch(e){return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const e=Ds(t.n);return function(e,t,r=!1){const n=e.length,a=Fs(t),i=Ds(t);if(n<16||n<i||n>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+n);const s=Cs(r?ns(e):as(e),t-As)+As;return r?ss(s,a):is(s,a)}(t.randomBytes(e),t.n)},precompute:(e=8,t=c.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function y(e){const t=Gi(e),r="string"==typeof e,n=(t||r)&&e.length;return t?n===a||n===i:r?n===2*a||n===2*i:e instanceof c}const m=t.bits2int||function(e){if(e.length>8192)throw new Error("input is too large");const r=ns(e),n=8*e.length-t.nBitLength;return n>0?r>>BigInt(n):r},w=t.bits2int_modN||function(e){return s(m(e))},v=ps(t.nBitLength);function E(e){return ls("num < 2^"+t.nBitLength,e,to,v),is(e,t.nByteLength)}function A(e,n,a=_){if(["recovered","canonical"].some((e=>e in a)))throw new Error("sign() legacy options not supported");const{hash:i,randomBytes:f}=t;let{lowS:l,prehash:p,extraEntropy:g}=a;null==l&&(l=!0),e=cs("msgHash",e),Zs(a),p&&(e=cs("prehashed msgHash",i(e)));const y=w(e),v=d(n),A=[E(v),E(y)];if(null!=g&&!1!==g){const e=!0===g?f(r.BYTES):g;A.push(cs("extraEntropy",e))}const x=ds(...A),S=y;return{seed:x,k2sig:function(e){const t=m(e);if(!u(t))return;const r=o(t),n=c.BASE.multiply(t).toAffine(),a=s(n.x);if(a===to)return;const i=s(r*s(S+a*v));if(i===to)return;let d=(n.x===a?0:2)|Number(n.y&ro),f=i;return l&&h(i)&&(f=function(e){return h(e)?s(-e):e}(i),d^=1),new b(a,f,d)}}}const _={lowS:t.lowS,prehash:!1},x={lowS:t.lowS,prehash:!1};return c.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return c.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(y(e))throw new Error("first arg must be private key");if(!y(t))throw new Error("second arg must be public key");return c.fromHex(t).multiply(d(e)).toRawBytes(r)},sign:function(e,r,n=_){const{seed:a,k2sig:i}=A(e,r,n),s=t;return ys(s.hash.outputLen,s.nByteLength,s.hmac)(a,i)},verify:function(e,r,n,a=x){const i=e;r=cs("msgHash",r),n=cs("publicKey",n);const{lowS:d,prehash:f,format:u}=a;if(Zs(a),"strict"in a)throw new Error("options.strict was renamed to lowS");if(void 0!==u&&"compact"!==u&&"der"!==u)throw new Error("format must be compact or der");const l="string"==typeof i||Gi(i),h=!l&&!u&&"object"==typeof i&&null!==i&&"bigint"==typeof i.r&&"bigint"==typeof i.s;if(!l&&!h)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let p,g;try{if(h&&(p=new b(i.r,i.s)),l){try{"compact"!==u&&(p=b.fromDER(i))}catch(e){if(!(e instanceof eo.Err))throw e}p||"der"===u||(p=b.fromCompact(i))}g=c.fromHex(n)}catch(e){return!1}if(!p)return!1;if(d&&p.hasHighS())return!1;f&&(r=t.hash(r));const{r:y,s:m}=p,v=w(r),E=o(m),A=s(v*E),_=s(y*E),S=c.BASE.multiplyAndAddUnsafe(g,A,_)?.toAffine();return!!S&&s(S.x)===y},ProjectivePoint:c,Signature:b,utils:g}}({a:BigInt(1),b:BigInt("3141592653589793238462643383279502884197169399375105820974944592307816406665"),Fp:Ls(BigInt("0x800000000000011000000000000000000000000000000000000000000000001")),n:yo,nBitLength:252,Gx:BigInt("874739451078007766457464989774322083649278607533249481151382481072868806602"),Gy:BigInt("152666792071518830868575557812948353041420400780739481342941381225525861407"),h:BigInt(1),lowS:!1,...go($i),bits2int:wo,bits2int_modN:e=>{const t=ns(e).toString(16);return 63===t.length&&(e=vo(t+"0")),Cs(wo(e),yo)}}),Ao=Eo;function _o(e){return cs("","string"==typeof e?vo(e):e)}function xo(e){return Zi(_o(e)).padStart(64,"0")}function So(e,t=!1){return Eo.getPublicKey(xo(e),t)}function Io(e,t){return Eo.getSharedSecret(xo(e),t)}function ko(e){const{r:t,s:r}=e;if(t<0n||t>=mo)throw new Error(`Signature.r should be [1, ${mo})`);const n=Bs(r,yo);if(n<0n||n>=mo)throw new Error(`inv(Signature.s) should be [1, ${mo})`)}function Co(e){const t=_o(e);if(ns(t)>=mo)throw new Error(`msgHash should be [0, ${mo})`);return t}function To(e,t,r){const n=Eo.sign(Co(e),xo(t),r);return ko(n),n}function Bo(e,t,r){if(!(e instanceof Ro)){const t=_o(e);try{e=Ro.fromDER(t)}catch(r){if(!(r instanceof eo.Err))throw r;e=Ro.fromCompact(t)}}return ko(e),Eo.verify(e,Co(t),_o(r))}const{CURVE:Mo,ProjectivePoint:Oo,Signature:Ro,utils:No}=Eo;function Po(e){return`0x${Zi(e.subarray(1)).replace(/^0+/gm,"")}`}function Lo(e){return e.replace(/^0x/i,"")}function Fo(e){const t=_o(e),r=2n**256n,n=r-Cs(r,yo);for(let e=0;;e++){const r=Zo(ds(t,os(BigInt(e))));if(r<n)return Cs(r,yo).toString(16);if(1e5===e)throw new Error("grindKey is broken: tried 100k vals")}}function Do(e){return Po(So(e,!0))}function Uo(e){if(130!==(e=Lo(e)).length)throw new Error("Wrong ethereum signature");return Fo(e.substring(0,64))}const Ho=e=>Number(2147483647n&e);function jo(e,t,r,n){const a=Ho(Zo(e)),i=Ho(Zo(t)),s=Qi(Lo(r));return`m/2645'/${a}'/${i}'/${Ho(s)}'/${Ho(s>>31n)}'/${n}`}const Vo=[new Oo(2089986280348253421170679821480865132823066470938446095505822317253594081284n,1713931329540660377023406109199410414810705867260802078187082345529207694986n,1n),new Oo(996781205833008774514500082376783249102396023663454813447423147977397232763n,1668503676786377725805489344771023921079126552019160156920634619255970485781n,1n),new Oo(2251563274489750535117886426533222435294046428347329203627021249169616184184n,1798716007562728905295480679789526322175868328062420237419143593021674992973n,1n),new Oo(2138414695194151160943305727036575959195309218611738193261179310511854807447n,113410276730064486255102093846540133784865286929052426931474106396135072156n,1n),new Oo(2379962749567351885752724891227938183011949129833673362440656643086021394946n,776496453633298175483985398648758586525933812536653089401905292063708816422n,1n)];function $o(e,t){const r=[];let n=e;for(let e=0;e<248;e++)r.push(n),n=n.double();n=t;for(let e=0;e<4;e++)r.push(n),n=n.double();return r}const zo=$o(Vo[1],Vo[2]),qo=$o(Vo[3],Vo[4]);function Ko(e,t,r){let n=function(e){let t;if("bigint"==typeof e)t=e;else if("number"==typeof e){if(!Number.isSafeInteger(e))throw new Error(`Invalid pedersenArg: ${e}`);t=BigInt(e)}else t=ns(_o(e));if(!(0n<=t&&t<Eo.CURVE.Fp.ORDER))throw new Error(`PedersenArg should be 0 <= value < CURVE.P: ${t}`);return t}(t);for(let t=0;t<252;t++){const a=r[t];if(!a)throw new Error("invalid constant index");if(a.equals(e))throw new Error("Same point");0n!==(1n&n)&&(e=e.add(a)),n>>=1n}return e}function Go(e,t){let r=Vo[0];return r=Ko(r,e,zo),r=Ko(r,t,qo),Po(r.toRawBytes(!0))}const Jo=(e,t=Go)=>[0,...e,e.length].reduce(((e,r)=>t(e,r))),Wo=ps(250),Yo=e=>ns(Li(e))&Wo,Zo=e=>ns($i(e)),Xo=Ls(BigInt("3618502788666131213697322783095070105623107215331596699973092056135872020481"));function Qo(e,t,r){const n=e.fromBytes($i(yi(`${t}${r}`)));return e.create(n)}function ec(e,t,r,n=0){const a=[],i=[];for(let s=0;s<r;s++)a.push(Qo(e,`${t}x`,n*r+s)),i.push(Qo(e,`${t}y`,n*r+s));if(new Set([...a,...i]).size!==2*r)throw new Error("X and Y values are not distinct");return a.map((t=>i.map((r=>e.inv(e.sub(t,r))))))}const tc=[[3,1,1],[1,-1,1],[1,1,-2]].map((e=>e.map(BigInt)));function rc(e,t){if(Rs(e.Fp),!Number.isSafeInteger(e.rate)||!Number.isSafeInteger(e.capacity))throw new Error(`Wrong poseidon opts: ${e}`);const r=e.rate+e.capacity,n=e.roundsFull+e.roundsPartial,a=[];for(let t=0;t<n;t++){const n=[];for(let a=0;a<r;a++)n.push(Qo(e.Fp,"Hades",r*t+a));a.push(n)}const i=Us({...e,t:r,sboxPower:3,reversePartialPowIdx:!0,mds:t,roundConstants:a});return i.m=r,i.rate=e.rate,i.capacity=e.capacity,i}function nc(e,t=0){const r=e.rate+e.capacity;if(!Number.isSafeInteger(t))throw new Error(`Wrong mdsAttempt=${t}`);return rc(e,ec(e.Fp,"HadesMDS",r,t))}const ac=rc({Fp:Xo,rate:2,capacity:1,roundsFull:8,roundsPartial:83},tc);function ic(e,t,r=ac){return r([e,t,2n])[0]}function sc(e,t,r=ac){return os(ic(ns(e),ns(t),r))}function oc(e,t=ac){return t([e,0n,1n])[0]}function cc(e,t=ac){const{m:r,rate:n}=t;if(!Array.isArray(e))throw new Error("bigint array expected in values");const a=Array.from(e);for(a.push(1n);a.length%n!=0;)a.push(0n);let i=new Array(r).fill(0n);for(let e=0;e<a.length;e+=n){for(let t=0;t<n;t++){const r=a[e+t];if(void 0===r)throw new Error("invalid index");if(void 0===i[t])throw new Error("state[j] is undefined");i[t]=i[t]+r}i=t(i)}return i[0]}const dc=BigInt(2**32-1),fc=BigInt(32);function uc(e,t=!1){return t?{h:Number(e&dc),l:Number(e>>fc&dc)}:{h:0|Number(e>>fc&dc),l:0|Number(e&dc)}}function lc(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let a=0;a<e.length;a++){const{h:i,l:s}=uc(e[a],t);[r[a],n[a]]=[i,s]}return[r,n]}const hc=(e,t,r)=>e<<r|t>>>32-r,pc=(e,t,r)=>t<<r|e>>>32-r,bc=(e,t,r)=>t<<r-32|e>>>64-r,gc=(e,t,r)=>e<<r-32|t>>>64-r;const yc=[],mc=[],wc=[],vc=BigInt(0),Ec=BigInt(1),Ac=BigInt(2),_c=BigInt(7),xc=BigInt(256),Sc=BigInt(113);for(let e=0,t=Ec,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],yc.push(2*(5*n+r)),mc.push((e+1)*(e+2)/2%64);let a=vc;for(let e=0;e<7;e++)t=(t<<Ec^(t>>_c)*Sc)%xc,t&Ac&&(a^=Ec<<(Ec<<BigInt(e))-Ec);wc.push(a)}const[Ic,kc]=lc(wc,!0),Cc=(e,t,r)=>r>32?bc(e,t,r):hc(e,t,r),Tc=(e,t,r)=>r>32?gc(e,t,r):pc(e,t,r);class Bc extends za{constructor(e,t,r,n=!1,a=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Oa(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var i;this.state=new Uint8Array(200),this.state32=(i=this.state,new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.byteLength/4)))}keccak(){Ha||Va(this.state32),function(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,a=(t+2)%10,i=r[a],s=r[a+1],o=Cc(i,s,1)^r[n],c=Tc(i,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=o,e[t+r+1]^=c}let t=e[2],a=e[3];for(let r=0;r<24;r++){const n=mc[r],i=Cc(t,a,n),s=Tc(t,a,n),o=yc[r];t=e[o],a=e[o+1],e[o]=i,e[o+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=Ic[n],e[1]^=kc[n]}r.fill(0)}(this.state32,this.rounds),Ha||Va(this.state32),this.posOut=0,this.pos=0}update(e){Pa(this);const{blockLen:t,state:r}=this,n=(e=$a(e)).length;for(let a=0;a<n;){const i=Math.min(t-this.pos,n-a);for(let t=0;t<i;t++)r[this.pos++]^=e[a++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,128&t&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){Pa(this,!1),Ra(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,a=e.length;n<a;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,a-n);e.set(t.subarray(this.posOut,this.posOut+i),n),this.posOut+=i,n+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Oa(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(La(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){const{blockLen:t,suffix:r,outputLen:n,rounds:a,enableXOF:i}=this;return e||(e=new Bc(t,r,n,i,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=r,e.outputLen=n,e.enableXOF=i,e.destroyed=this.destroyed,e}}const Mc=(e,t,r)=>qa((()=>new Bc(t,e,r))),Oc=Mc(1,136,32),Rc=BigInt(0),Nc=BigInt(1),Pc=BigInt(2),Lc=BigInt(3),Fc=BigInt(4),Dc=BigInt(5),Uc=BigInt(8);BigInt(9),BigInt(16);function Hc(e,t){const r=e%t;return r>=Rc?r:t+r}function jc(e,t,r){if(t<Rc)throw new Error("invalid exponent, negatives unsupported");if(r<=Rc)throw new Error("invalid modulus");if(r===Nc)return Rc;let n=Nc;for(;t>Rc;)t&Nc&&(n=n*e%r),e=e*e%r,t>>=Nc;return n}function Vc(e,t,r){let n=e;for(;t-- >Rc;)n*=n,n%=r;return n}function $c(e,t){if(e===Rc)throw new Error("invert: expected non-zero number");if(t<=Rc)throw new Error("invert: expected positive modulus, got "+t);let r=Hc(e,t),n=t,a=Rc,i=Nc,s=Nc,o=Rc;for(;r!==Rc;){const e=n/r,t=n%r,c=a-s*e,d=i-o*e;n=r,r=t,a=s,i=o,s=c,o=d}if(n!==Nc)throw new Error("invert: does not exist");return Hc(a,t)}function zc(e){if(e%Fc===Lc){const t=(e+Nc)/Fc;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}if(e%Uc===Dc){const t=(e-Dc)/Uc;return function(e,r){const n=e.mul(r,Pc),a=e.pow(n,t),i=e.mul(r,a),s=e.mul(e.mul(i,Pc),a),o=e.mul(i,e.sub(s,e.ONE));if(!e.eql(e.sqr(o),r))throw new Error("Cannot find square root");return o}}return function(e){const t=(e-Nc)/Pc;let r,n,a;for(r=e-Nc,n=0;r%Pc===Rc;r/=Pc,n++);for(a=Pc;a<e&&jc(a,t,e)!==e-Nc;a++)if(a>1e3)throw new Error("Cannot find square root: likely non-prime P");if(1===n){const t=(e+Nc)/Fc;return function(e,r){const n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw new Error("Cannot find square root");return n}}const i=(r+Nc)/Pc;return function(e,s){if(e.pow(s,t)===e.neg(e.ONE))throw new Error("Cannot find square root");let o=n,c=e.pow(e.mul(e.ONE,a),r),d=e.pow(s,i),f=e.pow(s,r);for(;!e.eql(f,e.ONE);){if(e.eql(f,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(f);t<o&&!e.eql(r,e.ONE);t++)r=e.sqr(r);const r=e.pow(c,Nc<<BigInt(o-t-1));c=e.sqr(r),d=e.mul(d,r),f=e.mul(f,c),o=t}return d}}(e)}const qc=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function Kc(e){const t=qc.reduce(((e,t)=>(e[t]="function",e)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return Ba(e,t)}function Gc(e,t,r){if(r<Rc)throw new Error("invalid exponent, negatives unsupported");if(r===Rc)return e.ONE;if(r===Nc)return t;let n=e.ONE,a=t;for(;r>Rc;)r&Nc&&(n=e.mul(n,a)),a=e.sqr(a),r>>=Nc;return n}function Jc(e,t){const r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function Wc(e,t,r=!1,n={}){if(e<=Rc)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:a,nByteLength:i}=Jc(e,t);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let s;const o=Object.freeze({ORDER:e,BITS:a,BYTES:i,MASK:Sa(a),ZERO:Rc,ONE:Nc,create:t=>Hc(t,e),isValid:t=>{if("bigint"!=typeof t)throw new Error("invalid field element: expected bigint, got "+typeof t);return Rc<=t&&t<e},is0:e=>e===Rc,isOdd:e=>(e&Nc)===Nc,neg:t=>Hc(-t,e),eql:(e,t)=>e===t,sqr:t=>Hc(t*t,e),add:(t,r)=>Hc(t+r,e),sub:(t,r)=>Hc(t-r,e),mul:(t,r)=>Hc(t*r,e),pow:(e,t)=>Gc(o,e,t),div:(t,r)=>Hc(t*$c(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>$c(t,e),sqrt:n.sqrt||(t=>(s||(s=zc(e)),s(o,t))),invertBatch:e=>function(e,t){const r=new Array(t.length),n=t.reduce(((t,n,a)=>e.is0(n)?t:(r[a]=t,e.mul(t,n))),e.ONE),a=e.inv(n);return t.reduceRight(((t,n,a)=>e.is0(n)?t:(r[a]=e.mul(t,r[a]),e.mul(t,n))),a),r}(o,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?ma(e,i):ya(e,i),fromBytes:e=>{if(e.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+e.length);return r?ga(e):ba(e)}});return Object.freeze(o)}function Yc(e){if("bigint"!=typeof e)throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function Zc(e){const t=Yc(e);return t+Math.ceil(t/2)}function Xc(e){const{Fp:t,mds:r,reversePartialPowIdx:n,roundConstants:a}=e,{roundsFull:i,roundsPartial:s,sboxPower:o,t:c}=e;Kc(t);for(const t of["t","roundsFull","roundsPartial"])if("number"!=typeof e[t]||!Number.isSafeInteger(e[t]))throw new Error("invalid number "+t);if(!Array.isArray(r)||r.length!==c)throw new Error("Poseidon: invalid MDS matrix");const d=r.map((e=>{if(!Array.isArray(e)||e.length!==c)throw new Error("invalid MDS matrix row: "+e);return e.map((e=>{if("bigint"!=typeof e)throw new Error("invalid MDS matrix bigint: "+e);return t.create(e)}))}));if(void 0!==n&&"boolean"!=typeof n)throw new Error("invalid param reversePartialPowIdx="+n);if(1&i)throw new Error("roundsFull is not even"+i);const f=i+s;if(!Array.isArray(a)||a.length!==f)throw new Error("Poseidon: invalid round constants");const u=a.map((e=>{if(!Array.isArray(e)||e.length!==c)throw new Error("invalid round constants");return e.map((e=>{if("bigint"!=typeof e||!t.isValid(e))throw new Error("invalid round constant");return t.create(e)}))}));if(!o||![3,5,7].includes(o))throw new Error("invalid sboxPower");const l=BigInt(o);let h=e=>Gc(t,e,l);return 3===o?h=e=>t.mul(t.sqrN(e),e):5===o&&(h=e=>t.mul(t.sqrN(t.sqrN(e)),e)),Object.freeze({...e,rounds:f,sboxFn:h,roundConstants:u,mds:d})}function Qc(e,t){if("number"!=typeof t)throw new Error("poseidonSplitConstants: invalid t");if(!Array.isArray(e)||e.length%t)throw new Error("poseidonSplitConstants: invalid rc");const r=[];let n=[];for(let a=0;a<e.length;a++)n.push(e[a]),n.length===t&&(r.push(n),n=[]);return r}function ed(e){const t=Xc(e),{Fp:r,mds:n,roundConstants:a,rounds:i,roundsPartial:s,sboxFn:o,t:c}=t,d=t.roundsFull/2,f=t.reversePartialPowIdx?c-1:0,u=(e,t,i)=>(e=e.map(((e,t)=>r.add(e,a[i][t]))),t?e=e.map((e=>o(e))):e[f]=o(e[f]),e=n.map((t=>t.reduce(((t,n,a)=>r.add(t,r.mulN(n,e[a]))),r.ZERO))),e),l=function(e){if(!Array.isArray(e)||e.length!==c)throw new Error("invalid values, expected array of bigints with length "+c);e=e.map((e=>{if("bigint"!=typeof e)throw new Error("invalid bigint="+e);return r.create(e)}));let t=0;for(let r=0;r<d;r++)e=u(e,!0,t++);for(let r=0;r<s;r++)e=u(e,!1,t++);for(let r=0;r<d;r++)e=u(e,!0,t++);if(t!==i)throw new Error("invalid number of rounds");return e};return l.roundConstants=a,l}const td=BigInt(0),rd=BigInt(1);function nd(e,t){const r=t.negate();return e?r:t}function ad(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function id(e,t){ad(e,t);return{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)}}function sd(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach(((e,r)=>{if(!(e instanceof t))throw new Error("invalid point at index "+r)}))}function od(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach(((e,r)=>{if(!t.isValid(e))throw new Error("invalid scalar at index "+r)}))}const cd=new WeakMap,dd=new WeakMap;function fd(e){return dd.get(e)||1}function ud(e){return Kc(e.Fp),Ba(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Jc(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}function ld(e){void 0!==e.lowS&&oa("lowS",e.lowS),void 0!==e.prehash&&oa("prehash",e.prehash)}const{Ph:hd,aT:pd}=l,bd={Err:class extends Error{constructor(e=""){super(e)}},_tlv:{encode:(e,t)=>{const{Err:r}=bd;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");const n=t.length/2,a=fa(n);if(a.length/2&128)throw new r("tlv.encode: long form length too big");const i=n>127?fa(a.length/2|128):"";return fa(e)+i+a+t},decode(e,t){const{Err:r}=bd;let n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");const a=t[n++];let i=0;if(!!(128&a)){const e=127&a;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");const s=t.subarray(n,n+e);if(s.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(const e of s)i=i<<8|e;if(n+=e,i<128)throw new r("tlv.decode(long): not minimal encoding")}else i=a;const s=t.subarray(n,n+i);if(s.length!==i)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(n+i)}}},_int:{encode(e){const{Err:t}=bd;if(e<gd)throw new t("integer: negative integers are not allowed");let r=fa(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){const{Err:t}=bd;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return hd(e)}},toSig(e){const{Err:t,_int:r,_tlv:n}=bd,a="string"==typeof e?pd(e):e;sa(a);const{v:i,l:s}=n.decode(48,a);if(s.length)throw new t("invalid signature: left bytes after parsing");const{v:o,l:c}=n.decode(2,i),{v:d,l:f}=n.decode(2,c);if(f.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(o),s:r.decode(d)}},hexFromSig(e){const{_tlv:t,_int:r}=bd,n=t.encode(2,r.encode(e.r))+t.encode(2,r.encode(e.s));return t.encode(48,n)}},gd=BigInt(0),yd=BigInt(1),md=BigInt(2),wd=BigInt(3),vd=BigInt(4);function Ed(e){const t=function(e){const t=ud(e);Ba(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:r,Fp:n,a}=t;if(r){if(!n.eql(a,n.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:r}=t,n=Wc(t.n,t.nBitLength),a=t.toBytes||((e,t,n)=>{const a=t.toAffine();return va(Uint8Array.from([4]),r.toBytes(a.x),r.toBytes(a.y))}),i=t.fromBytes||(e=>{const t=e.subarray(1);return{x:r.fromBytes(t.subarray(0,r.BYTES)),y:r.fromBytes(t.subarray(r.BYTES,2*r.BYTES))}});function s(e){const{a:n,b:a}=t,i=r.sqr(e),s=r.mul(i,e);return r.add(r.add(s,r.mul(e,n)),a)}if(!r.eql(r.sqr(t.Gy),s(t.Gx)))throw new Error("bad generator point: equation left != right");function o(e){const{allowedPrivateKeyLengths:r,nByteLength:n,wrapPrivateKey:a,n:i}=t;if(r&&"bigint"!=typeof e){if(ia(e)&&(e=da(e)),"string"!=typeof e||!r.includes(e.length))throw new Error("invalid private key");e=e.padStart(2*n,"0")}let s;try{s="bigint"==typeof e?e:ba(wa("private key",e,n))}catch(t){throw new Error("invalid private key, expected hex or "+n+" bytes, got "+typeof e)}return a&&(s=Hc(s,i)),_a("private key",s,yd,i),s}function c(e){if(!(e instanceof u))throw new Error("ProjectivePoint expected")}const d=Ma(((e,t)=>{const{px:n,py:a,pz:i}=e;if(r.eql(i,r.ONE))return{x:n,y:a};const s=e.is0();null==t&&(t=s?r.ONE:r.inv(i));const o=r.mul(n,t),c=r.mul(a,t),d=r.mul(i,t);if(s)return{x:r.ZERO,y:r.ZERO};if(!r.eql(d,r.ONE))throw new Error("invZ was invalid");return{x:o,y:c}})),f=Ma((e=>{if(e.is0()){if(t.allowInfinityPoint&&!r.is0(e.py))return;throw new Error("bad point: ZERO")}const{x:n,y:a}=e.toAffine();if(!r.isValid(n)||!r.isValid(a))throw new Error("bad point: x or y not FE");const i=r.sqr(a),o=s(n);if(!r.eql(i,o))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0}));class u{constructor(e,t,n){if(this.px=e,this.py=t,this.pz=n,null==e||!r.isValid(e))throw new Error("x required");if(null==t||!r.isValid(t))throw new Error("y required");if(null==n||!r.isValid(n))throw new Error("z required");Object.freeze(this)}static fromAffine(e){const{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw new Error("invalid affine point");if(e instanceof u)throw new Error("projective point not allowed");const a=e=>r.eql(e,r.ZERO);return a(t)&&a(n)?u.ZERO:new u(t,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){const t=r.invertBatch(e.map((e=>e.pz)));return e.map(((e,r)=>e.toAffine(t[r]))).map(u.fromAffine)}static fromHex(e){const t=u.fromAffine(i(wa("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return u.BASE.multiply(o(e))}static msm(e,t){return function(e,t,r,n){if(sd(r,e),od(n,t),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const a=e.ZERO,i=xa(BigInt(r.length)),s=i>12?i-3:i>4?i-2:i?2:1,o=(1<<s)-1,c=new Array(o+1).fill(a);let d=a;for(let e=Math.floor((t.BITS-1)/s)*s;e>=0;e-=s){c.fill(a);for(let t=0;t<n.length;t++){const a=n[t],i=Number(a>>BigInt(e)&BigInt(o));c[i]=c[i].add(r[t])}let t=a;for(let e=c.length-1,r=a;e>0;e--)r=r.add(c[e]),t=t.add(r);if(d=d.add(t),0!==e)for(let e=0;e<s;e++)d=d.double()}return d}(u,n,e,t)}_setWindowSize(e){h.setWindowSize(this,e)}assertValidity(){f(this)}hasEvenY(){const{y:e}=this.toAffine();if(r.isOdd)return!r.isOdd(e);throw new Error("Field doesn't support isOdd")}equals(e){c(e);const{px:t,py:n,pz:a}=this,{px:i,py:s,pz:o}=e,d=r.eql(r.mul(t,o),r.mul(i,a)),f=r.eql(r.mul(n,o),r.mul(s,a));return d&&f}negate(){return new u(this.px,r.neg(this.py),this.pz)}double(){const{a:e,b:n}=t,a=r.mul(n,wd),{px:i,py:s,pz:o}=this;let c=r.ZERO,d=r.ZERO,f=r.ZERO,l=r.mul(i,i),h=r.mul(s,s),p=r.mul(o,o),b=r.mul(i,s);return b=r.add(b,b),f=r.mul(i,o),f=r.add(f,f),c=r.mul(e,f),d=r.mul(a,p),d=r.add(c,d),c=r.sub(h,d),d=r.add(h,d),d=r.mul(c,d),c=r.mul(b,c),f=r.mul(a,f),p=r.mul(e,p),b=r.sub(l,p),b=r.mul(e,b),b=r.add(b,f),f=r.add(l,l),l=r.add(f,l),l=r.add(l,p),l=r.mul(l,b),d=r.add(d,l),p=r.mul(s,o),p=r.add(p,p),l=r.mul(p,b),c=r.sub(c,l),f=r.mul(p,h),f=r.add(f,f),f=r.add(f,f),new u(c,d,f)}add(e){c(e);const{px:n,py:a,pz:i}=this,{px:s,py:o,pz:d}=e;let f=r.ZERO,l=r.ZERO,h=r.ZERO;const p=t.a,b=r.mul(t.b,wd);let g=r.mul(n,s),y=r.mul(a,o),m=r.mul(i,d),w=r.add(n,a),v=r.add(s,o);w=r.mul(w,v),v=r.add(g,y),w=r.sub(w,v),v=r.add(n,i);let E=r.add(s,d);return v=r.mul(v,E),E=r.add(g,m),v=r.sub(v,E),E=r.add(a,i),f=r.add(o,d),E=r.mul(E,f),f=r.add(y,m),E=r.sub(E,f),h=r.mul(p,v),f=r.mul(b,m),h=r.add(f,h),f=r.sub(y,h),h=r.add(y,h),l=r.mul(f,h),y=r.add(g,g),y=r.add(y,g),m=r.mul(p,m),v=r.mul(b,v),y=r.add(y,m),m=r.sub(g,m),m=r.mul(p,m),v=r.add(v,m),g=r.mul(y,v),l=r.add(l,g),g=r.mul(E,v),f=r.mul(w,f),f=r.sub(f,g),g=r.mul(w,y),h=r.mul(E,h),h=r.add(h,g),new u(f,l,h)}subtract(e){return this.add(e.negate())}is0(){return this.equals(u.ZERO)}wNAF(e){return h.wNAFCached(this,e,u.normalizeZ)}multiplyUnsafe(e){const{endo:n,n:a}=t;_a("scalar",e,gd,a);const i=u.ZERO;if(e===gd)return i;if(this.is0()||e===yd)return this;if(!n||h.hasPrecomputes(this))return h.wNAFCachedUnsafe(this,e,u.normalizeZ);let{k1neg:s,k1:o,k2neg:c,k2:d}=n.splitScalar(e),f=i,l=i,p=this;for(;o>gd||d>gd;)o&yd&&(f=f.add(p)),d&yd&&(l=l.add(p)),p=p.double(),o>>=yd,d>>=yd;return s&&(f=f.negate()),c&&(l=l.negate()),l=new u(r.mul(l.px,n.beta),l.py,l.pz),f.add(l)}multiply(e){const{endo:n,n:a}=t;let i,s;if(_a("scalar",e,yd,a),n){const{k1neg:t,k1:a,k2neg:o,k2:c}=n.splitScalar(e);let{p:d,f}=this.wNAF(a),{p:l,f:p}=this.wNAF(c);d=h.constTimeNegate(t,d),l=h.constTimeNegate(o,l),l=new u(r.mul(l.px,n.beta),l.py,l.pz),i=d.add(l),s=f.add(p)}else{const{p:t,f:r}=this.wNAF(e);i=t,s=r}return u.normalizeZ([i,s])[0]}multiplyAndAddUnsafe(e,t,r){const n=u.BASE,a=(e,t)=>t!==gd&&t!==yd&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),i=a(this,t).add(a(e,r));return i.is0()?void 0:i}toAffine(e){return d(this,e)}isTorsionFree(){const{h:e,isTorsionFree:r}=t;if(e===yd)return!0;if(r)return r(u,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:e,clearCofactor:r}=t;return e===yd?this:r?r(u,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return oa("isCompressed",e),this.assertValidity(),a(u,this,e)}toHex(e=!0){return oa("isCompressed",e),da(this.toRawBytes(e))}}u.BASE=new u(t.Gx,t.Gy,r.ONE),u.ZERO=new u(r.ZERO,r.ONE,r.ZERO);const l=t.nBitLength,h=(p=u,b=t.endo?Math.ceil(l/2):l,{constTimeNegate:nd,hasPrecomputes:e=>1!==fd(e),unsafeLadder(e,t,r=p.ZERO){let n=e;for(;t>td;)t&rd&&(r=r.add(n)),n=n.double(),t>>=rd;return r},precomputeWindow(e,t){const{windows:r,windowSize:n}=id(t,b),a=[];let i=e,s=i;for(let e=0;e<r;e++){s=i,a.push(s);for(let e=1;e<n;e++)s=s.add(i),a.push(s);i=s.double()}return a},wNAF(e,t,r){const{windows:n,windowSize:a}=id(e,b);let i=p.ZERO,s=p.BASE;const o=BigInt(2**e-1),c=2**e,d=BigInt(e);for(let e=0;e<n;e++){const n=e*a;let f=Number(r&o);r>>=d,f>a&&(f-=c,r+=rd);const u=n,l=n+Math.abs(f)-1,h=e%2!=0,p=f<0;0===f?s=s.add(nd(h,t[u])):i=i.add(nd(p,t[l]))}return{p:i,f:s}},wNAFUnsafe(e,t,r,n=p.ZERO){const{windows:a,windowSize:i}=id(e,b),s=BigInt(2**e-1),o=2**e,c=BigInt(e);for(let e=0;e<a;e++){const a=e*i;if(r===td)break;let d=Number(r&s);if(r>>=c,d>i&&(d-=o,r+=rd),0===d)continue;let f=t[a+Math.abs(d)-1];d<0&&(f=f.negate()),n=n.add(f)}return n},getPrecomputes(e,t,r){let n=cd.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&cd.set(t,r(n))),n},wNAFCached(e,t,r){const n=fd(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){const a=fd(e);return 1===a?this.unsafeLadder(e,t,n):this.wNAFUnsafe(a,this.getPrecomputes(a,e,r),t,n)},setWindowSize(e,t){ad(t,b),dd.set(e,t),cd.delete(e)}});var p,b;return{CURVE:t,ProjectivePoint:u,normPrivateKeyToScalar:o,weierstrassEquation:s,isWithinCurveOrder:function(e){return Aa(e,yd,t.n)}}}function Ad(e){const t=function(e){const t=ud(e);return Ba(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:r,n}=t,a=r.BYTES+1,i=2*r.BYTES+1;function s(e){return Hc(e,n)}function o(e){return $c(e,n)}const{ProjectivePoint:c,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:u}=Ed({...t,toBytes(e,t,n){const a=t.toAffine(),i=r.toBytes(a.x),s=va;return oa("isCompressed",n),n?s(Uint8Array.from([t.hasEvenY()?2:3]),i):s(Uint8Array.from([4]),i,r.toBytes(a.y))},fromBytes(e){const t=e.length,n=e[0],s=e.subarray(1);if(t!==a||2!==n&&3!==n){if(t===i&&4===n){return{x:r.fromBytes(s.subarray(0,r.BYTES)),y:r.fromBytes(s.subarray(r.BYTES,2*r.BYTES))}}throw new Error("invalid Point, expected length of "+a+", or uncompressed "+i+", got "+t)}{const e=ba(s);if(!Aa(e,yd,r.ORDER))throw new Error("Point is not on curve");const t=f(e);let a;try{a=r.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("Point is not on curve"+t)}return!(1&~n)!==((a&yd)===yd)&&(a=r.neg(a)),{x:e,y:a}}}}),l=e=>da(ya(e,t.nByteLength));function h(e){return e>n>>yd}const p=(e,t,r)=>ba(e.slice(t,r));class b{constructor(e,t,r){this.r=e,this.s=t,this.recovery=r,this.assertValidity()}static fromCompact(e){const r=t.nByteLength;return e=wa("compactSignature",e,2*r),new b(p(e,0,r),p(e,r,2*r))}static fromDER(e){const{r:t,s:r}=bd.toSig(wa("DER",e));return new b(t,r)}assertValidity(){_a("r",this.r,yd,n),_a("s",this.s,yd,n)}addRecoveryBit(e){return new b(this.r,this.s,e)}recoverPublicKey(e){const{r:n,s:a,recovery:i}=this,d=w(wa("msgHash",e));if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");const f=2===i||3===i?n+t.n:n;if(f>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const u=1&i?"03":"02",h=c.fromHex(u+l(f)),p=o(f),b=s(-d*p),g=s(a*p),y=c.BASE.multiplyAndAddUnsafe(h,b,g);if(!y)throw new Error("point at infinify");return y.assertValidity(),y}hasHighS(){return h(this.s)}normalizeS(){return this.hasHighS()?new b(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return pa(this.toDERHex())}toDERHex(){return bd.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return pa(this.toCompactHex())}toCompactHex(){return l(this.r)+l(this.s)}}const g={isValidPrivateKey(e){try{return d(e),!0}catch(e){return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const e=Zc(t.n);return function(e,t,r=!1){const n=e.length,a=Yc(t),i=Zc(t);if(n<16||n<i||n>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+n);const s=Hc(r?ba(e):ga(e),t-Nc)+Nc;return r?ma(s,a):ya(s,a)}(t.randomBytes(e),t.n)},precompute:(e=8,t=c.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function y(e){const t=ia(e),r="string"==typeof e,n=(t||r)&&e.length;return t?n===a||n===i:r?n===2*a||n===2*i:e instanceof c}const m=t.bits2int||function(e){if(e.length>8192)throw new Error("input is too large");const r=ba(e),n=8*e.length-t.nBitLength;return n>0?r>>BigInt(n):r},w=t.bits2int_modN||function(e){return s(m(e))},v=Sa(t.nBitLength);function E(e){return _a("num < 2^"+t.nBitLength,e,gd,v),ya(e,t.nByteLength)}function A(e,n,a=_){if(["recovered","canonical"].some((e=>e in a)))throw new Error("sign() legacy options not supported");const{hash:i,randomBytes:f}=t;let{lowS:l,prehash:p,extraEntropy:g}=a;null==l&&(l=!0),e=wa("msgHash",e),ld(a),p&&(e=wa("prehashed msgHash",i(e)));const y=w(e),v=d(n),A=[E(v),E(y)];if(null!=g&&!1!==g){const e=!0===g?f(r.BYTES):g;A.push(wa("extraEntropy",e))}const x=va(...A),S=y;return{seed:x,k2sig:function(e){const t=m(e);if(!u(t))return;const r=o(t),n=c.BASE.multiply(t).toAffine(),a=s(n.x);if(a===gd)return;const i=s(r*s(S+a*v));if(i===gd)return;let d=(n.x===a?0:2)|Number(n.y&yd),f=i;return l&&h(i)&&(f=function(e){return h(e)?s(-e):e}(i),d^=1),new b(a,f,d)}}}const _={lowS:t.lowS,prehash:!1},x={lowS:t.lowS,prehash:!1};return c.BASE._setWindowSize(8),{CURVE:t,getPublicKey:function(e,t=!0){return c.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(y(e))throw new Error("first arg must be private key");if(!y(t))throw new Error("second arg must be public key");return c.fromHex(t).multiply(d(e)).toRawBytes(r)},sign:function(e,r,n=_){const{seed:a,k2sig:i}=A(e,r,n),s=t;return Ca(s.hash.outputLen,s.nByteLength,s.hmac)(a,i)},verify:function(e,r,n,a=x){const i=e;r=wa("msgHash",r),n=wa("publicKey",n);const{lowS:d,prehash:f,format:u}=a;if(ld(a),"strict"in a)throw new Error("options.strict was renamed to lowS");if(void 0!==u&&"compact"!==u&&"der"!==u)throw new Error("format must be compact or der");const l="string"==typeof i||ia(i),h=!l&&!u&&"object"==typeof i&&null!==i&&"bigint"==typeof i.r&&"bigint"==typeof i.s;if(!l&&!h)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let p,g;try{if(h&&(p=new b(i.r,i.s)),l){try{"compact"!==u&&(p=b.fromDER(i))}catch(e){if(!(e instanceof bd.Err))throw e}p||"der"===u||(p=b.fromCompact(i))}g=c.fromHex(n)}catch(e){return!1}if(!p)return!1;if(d&&p.hasHighS())return!1;f&&(r=t.hash(r));const{r:y,s:m}=p,v=w(r),E=o(m),A=s(v*E),_=s(y*E),S=c.BASE.multiplyAndAddUnsafe(g,A,_)?.toAffine();return!!S&&s(S.x)===y},ProjectivePoint:c,Signature:b,utils:g}}function _d(e,t){const r=e.ORDER;let n=gd;for(let e=r-yd;e%md===gd;e/=md)n+=yd;const a=n,i=md<<a-yd-yd,s=i*md,o=(r-yd)/s,c=(o-yd)/md,d=s-yd,f=i,u=e.pow(t,o),l=e.pow(t,(o+yd)/md);let h=(t,r)=>{let n=u,i=e.pow(r,d),s=e.sqr(i);s=e.mul(s,r);let o=e.mul(t,s);o=e.pow(o,c),o=e.mul(o,i),i=e.mul(o,r),s=e.mul(o,t);let h=e.mul(s,i);o=e.pow(h,f);let p=e.eql(o,e.ONE);i=e.mul(s,l),o=e.mul(h,n),s=e.cmov(i,s,p),h=e.cmov(o,h,p);for(let t=a;t>yd;t--){let r=t-md;r=md<<r-yd;let a=e.pow(h,r);const o=e.eql(a,e.ONE);i=e.mul(s,n),n=e.mul(n,n),a=e.mul(h,n),s=e.cmov(i,s,o),h=e.cmov(a,h,o)}return{isValid:p,value:s}};if(e.ORDER%vd===wd){const r=(e.ORDER-wd)/vd,n=e.sqrt(e.neg(t));h=(t,a)=>{let i=e.sqr(a);const s=e.mul(t,a);i=e.mul(i,s);let o=e.pow(i,r);o=e.mul(o,s);const c=e.mul(o,n),d=e.mul(e.sqr(o),a),f=e.eql(d,t);return{isValid:f,value:e.cmov(c,o,f)}}}return h}function xd(e,t){if(Kc(e),!e.isValid(t.A)||!e.isValid(t.B)||!e.isValid(t.Z))throw new Error("mapToCurveSimpleSWU: invalid opts");const r=_d(e,t.Z);if(!e.isOdd)throw new Error("Fp.isOdd is not implemented!");return n=>{let a,i,s,o,c,d,f,u;a=e.sqr(n),a=e.mul(a,t.Z),i=e.sqr(a),i=e.add(i,a),s=e.add(i,e.ONE),s=e.mul(s,t.B),o=e.cmov(t.Z,e.neg(i),!e.eql(i,e.ZERO)),o=e.mul(o,t.A),i=e.sqr(s),d=e.sqr(o),c=e.mul(d,t.A),i=e.add(i,c),i=e.mul(i,s),d=e.mul(d,o),c=e.mul(d,t.B),i=e.add(i,c),f=e.mul(a,s);const{isValid:l,value:h}=r(i,d);u=e.mul(a,n),u=e.mul(u,h),f=e.cmov(f,s,l),u=e.cmov(u,h,l);const p=e.isOdd(n)===e.isOdd(u);return u=e.cmov(e.neg(u),u,p),f=e.div(f,o),{x:f,y:u}}}function Sd(e){let t=e.length;for(;--t>=0;)e[t]=0}const Id=256,kd=286,Cd=30,Td=15,Bd=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Md=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Od=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Rd=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Nd=new Array(576);Sd(Nd);const Pd=new Array(60);Sd(Pd);const Ld=new Array(512);Sd(Ld);const Fd=new Array(256);Sd(Fd);const Dd=new Array(29);Sd(Dd);const Ud=new Array(Cd);function Hd(e,t,r,n,a){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=a,this.has_stree=e&&e.length}let jd,Vd,$d;function zd(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}Sd(Ud);const qd=e=>e<256?Ld[e]:Ld[256+(e>>>7)],Kd=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Gd=(e,t,r)=>{e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,Kd(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},Jd=(e,t,r)=>{Gd(e,r[2*t],r[2*t+1])},Wd=(e,t)=>{let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1},Yd=(e,t,r)=>{const n=new Array(16);let a,i,s=0;for(a=1;a<=Td;a++)s=s+r[a-1]<<1,n[a]=s;for(i=0;i<=t;i++){let t=e[2*i+1];0!==t&&(e[2*i]=Wd(n[t]++,t))}},Zd=e=>{let t;for(t=0;t<kd;t++)e.dyn_ltree[2*t]=0;for(t=0;t<Cd;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Xd=e=>{e.bi_valid>8?Kd(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Qd=(e,t,r,n)=>{const a=2*t,i=2*r;return e[a]<e[i]||e[a]===e[i]&&n[t]<=n[r]},ef=(e,t,r)=>{const n=e.heap[r];let a=r<<1;for(;a<=e.heap_len&&(a<e.heap_len&&Qd(t,e.heap[a+1],e.heap[a],e.depth)&&a++,!Qd(t,n,e.heap[a],e.depth));)e.heap[r]=e.heap[a],r=a,a<<=1;e.heap[r]=n},tf=(e,t,r)=>{let n,a,i,s,o=0;if(0!==e.sym_next)do{n=255&e.pending_buf[e.sym_buf+o++],n+=(255&e.pending_buf[e.sym_buf+o++])<<8,a=e.pending_buf[e.sym_buf+o++],0===n?Jd(e,a,t):(i=Fd[a],Jd(e,i+Id+1,t),s=Bd[i],0!==s&&(a-=Dd[i],Gd(e,a,s)),n--,i=qd(n),Jd(e,i,r),s=Md[i],0!==s&&(n-=Ud[i],Gd(e,n,s)))}while(o<e.sym_next);Jd(e,256,t)},rf=(e,t)=>{const r=t.dyn_tree,n=t.stat_desc.static_tree,a=t.stat_desc.has_stree,i=t.stat_desc.elems;let s,o,c,d=-1;for(e.heap_len=0,e.heap_max=573,s=0;s<i;s++)0!==r[2*s]?(e.heap[++e.heap_len]=d=s,e.depth[s]=0):r[2*s+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=d<2?++d:0,r[2*c]=1,e.depth[c]=0,e.opt_len--,a&&(e.static_len-=n[2*c+1]);for(t.max_code=d,s=e.heap_len>>1;s>=1;s--)ef(e,r,s);c=i;do{s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ef(e,r,1),o=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=o,r[2*c]=r[2*s]+r[2*o],e.depth[c]=(e.depth[s]>=e.depth[o]?e.depth[s]:e.depth[o])+1,r[2*s+1]=r[2*o+1]=c,e.heap[1]=c++,ef(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const r=t.dyn_tree,n=t.max_code,a=t.stat_desc.static_tree,i=t.stat_desc.has_stree,s=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,c=t.stat_desc.max_length;let d,f,u,l,h,p,b=0;for(l=0;l<=Td;l++)e.bl_count[l]=0;for(r[2*e.heap[e.heap_max]+1]=0,d=e.heap_max+1;d<573;d++)f=e.heap[d],l=r[2*r[2*f+1]+1]+1,l>c&&(l=c,b++),r[2*f+1]=l,f>n||(e.bl_count[l]++,h=0,f>=o&&(h=s[f-o]),p=r[2*f],e.opt_len+=p*(l+h),i&&(e.static_len+=p*(a[2*f+1]+h)));if(0!==b){do{for(l=c-1;0===e.bl_count[l];)l--;e.bl_count[l]--,e.bl_count[l+1]+=2,e.bl_count[c]--,b-=2}while(b>0);for(l=c;0!==l;l--)for(f=e.bl_count[l];0!==f;)u=e.heap[--d],u>n||(r[2*u+1]!==l&&(e.opt_len+=(l-r[2*u+1])*r[2*u],r[2*u+1]=l),f--)}})(e,t),Yd(r,d,e.bl_count)},nf=(e,t,r)=>{let n,a,i=-1,s=t[1],o=0,c=7,d=4;for(0===s&&(c=138,d=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)a=s,s=t[2*(n+1)+1],++o<c&&a===s||(o<d?e.bl_tree[2*a]+=o:0!==a?(a!==i&&e.bl_tree[2*a]++,e.bl_tree[32]++):o<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=0,i=a,0===s?(c=138,d=3):a===s?(c=6,d=3):(c=7,d=4))},af=(e,t,r)=>{let n,a,i=-1,s=t[1],o=0,c=7,d=4;for(0===s&&(c=138,d=3),n=0;n<=r;n++)if(a=s,s=t[2*(n+1)+1],!(++o<c&&a===s)){if(o<d)do{Jd(e,a,e.bl_tree)}while(0!=--o);else 0!==a?(a!==i&&(Jd(e,a,e.bl_tree),o--),Jd(e,16,e.bl_tree),Gd(e,o-3,2)):o<=10?(Jd(e,17,e.bl_tree),Gd(e,o-3,3)):(Jd(e,18,e.bl_tree),Gd(e,o-11,7));o=0,i=a,0===s?(c=138,d=3):a===s?(c=6,d=3):(c=7,d=4)}};let sf=!1;const of=(e,t,r,n)=>{Gd(e,0+(n?1:0),3),Xd(e),Kd(e,r),Kd(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r};var cf=e=>{sf||((()=>{let e,t,r,n,a;const i=new Array(16);for(r=0,n=0;n<28;n++)for(Dd[n]=r,e=0;e<1<<Bd[n];e++)Fd[r++]=n;for(Fd[r-1]=n,a=0,n=0;n<16;n++)for(Ud[n]=a,e=0;e<1<<Md[n];e++)Ld[a++]=n;for(a>>=7;n<Cd;n++)for(Ud[n]=a<<7,e=0;e<1<<Md[n]-7;e++)Ld[256+a++]=n;for(t=0;t<=Td;t++)i[t]=0;for(e=0;e<=143;)Nd[2*e+1]=8,e++,i[8]++;for(;e<=255;)Nd[2*e+1]=9,e++,i[9]++;for(;e<=279;)Nd[2*e+1]=7,e++,i[7]++;for(;e<=287;)Nd[2*e+1]=8,e++,i[8]++;for(Yd(Nd,287,i),e=0;e<Cd;e++)Pd[2*e+1]=5,Pd[2*e]=Wd(e,5);jd=new Hd(Nd,Bd,257,kd,Td),Vd=new Hd(Pd,Md,0,Cd,Td),$d=new Hd(new Array(0),Od,0,19,7)})(),sf=!0),e.l_desc=new zd(e.dyn_ltree,jd),e.d_desc=new zd(e.dyn_dtree,Vd),e.bl_desc=new zd(e.bl_tree,$d),e.bi_buf=0,e.bi_valid=0,Zd(e)},df=(e,t,r,n)=>{let a,i,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<Id;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),rf(e,e.l_desc),rf(e,e.d_desc),s=(e=>{let t;for(nf(e,e.dyn_ltree,e.l_desc.max_code),nf(e,e.dyn_dtree,e.d_desc.max_code),rf(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*Rd[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),a=e.opt_len+3+7>>>3,i=e.static_len+3+7>>>3,i<=a&&(a=i)):a=i=r+5,r+4<=a&&-1!==t?of(e,t,r,n):4===e.strategy||i===a?(Gd(e,2+(n?1:0),3),tf(e,Nd,Pd)):(Gd(e,4+(n?1:0),3),((e,t,r,n)=>{let a;for(Gd(e,t-257,5),Gd(e,r-1,5),Gd(e,n-4,4),a=0;a<n;a++)Gd(e,e.bl_tree[2*Rd[a]+1],3);af(e,e.dyn_ltree,t-1),af(e,e.dyn_dtree,r-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),tf(e,e.dyn_ltree,e.dyn_dtree)),Zd(e),n&&Xd(e)},ff=(e,t,r)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=r,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(Fd[r]+Id+1)]++,e.dyn_dtree[2*qd(t)]++),e.sym_next===e.sym_end),uf={_tr_init:cf,_tr_stored_block:of,_tr_flush_block:df,_tr_tally:ff,_tr_align:e=>{Gd(e,2,3),Jd(e,256,Nd),(e=>{16===e.bi_valid?(Kd(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var lf=(e,t,r,n)=>{let a=65535&e,i=e>>>16&65535,s=0;for(;0!==r;){s=r>2e3?2e3:r,r-=s;do{a=a+t[n++]|0,i=i+a|0}while(--s);a%=65521,i%=65521}return a|i<<16};const hf=new Uint32Array((()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t})());var pf=(e,t,r,n)=>{const a=hf,i=n+r;e^=-1;for(let r=n;r<i;r++)e=e>>>8^a[255&(e^t[r])];return~e},bf={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},gf={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:yf,_tr_stored_block:mf,_tr_flush_block:wf,_tr_tally:vf,_tr_align:Ef}=uf,{Z_NO_FLUSH:Af,Z_PARTIAL_FLUSH:_f,Z_FULL_FLUSH:xf,Z_FINISH:Sf,Z_BLOCK:If,Z_OK:kf,Z_STREAM_END:Cf,Z_STREAM_ERROR:Tf,Z_DATA_ERROR:Bf,Z_BUF_ERROR:Mf,Z_DEFAULT_COMPRESSION:Of,Z_FILTERED:Rf,Z_HUFFMAN_ONLY:Nf,Z_RLE:Pf,Z_FIXED:Lf,Z_DEFAULT_STRATEGY:Ff,Z_UNKNOWN:Df,Z_DEFLATED:Uf}=gf,Hf=258,jf=262,Vf=42,$f=113,zf=666,qf=(e,t)=>(e.msg=bf[t],t),Kf=e=>2*e-(e>4?9:0),Gf=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Jf=e=>{let t,r,n,a=e.w_size;t=e.hash_size,n=t;do{r=e.head[--n],e.head[n]=r>=a?r-a:0}while(--t);t=a,n=t;do{r=e.prev[--n],e.prev[n]=r>=a?r-a:0}while(--t)};let Wf=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask;const Yf=e=>{const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))},Zf=(e,t)=>{wf(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Yf(e.strm)},Xf=(e,t)=>{e.pending_buf[e.pending++]=t},Qf=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},eu=(e,t,r,n)=>{let a=e.avail_in;return a>n&&(a=n),0===a?0:(e.avail_in-=a,t.set(e.input.subarray(e.next_in,e.next_in+a),r),1===e.state.wrap?e.adler=lf(e.adler,t,a,r):2===e.state.wrap&&(e.adler=pf(e.adler,t,a,r)),e.next_in+=a,e.total_in+=a,a)},tu=(e,t)=>{let r,n,a=e.max_chain_length,i=e.strstart,s=e.prev_length,o=e.nice_match;const c=e.strstart>e.w_size-jf?e.strstart-(e.w_size-jf):0,d=e.window,f=e.w_mask,u=e.prev,l=e.strstart+Hf;let h=d[i+s-1],p=d[i+s];e.prev_length>=e.good_match&&(a>>=2),o>e.lookahead&&(o=e.lookahead);do{if(r=t,d[r+s]===p&&d[r+s-1]===h&&d[r]===d[i]&&d[++r]===d[i+1]){i+=2,r++;do{}while(d[++i]===d[++r]&&d[++i]===d[++r]&&d[++i]===d[++r]&&d[++i]===d[++r]&&d[++i]===d[++r]&&d[++i]===d[++r]&&d[++i]===d[++r]&&d[++i]===d[++r]&&i<l);if(n=Hf-(l-i),i=l-Hf,n>s){if(e.match_start=t,s=n,n>=o)break;h=d[i+s-1],p=d[i+s]}}}while((t=u[t&f])>c&&0!=--a);return s<=e.lookahead?s:e.lookahead},ru=e=>{const t=e.w_size;let r,n,a;do{if(n=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-jf)&&(e.window.set(e.window.subarray(t,t+t-n),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Jf(e),n+=t),0===e.strm.avail_in)break;if(r=eu(e.strm,e.window,e.strstart+e.lookahead,n),e.lookahead+=r,e.lookahead+e.insert>=3)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=Wf(e,e.ins_h,e.window[a+1]);e.insert&&(e.ins_h=Wf(e,e.ins_h,e.window[a+3-1]),e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<jf&&0!==e.strm.avail_in)},nu=(e,t)=>{let r,n,a,i=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,o=e.strm.avail_in;do{if(r=65535,a=e.bi_valid+42>>3,e.strm.avail_out<a)break;if(a=e.strm.avail_out-a,n=e.strstart-e.block_start,r>n+e.strm.avail_in&&(r=n+e.strm.avail_in),r>a&&(r=a),r<i&&(0===r&&t!==Sf||t===Af||r!==n+e.strm.avail_in))break;s=t===Sf&&r===n+e.strm.avail_in?1:0,mf(e,0,0,s),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,Yf(e.strm),n&&(n>r&&(n=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+n),e.strm.next_out),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n,e.block_start+=n,r-=n),r&&(eu(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(0===s);return o-=e.strm.avail_in,o&&(o>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=o&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-o,e.strm.next_in),e.strstart),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?4:t!==Af&&t!==Sf&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(a=e.window_size-e.strstart,e.strm.avail_in>a&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,a+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),a>e.strm.avail_in&&(a=e.strm.avail_in),a&&(eu(e.strm,e.window,e.strstart,a),e.strstart+=a,e.insert+=a>e.w_size-e.insert?e.w_size-e.insert:a),e.high_water<e.strstart&&(e.high_water=e.strstart),a=e.bi_valid+42>>3,a=e.pending_buf_size-a>65535?65535:e.pending_buf_size-a,i=a>e.w_size?e.w_size:a,n=e.strstart-e.block_start,(n>=i||(n||t===Sf)&&t!==Af&&0===e.strm.avail_in&&n<=a)&&(r=n>a?a:n,s=t===Sf&&0===e.strm.avail_in&&r===n?1:0,mf(e,e.block_start,r,s),e.block_start+=r,Yf(e.strm)),s?3:1)},au=(e,t)=>{let r,n;for(;;){if(e.lookahead<jf){if(ru(e),e.lookahead<jf&&t===Af)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=Wf(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-jf&&(e.match_length=tu(e,r)),e.match_length>=3)if(n=vf(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=Wf(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Wf(e,e.ins_h,e.window[e.strstart+1]);else n=vf(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(Zf(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===Sf?(Zf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Zf(e,!1),0===e.strm.avail_out)?1:2},iu=(e,t)=>{let r,n,a;for(;;){if(e.lookahead<jf){if(ru(e),e.lookahead<jf&&t===Af)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=Wf(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-jf&&(e.match_length=tu(e,r),e.match_length<=5&&(e.strategy===Rf||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-3,n=vf(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=a&&(e.ins_h=Wf(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(Zf(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(n=vf(e,0,e.window[e.strstart-1]),n&&Zf(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=vf(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===Sf?(Zf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Zf(e,!1),0===e.strm.avail_out)?1:2};function su(e,t,r,n,a){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=a}const ou=[new su(0,0,0,0,nu),new su(4,4,8,4,au),new su(4,5,16,8,au),new su(4,6,32,32,au),new su(4,4,16,16,iu),new su(8,16,32,32,iu),new su(8,16,128,128,iu),new su(8,32,128,256,iu),new su(32,128,258,1024,iu),new su(32,258,258,4096,iu)];function cu(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Uf,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Gf(this.dyn_ltree),Gf(this.dyn_dtree),Gf(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Gf(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Gf(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const du=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Vf&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==$f&&t.status!==zf?1:0},fu=e=>{if(du(e))return qf(e,Tf);e.total_in=e.total_out=0,e.data_type=Df;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?Vf:$f,e.adler=2===t.wrap?0:1,t.last_flush=-2,yf(t),kf},uu=e=>{const t=fu(e);var r;return t===kf&&((r=e.state).window_size=2*r.w_size,Gf(r.head),r.max_lazy_match=ou[r.level].max_lazy,r.good_match=ou[r.level].good_length,r.nice_match=ou[r.level].nice_length,r.max_chain_length=ou[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),t},lu=(e,t,r,n,a,i)=>{if(!e)return Tf;let s=1;if(t===Of&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),a<1||a>9||r!==Uf||n<8||n>15||t<0||t>9||i<0||i>Lf||8===n&&1!==s)return qf(e,Tf);8===n&&(n=9);const o=new cu;return e.state=o,o.strm=e,o.status=Vf,o.wrap=s,o.gzhead=null,o.w_bits=n,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=a+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<a+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=3*(o.lit_bufsize-1),o.level=t,o.strategy=i,o.method=r,uu(e)};var hu=(e,t)=>{let r=t.length;if(du(e))return Tf;const n=e.state,a=n.wrap;if(2===a||1===a&&n.status!==Vf||n.lookahead)return Tf;if(1===a&&(e.adler=lf(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){0===a&&(Gf(n.head),n.strstart=0,n.block_start=0,n.insert=0);let e=new Uint8Array(n.w_size);e.set(t.subarray(r-n.w_size,r),0),t=e,r=n.w_size}const i=e.avail_in,s=e.next_in,o=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,ru(n);n.lookahead>=3;){let e=n.strstart,t=n.lookahead-2;do{n.ins_h=Wf(n,n.ins_h,n.window[e+3-1]),n.prev[e&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=e,e++}while(--t);n.strstart=e,n.lookahead=2,ru(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=s,e.input=o,e.avail_in=i,n.wrap=a,kf},pu={deflateInit:(e,t)=>lu(e,t,Uf,15,8,Ff),deflateInit2:lu,deflateReset:uu,deflateResetKeep:fu,deflateSetHeader:(e,t)=>du(e)||2!==e.state.wrap?Tf:(e.state.gzhead=t,kf),deflate:(e,t)=>{if(du(e)||t>If||t<0)return e?qf(e,Tf):Tf;const r=e.state;if(!e.output||0!==e.avail_in&&!e.input||r.status===zf&&t!==Sf)return qf(e,0===e.avail_out?Mf:Tf);const n=r.last_flush;if(r.last_flush=t,0!==r.pending){if(Yf(e),0===e.avail_out)return r.last_flush=-1,kf}else if(0===e.avail_in&&Kf(t)<=Kf(n)&&t!==Sf)return qf(e,Mf);if(r.status===zf&&0!==e.avail_in)return qf(e,Mf);if(r.status===Vf&&0===r.wrap&&(r.status=$f),r.status===Vf){let t=Uf+(r.w_bits-8<<4)<<8,n=-1;if(n=r.strategy>=Nf||r.level<2?0:r.level<6?1:6===r.level?2:3,t|=n<<6,0!==r.strstart&&(t|=32),t+=31-t%31,Qf(r,t),0!==r.strstart&&(Qf(r,e.adler>>>16),Qf(r,65535&e.adler)),e.adler=1,r.status=$f,Yf(e),0!==r.pending)return r.last_flush=-1,kf}if(57===r.status)if(e.adler=0,Xf(r,31),Xf(r,139),Xf(r,8),r.gzhead)Xf(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Xf(r,255&r.gzhead.time),Xf(r,r.gzhead.time>>8&255),Xf(r,r.gzhead.time>>16&255),Xf(r,r.gzhead.time>>24&255),Xf(r,9===r.level?2:r.strategy>=Nf||r.level<2?4:0),Xf(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Xf(r,255&r.gzhead.extra.length),Xf(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=pf(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(Xf(r,0),Xf(r,0),Xf(r,0),Xf(r,0),Xf(r,0),Xf(r,9===r.level?2:r.strategy>=Nf||r.level<2?4:0),Xf(r,3),r.status=$f,Yf(e),0!==r.pending)return r.last_flush=-1,kf;if(69===r.status){if(r.gzhead.extra){let t=r.pending,n=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+n>r.pending_buf_size;){let a=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>t&&(e.adler=pf(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex+=a,Yf(e),0!==r.pending)return r.last_flush=-1,kf;t=0,n-=a}let a=new Uint8Array(r.gzhead.extra);r.pending_buf.set(a.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending+=n,r.gzhead.hcrc&&r.pending>t&&(e.adler=pf(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){let t,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(e.adler=pf(e.adler,r.pending_buf,r.pending-n,n)),Yf(e),0!==r.pending)return r.last_flush=-1,kf;n=0}t=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Xf(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=pf(e.adler,r.pending_buf,r.pending-n,n)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let t,n=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>n&&(e.adler=pf(e.adler,r.pending_buf,r.pending-n,n)),Yf(e),0!==r.pending)return r.last_flush=-1,kf;n=0}t=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Xf(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>n&&(e.adler=pf(e.adler,r.pending_buf,r.pending-n,n))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(Yf(e),0!==r.pending))return r.last_flush=-1,kf;Xf(r,255&e.adler),Xf(r,e.adler>>8&255),e.adler=0}if(r.status=$f,Yf(e),0!==r.pending)return r.last_flush=-1,kf}if(0!==e.avail_in||0!==r.lookahead||t!==Af&&r.status!==zf){let n=0===r.level?nu(r,t):r.strategy===Nf?((e,t)=>{let r;for(;;){if(0===e.lookahead&&(ru(e),0===e.lookahead)){if(t===Af)return 1;break}if(e.match_length=0,r=vf(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(Zf(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Sf?(Zf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Zf(e,!1),0===e.strm.avail_out)?1:2})(r,t):r.strategy===Pf?((e,t)=>{let r,n,a,i;const s=e.window;for(;;){if(e.lookahead<=Hf){if(ru(e),e.lookahead<=Hf&&t===Af)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(a=e.strstart-1,n=s[a],n===s[++a]&&n===s[++a]&&n===s[++a])){i=e.strstart+Hf;do{}while(n===s[++a]&&n===s[++a]&&n===s[++a]&&n===s[++a]&&n===s[++a]&&n===s[++a]&&n===s[++a]&&n===s[++a]&&a<i);e.match_length=Hf-(i-a),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=vf(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=vf(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(Zf(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Sf?(Zf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Zf(e,!1),0===e.strm.avail_out)?1:2})(r,t):ou[r.level].func(r,t);if(3!==n&&4!==n||(r.status=zf),1===n||3===n)return 0===e.avail_out&&(r.last_flush=-1),kf;if(2===n&&(t===_f?Ef(r):t!==If&&(mf(r,0,0,!1),t===xf&&(Gf(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Yf(e),0===e.avail_out))return r.last_flush=-1,kf}return t!==Sf?kf:r.wrap<=0?Cf:(2===r.wrap?(Xf(r,255&e.adler),Xf(r,e.adler>>8&255),Xf(r,e.adler>>16&255),Xf(r,e.adler>>24&255),Xf(r,255&e.total_in),Xf(r,e.total_in>>8&255),Xf(r,e.total_in>>16&255),Xf(r,e.total_in>>24&255)):(Qf(r,e.adler>>>16),Qf(r,65535&e.adler)),Yf(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?kf:Cf)},deflateEnd:e=>{if(du(e))return Tf;const t=e.state.status;return e.state=null,t===$f?qf(e,Bf):kf},deflateSetDictionary:hu,deflateInfo:"pako deflate (from Nodeca project)"};const bu=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var gu={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const t in r)bu(r,t)&&(e[t]=r[t])}}return e},flattenChunks:e=>{let t=0;for(let r=0,n=e.length;r<n;r++)t+=e[r].length;const r=new Uint8Array(t);for(let t=0,n=0,a=e.length;t<a;t++){let a=e[t];r.set(a,n),n+=a.length}return r}};let yu=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){yu=!1}const mu=new Uint8Array(256);for(let e=0;e<256;e++)mu[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;mu[254]=mu[254]=1;var wu={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,n,a,i,s=e.length,o=0;for(a=0;a<s;a++)r=e.charCodeAt(a),55296==(64512&r)&&a+1<s&&(n=e.charCodeAt(a+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),a++)),o+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(o),i=0,a=0;i<o;a++)r=e.charCodeAt(a),55296==(64512&r)&&a+1<s&&(n=e.charCodeAt(a+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),a++)),r<128?t[i++]=r:r<2048?(t[i++]=192|r>>>6,t[i++]=128|63&r):r<65536?(t[i++]=224|r>>>12,t[i++]=128|r>>>6&63,t[i++]=128|63&r):(t[i++]=240|r>>>18,t[i++]=128|r>>>12&63,t[i++]=128|r>>>6&63,t[i++]=128|63&r);return t},buf2string:(e,t)=>{const r=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let n,a;const i=new Array(2*r);for(a=0,n=0;n<r;){let t=e[n++];if(t<128){i[a++]=t;continue}let s=mu[t];if(s>4)i[a++]=65533,n+=s-1;else{for(t&=2===s?31:3===s?15:7;s>1&&n<r;)t=t<<6|63&e[n++],s--;s>1?i[a++]=65533:t<65536?i[a++]=t:(t-=65536,i[a++]=55296|t>>10&1023,i[a++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&yu)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r})(i,a)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let r=t-1;for(;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+mu[e[r]]>t?r:t}};var vu=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Eu=Object.prototype.toString,{Z_NO_FLUSH:Au,Z_SYNC_FLUSH:_u,Z_FULL_FLUSH:xu,Z_FINISH:Su,Z_OK:Iu,Z_STREAM_END:ku,Z_DEFAULT_COMPRESSION:Cu,Z_DEFAULT_STRATEGY:Tu,Z_DEFLATED:Bu}=gf;function Mu(e){this.options=gu.assign({level:Cu,method:Bu,chunkSize:16384,windowBits:15,memLevel:8,strategy:Tu},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new vu,this.strm.avail_out=0;let r=pu.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Iu)throw new Error(bf[r]);if(t.header&&pu.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?wu.string2buf(t.dictionary):"[object ArrayBuffer]"===Eu.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,r=pu.deflateSetDictionary(this.strm,e),r!==Iu)throw new Error(bf[r]);this._dict_set=!0}}function Ou(e,t){const r=new Mu(t);if(r.push(e,!0),r.err)throw r.msg||bf[r.err];return r.result}Mu.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize;let a,i;if(this.ended)return!1;for(i=t===~~t?t:!0===t?Su:Au,"string"==typeof e?r.input=wu.string2buf(e):"[object ArrayBuffer]"===Eu.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(i===_u||i===xu)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(a=pu.deflate(r,i),a===ku)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=pu.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Iu;if(0!==r.avail_out){if(i>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},Mu.prototype.onData=function(e){this.chunks.push(e)},Mu.prototype.onEnd=function(e){e===Iu&&(this.result=gu.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Ru=function(e,t){return(t=t||{}).raw=!0,Ou(e,t)},Nu=function(e,t){return(t=t||{}).gzip=!0,Ou(e,t)},Pu={Deflate:Mu,deflate:Ou,deflateRaw:Ru,gzip:Nu,constants:gf};const Lu=16209;var Fu=function(e,t){let r,n,a,i,s,o,c,d,f,u,l,h,p,b,g,y,m,w,v,E,A,_,x,S;const I=e.state;r=e.next_in,x=e.input,n=r+(e.avail_in-5),a=e.next_out,S=e.output,i=a-(t-e.avail_out),s=a+(e.avail_out-257),o=I.dmax,c=I.wsize,d=I.whave,f=I.wnext,u=I.window,l=I.hold,h=I.bits,p=I.lencode,b=I.distcode,g=(1<<I.lenbits)-1,y=(1<<I.distbits)-1;e:do{h<15&&(l+=x[r++]<<h,h+=8,l+=x[r++]<<h,h+=8),m=p[l&g];t:for(;;){if(w=m>>>24,l>>>=w,h-=w,w=m>>>16&255,0===w)S[a++]=65535&m;else{if(!(16&w)){if(64&w){if(32&w){I.mode=16191;break e}e.msg="invalid literal/length code",I.mode=Lu;break e}m=p[(65535&m)+(l&(1<<w)-1)];continue t}for(v=65535&m,w&=15,w&&(h<w&&(l+=x[r++]<<h,h+=8),v+=l&(1<<w)-1,l>>>=w,h-=w),h<15&&(l+=x[r++]<<h,h+=8,l+=x[r++]<<h,h+=8),m=b[l&y];;){if(w=m>>>24,l>>>=w,h-=w,w=m>>>16&255,16&w){if(E=65535&m,w&=15,h<w&&(l+=x[r++]<<h,h+=8,h<w&&(l+=x[r++]<<h,h+=8)),E+=l&(1<<w)-1,E>o){e.msg="invalid distance too far back",I.mode=Lu;break e}if(l>>>=w,h-=w,w=a-i,E>w){if(w=E-w,w>d&&I.sane){e.msg="invalid distance too far back",I.mode=Lu;break e}if(A=0,_=u,0===f){if(A+=c-w,w<v){v-=w;do{S[a++]=u[A++]}while(--w);A=a-E,_=S}}else if(f<w){if(A+=c+f-w,w-=f,w<v){v-=w;do{S[a++]=u[A++]}while(--w);if(A=0,f<v){w=f,v-=w;do{S[a++]=u[A++]}while(--w);A=a-E,_=S}}}else if(A+=f-w,w<v){v-=w;do{S[a++]=u[A++]}while(--w);A=a-E,_=S}for(;v>2;)S[a++]=_[A++],S[a++]=_[A++],S[a++]=_[A++],v-=3;v&&(S[a++]=_[A++],v>1&&(S[a++]=_[A++]))}else{A=a-E;do{S[a++]=S[A++],S[a++]=S[A++],S[a++]=S[A++],v-=3}while(v>2);v&&(S[a++]=S[A++],v>1&&(S[a++]=S[A++]))}break}if(64&w){e.msg="invalid distance code",I.mode=Lu;break e}m=b[(65535&m)+(l&(1<<w)-1)]}}break}}while(r<n&&a<s);v=h>>3,r-=v,h-=v<<3,l&=(1<<h)-1,e.next_in=r,e.next_out=a,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=a<s?s-a+257:257-(a-s),I.hold=l,I.bits=h};const Du=15,Uu=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Hu=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),ju=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Vu=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var $u=(e,t,r,n,a,i,s,o)=>{const c=o.bits;let d,f,u,l,h,p,b=0,g=0,y=0,m=0,w=0,v=0,E=0,A=0,_=0,x=0,S=null;const I=new Uint16Array(16),k=new Uint16Array(16);let C,T,B,M=null;for(b=0;b<=Du;b++)I[b]=0;for(g=0;g<n;g++)I[t[r+g]]++;for(w=c,m=Du;m>=1&&0===I[m];m--);if(w>m&&(w=m),0===m)return a[i++]=20971520,a[i++]=20971520,o.bits=1,0;for(y=1;y<m&&0===I[y];y++);for(w<y&&(w=y),A=1,b=1;b<=Du;b++)if(A<<=1,A-=I[b],A<0)return-1;if(A>0&&(0===e||1!==m))return-1;for(k[1]=0,b=1;b<Du;b++)k[b+1]=k[b]+I[b];for(g=0;g<n;g++)0!==t[r+g]&&(s[k[t[r+g]]++]=g);if(0===e?(S=M=s,p=20):1===e?(S=Uu,M=Hu,p=257):(S=ju,M=Vu,p=0),x=0,g=0,b=y,h=i,v=w,E=0,u=-1,_=1<<w,l=_-1,1===e&&_>852||2===e&&_>592)return 1;for(;;){C=b-E,s[g]+1<p?(T=0,B=s[g]):s[g]>=p?(T=M[s[g]-p],B=S[s[g]-p]):(T=96,B=0),d=1<<b-E,f=1<<v,y=f;do{f-=d,a[h+(x>>E)+f]=C<<24|T<<16|B}while(0!==f);for(d=1<<b-1;x&d;)d>>=1;if(0!==d?(x&=d-1,x+=d):x=0,g++,0==--I[b]){if(b===m)break;b=t[r+s[g]]}if(b>w&&(x&l)!==u){for(0===E&&(E=w),h+=y,v=b-E,A=1<<v;v+E<m&&(A-=I[v+E],!(A<=0));)v++,A<<=1;if(_+=1<<v,1===e&&_>852||2===e&&_>592)return 1;u=x&l,a[u]=w<<24|v<<16|h-i}}return 0!==x&&(a[h+x]=b-E<<24|64<<16),o.bits=w,0};const{Z_FINISH:zu,Z_BLOCK:qu,Z_TREES:Ku,Z_OK:Gu,Z_STREAM_END:Ju,Z_NEED_DICT:Wu,Z_STREAM_ERROR:Yu,Z_DATA_ERROR:Zu,Z_MEM_ERROR:Xu,Z_BUF_ERROR:Qu,Z_DEFLATED:el}=gf,tl=16180,rl=16190,nl=16191,al=16192,il=16194,sl=16199,ol=16200,cl=16206,dl=16209,fl=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function ul(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const ll=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<tl||t.mode>16211?1:0},hl=e=>{if(ll(e))return Yu;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=tl,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Gu},pl=e=>{if(ll(e))return Yu;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,hl(e)},bl=(e,t)=>{let r;if(ll(e))return Yu;const n=e.state;return t<0?(r=0,t=-t):(r=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Yu:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,pl(e))},gl=(e,t)=>{if(!e)return Yu;const r=new ul;e.state=r,r.strm=e,r.window=null,r.mode=tl;const n=bl(e,t);return n!==Gu&&(e.state=null),n};let yl,ml,wl=!0;const vl=e=>{if(wl){yl=new Int32Array(512),ml=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for($u(1,e.lens,0,288,yl,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;$u(2,e.lens,0,32,ml,0,e.work,{bits:5}),wl=!1}e.lencode=yl,e.lenbits=9,e.distcode=ml,e.distbits=5},El=(e,t,r,n)=>{let a;const i=e.state;return null===i.window&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),n>=i.wsize?(i.window.set(t.subarray(r-i.wsize,r),0),i.wnext=0,i.whave=i.wsize):(a=i.wsize-i.wnext,a>n&&(a=n),i.window.set(t.subarray(r-n,r-n+a),i.wnext),(n-=a)?(i.window.set(t.subarray(r-n,r),0),i.wnext=n,i.whave=i.wsize):(i.wnext+=a,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=a))),0};var Al=(e,t)=>{let r,n,a,i,s,o,c,d,f,u,l,h,p,b,g,y,m,w,v,E,A,_,x=0;const S=new Uint8Array(4);let I,k;const C=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(ll(e)||!e.output||!e.input&&0!==e.avail_in)return Yu;r=e.state,r.mode===nl&&(r.mode=al),s=e.next_out,a=e.output,c=e.avail_out,i=e.next_in,n=e.input,o=e.avail_in,d=r.hold,f=r.bits,u=o,l=c,_=Gu;e:for(;;)switch(r.mode){case tl:if(0===r.wrap){r.mode=al;break}for(;f<16;){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}if(2&r.wrap&&35615===d){0===r.wbits&&(r.wbits=15),r.check=0,S[0]=255&d,S[1]=d>>>8&255,r.check=pf(r.check,S,2,0),d=0,f=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&d)<<8)+(d>>8))%31){e.msg="incorrect header check",r.mode=dl;break}if((15&d)!==el){e.msg="unknown compression method",r.mode=dl;break}if(d>>>=4,f-=4,A=8+(15&d),0===r.wbits&&(r.wbits=A),A>15||A>r.wbits){e.msg="invalid window size",r.mode=dl;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=512&d?16189:nl,d=0,f=0;break;case 16181:for(;f<16;){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}if(r.flags=d,(255&r.flags)!==el){e.msg="unknown compression method",r.mode=dl;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=dl;break}r.head&&(r.head.text=d>>8&1),512&r.flags&&4&r.wrap&&(S[0]=255&d,S[1]=d>>>8&255,r.check=pf(r.check,S,2,0)),d=0,f=0,r.mode=16182;case 16182:for(;f<32;){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}r.head&&(r.head.time=d),512&r.flags&&4&r.wrap&&(S[0]=255&d,S[1]=d>>>8&255,S[2]=d>>>16&255,S[3]=d>>>24&255,r.check=pf(r.check,S,4,0)),d=0,f=0,r.mode=16183;case 16183:for(;f<16;){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}r.head&&(r.head.xflags=255&d,r.head.os=d>>8),512&r.flags&&4&r.wrap&&(S[0]=255&d,S[1]=d>>>8&255,r.check=pf(r.check,S,2,0)),d=0,f=0,r.mode=16184;case 16184:if(1024&r.flags){for(;f<16;){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}r.length=d,r.head&&(r.head.extra_len=d),512&r.flags&&4&r.wrap&&(S[0]=255&d,S[1]=d>>>8&255,r.check=pf(r.check,S,2,0)),d=0,f=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(h=r.length,h>o&&(h=o),h&&(r.head&&(A=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(i,i+h),A)),512&r.flags&&4&r.wrap&&(r.check=pf(r.check,n,h,i)),o-=h,i+=h,r.length-=h),r.length))break e;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===o)break e;h=0;do{A=n[i+h++],r.head&&A&&r.length<65536&&(r.head.name+=String.fromCharCode(A))}while(A&&h<o);if(512&r.flags&&4&r.wrap&&(r.check=pf(r.check,n,h,i)),o-=h,i+=h,A)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===o)break e;h=0;do{A=n[i+h++],r.head&&A&&r.length<65536&&(r.head.comment+=String.fromCharCode(A))}while(A&&h<o);if(512&r.flags&&4&r.wrap&&(r.check=pf(r.check,n,h,i)),o-=h,i+=h,A)break e}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;f<16;){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}if(4&r.wrap&&d!==(65535&r.check)){e.msg="header crc mismatch",r.mode=dl;break}d=0,f=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=nl;break;case 16189:for(;f<32;){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}e.adler=r.check=fl(d),d=0,f=0,r.mode=rl;case rl:if(0===r.havedict)return e.next_out=s,e.avail_out=c,e.next_in=i,e.avail_in=o,r.hold=d,r.bits=f,Wu;e.adler=r.check=1,r.mode=nl;case nl:if(t===qu||t===Ku)break e;case al:if(r.last){d>>>=7&f,f-=7&f,r.mode=cl;break}for(;f<3;){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}switch(r.last=1&d,d>>>=1,f-=1,3&d){case 0:r.mode=16193;break;case 1:if(vl(r),r.mode=sl,t===Ku){d>>>=2,f-=2;break e}break;case 2:r.mode=16196;break;case 3:e.msg="invalid block type",r.mode=dl}d>>>=2,f-=2;break;case 16193:for(d>>>=7&f,f-=7&f;f<32;){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}if((65535&d)!=(d>>>16^65535)){e.msg="invalid stored block lengths",r.mode=dl;break}if(r.length=65535&d,d=0,f=0,r.mode=il,t===Ku)break e;case il:r.mode=16195;case 16195:if(h=r.length,h){if(h>o&&(h=o),h>c&&(h=c),0===h)break e;a.set(n.subarray(i,i+h),s),o-=h,i+=h,c-=h,s+=h,r.length-=h;break}r.mode=nl;break;case 16196:for(;f<14;){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}if(r.nlen=257+(31&d),d>>>=5,f-=5,r.ndist=1+(31&d),d>>>=5,f-=5,r.ncode=4+(15&d),d>>>=4,f-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=dl;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;f<3;){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}r.lens[C[r.have++]]=7&d,d>>>=3,f-=3}for(;r.have<19;)r.lens[C[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,I={bits:r.lenbits},_=$u(0,r.lens,0,19,r.lencode,0,r.work,I),r.lenbits=I.bits,_){e.msg="invalid code lengths set",r.mode=dl;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;x=r.lencode[d&(1<<r.lenbits)-1],g=x>>>24,y=x>>>16&255,m=65535&x,!(g<=f);){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}if(m<16)d>>>=g,f-=g,r.lens[r.have++]=m;else{if(16===m){for(k=g+2;f<k;){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}if(d>>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=dl;break}A=r.lens[r.have-1],h=3+(3&d),d>>>=2,f-=2}else if(17===m){for(k=g+3;f<k;){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}d>>>=g,f-=g,A=0,h=3+(7&d),d>>>=3,f-=3}else{for(k=g+7;f<k;){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}d>>>=g,f-=g,A=0,h=11+(127&d),d>>>=7,f-=7}if(r.have+h>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=dl;break}for(;h--;)r.lens[r.have++]=A}}if(r.mode===dl)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=dl;break}if(r.lenbits=9,I={bits:r.lenbits},_=$u(1,r.lens,0,r.nlen,r.lencode,0,r.work,I),r.lenbits=I.bits,_){e.msg="invalid literal/lengths set",r.mode=dl;break}if(r.distbits=6,r.distcode=r.distdyn,I={bits:r.distbits},_=$u(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,I),r.distbits=I.bits,_){e.msg="invalid distances set",r.mode=dl;break}if(r.mode=sl,t===Ku)break e;case sl:r.mode=ol;case ol:if(o>=6&&c>=258){e.next_out=s,e.avail_out=c,e.next_in=i,e.avail_in=o,r.hold=d,r.bits=f,Fu(e,l),s=e.next_out,a=e.output,c=e.avail_out,i=e.next_in,n=e.input,o=e.avail_in,d=r.hold,f=r.bits,r.mode===nl&&(r.back=-1);break}for(r.back=0;x=r.lencode[d&(1<<r.lenbits)-1],g=x>>>24,y=x>>>16&255,m=65535&x,!(g<=f);){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}if(y&&!(240&y)){for(w=g,v=y,E=m;x=r.lencode[E+((d&(1<<w+v)-1)>>w)],g=x>>>24,y=x>>>16&255,m=65535&x,!(w+g<=f);){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}d>>>=w,f-=w,r.back+=w}if(d>>>=g,f-=g,r.back+=g,r.length=m,0===y){r.mode=16205;break}if(32&y){r.back=-1,r.mode=nl;break}if(64&y){e.msg="invalid literal/length code",r.mode=dl;break}r.extra=15&y,r.mode=16201;case 16201:if(r.extra){for(k=r.extra;f<k;){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}r.length+=d&(1<<r.extra)-1,d>>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;x=r.distcode[d&(1<<r.distbits)-1],g=x>>>24,y=x>>>16&255,m=65535&x,!(g<=f);){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}if(!(240&y)){for(w=g,v=y,E=m;x=r.distcode[E+((d&(1<<w+v)-1)>>w)],g=x>>>24,y=x>>>16&255,m=65535&x,!(w+g<=f);){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}d>>>=w,f-=w,r.back+=w}if(d>>>=g,f-=g,r.back+=g,64&y){e.msg="invalid distance code",r.mode=dl;break}r.offset=m,r.extra=15&y,r.mode=16203;case 16203:if(r.extra){for(k=r.extra;f<k;){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}r.offset+=d&(1<<r.extra)-1,d>>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=dl;break}r.mode=16204;case 16204:if(0===c)break e;if(h=l-c,r.offset>h){if(h=r.offset-h,h>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=dl;break}h>r.wnext?(h-=r.wnext,p=r.wsize-h):p=r.wnext-h,h>r.length&&(h=r.length),b=r.window}else b=a,p=s-r.offset,h=r.length;h>c&&(h=c),c-=h,r.length-=h;do{a[s++]=b[p++]}while(--h);0===r.length&&(r.mode=ol);break;case 16205:if(0===c)break e;a[s++]=r.length,c--,r.mode=ol;break;case cl:if(r.wrap){for(;f<32;){if(0===o)break e;o--,d|=n[i++]<<f,f+=8}if(l-=c,e.total_out+=l,r.total+=l,4&r.wrap&&l&&(e.adler=r.check=r.flags?pf(r.check,a,l,s-l):lf(r.check,a,l,s-l)),l=c,4&r.wrap&&(r.flags?d:fl(d))!==r.check){e.msg="incorrect data check",r.mode=dl;break}d=0,f=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;f<32;){if(0===o)break e;o--,d+=n[i++]<<f,f+=8}if(4&r.wrap&&d!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=dl;break}d=0,f=0}r.mode=16208;case 16208:_=Ju;break e;case dl:_=Zu;break e;case 16210:return Xu;default:return Yu}return e.next_out=s,e.avail_out=c,e.next_in=i,e.avail_in=o,r.hold=d,r.bits=f,(r.wsize||l!==e.avail_out&&r.mode<dl&&(r.mode<cl||t!==zu))&&El(e,e.output,e.next_out,l-e.avail_out),u-=e.avail_in,l-=e.avail_out,e.total_in+=u,e.total_out+=l,r.total+=l,4&r.wrap&&l&&(e.adler=r.check=r.flags?pf(r.check,a,l,e.next_out-l):lf(r.check,a,l,e.next_out-l)),e.data_type=r.bits+(r.last?64:0)+(r.mode===nl?128:0)+(r.mode===sl||r.mode===il?256:0),(0===u&&0===l||t===zu)&&_===Gu&&(_=Qu),_},_l={inflateReset:pl,inflateReset2:bl,inflateResetKeep:hl,inflateInit:e=>gl(e,15),inflateInit2:gl,inflate:Al,inflateEnd:e=>{if(ll(e))return Yu;let t=e.state;return t.window&&(t.window=null),e.state=null,Gu},inflateGetHeader:(e,t)=>{if(ll(e))return Yu;const r=e.state;return 2&r.wrap?(r.head=t,t.done=!1,Gu):Yu},inflateSetDictionary:(e,t)=>{const r=t.length;let n,a,i;return ll(e)?Yu:(n=e.state,0!==n.wrap&&n.mode!==rl?Yu:n.mode===rl&&(a=1,a=lf(a,t,r,0),a!==n.check)?Zu:(i=El(e,t,r,r),i?(n.mode=16210,Xu):(n.havedict=1,Gu)))},inflateInfo:"pako inflate (from Nodeca project)"};var xl=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Sl=Object.prototype.toString,{Z_NO_FLUSH:Il,Z_FINISH:kl,Z_OK:Cl,Z_STREAM_END:Tl,Z_NEED_DICT:Bl,Z_STREAM_ERROR:Ml,Z_DATA_ERROR:Ol,Z_MEM_ERROR:Rl}=gf;function Nl(e){this.options=gu.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new vu,this.strm.avail_out=0;let r=_l.inflateInit2(this.strm,t.windowBits);if(r!==Cl)throw new Error(bf[r]);if(this.header=new xl,_l.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=wu.string2buf(t.dictionary):"[object ArrayBuffer]"===Sl.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=_l.inflateSetDictionary(this.strm,t.dictionary),r!==Cl)))throw new Error(bf[r])}function Pl(e,t){const r=new Nl(t);if(r.push(e),r.err)throw r.msg||bf[r.err];return r.result}Nl.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,a=this.options.dictionary;let i,s,o;if(this.ended)return!1;for(s=t===~~t?t:!0===t?kl:Il,"[object ArrayBuffer]"===Sl.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),i=_l.inflate(r,s),i===Bl&&a&&(i=_l.inflateSetDictionary(r,a),i===Cl?i=_l.inflate(r,s):i===Ol&&(i=Bl));r.avail_in>0&&i===Tl&&r.state.wrap>0&&0!==e[r.next_in];)_l.inflateReset(r),i=_l.inflate(r,s);switch(i){case Ml:case Ol:case Bl:case Rl:return this.onEnd(i),this.ended=!0,!1}if(o=r.avail_out,r.next_out&&(0===r.avail_out||i===Tl))if("string"===this.options.to){let e=wu.utf8border(r.output,r.next_out),t=r.next_out-e,a=wu.buf2string(r.output,e);r.next_out=t,r.avail_out=n-t,t&&r.output.set(r.output.subarray(e,e+t),0),this.onData(a)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(i!==Cl||0!==o){if(i===Tl)return i=_l.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Nl.prototype.onData=function(e){this.chunks.push(e)},Nl.prototype.onEnd=function(e){e===Cl&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=gu.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Ll=function(e,t){return(t=t||{}).raw=!0,Pl(e,t)},Fl={Inflate:Nl,inflate:Pl,inflateRaw:Ll,ungzip:Pl,constants:gf};const{Deflate:Dl,deflate:Ul,deflateRaw:Hl,gzip:jl}=Pu,{Inflate:Vl,inflate:$l,inflateRaw:zl,ungzip:ql}=Fl;var Kl=jl,Gl=ql;class Jl extends za{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Na(e);const r=$a(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const n=this.blockLen,a=new Uint8Array(n);a.set(r.length>n?e.create().update(r).digest():r);for(let e=0;e<a.length;e++)a[e]^=54;this.iHash.update(a),this.oHash=e.create();for(let e=0;e<a.length;e++)a[e]^=106;this.oHash.update(a),a.fill(0)}update(e){return Pa(this),this.iHash.update(e),this}digestInto(e){Pa(this),Ra(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:a,blockLen:i,outputLen:s}=this;return e.finished=n,e.destroyed=a,e.blockLen=i,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Wl=(e,t,r)=>new Jl(e,t).update(r).digest();function Yl(e){return{hash:e,hmac:(t,...r)=>Wl(e,t,function(...e){let t=0;for(let r=0;r<e.length;r++){const n=e[r];Ra(n),t+=n.length}const r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const a=e[t];r.set(a,n),n+=a.length}return r}(...r)),randomBytes:Ka}}Wl.create=(e,t)=>new Jl(e,t);const Zl=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Xl=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Ql=BigInt(1),eh=BigInt(2),th=(e,t)=>(e+t/eh)/t;function rh(e){const t=Zl,r=BigInt(3),n=BigInt(6),a=BigInt(11),i=BigInt(22),s=BigInt(23),o=BigInt(44),c=BigInt(88),d=e*e*e%t,f=d*d*e%t,u=Vc(f,r,t)*f%t,l=Vc(u,r,t)*f%t,h=Vc(l,eh,t)*d%t,p=Vc(h,a,t)*h%t,b=Vc(p,i,t)*p%t,g=Vc(b,o,t)*b%t,y=Vc(g,c,t)*g%t,m=Vc(y,o,t)*b%t,w=Vc(m,r,t)*f%t,v=Vc(w,s,t)*p%t,E=Vc(v,n,t)*d%t,A=Vc(E,eh,t);if(!nh.eql(nh.sqr(A),e))throw new Error("Cannot find square root");return A}const nh=Wc(Zl,void 0,void 0,{sqrt:rh}),ah=function(e,t){const r=t=>Ad({...e,...Yl(t)});return Object.freeze({...r(t),create:r})}({a:BigInt(0),b:BigInt(7),Fp:nh,n:Xl,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=Xl,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Ql*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),a=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=r,s=BigInt("0x100000000000000000000000000000000"),o=th(i*e,t),c=th(-n*e,t);let d=Hc(e-o*r-c*a,t),f=Hc(-o*n-c*i,t);const u=d>s,l=f>s;if(u&&(d=t-d),l&&(f=t-f),d>s||f>s)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:u,k1:d,k2neg:l,k2:f}}}},Qa);BigInt(0);ah.ProjectivePoint;const ih=(e,t,r=[])=>{const n=Object.getOwnPropertyDescriptors(t);for(let e of r)delete n[e];Object.defineProperties(e,n)},sh=(e,t=[e])=>{const r=Object.getPrototypeOf(e);return null===r?t:sh(r,[...t,r])},oh=(e,t,r=[])=>{var n;const a=null!==(n=((...e)=>{if(0===e.length)return;let t;const r=e.map((e=>sh(e)));for(;r.every((e=>e.length>0));){const e=r.map((e=>e.pop())),n=e[0];if(!e.every((e=>e===n)))break;t=n}return t})(...e))&&void 0!==n?n:Object.prototype,i=Object.create(a),s=sh(a);for(let t of e){let e=sh(t);for(let t=e.length-1;t>=0;t--){let n=e[t];-1===s.indexOf(n)&&(ih(i,n,["constructor",...r]),s.push(n))}}return i.constructor=t,i},ch=e=>e.filter(((t,r)=>e.indexOf(t)==r)),dh=(e,t)=>{const r=t.map((e=>sh(e)));let n=0,a=!0;for(;a;){a=!1;for(let i=t.length-1;i>=0;i--){const t=r[i][n];if(null!=t&&(a=!0,null!=Object.getOwnPropertyDescriptor(t,e)))return r[i][0]}n++}},fh=(e,t=Object.prototype)=>new Proxy({},{getPrototypeOf:()=>t,setPrototypeOf(){throw Error("Cannot set prototype of Proxies created by ts-mixer")},getOwnPropertyDescriptor:(t,r)=>Object.getOwnPropertyDescriptor(dh(r,e)||{},r),defineProperty(){throw new Error("Cannot define new properties on Proxies created by ts-mixer")},has:(r,n)=>void 0!==dh(n,e)||void 0!==t[n],get:(r,n)=>(dh(n,e)||t)[n],set(t,r,n){const a=dh(r,e);if(void 0===a)throw new Error("Cannot set new properties on Proxies created by ts-mixer");return a[r]=n,!0},deleteProperty(){throw new Error("Cannot delete properties on Proxies created by ts-mixer")},ownKeys:()=>e.map(Object.getOwnPropertyNames).reduce(((e,t)=>t.concat(e.filter((e=>t.indexOf(e)<0)))))}),uh=null,lh="copy",hh="copy",ph="deep",bh=new WeakMap,gh=e=>bh.get(e),yh=(e,t)=>{var r,n;const a=ch([...Object.getOwnPropertyNames(e),...Object.getOwnPropertyNames(t)]),i={};for(let s of a)i[s]=ch([...null!==(r=null==e?void 0:e[s])&&void 0!==r?r:[],...null!==(n=null==t?void 0:t[s])&&void 0!==n?n:[]]);return i},mh=(e,t)=>{var r,n,a,i;return{property:yh(null!==(r=null==e?void 0:e.property)&&void 0!==r?r:{},null!==(n=null==t?void 0:t.property)&&void 0!==n?n:{}),method:yh(null!==(a=null==e?void 0:e.method)&&void 0!==a?a:{},null!==(i=null==t?void 0:t.method)&&void 0!==i?i:{})}},wh=(e,t)=>{var r,n,a,i,s,o;return{class:ch([...null!==(r=null==e?void 0:e.class)&&void 0!==r?r:[],...null!==(n=null==t?void 0:t.class)&&void 0!==n?n:[]]),static:mh(null!==(a=null==e?void 0:e.static)&&void 0!==a?a:{},null!==(i=null==t?void 0:t.static)&&void 0!==i?i:{}),instance:mh(null!==(s=null==e?void 0:e.instance)&&void 0!==s?s:{},null!==(o=null==t?void 0:t.instance)&&void 0!==o?o:{})}},vh=new Map,Eh=(...e)=>{const t=((...e)=>{var t;const r=new Set,n=new Set([...e]);for(;n.size>0;)for(let e of n){const a=[...sh(e.prototype).map((e=>e.constructor)),...null!==(t=gh(e))&&void 0!==t?t:[]].filter((e=>!r.has(e)));for(let e of a)n.add(e);r.add(e),n.delete(e)}return[...r]})(...e).map((e=>vh.get(e))).filter((e=>!!e));return 0==t.length?{}:1==t.length?t[0]:t.reduce(((e,t)=>wh(e,t)))},Ah=e=>{let t=vh.get(e);return t||(t={},vh.set(e,t)),t};function _h(...e){var t,r,n;const a=e.map((e=>e.prototype)),i=uh;if(null!==i){const e=a.map((e=>e[i])).filter((e=>"function"==typeof e)),t=function(...t){for(let r of e)r.apply(this,t)},r={[i]:t};a.push(r)}function s(...t){for(const r of e)ih(this,new r(...t));null!==i&&"function"==typeof this[i]&&this[i].apply(this,t)}var o,c;s.prototype="copy"===hh?oh(a,s):(o=a,c=s,fh([...o,{constructor:c}])),Object.setPrototypeOf(s,"copy"===lh?oh(e,null,["prototype"]):fh(e,Function.prototype));let d=s;if("none"!==ph){const a="deep"===ph?Eh(...e):((...e)=>{const t=e.map((e=>Ah(e)));return 0===t.length?{}:1===t.length?t[0]:t.reduce(((e,t)=>wh(e,t)))})(...e);for(let e of null!==(t=null==a?void 0:a.class)&&void 0!==t?t:[]){const t=e(d);t&&(d=t)}xh(null!==(r=null==a?void 0:a.static)&&void 0!==r?r:{},d),xh(null!==(n=null==a?void 0:a.instance)&&void 0!==n?n:{},d.prototype)}var f,u;return f=d,u=e,bh.set(f,u),d}const xh=(e,t)=>{const r=e.property,n=e.method;if(r)for(let e in r)for(let n of r[e])n(t,e);if(n)for(let e in n)for(let r of n[e])r(t,e,Object.getOwnPropertyDescriptor(t,e))};a(1048).hp;var Sh=Object.defineProperty,Ih=Object.getOwnPropertyDescriptor,kh=Object.getOwnPropertyNames,Ch=Object.prototype.hasOwnProperty,Th=(e,t)=>{for(var r in t)Sh(e,r,{get:t[r],enumerable:!0})},Bh=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of kh(t))Ch.call(e,a)||a===r||Sh(e,a,{get:()=>t[a],enumerable:!(n=Ih(t,a))||n.enumerable});return e},Mh={};Th(Mh,{ADDR_BOUND:()=>ap,API_VERSION:()=>tp,BaseUrl:()=>bp,DEFAULT_GLOBAL_CONFIG:()=>vp,HARDENING_4BYTES:()=>pp,HARDENING_BYTE:()=>hp,IS_BROWSER:()=>Ph,MASK_250:()=>Qh,MASK_31:()=>ep,MAX_STORAGE_ITEM_SIZE:()=>np,NetworkName:()=>gp,OutsideExecutionCallerAny:()=>fp,PAYMASTER_RPC_NODES:()=>Ap,PRIME:()=>rp,RANGE_FELT:()=>sp,RANGE_I128:()=>op,RANGE_U128:()=>cp,RPC_DEFAULT_NODES:()=>Ep,SNIP9_V1_INTERFACE_ID:()=>up,SNIP9_V2_INTERFACE_ID:()=>lp,SYSTEM_MESSAGES:()=>_p,StarknetChainId:()=>yp,SupportedRpcVersion:()=>wp,TEXT_TO_FELT_MAX_LEN:()=>Yh,TRANSACTION_VERSION:()=>Zh,TransactionHashPrefix:()=>mp,UDC:()=>dp,ZERO:()=>Xh});var Oh={};Th(Oh,{JRPC:()=>Rh,PAYMASTER_API:()=>f,RPCSPEC07:()=>s,RPCSPEC08:()=>u});var Rh={};((e,t,r)=>{Bh(e,t,"default"),r&&Bh(r,t,"default")})(Oh,u);var Nh={};Th(Nh,{IS_BROWSER:()=>Ph,addHexPrefix:()=>$h,arrayBufferToString:()=>Fh,atobUniversal:()=>Uh,btoaUniversal:()=>Hh,buf2hex:()=>jh,calcByteLength:()=>qh,concatenateArrayBuffer:()=>Wh,padLeft:()=>zh,pascalToSnake:()=>Jh,removeHexPrefix:()=>Vh,sanitizeBytes:()=>Kh,sanitizeHex:()=>Gh,utf8ToArray:()=>Dh});var Ph="undefined"!=typeof window,Lh="0";function Fh(e){return new Uint8Array(e).reduce(((e,t)=>e+String.fromCharCode(t)),"")}function Dh(e){return(new TextEncoder).encode(e)}function Uh(e){return Zr.decode(e)}function Hh(e){return Zr.encode(new Uint8Array(e))}function jh(e){return e.reduce(((e,t)=>e+t.toString(16).padStart(2,"0")),"")}function Vh(e){return e.replace(/^0x/i,"")}function $h(e){return`0x${Vh(e)}`}function zh(e,t,r=Lh){return function(e,t,r,n=Lh){const a=t-e.length;let i=e;if(a>0){const t=n.repeat(a);i=r?t+e:e+t}return i}(e,t,!0,r)}function qh(e,t=8){const{length:r}=e,n=r%t;return n?(r-n)/t*t+t:r}function Kh(e,t=8,r=Lh){return zh(e,qh(e,t),r)}function Gh(e){const t=Kh(Vh(e),2);return t?$h(t):t}var Jh=e=>/[a-z]/.test(e)?e.split(/(?=[A-Z])/).join("_").toUpperCase():e;function Wh(e){const t=e.reduce(((e,t)=>e+t.byteLength),0),r=new Uint8Array(t);let n=0;return e.forEach((e=>{r.set(e,n),n+=e.byteLength})),r}var Yh=31,{ETransactionVersion:Zh}=u,Xh=0n,Qh=2n**250n-1n,ep=2n**31n-1n,tp=Xh,rp=2n**251n+17n*2n**192n+1n,np=256n,ap=2n**251n-np,ip=(e,t)=>({min:e,max:t}),sp=ip(Xh,rp-1n),op=ip(-(2n**127n),2n**127n-1n),cp=ip(Xh,2n**128n-1n),dp={ADDRESS:"0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf",ENTRYPOINT:"deployContract"},fp="0x414e595f43414c4c4552",up="0x68cfd18b92d1907b8ba3cc324900277f5a3622099431ea85dd8089255e4181",lp="0x1d1144bb2138366ff28d8e9ab57456b1d332ac42196230c3a602003c89872",hp=128,pp=2147483648n,bp={SN_MAIN:"https://alpha-mainnet.starknet.io",SN_SEPOLIA:"https://alpha-sepolia.starknet.io"},gp={SN_MAIN:"SN_MAIN",SN_SEPOLIA:"SN_SEPOLIA"},yp={SN_MAIN:"0x534e5f4d41494e",SN_SEPOLIA:"0x534e5f5345504f4c4941"},mp={DECLARE:"0x6465636c617265",DEPLOY:"0x6465706c6f79",DEPLOY_ACCOUNT:"0x6465706c6f795f6163636f756e74",INVOKE:"0x696e766f6b65",L1_HANDLER:"0x6c315f68616e646c6572"},wp={"0.7.1":"0.7.1","0.8.1":"0.8.1",v0_7_1:"0.7.1",v0_8_1:"0.8.1"},vp={legacyMode:!1,rpcVersion:"0.8.1",transactionVersion:Oh.ETransactionVersion.V3,logLevel:"INFO",feeMarginPercentage:{bounds:{l1_gas:{max_amount:50,max_price_per_unit:50},l1_data_gas:{max_amount:50,max_price_per_unit:50},l2_gas:{max_amount:50,max_price_per_unit:50}},maxFee:50},fetch:void 0,websocket:void 0},Ep={SN_MAIN:["https://starknet-mainnet.public.blastapi.io/rpc/"],SN_SEPOLIA:["https://starknet-sepolia.public.blastapi.io/rpc/"]},Ap={SN_MAIN:["https://starknet.paymaster.avnu.fi"],SN_SEPOLIA:["https://sepolia.paymaster.avnu.fi"]},_p={legacyTxWarningMessage:"You are using a deprecated transaction version (V0,V1,V2)!\nUpdate to the latest V3 transactions!",legacyTxRPC08Message:"RPC 0.8 do not support legacy transactions",SWOldV3:"RPC 0.7 V3 tx (improper resource bounds) not supported in RPC 0.8",channelVersionMismatch:"Channel specification version is not compatible with the connected node Specification Version",unsupportedSpecVersion:"The connected node specification version is not supported by this library",maxFeeInV3:"maxFee is not supported in V3 transactions, use resourceBounds instead"},xp=class e{static instance;config;constructor(){this.initialize()}initialize(){this.config={...vp}}static getInstance(){return e.instance||(e.instance=new e),e.instance}get(e,t){return this.config[e]??t}set(e,t){this.config[e]=t}update(e){this.config={...this.config,...e}}getAll(){return{...this.config}}reset(){this.initialize()}delete(e){delete this.config[e]}hasKey(e){return e in this.config}}.getInstance(),Sp={DEBUG:5,INFO:4,WARN:3,ERROR:2,FATAL:1,OFF:0},Ip=class e{static instance;config;constructor(){this.config=xp}static getInstance(){return e.instance||(e.instance=new e),e.instance}getTimestamp(){return(new Date).toISOString()}shouldLog(e){const t=this.config.get("logLevel","INFO");return e<=Sp[t]}formatMessage(e){const{level:t,message:r,timestamp:n,data:a}=e;let i=`[${n}] ${t}: ${r}`;if(a)try{i+=`\n${JSON.stringify(a,null,2)}`}catch(e){i+=`\n[JSON.stringify Error/Circular]: ${e}`}return i}log(e,t,r){if(!this.shouldLog(Sp[e]))return;const n={level:e,message:t,timestamp:this.getTimestamp(),data:r},a=this.formatMessage(n);switch(e){case"DEBUG":console.debug(a);break;case"INFO":console.info(a);break;case"WARN":console.warn(a);break;case"ERROR":case"FATAL":console.error(a);break;case"OFF":break;default:console.log(a)}}debug(e,t){this.log("DEBUG",e,t)}info(e,t){this.log("INFO",e,t)}warn(e,t){this.log("WARN",e,t)}error(e,t){this.log("ERROR",e,t)}fatal(e,t){this.log("FATAL",e,t)}setLogLevel(e){this.config.set("logLevel",e)}getLogLevel(){return this.config.get("logLevel","INFO")}getEnabledLogLevels(){return Object.keys(Sp).filter((e=>this.shouldLog(Sp[e])&&"OFF"!==e))}}.getInstance(),kp={};Th(kp,{RpcChannel:()=>Hm});Th({},{BlockStatus:()=>Op,BlockTag:()=>Rp,EDAMode:()=>Dp,EDataAvailabilityMode:()=>Fp,ETH_ADDRESS:()=>Kp,ETransactionExecutionStatus:()=>Vp,ETransactionStatus:()=>jp,ETransactionVersion:()=>Np,ETransactionVersion2:()=>Pp,ETransactionVersion3:()=>Lp,EntryPointType:()=>Cp,Literal:()=>qp,NON_ZERO_PREFIX:()=>Gp,OutsideExecutionTypesV1:()=>Jp,OutsideExecutionTypesV2:()=>Wp,OutsideExecutionVersion:()=>Yp,RPC:()=>Oh,TransactionExecutionStatus:()=>Mp,TransactionFinalityStatus:()=>Bp,TransactionType:()=>Tp,TypedDataRevision:()=>zt,Uint:()=>zp,ValidateType:()=>$p,isRPC08_FeeEstimate:()=>Up,isRPC08_ResourceBounds:()=>Hp});var Cp={EXTERNAL:"EXTERNAL",L1_HANDLER:"L1_HANDLER",CONSTRUCTOR:"CONSTRUCTOR"},Tp={DECLARE:"DECLARE",DEPLOY:"DEPLOY",DEPLOY_ACCOUNT:"DEPLOY_ACCOUNT",INVOKE:"INVOKE_FUNCTION"},Bp={NOT_RECEIVED:"NOT_RECEIVED",RECEIVED:"RECEIVED",ACCEPTED_ON_L2:"ACCEPTED_ON_L2",ACCEPTED_ON_L1:"ACCEPTED_ON_L1"},Mp={REJECTED:"REJECTED",REVERTED:"REVERTED",SUCCEEDED:"SUCCEEDED"},Op={PENDING:"PENDING",ACCEPTED_ON_L1:"ACCEPTED_ON_L1",ACCEPTED_ON_L2:"ACCEPTED_ON_L2",REJECTED:"REJECTED"},Rp={PENDING:"pending",LATEST:"latest"},{ETransactionVersion:Np}=u,{ETransactionVersion2:Pp}=u,{ETransactionVersion3:Lp}=u,{EDataAvailabilityMode:Fp}=u,{EDAMode:Dp}=u;function Up(e){return"l1_data_gas_consumed"in e}function Hp(e){return"l1_data_gas"in e}var{ETransactionStatus:jp}=u,{ETransactionExecutionStatus:Vp}=u,$p={DEPLOY:"DEPLOY",CALL:"CALL",INVOKE:"INVOKE"},zp={u8:"core::integer::u8",u16:"core::integer::u16",u32:"core::integer::u32",u64:"core::integer::u64",u128:"core::integer::u128",u256:"core::integer::u256",u512:"core::integer::u512"},qp={ClassHash:"core::starknet::class_hash::ClassHash",ContractAddress:"core::starknet::contract_address::ContractAddress",Secp256k1Point:"core::starknet::secp256k1::Secp256k1Point",U96:"core::internal::bounded_int::BoundedInt::<0, 79228162514264337593543950335>"},Kp="core::starknet::eth_address::EthAddress",Gp="core::zeroable::NonZero::",Jp={StarkNetDomain:[{name:"name",type:"felt"},{name:"version",type:"felt"},{name:"chainId",type:"felt"}],OutsideExecution:[{name:"caller",type:"felt"},{name:"nonce",type:"felt"},{name:"execute_after",type:"felt"},{name:"execute_before",type:"felt"},{name:"calls_len",type:"felt"},{name:"calls",type:"OutsideCall*"}],OutsideCall:[{name:"to",type:"felt"},{name:"selector",type:"felt"},{name:"calldata_len",type:"felt"},{name:"calldata",type:"felt*"}]},Wp={StarknetDomain:[{name:"name",type:"shortstring"},{name:"version",type:"shortstring"},{name:"chainId",type:"shortstring"},{name:"revision",type:"shortstring"}],OutsideExecution:[{name:"Caller",type:"ContractAddress"},{name:"Nonce",type:"felt"},{name:"Execute After",type:"u128"},{name:"Execute Before",type:"u128"},{name:"Calls",type:"Call*"}],Call:[{name:"To",type:"ContractAddress"},{name:"Selector",type:"selector"},{name:"Calldata",type:"felt*"}]},Yp={UNSUPPORTED:"0",V1:"1",V2:"2"};Th({},{parse:()=>Xp,parseAlwaysAsBig:()=>Qp,stringify:()=>eb});var Zp=e=>{if(!fn(e))return parseFloat(e);const t=parseInt(e,10);return Number.isSafeInteger(t)?t:BigInt(e)},Xp=e=>Sn(String(e),void 0,Zp),Qp=e=>Sn(String(e),void 0,_n),eb=(e,t,r,n)=>ta(e,t,r,n),tb=class{nodeUrl;headers;interval;requestId=0;pendingRequests={};batchPromises={};delayTimer;delayPromise;delayPromiseResolve;baseFetch;constructor(e){this.nodeUrl=e.nodeUrl,this.headers=e.headers,this.interval=e.interval,this.baseFetch=e.baseFetch}async wait(){return this.delayPromise&&this.delayPromiseResolve||(this.delayPromise=new Promise((e=>{this.delayPromiseResolve=e}))),this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=void 0),this.delayTimer=setTimeout((()=>{this.delayPromiseResolve&&(this.delayPromiseResolve(),this.delayPromise=void 0,this.delayPromiseResolve=void 0)}),this.interval),this.delayPromise}addPendingRequest(e,t,r){const n={id:r??`batched_${this.requestId+=1}`,jsonrpc:"2.0",method:e,params:t??void 0};return this.pendingRequests[n.id]=n,n.id}async sendBatch(e){return(await this.baseFetch(this.nodeUrl,{method:"POST",body:eb(e),headers:this.headers})).json()}async fetch(e,t,r){const n=this.addPendingRequest(e,t,r);await this.wait();const a=this.pendingRequests;if(this.pendingRequests={},!this.batchPromises[n]){const e=this.sendBatch(Object.values(a));Object.keys(a).forEach((t=>{this.batchPromises[t]=e}))}const i=await this.batchPromises[n];delete this.batchPromises[n];const s=i.find((e=>e.id===n));if(!s)throw new Error(`Couldn't find the result for the request. Method: ${e}`);return s}};function rb(e,t){if(!e)throw new Error(t||"Assertion failure")}function nb(e,t){if(!e){if(0!==t.length)throw new Error("AssertionX failure: message function should not require arguments");t()}}var ab={};Th(ab,{addPercent:()=>Tb,assertInRange:()=>vb,bigNumberishArrayToDecimalStringArray:()=>Eb,bigNumberishArrayToHexadecimalStringArray:()=>Ab,cleanHex:()=>wb,getDecimalString:()=>xb,getHexString:()=>Sb,getHexStringArray:()=>Ib,hexToBytes:()=>Cb,hexToDecimalString:()=>mb,isBigNumberish:()=>Mb,isHex:()=>ub,isStringWholeNumber:()=>_b,stringToSha256ToArrayBuff4:()=>Bb,toBigInt:()=>lb,toCairoBool:()=>kb,toHex:()=>pb,toHex64:()=>yb,toHexString:()=>bb,toStorageKey:()=>gb,tryToBigInt:()=>hb});var ib=e=>void 0===e||void 0===e;function sb(e){return"number"==typeof e}function ob(e){return"boolean"==typeof e}function cb(e){return"bigint"==typeof e}function db(e){return"string"==typeof e}function fb(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}function ub(e){return/^0x[0-9a-f]*$/i.test(e)}function lb(e){return BigInt(e)}function hb(e){return e?BigInt(e):void 0}function pb(e){return $h(lb(e).toString(16))}var bb=pb;function gb(e){return $h(lb(e).toString(16).padStart(64,"0"))}function yb(e){const t=$h(lb(e).toString(16).padStart(64,"0"));if(66!==t.length)throw TypeError("number is too big for hex 0x(64) representation");return t}function mb(e){return BigInt($h(e)).toString(10)}function wb(e){return e.toLowerCase().replace(/^(0x)0+/,"$1")}function vb(e,t,r,n=""){const a=""===n?"invalid length":`invalid ${n} length`,i=BigInt(e),s=BigInt(t),o=BigInt(r);rb(i>=s&&i<=o,`Message not signable, ${a}.`)}function Eb(e){return e.map((e=>lb(e).toString(10)))}function Ab(e){return e.map((e=>pb(e)))}function _b(e){return/^\d+$/.test(e)}function xb(e){if(ub(e))return mb(e);if(_b(e))return e;throw new Error(`${e} needs to be a hex-string or whole-number-string`)}function Sb(e){if(ub(e))return e;if(_b(e))return bb(e);throw new Error(`${e} needs to be a hex-string or whole-number-string`)}function Ib(e){return e.map(Sb)}function kb(e){return(+e).toString()}function Cb(e){if(!ub(e))throw new Error(`${e} needs to be a hex-string`);let t=Vh(e);return t.length%2!=0&&(t=`0${t}`),pa(t)}function Tb(e,t){const r=BigInt(e);return r+r*BigInt(t)/100n}function Bb(e){var t;return Cb(pb((t=BigInt($h(jh(Qa(e)))),Number(t&ep))))}function Mb(e){return sb(e)||cb(e)||db(e)&&(ub(e)||_b(e))}function Ob(e){const t=Vh(pb(BigInt(e))),r=t.length%2==0?t:`0${t}`;return $h(Yo(Cb($h(r))).toString(16))}function Rb(e){const t=BigInt(function(e){return $h(Yo(Dh(e)).toString(16))}(e));return t&Qh}function Nb(e){return pb(Rb(e))}function Pb(e){return sb(e)||cb(e)?pb(e):ub(e)?e:_b(e)?pb(e):Nb(e)}function Lb(e){const t=$h(e.reduce(((e,t)=>e+Vh(pb(t)).padStart(64,"0")),""));return $h(da(Oc(Cb(t))))}function Fb(e,t,r,n,a){return Lb([e,t,a,r,n.length,...n])}function Db(e,t,r){return Lb([e,t,r.length,...r])}Th({},{getL1MessageHash:()=>Db,getL2MessageHash:()=>Fb,getSelector:()=>Pb,getSelectorFromName:()=>Nb,keccakBn:()=>Ob,solidityUint256PackedKeccak256:()=>Lb,starknetKeccak:()=>Rb});function Ub(e){return/^[\x00-\x7F]*$/.test(e)}function Hb(e){return e.length<=Yh}function jb(e){return/^[0-9]*$/i.test(e)}function Vb(e){return db(e)&&!ub(e)&&!_b(e)}Th({},{decodeShortString:()=>Gb,encodeShortString:()=>Kb,isASCII:()=>Ub,isDecimalString:()=>jb,isLongText:()=>zb,isShortString:()=>Hb,isShortText:()=>$b,isText:()=>Vb,splitLongString:()=>qb});var $b=e=>Vb(e)&&Hb(e),zb=e=>Vb(e)&&!Hb(e);function qb(e){const t=RegExp(`[^]{1,${Yh}}`,"g");return e.match(t)||[]}function Kb(e){if(!Ub(e))throw new Error(`${e} is not an ASCII string`);if(!Hb(e))throw new Error(`${e} is too long`);return $h(e.replace(/./g,(e=>e.charCodeAt(0).toString(16))))}function Gb(e){if(!Ub(e))throw new Error(`${e} is not an ASCII string`);if(ub(e))return Vh(e).replace(/.{2}/g,(e=>String.fromCharCode(parseInt(e,16))));if(jb(e))return Gb("0X".concat(BigInt(e).toString(16)));throw new Error(`${e} is not Hex or decimal`)}function Jb(e){const t=0n===BigInt(e.pending_word)?"":Gb(pb(e.pending_word));return e.data.reduce(((e,t)=>e+(0n===BigInt(t)?"":Gb(pb(t)))),"")+t}function Wb(e){const t=qb(e),r=t[t.length-1],n=t.map(Kb),[a,i]=void 0===r||31===r.length?["0x00",0]:[n.pop(),r.length];return{data:0===n.length?[]:n,pending_word:a,pending_word_len:i}}Th({},{byteArrayFromString:()=>Wb,stringFromByteArray:()=>Jb});var Yb={};function Zb(e){if(cb(e)||Number.isInteger(e))return e.toString();if(db(e)){if(ub(e))return BigInt(e).toString();if(Vb(e)){if(!Hb(e))throw new Error(`${e} is a long string > 31 chars. Please split it into an array of short strings.`);return BigInt(Kb(e)).toString()}if(_b(e))return e}if(ob(e))return""+ +e;throw new Error(`${e} can't be computed by felt()`)}Th(Yb,{felt:()=>Bg,getAbiContractVersion:()=>Ig,getArrayType:()=>_g,isCairo1Abi:()=>xg,isCairo1Type:()=>Ag,isLen:()=>ng,isTypeArray:()=>ig,isTypeBool:()=>bg,isTypeByteArray:()=>wg,isTypeBytes31:()=>mg,isTypeContractAddress:()=>gg,isTypeEnum:()=>dg,isTypeEthAddress:()=>yg,isTypeFelt:()=>ag,isTypeLiteral:()=>pg,isTypeNamedTuple:()=>og,isTypeNonZero:()=>Sg,isTypeOption:()=>fg,isTypeResult:()=>ug,isTypeSecp256k1Point:()=>Eg,isTypeStruct:()=>cg,isTypeTuple:()=>sg,isTypeU96:()=>vg,isTypeUint:()=>lg,isTypeUint256:()=>hg,tuple:()=>Tg,uint256:()=>kg,uint512:()=>Cg});var Xb=(1n<<128n)-1n,Qb=(1n<<256n)-1n,eg=class e{low;high;static abiSelector="core::integer::u256";constructor(...t){if("object"==typeof t[0]&&1===t.length&&"low"in t[0]&&"high"in t[0]){const r=e.validateProps(t[0].low,t[0].high);this.low=r.low,this.high=r.high}else if(1===t.length){const r=e.validate(t[0]);this.low=r&Xb,this.high=r>>128n}else{if(2!==t.length)throw Error("Incorrect constructor parameters");{const r=e.validateProps(t[0],t[1]);this.low=r.low,this.high=r.high}}}static validate(e){const t=BigInt(e);if(t<0n)throw Error("bigNumberish is smaller than UINT_256_MIN");if(t>Qb)throw new Error("bigNumberish is bigger than UINT_256_MAX");return t}static validateProps(e,t){const r=BigInt(e),n=BigInt(t);if(r<0n||r>340282366920938463463374607431768211455n)throw new Error("low is out of range UINT_256_LOW_MIN - UINT_256_LOW_MAX");if(n<0n||n>340282366920938463463374607431768211455n)throw new Error("high is out of range UINT_256_HIGH_MIN - UINT_256_HIGH_MAX");return{low:r,high:n}}static is(t){try{e.validate(t)}catch(e){return!1}return!0}static isAbiType(t){return t===e.abiSelector}toBigInt(){return(this.high<<128n)+this.low}toUint256HexString(){return{low:$h(this.low.toString(16)),high:$h(this.high.toString(16))}}toUint256DecimalString(){return{low:this.low.toString(10),high:this.high.toString(10)}}toApiRequest(){return[Zb(this.low),Zb(this.high)]}},tg=(1n<<512n)-1n,rg=class e{limb0;limb1;limb2;limb3;static abiSelector="core::integer::u512";constructor(...t){if("object"==typeof t[0]&&1===t.length&&"limb0"in t[0]&&"limb1"in t[0]&&"limb2"in t[0]&&"limb3"in t[0]){const r=e.validateProps(t[0].limb0,t[0].limb1,t[0].limb2,t[0].limb3);this.limb0=r.limb0,this.limb1=r.limb1,this.limb2=r.limb2,this.limb3=r.limb3}else if(1===t.length){const r=e.validate(t[0]);this.limb0=r&Xb,this.limb1=(r&Xb<<128n)>>128n,this.limb2=(r&Xb<<256n)>>256n,this.limb3=r>>384n}else{if(4!==t.length)throw Error("Incorrect Uint512 constructor parameters");{const r=e.validateProps(t[0],t[1],t[2],t[3]);this.limb0=r.limb0,this.limb1=r.limb1,this.limb2=r.limb2,this.limb3=r.limb3}}}static validate(e){const t=BigInt(e);if(t<0n)throw Error("bigNumberish is smaller than UINT_512_MIN.");if(t>tg)throw Error("bigNumberish is bigger than UINT_512_MAX.");return t}static validateProps(e,t,r,n){const a=BigInt(e),i=BigInt(t),s=BigInt(r),o=BigInt(n);return[a,i,s,o].forEach(((e,t)=>{if(e<0n||e>Xb)throw Error(`limb${t} is not in the range of a u128 number`)})),{limb0:a,limb1:i,limb2:s,limb3:o}}static is(t){try{e.validate(t)}catch(e){return!1}return!0}static isAbiType(t){return t===e.abiSelector}toBigInt(){return(this.limb3<<384n)+(this.limb2<<256n)+(this.limb1<<128n)+this.limb0}toUint512HexString(){return{limb0:$h(this.limb0.toString(16)),limb1:$h(this.limb1.toString(16)),limb2:$h(this.limb2.toString(16)),limb3:$h(this.limb3.toString(16))}}toUint512DecimalString(){return{limb0:this.limb0.toString(10),limb1:this.limb1.toString(10),limb2:this.limb2.toString(10),limb3:this.limb3.toString(10)}}toApiRequest(){return[Zb(this.limb0),Zb(this.limb1),Zb(this.limb2),Zb(this.limb3)]}},ng=e=>/_len$/.test(e),ag=e=>"felt"===e||"core::felt252"===e,ig=e=>/\*/.test(e)||e.startsWith("core::array::Array::")||e.startsWith("core::array::Span::"),sg=e=>/^\(.*\)$/i.test(e),og=e=>/\(.*\)/i.test(e)&&e.includes(":"),cg=(e,t)=>e in t,dg=(e,t)=>e in t,fg=e=>e.startsWith("core::option::Option::"),ug=e=>e.startsWith("core::result::Result::"),lg=e=>Object.values(zp).includes(e),hg=e=>eg.isAbiType(e),pg=e=>Object.values(qp).includes(e),bg=e=>"core::bool"===e,gg=e=>e===qp.ContractAddress,yg=e=>e===Kp,mg=e=>"core::bytes_31::bytes31"===e,wg=e=>"core::byte_array::ByteArray"===e,vg=e=>"core::internal::bounded_int::BoundedInt::<0, 79228162514264337593543950335>"===e,Eg=e=>e===qp.Secp256k1Point,Ag=e=>e.includes("::"),_g=e=>Ag(e)?e.substring(e.indexOf("<")+1,e.lastIndexOf(">")):e.replace("*","");function xg(e){const{cairo:t}=Ig(e);if(void 0===t)throw Error("Unable to determine Cairo version");return"1"===t}function Sg(e){return e.startsWith(Gp)}function Ig(e){if(e.find((e=>"interface"===e.type)))return{cairo:"1",compiler:"2"};const t=e.find((e=>("function"===e.type||"constructor"===e.type)&&(e.inputs.length||e.outputs.length)));if(!t)return{cairo:void 0,compiler:void 0};const r=t.inputs.length?t.inputs:t.outputs;return Ag(r[0].type)?{cairo:"1",compiler:"1"}:{cairo:"0",compiler:"0"}}var kg=e=>new eg(e).toUint256DecimalString(),Cg=e=>new rg(e).toUint512DecimalString(),Tg=(...e)=>({...e});function Bg(e){return Zb(e)}var Mg=class{variant;constructor(e){const t=Object.values(e);if(0===t.length)throw new Error("This Enum must have at least 1 variant");if(1!==t.filter((e=>!ib(e))).length)throw new Error("This Enum must have exactly one active variant");this.variant=e}unwrap(){return Object.values(this.variant).find((e=>!ib(e)))}activeVariant(){const e=Object.entries(this.variant).find((e=>!ib(e[1])));return ib(e)?"":e[0]}},Og={Some:0,None:1},Rg=class{Some;None;constructor(e,t){if(!(e in Object.values(Og)))throw new Error("Wrong variant! It should be CairoOptionVariant.Some or .None.");if(e===Og.Some){if(ib(t))throw new Error('The creation of a Cairo Option with "Some" variant needs a content as input.');this.Some=t,this.None=void 0}else this.Some=void 0,this.None=!0}unwrap(){return this.None?void 0:this.Some}isSome(){return!ib(this.Some)}isNone(){return!0===this.None}},Ng={Ok:0,Err:1},Pg=class{Ok;Err;constructor(e,t){if(!(e in Object.values(Ng)))throw new Error("Wrong variant! It should be CairoResultVariant.Ok or .Err.");e===Ng.Ok?(this.Ok=t,this.Err=void 0):(this.Ok=void 0,this.Err=t)}unwrap(){if(!ib(this.Ok))return this.Ok;if(!ib(this.Err))return this.Err;throw new Error("Both Result.Ok and .Err are undefined. Not authorized.")}isOk(){return!ib(this.Ok)}isErr(){return!ib(this.Err)}},Lg=(e,t,r)=>{if(!cb(e[r]))throw new Error(`Data and formatter mismatch on ${r}:${t[r]}, expected response data ${r}:${e[r]} to be BN instead it is ${typeof e[r]}`)},Fg=(e,t,r)=>{throw new Error(`Unhandled formatter type on ${r}:${t[r]} for data ${r}:${e[r]}`)};function Dg(e,t,r){return Object.entries(e).reduce(((n,[a,i])=>{const s=r??t[a];if(!(a in t)&&!r)return n[a]=i,n;if("string"===s){if(Array.isArray(e[a])){const t=Dg(e[a],e[a].map((e=>s)));return n[a]=Object.values(t).join(""),n}return Lg(e,t,a),n[a]=Gb(i),n}if("number"===s)return Lg(e,t,a),n[a]=Number(i),n;if("function"==typeof s)return n[a]=s(i),n;if(Array.isArray(s)){const t=Dg(e[a],s,s[0]);return n[a]=Object.values(t),n}return fb(s)?(n[a]=Dg(e[a],s),n):(Fg(e,t,a),n)}),{})}var Ug=class{abi;constructor(e){this.abi=e}methodInputsLength(e){return e.inputs.reduce(((e,t)=>ng(t.name)?e:e+1),0)}getMethod(e){return this.abi.find((t=>t.name===e))}getLegacyFormat(){return this.abi}},Hg=class{abi;constructor(e){this.abi=e}methodInputsLength(e){return e.inputs.length}getMethod(e){const t=this.abi.find((e=>"interface"===e.type));return t?.items?.find((t=>t.name===e))}getLegacyFormat(){return this.abi.flatMap((e=>"interface"===e.type?e.items:e))}};function jg(e){const t=function(e){return e.find((e=>"interface"===e.type))?2:xg(e)?1:0}(e);if(0===t||1===t)return new Ug(e);if(2===t)return new Hg(e);throw Error(`Unsupported ABI version ${t}`)}function Vg(e,t,r){return"constructor"===e&&!r&&!t.length}function $g(e,t,r){for(let n=0,a=0;n<e.length;n++)if(e[n]===t)a++;else if(e[n]===r&&0==--a)return n;return Number.POSITIVE_INFINITY}function zg(e){return Ag(e)?function(e){const t=e.slice(1,-1),r=[];let n,a=0;for(;a<t.length;){switch(!0){case"("===t[a]:n=a+$g(t.slice(a),"(",")")+1;break;case t.startsWith("core::result::Result::<",a)||t.startsWith("core::array::Array::<",a)||t.startsWith("core::option::Option::<",a):n=a+$g(t.slice(a),"<",">")+1;break;default:{const e=t.indexOf(",",a);n=-1!==e?e:Number.POSITIVE_INFINITY}}r.push(t.slice(a,n)),a=n+2}return r}(e):function(e){const t=e.replace(/\s/g,"").slice(1,-1),{subTuple:r,result:n}=function(e){if(!e.includes("("))return{subTuple:[],result:e};const t=[];let r="",n=0;for(;n<e.length;){if("("===e[n]){let a=1;const i=n;for(n++;a;)")"===e[n]&&a--,"("===e[n]&&a++,n++;t.push(e.substring(i,n)),r+=" ",n--}else r+=e[n];n++}return{subTuple:t,result:r}}(t);let a=n.split(",").map((e=>r.length?e.replace(" ",r.shift()):e));return og(e)&&(a=a.reduce(((e,t)=>e.concat(function(e){const t=e.substring(0,e.indexOf(":"));return{name:t,type:e.substring(t.length+1)}}(t))),[])),a}(e)}var qg=class e{content;arrayType;constructor(t,r){rb(e.isTypeFixedArray(r),`The type ${r} is not a Cairo fixed array. Needs [type; length].`);try{e.getFixedArrayType(r)}catch{throw new Error(`The type ${r} do not includes any content type. Needs [type; length].`)}try{e.getFixedArraySize(r)}catch{throw new Error(`The type ${r} type do not includes any length. Needs [type; length].`)}rb(e.getFixedArraySize(r)===t.length,`The ABI type ${r} is expecting ${e.getFixedArraySize(r)} items. ${t.length} items provided.`),this.content=t,this.arrayType=r}static getFixedArraySize(e){const t=e.match(/(?<=; )\d+(?=\])/);if(null===t)throw new Error(`ABI type ${e} do not includes a valid number after ';' character.`);return Number(t[0])}getFixedArraySize(){return e.getFixedArraySize(this.arrayType)}static getFixedArrayType=e=>{const t=e.match(/(?<=\[).+(?=;)/);if(null===t)throw new Error(`ABI type ${e} do not includes a valid type of data.`);return t[0]};getFixedArrayType(){return e.getFixedArrayType(this.arrayType)}static compile(e){return e.reduce(((e,t,r)=>(e[r]=t,e)),{})}compile(){return e.compile(this.content)}static isTypeFixedArray(e){return/^\[.*;\s.*\]$/.test(e)&&/(?<=\[).+(?=;)/.test(e)&&/(?<=; )\d+(?=\])/.test(e)}};function Kg(e,t,r,n){const a=(e,t)=>{if(qg.isTypeFixedArray(t))return function(e,t){const r=qg.getFixedArrayType(t),n=qg.getFixedArraySize(t);if(Array.isArray(e)){if(n!==e.length)throw new Error(`ABI type ${t}: array provided do not includes ${n} items. ${e.length} items provided.`);return e.map((e=>a(e,r)))}if(n!==Object.keys(e).length)throw new Error(`ABI type ${t}: object provided do not includes ${n} properties. ${Object.keys(e).length} items provided.`);return a(e,r)}(e,t);if(ig(t))return function(e,t){const r=_g(t);if(db(e))return e;return e.map((e=>a(e,r)))}(e,t);if(dg(t,n)){const r=n[t];return s(e,r)}if(sg(t))return function(e,t){const r=zg(t).reduce(((t,r,n)=>{const i=Object.keys(e),s=r=>Object.defineProperty(t,n.toString(),{enumerable:!0,value:r??e[i[n]]}),o=r?.type?r.type:r;return s(a(e[i[n]],o)),t}),{});return r}(e,t);if(yg(t))return e;if(Sg(t))return e;if(wg(t))return e;if(vg(t))return e;if(Eg(t))return e;if(eg.isAbiType(t)){const r=e;if("object"!=typeof r)return r;if(!("low"in r)||!("high"in r))throw Error(`Your object includes the property : ${t}, containing an Uint256 object without the 'low' and 'high' keys.`);return{low:r.low,high:r.high}}if(rg.isAbiType(t)){const r=e;if("object"!=typeof r)return r;if(!["limb0","limb1","limb2","limb3"].every((e=>e in r)))throw function(e){return Error(`Your object includes the property : ${e}, containing an Uint512 object without the 'limb0' to 'limb3' keys.`)}(t);return{limb0:r.limb0,limb1:r.limb1,limb2:r.limb2,limb3:r.limb3}}if(cg(t,r)){const n=r[t].members;return i(e,n)}return e},i=(e,t)=>t.reduce(((t,r)=>{if("undefined"===e[r.name]&&(Ag(r.type)||!ng(r.name)))throw Error(`Your object needs a property with key : ${r.name} .`);var n;return n=a(e[r.name],r.type),Object.defineProperty(t,r.name,{enumerable:!0,value:n??e[r.name]}),t}),{});const s=(e,t)=>{if(ug(t.name)){const r=e,n=t.name.substring(t.name.indexOf("<")+1,t.name.lastIndexOf(",")),i=t.name.substring(t.name.indexOf(",")+1,t.name.lastIndexOf(">"));return r.isOk()?new Pg(Ng.Ok,a(e.unwrap(),n)):new Pg(Ng.Err,a(e.unwrap(),i))}if(fg(t.name)){const r=e,n=t.name.substring(t.name.indexOf("<")+1,t.name.lastIndexOf(">"));return r.isSome()?new Rg(Og.Some,a(r.unwrap(),n)):new Rg(Og.None,{})}const r=e,n=Object.entries(r.variant).map((e=>{if(ib(e[1]))return e;const n=t.type.substring(t.type.lastIndexOf("<")+1,t.type.lastIndexOf(">"));return"()"===n?e:[e[0],a(r.unwrap(),n)]}));return new Mg(Object.fromEntries(n))};return t.reduce(((t,r)=>{return ng(r.name)&&!Ag(r.type)||(n=a(e[r.name],r.type),Object.defineProperty(t,r.name,{enumerable:!0,value:n})),t;var n}),{})}function Gg(e,t){switch(!0){case eg.isAbiType(e):return new eg(t).toApiRequest();case rg.isAbiType(e):return new rg(t).toApiRequest();case mg(e):return Kb(t.toString());case Eg(e):{const e=Vh(pb(t)).padStart(128,"0"),r=kg($h(e.slice(-64))),n=kg($h(e.slice(0,-64)));return[Bg(n.low),Bg(n.high),Bg(r.low),Bg(r.high)]}default:return Bg(t)}}function Jg(e,t,r,n){if(void 0===e)throw Error(`Missing parameter for type ${t}`);if(qg.isTypeFixedArray(t)){const a=qg.getFixedArrayType(t);let i=[];if(Array.isArray(e)){i=new qg(e,t).content}else{if("object"!=typeof e)throw new Error(`ABI type ${t}: not an Array representing a cairo.fixedArray() provided.`);i=Object.values(e),rb(i.length===qg.getFixedArraySize(t),`ABI type ${t}: object provided do not includes ${qg.getFixedArraySize(t)} items. ${i.length} items provided.`)}return i.reduce(((e,t)=>e.concat(Jg(t,a,r,n))),[])}if(Array.isArray(e)){const a=[];a.push(Bg(e.length));const i=_g(t);return e.reduce(((e,t)=>e.concat(Jg(t,i,r,n))),a)}if(r[t]&&r[t].members.length){if(eg.isAbiType(t))return new eg(e).toApiRequest();if(rg.isAbiType(t))return new rg(e).toApiRequest();if(yg(t))return Gg(t,e);if(wg(t))return function(e){const t=Wb(e);return[t.data.length.toString(),...t.data.map((e=>e.toString())),t.pending_word.toString(),t.pending_word_len.toString()]}(e);const{members:a}=r[t],i=e;return a.reduce(((e,t)=>e.concat(Jg(i[t.name],t.type,r,n))),[])}if(sg(t)){const a=function(e,t){const r=zg(t),n=Object.values(e);if(n.length!==r.length)throw Error(`ParseTuple: provided and expected abi tuple size do not match.\n provided: ${n}\n expected: ${r}`);return r.map(((e,t)=>({element:n[t],type:e.type??e})))}(e,t);return a.reduce(((e,t)=>{const a=Jg(t.element,t.type,r,n);return e.concat(a)}),[])}if(eg.isAbiType(t))return new eg(e).toApiRequest();if(rg.isAbiType(t))return new rg(e).toApiRequest();if(dg(t,n)){const{variants:a}=n[t];if(fg(t)){const t=e;if(t.isSome()){const e=a.find((e=>"Some"===e.name));if(ib(e))throw Error("Error in abi : Option has no 'Some' variant.");const i=e.type;if("()"===i)return Og.Some.toString();const s=Jg(t.unwrap(),i,r,n);return Array.isArray(s)?[Og.Some.toString(),...s]:[Og.Some.toString(),s]}return Og.None.toString()}if(ug(t)){const t=e;if(t.isOk()){const e=a.find((e=>"Ok"===e.name));if(ib(e))throw Error("Error in abi : Result has no 'Ok' variant.");const i=e.type;if("()"===i)return Ng.Ok.toString();const s=Jg(t.unwrap(),i,r,n);return Array.isArray(s)?[Ng.Ok.toString(),...s]:[Ng.Ok.toString(),s]}const i=a.find((e=>"Err"===e.name));if(ib(i))throw Error("Error in abi : Result has no 'Err' variant.");const s=i.type;if("()"===s)return Ng.Err.toString();const o=Jg(t.unwrap(),s,r,n);return Array.isArray(o)?[Ng.Err.toString(),...o]:[Ng.Err.toString(),o]}const i=e,s=i.activeVariant(),o=a.find((e=>e.name===s));if(ib(o))throw Error(`Not find in abi : Enum has no '${s}' variant.`);const c=o.type,d=a.findIndex((e=>e.name===s));if("()"===c)return d.toString();const f=Jg(i.unwrap(),c,r,n);return Array.isArray(f)?[d.toString(),...f]:[d.toString(),f]}if(Sg(t))return Gg(_g(t),e);if("object"==typeof e)throw Error(`Parameter ${e} do not align with abi parameter ${t}`);return Gg(t,e)}function Wg(e,t){let r;switch(!0){case bg(e):return r=t.next().value,Boolean(BigInt(r));case eg.isAbiType(e):const n=t.next().value,a=t.next().value;return new eg(n,a).toBigInt();case rg.isAbiType(e):const i=t.next().value,s=t.next().value,o=t.next().value,c=t.next().value;return new rg(i,s,o,c).toBigInt();case yg(e):return r=t.next().value,BigInt(r);case mg(e):return r=t.next().value,Gb(r);case Eg(e):const d=Vh(t.next().value).padStart(32,"0"),f=Vh(t.next().value).padStart(32,"0"),u=Vh(t.next().value).padStart(32,"0"),l=Vh(t.next().value).padStart(32,"0");return BigInt($h(f+d+l+u));default:return r=t.next().value,BigInt(r)}}function Yg(e,t,r,n){if("()"===t.type)return{};if(eg.isAbiType(t.type)){const t=e.next().value,r=e.next().value;return new eg(t,r).toBigInt()}if(rg.isAbiType(t.type)){const t=e.next().value,r=e.next().value,n=e.next().value,a=e.next().value;return new rg(t,r,n,a).toBigInt()}if(wg(t.type)){const t=[],r=BigInt(e.next().value);for(;t.length<r;)t.push(pb(e.next().value));return Jb({data:t,pending_word:pb(e.next().value),pending_word_len:BigInt(e.next().value)})}if(qg.isTypeFixedArray(t.type)){const a=[],i={name:"",type:qg.getFixedArrayType(t.type)},s=qg.getFixedArraySize(t.type);for(;a.length<s;)a.push(Yg(e,i,r,n));return a}if(ig(t.type)){const a=[],i={name:"",type:_g(t.type)},s=BigInt(e.next().value);for(;a.length<s;)a.push(Yg(e,i,r,n));return a}if(Sg(t.type)){const a={name:"",type:_g(t.type)};return Yg(e,a,r,n)}if(r&&t.type in r&&r[t.type])return yg(t.type)?Wg(t.type,e):r[t.type].members.reduce(((t,a)=>(t[a.name]=Yg(e,a,r,n),t)),{});if(n&&t.type in n&&n[t.type]){const a=Number(e.next().value),i=n[t.type].variants.reduce(((t,i,s)=>s===a?(t[i.name]=Yg(e,{name:"",type:i.type},r,n),t):(t[i.name]=void 0,t)),{});if(t.type.startsWith("core::option::Option")){const e=a===Og.Some?i.Some:void 0;return new Rg(a,e)}if(t.type.startsWith("core::result::Result")){let e;return e=a===Ng.Ok?i.Ok:i.Err,new Pg(a,e)}return new Mg(i)}if(sg(t.type)){return zg(t.type).reduce(((t,a,i)=>{const s=a?.name?a.name:i,o={name:s,type:a?.type?a.type:a};return t[s]=Yg(e,o,r,n),t}),{})}if(ig(t.type)){const a=[],i={name:"",type:_g(t.type)},s=BigInt(e.next().value);for(;a.length<s;)a.push(Yg(e,i,r,n));return a}return Wg(t.type,e)}function Zg(e,t,r,n,a){const{name:i,type:s}=t;let o;switch(!0){case ng(i):return o=e.next().value,BigInt(o);case r&&s in r||sg(s):case n&&dg(s,n):case qg.isTypeFixedArray(s):return Yg(e,t,r,n);case ig(s):if(Ag(s))return Yg(e,t,r,n);const c=[];if(a&&a[`${i}_len`]){const s=a[`${i}_len`];for(;c.length<s;)c.push(Yg(e,{name:i,type:t.type.replace("*","")},r,n))}return c;case Sg(s):return Yg(e,t,r,n);default:return Wg(s,e)}}var Xg=(e,t)=>{if(rb(db(e)||sb(e)||cb(e),`Validate: arg ${t.name} should be a felt typed as (String, Number or BigInt)`),db(e)&&!ub(e))return;const r=BigInt(e.toString(10));rb(r>=0n&&r<=2n**252n-1n,`Validate: arg ${t.name} cairo typed ${t.type} should be in range [0, 2^252-1]`)},Qg=(e,t)=>{let r;switch(sb(e)&&rb(e<=Number.MAX_SAFE_INTEGER,"Validation: Parameter is too large to be typed as Number use (BigInt or String)"),rb(db(e)||sb(e)||cb(e)||fb(e)&&"low"in e&&"high"in e||fb(e)&&["limb0","limb1","limb2","limb3"].every((t=>t in e)),`Validate: arg ${t.name} of cairo type ${t.type} should be type (String, Number or BigInt), but is ${typeof e} ${e}.`),t.type){case zp.u256:r=new eg(e).toBigInt();break;case zp.u512:r=new rg(e).toBigInt();break;default:r=lb(e)}switch(t.type){case zp.u8:rb(r>=0n&&r<=255n,`Validate: arg ${t.name} cairo typed ${t.type} should be in range [0 - 255]`);break;case zp.u16:rb(r>=0n&&r<=65535n,`Validate: arg ${t.name} cairo typed ${t.type} should be in range [0, 65535]`);break;case zp.u32:rb(r>=0n&&r<=4294967295n,`Validate: arg ${t.name} cairo typed ${t.type} should be in range [0, 4294967295]`);break;case zp.u64:rb(r>=0n&&r<=2n**64n-1n,`Validate: arg ${t.name} cairo typed ${t.type} should be in range [0, 2^64-1]`);break;case zp.u128:rb(r>=0n&&r<=2n**128n-1n,`Validate: arg ${t.name} cairo typed ${t.type} should be in range [0, 2^128-1]`);break;case zp.u256:rb(r>=0n&&r<=2n**256n-1n,`Validate: arg ${t.name} is ${t.type} should be in range 0 - 2^256-1`);break;case zp.u512:rb(rg.is(r),`Validate: arg ${t.name} is ${t.type} should be in range 0 - 2^512-1`);break;case qp.ClassHash:case qp.ContractAddress:rb(r>=0n&&r<=2n**252n-1n,`Validate: arg ${t.name} cairo typed ${t.type} should be in range [0, 2^252-1]`);break;case qp.Secp256k1Point:rb(r>=0n&&r<=2n**512n-1n,`Validate: arg ${t.name} must be ${t.type} : a 512 bits number.`);break;case qp.U96:rb(r>=0n&&r<=2n**96n-1n,`Validate: arg ${t.name} must be ${t.type} : a 96 bits number.`)}},ey=(e,t)=>{rb(ob(e),`Validate: arg ${t.name} of cairo type ${t.type} should be type (Boolean)`)},ty=(e,t,r)=>{if(t.type!==zp.u256&&t.type!==zp.u512)if(yg(t.type)){rb(!fb(e),`EthAddress type is waiting a BigNumberish. Got "${e}"`);const r=BigInt(e.toString(10));rb(r>=0n&&r<=2n**160n-1n,`Validate: arg ${t.name} cairo typed ${t.type} should be in range [0, 2^160-1]`)}else rb(fb(e),`Validate: arg ${t.name} is cairo type struct (${t.type}), and should be defined as a js object (not array)`),r[t.type].members.forEach((({name:r})=>{rb(Object.keys(e).includes(r),`Validate: arg ${t.name} should have a property ${r}`)}));else Qg(e,t)},ry=(e,t)=>{rb(fb(e),`Validate: arg ${t.name} is cairo type Enum (${t.type}), and should be defined as a js object (not array)`);const r=Object.getOwnPropertyNames(Object.getPrototypeOf(e)),n=[...Object.getOwnPropertyNames(e),...r];if(!(fg(t.type)&&n.includes("isSome")&&n.includes("isNone")||ug(t.type)&&n.includes("isOk")&&n.includes("isErr")||n.includes("variant")&&n.includes("activeVariant")))throw new Error(`Validate Enum: argument ${t.name}, type ${t.type}, value received "${e}", is not an Enum.`)},ny=(e,t)=>{rb(fb(e),`Validate: arg ${t.name} should be a tuple (defined as object)`)},ay=(e,t,r,n)=>{const a=ig(t.type),i=a?_g(t.type):qg.getFixedArrayType(t.type);if(a&&ag(i)&&zb(e))return;let s=[];if(a)rb(Array.isArray(e),`Validate: arg ${t.name} should be an Array`),s=e;else switch(!0){case Array.isArray(e):s=e;break;case"object"==typeof e:s=Object.values(e);break;default:throw new Error(`Validate: arg ${t.name} should be an Array or an object.`)}switch(!0){case ag(i):s.forEach((e=>Xg(e,t)));break;case sg(i):s.forEach((e=>ny(e,{name:t.name,type:i})));break;case ig(i):s.forEach((e=>ay(e,{name:"",type:i},r,n)));break;case cg(i,r):s.forEach((e=>ty(e,{name:t.name,type:i},r)));break;case dg(i,n):s.forEach((e=>ry(e,{name:t.name,type:i})));break;case lg(i)||pg(i):s.forEach((e=>Qg(e,{name:"",type:i})));break;case bg(i):s.forEach((e=>ey(e,t)));break;default:throw new Error(`Validate Unhandled: argument ${t.name}, type ${t.type}, value ${s}`)}};function iy(e,t,r,n){e.inputs.reduce(((e,a)=>{const i=t[e];switch(!0){case ng(a.name):return e;case ag(a.type):Xg(i,a);break;case mg(a.type):((e,t)=>{rb(db(e),`Validate: arg ${t.name} should be a string.`),rb(e.length<32,`Validate: arg ${t.name} cairo typed ${t.type} should be a string of less than 32 characters.`)})(i,a);break;case lg(a.type)||pg(a.type):Qg(i,a);break;case bg(a.type):ey(i,a);break;case wg(a.type):((e,t)=>{rb(db(e),`Validate: arg ${t.name} should be a string.`)})(i,a);break;case ig(a.type)||qg.isTypeFixedArray(a.type):ay(i,a,r,n);break;case cg(a.type,r):ty(i,a,r);break;case dg(a.type,n):ry(i,a);break;case sg(a.type):ny(i,a);break;case Sg(a.type):((e,t)=>{const r=_g(t.type);switch(rb(lg(r)&&r!==rg.abiSelector||ag(r),`Validate: ${t.name} type is not authorized for NonZero type.`),!0){case ag(r):Xg(e,t),rb(BigInt(e.toString(10))>0,"Validate: value 0 is not authorized in NonZero felt252 type.");break;case lg(r):Qg(e,{name:"",type:r}),r===zp.u256?rb(new eg(e).toBigInt()>0,"Validate: value 0 is not authorized in NonZero uint256 type."):rb(lb(e)>0,"Validate: value 0 is not authorized in NonZero uint type.");break;default:throw new Error(`Validate Unhandled: argument ${t.name}, type ${t.type}, value "${e}"`)}})(i,a);break;default:throw new Error(`Validate Unhandled: argument ${a.name}, type ${a.type}, value ${i}`)}return e+1}),0)}var sy=class e{abi;parser;structs;enums;constructor(t){this.structs=e.getAbiStruct(t),this.enums=e.getAbiEnum(t),this.parser=jg(t),this.abi=this.parser.getLegacyFormat()}validate(e,t,r=[]){if(e!==$p.DEPLOY){rb(this.abi.filter((t=>{if("function"!==t.type)return!1;const r="view"===t.stateMutability||"view"===t.state_mutability;return e===$p.INVOKE?!r:r})).map((e=>e.name)).includes(t),(e===$p.INVOKE?"invocable":"viewable")+" method not found in abi")}const n=this.abi.find((r=>e===$p.DEPLOY?r.name===t&&"constructor"===r.type:r.name===t&&"function"===r.type));if(Vg(t,r,n))return;const a=this.parser.methodInputsLength(n);if(r.length!==a)throw Error(`Invalid number of arguments, expected ${a} arguments, but got ${r.length}`);iy(n,r,this.structs,this.enums)}compile(e,t){const r=this.abi.find((t=>t.name===e));if(Vg(e,t,r))return[];let n;if(Array.isArray(t))n=t;else{const e=Kg(t,r.inputs,this.structs,this.enums);n=Object.values(e),iy(r,n,this.structs,this.enums)}const a=n[Symbol.iterator](),i=r.inputs.reduce(((e,t)=>ng(t.name)&&!Ag(t.type)?e:e.concat(function(e,t,r,n){const{name:a,type:i}=t;let{value:s}=e.next();switch(!0){case qg.isTypeFixedArray(i):if(!Array.isArray(s)&&"object"!=typeof s)throw Error(`ABI expected parameter ${a} to be an array or an object, got ${s}`);return Jg(s,t.type,r,n);case ig(i):if(!Array.isArray(s)&&!Vb(s))throw Error(`ABI expected parameter ${a} to be array or long string, got ${s}`);return db(s)&&(s=qb(s)),Jg(s,t.type,r,n);case Sg(i):return Gg(_g(i),s);case yg(i):return Gg(i,s);case cg(i,r)||sg(i)||eg.isAbiType(i):case dg(i,n):return Jg(s,i,r,n);default:return Gg(i,s)}}(a,t,this.structs,this.enums))),[]);return Object.defineProperty(i,"__compiled__",{enumerable:!1,writable:!1,value:!0}),i}static compile(e){const t=e=>{const t=(e,r=".")=>{const n=Array.isArray(e)?[e.length.toString(),...e]:e;return Object.entries(n).flatMap((([e,a])=>{let i=a;"entrypoint"===e?i=Nb(i):zb(i)&&(i=Wb(i));const s=Array.isArray(n)&&"0"===e?"$$len":e;if(cb(i))return[[`${r}${s}`,Bg(i)]];if(Object(i)===i){const e=Object.getOwnPropertyNames(Object.getPrototypeOf(i)),n=[...Object.getOwnPropertyNames(i),...e];if(n.includes("isSome")&&n.includes("isNone")){const e=i,n=e.isSome()?Og.Some:Og.None;return e.isSome()?t({0:n,1:e.unwrap()},`${r}${s}.`):[[`${r}${s}`,Bg(n)]]}if(n.includes("isOk")&&n.includes("isErr")){const e=i,n=e.isOk()?Ng.Ok:Ng.Err;return t({0:n,1:e.unwrap()},`${r}${s}.`)}if(n.includes("variant")&&n.includes("activeVariant")){const e=i,n=e.activeVariant(),a=Object.keys(e.variant).findIndex((e=>e===n));return"object"==typeof e.unwrap()&&0===Object.keys(e.unwrap()).length?[[`${r}${s}`,Bg(a)]]:t({0:a,1:e.unwrap()},`${r}${s}.`)}return t(i,`${r}${s}.`)}return[[`${r}${s}`,Bg(i)]]}))};return Object.fromEntries(t(e))};let r;if(Array.isArray(e)){const n=t({...e});r=Object.values(n)}else{const n=t(e);r=Object.values(n)}return Object.defineProperty(r,"__compiled__",{enumerable:!1,writable:!1,value:!0}),r}parse(e,t){const{outputs:r}=this.abi.find((t=>t.name===e)),n=t.flat()[Symbol.iterator](),a=r.flat().reduce(((e,t,r)=>{const a=t.name??r;return e[a]=Zg(n,t,this.structs,this.enums,e),e[a]&&e[`${a}_len`]&&delete e[`${a}_len`],e}),{});return 1===Object.keys(a).length&&0 in a?a[0]:a}format(e,t,r){return Dg(this.parse(e,t),r)}static getAbiStruct(e){return e.filter((e=>"struct"===e.type)).reduce(((e,t)=>({...e,[t.name]:t})),{})}static getAbiEnum(e){const t=e.filter((e=>"enum"===e.type)).reduce(((e,t)=>({...e,[t.name]:t})),{});return delete t["core::bool"],t}static toCalldata(t=[]){return e.compile(t)}static toHex(t=[]){return e.compile(t).map((e=>pb(e)))}decodeParameters(e,t){const r=Array.isArray(e)?e:[e],n=t.flat()[Symbol.iterator](),a=r.map((e=>Zg(n,{name:"",type:e},this.structs,this.enums)));return 1===a.length?a[0]:a}},oy={};Th(oy,{calculateContractAddressFromHash:()=>Hy,calculateDeclareTransactionHash:()=>Ry,calculateDeployAccountTransactionHash:()=>Ny,calculateInvokeTransactionHash:()=>Oy,calculateL2MessageTxHash:()=>py,computeCompiledClassHash:()=>Gy,computeContractClassHash:()=>Yy,computeHashOnElements:()=>Fy,computeHintedClassHash:()=>$y,computeLegacyContractClassHash:()=>zy,computePedersenHash:()=>Py,computePedersenHashOnElements:()=>Dy,computePoseidonHash:()=>Ly,computePoseidonHashOnElements:()=>Uy,computeSierraContractClassHash:()=>Wy,formatSpaces:()=>Vy,getL1MessageHash:()=>Db,getL2MessageHash:()=>Fb,getSelector:()=>Pb,getSelectorFromName:()=>Nb,hashByteCodeSegments:()=>Ky,keccakBn:()=>Ob,poseidon:()=>b,solidityUint256PackedKeccak256:()=>Lb,starknetKeccak:()=>Rb});Th({},{calculateDeclareTransactionHash:()=>uy,calculateDeployAccountTransactionHash:()=>ly,calculateL2MessageTxHash:()=>py,calculateTransactionHash:()=>hy,calculateTransactionHashCommon:()=>fy,computeHashOnElements:()=>dy});var cy={};function dy(e){return[...e,e.length].reduce(((e,t)=>Go(lb(e),lb(t))),0).toString()}function fy(e,t,r,n,a,i,s,o=[]){const c=dy(a);return dy([e,t,r,n,c,i,s,...o])}function uy(e,t,r,n,a,i,s){return fy(mp.DECLARE,r,t,0,[e],n,a,[i,...s?[s]:[]])}function ly(e,t,r,n,a,i,s,o){const c=[t,n,...r];return fy(mp.DEPLOY_ACCOUNT,a,e,0,c,i,s,[o])}function hy(e,t,r,n,a,i){return fy(mp.INVOKE,t,e,0,r,n,a,[i])}function py(e,t,r,n,a,i){const s=[e,...n];return fy(mp.L1_HANDLER,0,t,Pb(r),s,0,a,[i])}Th(cy,{starkCurve:()=>p,weierstrass:()=>g});Th({},{calculateDeclareTransactionHash:()=>By,calculateDeployAccountTransactionHash:()=>Ty,calculateInvokeTransactionHash:()=>My,calculateTransactionHashCommon:()=>Cy,encodeDataResourceBoundsL1:()=>Sy,encodeResourceBoundsL1:()=>_y,encodeResourceBoundsL2:()=>xy,hashDAMode:()=>Ay,hashFeeField:()=>Iy,hashFeeFieldV3B3:()=>ky});var by=e=>e.map((e=>BigInt(e))),gy=32n,yy=128n,my=64n+yy,wy=BigInt(Kb("L1_GAS")),vy=BigInt(Kb("L2_GAS")),Ey=BigInt(Kb("L1_DATA"));function Ay(e,t){return(BigInt(e)<<gy)+BigInt(t)}function _y(e){return(wy<<my)+(BigInt(e.l1_gas.max_amount)<<yy)+BigInt(e.l1_gas.max_price_per_unit)}function xy(e){return(vy<<my)+(BigInt(e.l2_gas.max_amount)<<yy)+BigInt(e.l2_gas.max_price_per_unit)}function Sy(e){return(Ey<<my)+(BigInt(e.l1_data_gas.max_amount)<<yy)+BigInt(e.l1_data_gas.max_price_per_unit)}function Iy(e,t){const r=_y(t),n=xy(t);return cc([BigInt(e),r,n])}function ky(e,t){const r=_y(t),n=xy(t),a=Sy(t);return cc([BigInt(e),r,n,a])}function Cy(e,t,r,n,a,i,s,o,c,d,f=[]){const u=Hp(d)?ky(i,d):Iy(i,d),l=Ay(o,c),h=by([e,t,r,u,cc(by(s)),n,a,l,...by(f)]);return pb(cc(h))}function Ty(e,t,r,n,a,i,s,o,c,d,f,u){return Cy(mp.DEPLOY_ACCOUNT,a,e,i,s,f,u,o,c,d,[cc(by(r)),t,n])}function By(e,t,r,n,a,i,s,o,c,d,f,u){return Cy(mp.DECLARE,n,r,a,i,f,by(u),o,c,d,[cc(by(s)),e,t])}function My(e,t,r,n,a,i,s,o,c,d,f){return Cy(mp.INVOKE,t,e,n,a,d,f,s,o,c,[cc(by(i)),cc(by(r))])}function Oy(e){return function(e){return[Oh.ETransactionVersion.V3,Oh.ETransactionVersion.F3].includes(e.version)}(e)?My(e.senderAddress,e.version,e.compiledCalldata,e.chainId,e.nonce,e.accountDeploymentData,e.nonceDataAvailabilityMode,e.feeDataAvailabilityMode,e.resourceBounds,e.tip,e.paymasterData):hy(e.senderAddress,e.version,e.compiledCalldata,e.maxFee,e.chainId,e.nonce)}function Ry(e){return function(e){return[Oh.ETransactionVersion.V3,Oh.ETransactionVersion.F3].includes(e.version)}(e)?By(e.classHash,e.compiledClassHash,e.senderAddress,e.version,e.chainId,e.nonce,e.accountDeploymentData,e.nonceDataAvailabilityMode,e.feeDataAvailabilityMode,e.resourceBounds,e.tip,e.paymasterData):uy(e.classHash,e.senderAddress,e.version,e.maxFee,e.chainId,e.nonce,e.compiledClassHash)}function Ny(e){return function(e){return[Oh.ETransactionVersion.V3,Oh.ETransactionVersion.F3].includes(e.version)}(e)?Ty(e.contractAddress,e.classHash,e.compiledConstructorCalldata,e.salt,e.version,e.chainId,e.nonce,e.nonceDataAvailabilityMode,e.feeDataAvailabilityMode,e.resourceBounds,e.tip,e.paymasterData):ly(e.contractAddress,e.classHash,e.constructorCalldata,e.salt,e.version,e.maxFee,e.chainId,e.nonce)}function Py(e,t){return Go(BigInt(e),BigInt(t))}function Ly(e,t){return pb(ic(BigInt(e),BigInt(t)))}function Fy(e){return[...e,e.length].reduce(((e,t)=>Go(BigInt(e),BigInt(t))),0).toString()}var Dy=Fy;function Uy(e){return pb(cc(e.map((e=>BigInt(e)))))}function Hy(e,t,r,n){const a=Fy(sy.compile(r)),i=Fy([Bg("0x535441524b4e45545f434f4e54524143545f41444452455353"),n,e,t,a]);return pb(BigInt(i)%ap)}function jy(e,t){return"attributes"===e||"accessible_scopes"===e?Array.isArray(t)&&0===t.length?void 0:t:"debug_info"===e?null:null===t?void 0:t}function Vy(e){let t=!1;const r=[];for(const n of e)'"'===n&&!1==(r.length>0&&"\\"===r.slice(-1)[0])&&(t=!t),t?r.push(n):r.push(":"===n?": ":","===n?", ":n);return r.join("")}function $y(e){const{abi:t,program:r}=e,n=Vy(eb({abi:t,program:r},jy));return $h(Yo(Dh(n)).toString(16))}function zy(e){const t=db(e)?Xp(e):e,r=pb(tp),n=Fy(t.entry_points_by_type.EXTERNAL.flatMap((e=>[e.selector,e.offset]))),a=Fy(t.entry_points_by_type.L1_HANDLER.flatMap((e=>[e.selector,e.offset]))),i=Fy(t.entry_points_by_type.CONSTRUCTOR.flatMap((e=>[e.selector,e.offset]))),s=Fy(t.program.builtins.map((e=>Kb(e)))),o=$y(t),c=Fy(t.program.data);return Fy([r,n,a,i,s,o,c])}function qy(e){const t=e.flatMap((e=>{return[BigInt(e.selector),BigInt(e.offset),(t=e.builtins,cc(t.flatMap((e=>BigInt(Kb(e))))))];var t}));return cc(t)}function Ky(e){const t=e.bytecode.map((e=>BigInt(e))),r=e.bytecode_segment_lengths??[];let n=0;const a=r.flatMap((e=>{const r=t.slice(n,n+=e);return[BigInt(e),cc(r)]}));return 1n+cc(a)}function Gy(e){const t=BigInt(Kb("COMPILED_CLASS_V1")),r=qy(e.entry_points_by_type.EXTERNAL),n=qy(e.entry_points_by_type.L1_HANDLER),a=qy(e.entry_points_by_type.CONSTRUCTOR),i=e.bytecode_segment_lengths?Ky(e):cc(e.bytecode.map((e=>BigInt(e))));return pb(cc([t,r,n,a,i]))}function Jy(e){return cc(e.flatMap((e=>[BigInt(e.selector),BigInt(e.function_idx)])))}function Wy(e){const t=BigInt(Kb("CONTRACT_CLASS_V0.1.0")),r=Jy(e.entry_points_by_type.EXTERNAL),n=Jy(e.entry_points_by_type.L1_HANDLER),a=Jy(e.entry_points_by_type.CONSTRUCTOR),i=function(e){const t=Vy(eb(e.abi,null));return BigInt($h(Yo(Dh(t)).toString(16)))}(e),s=cc(e.sierra_program.map((e=>BigInt(e))));return pb(cc([t,r,n,a,i,s]))}function Yy(e){const t=db(e)?Xp(e):e;return"sierra_program"in t?Wy(t):zy(t)}var Zy={};function Xy(e){const t=e.version?pb(e.version):Np.V3;return t===Np.V3||t===Np.F3}function Qy(e,t){const r=e.split("."),n=t.split(".");return r.every(((e,t)=>"*"===e||e===n[t]))}function em(e,t={allowAnyPatchVersion:!1}){return Object.values(wp).some((r=>Qy(t.allowAnyPatchVersion?function(e){const t=e.split(".");if(t.length<3)return e;return`${t[0]}.${t[1]}.*`}(r):r,e)))}function tm(e){const t=db(e)?e:eb(e);return Hh(Kl(t))}function rm(e){if(Array.isArray(e))return e;const t=Fh(Gl(Uh(e)));return Xp(t)}function nm(){return Do(No.randomPrivateKey())}function am(e){if(!e)throw Error("formatSignature: provided signature is undefined");if(Array.isArray(e))return e.map((e=>pb(e)));try{const{r:t,s:r}=e;return[pb(t),pb(r)]}catch(e){throw new Error("Signature need to be weierstrass.SignatureType or an array for custom")}}function im(e){return Eb(am(e))}function sm(e){return Ab(am(e))}function om(e,t=xp.get("feeMarginPercentage").maxFee){return Tb(e,t)}function cm(e,t=xp.get("feeMarginPercentage").bounds,r){return cb(e)?{l2_gas:{max_amount:"0x0",max_price_per_unit:"0x0"},l1_gas:{max_amount:"0x0",max_price_per_unit:"0x0"},...r&&Qy("0.8",r)&&{l1_data_gas:{max_amount:"0x0",max_price_per_unit:"0x0"}}}:Up(e)?function(e,t){return{l2_gas:{max_amount:pb(Tb(e.l2_gas_consumed,t.l2_gas.max_amount)),max_price_per_unit:pb(Tb(e.l2_gas_price,t.l2_gas.max_price_per_unit))},l1_gas:{max_amount:pb(Tb(e.l1_gas_consumed,t.l1_gas.max_amount)),max_price_per_unit:pb(Tb(e.l1_gas_price,t.l1_gas.max_price_per_unit))},l1_data_gas:{max_amount:pb(Tb(e.l1_data_gas_consumed,t.l1_data_gas.max_amount)),max_price_per_unit:pb(Tb(e.l1_data_gas_price,t.l1_data_gas.max_price_per_unit))}}}(e,t):function(e,t){return{l2_gas:{max_amount:"0x0",max_price_per_unit:"0x0"},l1_gas:{max_amount:void 0!==e.data_gas_consumed&&void 0!==e.data_gas_price?pb(Tb(BigInt(e.overall_fee)/BigInt(e.gas_price),t.l1_gas.max_amount)):pb(Tb(e.gas_consumed,t.l1_gas.max_amount)),max_price_per_unit:pb(Tb(e.gas_price,t.l1_gas.max_price_per_unit))}}}(e,t)}function dm(e){return{l1_gas_consumed:0n,l1_gas_price:0n,l1_data_gas_consumed:0n,l1_data_gas_price:0n,l2_gas_consumed:0n,l2_gas_price:0n,overall_fee:Xh,unit:"FRI",suggestedMaxFee:Xh,resourceBounds:cm(Xh,void 0,e)}}function fm(e){if(e===Fp.L1)return Dp.L1;if(e===Fp.L2)return Dp.L2;throw Error("EDAM conversion")}function um(e,t){const r=t?pb(t):void 0,n=pb(e);if(t&&!Object.values(Np).includes(r))throw Error(`providedVersion ${t} is not ETransactionVersion`);if(!Object.values(Np).includes(n))throw Error(`defaultVersion ${e} is not ETransactionVersion`);return t?r:n}function lm(e){if(!e)return;const t=pb(e);if(t===Np.V0)return Np.F0;if(t===Np.V1)return Np.F1;if(t===Np.V2)return Np.F2;if(t===Np.V3)return Np.F3;throw Error(`toFeeVersion: ${t} is not supported`)}function hm(e,t){return{tip:e.tip||0,paymasterData:e.paymasterData||[],accountDeploymentData:e.accountDeploymentData||[],nonceDataAvailabilityMode:e.nonceDataAvailabilityMode||Fp.L1,feeDataAvailabilityMode:e.feeDataAvailabilityMode||Fp.L1,resourceBounds:e.resourceBounds??cm(Xh,void 0,t)}}function pm(e){return e===Np.F2?Np.F1:e===Np.V2?Np.V1:e}function bm(e){return $h(jh(So(pb(e),!1)))}function gm(e){return"sierra_program"in(db(e)?Xp(e):e)}function ym(e){const t={...e};if(gm(e.contract)&&(!e.compiledClassHash&&e.casm&&(t.compiledClassHash=Gy(e.casm)),!t.compiledClassHash))throw new Error("Extract compiledClassHash failed, provide (CairoAssembly).casm file or compiledClassHash");if(t.classHash=e.classHash??Yy(e.contract),!t.classHash)throw new Error("Extract classHash failed, provide (CompiledContract).json file or classHash");return t}Th(Zy,{ZEROFee:()=>dm,compressProgram:()=>tm,decompressProgram:()=>rm,estimateFeeToBounds:()=>cm,estimatedFeeToMaxFee:()=>om,formatSignature:()=>am,getFullPublicKey:()=>bm,intDAM:()=>fm,randomAddress:()=>nm,reduceV2:()=>pm,signatureToDecimalArray:()=>im,signatureToHexArray:()=>sm,toFeeVersion:()=>lm,toTransactionVersion:()=>um,v3Details:()=>hm});var mm={FAILED_TO_RECEIVE_TXN:1,NO_TRACE_AVAILABLE:10,CONTRACT_NOT_FOUND:20,ENTRYPOINT_NOT_FOUND:21,BLOCK_NOT_FOUND:24,INVALID_TXN_INDEX:27,CLASS_HASH_NOT_FOUND:28,TXN_HASH_NOT_FOUND:29,PAGE_SIZE_TOO_BIG:31,NO_BLOCKS:32,INVALID_CONTINUATION_TOKEN:33,TOO_MANY_KEYS_IN_FILTER:34,CONTRACT_ERROR:40,TRANSACTION_EXECUTION_ERROR:41,STORAGE_PROOF_NOT_SUPPORTED:42,CLASS_ALREADY_DECLARED:51,INVALID_TRANSACTION_NONCE:52,INSUFFICIENT_RESOURCES_FOR_VALIDATE:53,INSUFFICIENT_ACCOUNT_BALANCE:54,VALIDATION_FAILURE:55,COMPILATION_FAILED:56,CONTRACT_CLASS_SIZE_IS_TOO_LARGE:57,NON_ACCOUNT:58,DUPLICATE_TX:59,COMPILED_CLASS_HASH_MISMATCH:60,UNSUPPORTED_TX_VERSION:61,UNSUPPORTED_CONTRACT_CLASS_VERSION:62,UNEXPECTED_ERROR:63,INVALID_SUBSCRIPTION_ID:66,TOO_MANY_ADDRESSES_IN_FILTER:67,TOO_MANY_BLOCKS_BACK:68,COMPILATION_ERROR:100,INVALID_ADDRESS:150,TOKEN_NOT_SUPPORTED:151,INVALID_SIGNATURE:153,MAX_AMOUNT_TOO_LOW:154,CLASS_HASH_NOT_SUPPORTED:155,PAYMASTER_TRANSACTION_EXECUTION_ERROR:156,INVALID_TIME_BOUNDS:157,INVALID_DEPLOYMENT_DATA:158,INVALID_CLASS_HASH:159,INVALID_ID:160,UNKNOWN_ERROR:163};var wm=class extends Error{name;constructor(e){super(e),Object.defineProperty(this,"name",{value:new.target.name,enumerable:!1,configurable:!0}),function(e,t){const{setPrototypeOf:r}=Object;r?r(e,t):e.__proto__=t}(this,new.target.prototype),function(e,t=e.constructor){const{captureStackTrace:r}=Error;r&&r(e,t)}(this)}},vm=class extends wm{},Em=class extends vm{constructor(e,t,r){super(`RPC: ${t} with params ${eb(r,null,2)}\n\n ${e.code}: ${e.message}: ${eb(e.data)}`),this.baseError=e,this.request={method:t,params:r}}request;get code(){return this.baseError.code}isType(e){return mm[e]===this.code}};function Am(){return Gh(jh(ah.utils.randomPrivateKey()))}function _m(e){vb(e,Xh,2n**160n-1n,"Ethereum Address ");const t=$h(Vh(pb(e)).padStart(40,"0"));return rb(Boolean(t.match(/^(0x)?[0-9a-f]{40}$/)),"Invalid Ethereum Address Format"),t}Th({},{ethRandomPrivateKey:()=>Am,validateAndParseEthAddress:()=>_m});var xm="undefined"!=typeof globalThis&&globalThis.fetch.bind(globalThis)||"undefined"!=typeof window&&window.fetch.bind(window)||"undefined"!=typeof global&&global.fetch.bind(global)||(()=>{throw new vm("'fetch()' not detected, use the 'baseFetch' constructor parameter to set it")});function Sm(e){return new Promise((t=>{setTimeout(t,e)}))}function Im(e){const t={...e};return delete t.sierra_program_debug_info,t.abi=Vy(eb(e.abi)),t.sierra_program=Vy(eb(e.sierra_program)),t.sierra_program=tm(t.sierra_program),t}function km(e){const t=db(e)?Xp(e):e;return gm(e)?Im(t):{...t,..."program"in t&&{program:tm(t.program)}}}Th({},{Block:()=>Om,createSierraContractClass:()=>Im,getDefaultNodeUrl:()=>Cm,getDefaultNodes:()=>Tm,getSupportedRpcVersions:()=>Bm,parseContract:()=>km,validBlockTags:()=>Mm,wait:()=>Sm});var Cm=(e,t=!1,r)=>{t||Ip.info("Using default public node url, please provide nodeUrl in provider options!");const n=Tm(r??xp.get("rpcVersion"))[e??gp.SN_SEPOLIA];return n[Math.floor(Math.random()*n.length)]};function Tm(e){const t={...Ep};return Object.keys(t).forEach((function(r,n){t[r]=t[r].map((t=>`${t}${function(e){const[t,r]=e.replace(/^v/,"").split(".");return`v${t}_${r}`}(e)}`))})),t}function Bm(){return[...new Set(Object.values(wp))]}var Mm=Object.values(Rp),Om=class{hash=null;number=null;tag=null;setIdentifier(e){if(db(e))if(jb(e))this.number=parseInt(e,10);else if(ub(e))this.hash=e;else{if(!Mm.includes(e))throw TypeError(`Block identifier unmanaged: ${e}`);this.tag=e}else cb(e)?this.hash=pb(e):sb(e)?this.number=e:this.tag=Rp.PENDING;if(sb(this.number)&&this.number<0)throw TypeError(`Block number (${this.number}) can't be negative`)}constructor(e){this.setIdentifier(e)}get queryIdentifier(){return null!==this.number?`blockNumber=${this.number}`:null!==this.hash?`blockHash=${this.hash}`:`blockNumber=${this.tag}`}get identifier(){return null!==this.number?{block_number:this.number}:null!==this.hash?{block_hash:this.hash}:this.tag}set identifier(e){this.setIdentifier(e)}valueOf=()=>this.number;toString=()=>this.hash};Th({},{buildUDCCall:()=>Fm,fromCallsToExecuteCalldata:()=>Nm,fromCallsToExecuteCalldata_cairo1:()=>Pm,getExecuteCalldata:()=>Lm,getVersionsByType:()=>Dm,transformCallsToMulticallArrays:()=>Rm});var Rm=e=>{const t=[],r=[];return e.forEach((e=>{const n=sy.compile(e.calldata||[]);t.push({to:lb(e.contractAddress).toString(10),selector:lb(Nb(e.entrypoint)).toString(10),data_offset:r.length.toString(),data_len:n.length.toString()}),r.push(...n)})),{callArray:t,calldata:sy.compile({calldata:r})}},Nm=e=>{const{callArray:t,calldata:r}=Rm(e);return[...sy.compile({callArray:t}),...r]},Pm=e=>{const t=e.map((e=>({contractAddress:e.contractAddress,entrypoint:e.entrypoint,calldata:Array.isArray(e.calldata)&&"__compiled__"in e.calldata?e.calldata:sy.compile(e.calldata)})));return sy.compile({orderCalls:t})},Lm=(e,t="0")=>"1"===t?Pm(e):Nm(e);function Fm(e,t){const r=[].concat(e).map((e=>{const{classHash:r,salt:n,unique:a=!0,constructorCalldata:i=[]}=e,s=sy.compile(i),o=n??nm();return{call:{contractAddress:dp.ADDRESS,entrypoint:dp.ENTRYPOINT,calldata:[r,o,kb(a),s.length,...s]},address:Hy(a?Go(t,o):o,r,s,a?dp.ADDRESS:0)}}));return{calls:r.map((e=>e.call)),addresses:r.map((e=>e.address))}}function Dm(e){return"fee"===e?{v1:Np.F1,v2:Np.F2,v3:Np.F3}:{v1:Np.V1,v2:Np.V2,v3:Np.V3}}var Um={headers:{"Content-Type":"application/json"},blockIdentifier:Rp.PENDING,retries:200},Hm=class{id="RPC071";channelSpecVersion=wp.v0_7_1;nodeUrl;headers;requestId;blockIdentifier;retries;waitMode;chainId;specVersion;transactionRetryIntervalFallback;batchClient;baseFetch;constructor(e){const{baseFetch:t,batch:r,blockIdentifier:n,chainId:a,headers:i,nodeUrl:s,retries:o,specVersion:c,transactionRetryIntervalFallback:d,waitMode:f}=e||{};Object.values(gp).includes(s)?this.nodeUrl=Cm(s,e?.default,this.channelSpecVersion):this.nodeUrl=s||Cm(void 0,e?.default,this.channelSpecVersion),this.baseFetch=t||xp.get("fetch")||xm,this.blockIdentifier=n??Um.blockIdentifier,this.chainId=a,this.headers={...Um.headers,...i},this.retries=o??Um.retries,this.specVersion=c,this.transactionRetryIntervalFallback=d,this.waitMode=f??!1,this.requestId=0,"number"==typeof r&&(this.batchClient=new tb({nodeUrl:this.nodeUrl,headers:this.headers,interval:r,baseFetch:this.baseFetch})),Ip.debug("Using Channel",this.id)}readSpecVersion(){return this.specVersion}get transactionRetryIntervalDefault(){return this.transactionRetryIntervalFallback??5e3}setChainId(e){this.chainId=e}fetch(e,t,r=0){const n={id:r,jsonrpc:"2.0",method:e,...t&&{params:t}};return this.baseFetch(this.nodeUrl,{method:"POST",body:eb(n),headers:this.headers})}errorHandler(e,t,r,n){if(r)throw new Em(r,e,t);if(n instanceof vm)throw n;if(n)throw Error(n.message)}async fetchEndpoint(e,t){try{if(this.batchClient){const{error:r,result:n}=await this.batchClient.fetch(e,t,this.requestId+=1);return this.errorHandler(e,t,r),n}const r=await this.fetch(e,t,this.requestId+=1),{error:n,result:a}=await r.json();return this.errorHandler(e,t,n),a}catch(r){throw this.errorHandler(e,t,r?.response?.data,r),r}}async getChainId(){return this.chainId??=await this.fetchEndpoint("starknet_chainId"),this.chainId}getSpecVersion(){return this.fetchEndpoint("starknet_specVersion")}async setUpSpecVersion(){if(!this.specVersion){const e=await this.fetchEndpoint("starknet_specVersion");if(Qy(this.channelSpecVersion,e)||Ip.error(_p.channelVersionMismatch,{channelId:this.id,channelSpecVersion:this.channelSpecVersion,nodeSpecVersion:this.specVersion}),!em(e))throw new vm(`${_p.unsupportedSpecVersion}, channelId: ${this.id}`);this.specVersion=e}return this.specVersion}getNonceForAddress(e,t=this.blockIdentifier){const r=pb(e),n=new Om(t).identifier;return this.fetchEndpoint("starknet_getNonce",{contract_address:r,block_id:n})}getBlockLatestAccepted(){return this.fetchEndpoint("starknet_blockHashAndNumber")}getBlockNumber(){return this.fetchEndpoint("starknet_blockNumber")}getBlockWithTxHashes(e=this.blockIdentifier){const t=new Om(e).identifier;return this.fetchEndpoint("starknet_getBlockWithTxHashes",{block_id:t})}getBlockWithTxs(e=this.blockIdentifier){const t=new Om(e).identifier;return this.fetchEndpoint("starknet_getBlockWithTxs",{block_id:t})}getBlockWithReceipts(e=this.blockIdentifier){const t=new Om(e).identifier;return this.fetchEndpoint("starknet_getBlockWithReceipts",{block_id:t})}getBlockStateUpdate(e=this.blockIdentifier){const t=new Om(e).identifier;return this.fetchEndpoint("starknet_getStateUpdate",{block_id:t})}getBlockTransactionsTraces(e=this.blockIdentifier){const t=new Om(e).identifier;return this.fetchEndpoint("starknet_traceBlockTransactions",{block_id:t})}getBlockTransactionCount(e=this.blockIdentifier){const t=new Om(e).identifier;return this.fetchEndpoint("starknet_getBlockTransactionCount",{block_id:t})}getTransactionByHash(e){const t=pb(e);return this.fetchEndpoint("starknet_getTransactionByHash",{transaction_hash:t})}getTransactionByBlockIdAndIndex(e,t){const r=new Om(e).identifier;return this.fetchEndpoint("starknet_getTransactionByBlockIdAndIndex",{block_id:r,index:t})}getTransactionReceipt(e){const t=pb(e);return this.fetchEndpoint("starknet_getTransactionReceipt",{transaction_hash:t})}getTransactionTrace(e){const t=pb(e);return this.fetchEndpoint("starknet_traceTransaction",{transaction_hash:t})}getTransactionStatus(e){const t=pb(e);return this.fetchEndpoint("starknet_getTransactionStatus",{transaction_hash:t})}simulateTransaction(e,t={}){const{blockIdentifier:r=this.blockIdentifier,skipValidate:n=!0,skipFeeCharge:a=!0}=t,i=new Om(r).identifier,s=[];return n&&s.push(Rt.SKIP_VALIDATE),a&&s.push(Rt.SKIP_FEE_CHARGE),this.fetchEndpoint("starknet_simulateTransactions",{block_id:i,transactions:e.map((e=>this.buildTransaction(e))),simulation_flags:s})}async waitForTransaction(e,t){const r=pb(e);let{retries:n}=this,a=!1,i=!1;const s=t?.retryInterval??this.transactionRetryIntervalDefault,o=t?.errorStates??[Nt.REJECTED],c=t?.successStates??[Lt.SUCCEEDED,Nt.ACCEPTED_ON_L2,Nt.ACCEPTED_ON_L1];let d;for(;!a;){await Sm(s);try{d=await this.getTransactionStatus(r);const e=d.execution_status,t=d.finality_status;if(!t){throw new Error("waiting for transaction status")}if(o.includes(e)||o.includes(t)){const r=`${e}: ${t}`,n=new Error(r);throw n.response=d,i=!0,n}(c.includes(e)||c.includes(t))&&(a=!0)}catch(e){if(e instanceof Error&&i)throw e;if(n<=0)throw new Error(`waitForTransaction timed-out with retries ${this.retries}`)}n-=1}let f=null;for(;null===f;){try{f=await this.getTransactionReceipt(r)}catch(e){if(n<=0)throw new Error(`waitForTransaction timed-out with retries ${this.retries}`)}n-=1,await Sm(s)}return f}getStorageAt(e,t,r=this.blockIdentifier){const n=pb(e),a=gb(t),i=new Om(r).identifier;return this.fetchEndpoint("starknet_getStorageAt",{contract_address:n,key:a,block_id:i})}getClassHashAt(e,t=this.blockIdentifier){const r=pb(e),n=new Om(t).identifier;return this.fetchEndpoint("starknet_getClassHashAt",{block_id:n,contract_address:r})}getClass(e,t=this.blockIdentifier){const r=pb(e),n=new Om(t).identifier;return this.fetchEndpoint("starknet_getClass",{class_hash:r,block_id:n})}getClassAt(e,t=this.blockIdentifier){const r=pb(e),n=new Om(t).identifier;return this.fetchEndpoint("starknet_getClassAt",{block_id:n,contract_address:r})}async getEstimateFee(e,{blockIdentifier:t=this.blockIdentifier,skipValidate:r=!0}){const n=new Om(t).identifier,a={simulation_flags:r?[Rt.SKIP_VALIDATE]:[]};return this.fetchEndpoint("starknet_estimateFee",{request:e.map((e=>this.buildTransaction(e,"fee"))),block_id:n,...a})}async invoke(e,t){let r;return Xy(t)?(r=this.fetchEndpoint("starknet_addInvokeTransaction",{invoke_transaction:{type:Ot.INVOKE,sender_address:e.contractAddress,calldata:sy.toHex(e.calldata),version:Ht.V3,signature:sm(e.signature),nonce:pb(t.nonce),resource_bounds:t.resourceBounds,tip:pb(t.tip),paymaster_data:t.paymasterData.map((e=>pb(e))),account_deployment_data:t.accountDeploymentData.map((e=>pb(e))),nonce_data_availability_mode:t.nonceDataAvailabilityMode,fee_data_availability_mode:t.feeDataAvailabilityMode}}),nb(!t.maxFee,(()=>{Ip.warn(_p.maxFeeInV3,{type:Ot.INVOKE})}))):(r=this.fetchEndpoint("starknet_addInvokeTransaction",{invoke_transaction:{sender_address:e.contractAddress,calldata:sy.toHex(e.calldata),type:Ot.INVOKE,max_fee:pb(t.maxFee||0),version:Ht.V1,signature:sm(e.signature),nonce:pb(t.nonce)}}),Ip.warn(_p.legacyTxWarningMessage,{version:Ht.V1,type:Ot.INVOKE})),this.waitMode?this.waitForTransaction((await r).transaction_hash):r}async declare({contract:e,signature:t,senderAddress:r,compiledClassHash:n},a){let i;if(gm(e)||Xy(a))if(gm(e)&&!Xy(a))i=this.fetchEndpoint("starknet_addDeclareTransaction",{declare_transaction:{type:Ot.DECLARE,contract_class:{sierra_program:rm(e.sierra_program),contract_class_version:e.contract_class_version,entry_points_by_type:e.entry_points_by_type,abi:e.abi},compiled_class_hash:n||"",version:Ht.V2,max_fee:pb(a.maxFee||0),signature:sm(t),sender_address:r,nonce:pb(a.nonce)}}),Ip.warn(_p.legacyTxWarningMessage,{version:Ht.V2,type:Ot.DECLARE});else{if(!gm(e)||!Xy(a))throw Error("declare unspotted parameters");i=this.fetchEndpoint("starknet_addDeclareTransaction",{declare_transaction:{type:Ot.DECLARE,sender_address:r,compiled_class_hash:n||"",version:Ht.V3,signature:sm(t),nonce:pb(a.nonce),contract_class:{sierra_program:rm(e.sierra_program),contract_class_version:e.contract_class_version,entry_points_by_type:e.entry_points_by_type,abi:e.abi},resource_bounds:a.resourceBounds,tip:pb(a.tip),paymaster_data:a.paymasterData.map((e=>pb(e))),account_deployment_data:a.accountDeploymentData.map((e=>pb(e))),nonce_data_availability_mode:a.nonceDataAvailabilityMode,fee_data_availability_mode:a.feeDataAvailabilityMode}}),nb(!a.maxFee,(()=>{Ip.warn(_p.maxFeeInV3,{type:Ot.DECLARE})}))}else i=this.fetchEndpoint("starknet_addDeclareTransaction",{declare_transaction:{type:Ot.DECLARE,contract_class:{program:e.program,entry_points_by_type:e.entry_points_by_type,abi:e.abi},version:Ht.V1,max_fee:pb(a.maxFee||0),signature:sm(t),sender_address:r,nonce:pb(a.nonce)}}),Ip.warn(_p.legacyTxWarningMessage,{version:Ht.V1,type:Ot.DECLARE});return this.waitMode?this.waitForTransaction((await i).transaction_hash):i}async deployAccount({classHash:e,constructorCalldata:t,addressSalt:r,signature:n},a){let i;return Xy(a)?(i=this.fetchEndpoint("starknet_addDeployAccountTransaction",{deploy_account_transaction:{type:Ot.DEPLOY_ACCOUNT,version:Ht.V3,signature:sm(n),nonce:pb(a.nonce),contract_address_salt:pb(r||0),constructor_calldata:sy.toHex(t||[]),class_hash:pb(e),resource_bounds:a.resourceBounds,tip:pb(a.tip),paymaster_data:a.paymasterData.map((e=>pb(e))),nonce_data_availability_mode:a.nonceDataAvailabilityMode,fee_data_availability_mode:a.feeDataAvailabilityMode}}),nb(!a.maxFee,(()=>{Ip.warn(_p.maxFeeInV3,{type:Ot.DEPLOY_ACCOUNT})}))):(i=this.fetchEndpoint("starknet_addDeployAccountTransaction",{deploy_account_transaction:{constructor_calldata:sy.toHex(t||[]),class_hash:pb(e),contract_address_salt:pb(r||0),type:Ot.DEPLOY_ACCOUNT,max_fee:pb(a.maxFee||0),version:Ht.V1,signature:sm(n),nonce:pb(a.nonce)}}),Ip.warn(_p.legacyTxWarningMessage,{version:Ht.V1,type:Ot.DEPLOY_ACCOUNT})),this.waitMode?this.waitForTransaction((await i).transaction_hash):i}callContract(e,t=this.blockIdentifier){const r=new Om(t).identifier;return this.fetchEndpoint("starknet_call",{request:{contract_address:e.contractAddress,entry_point_selector:Nb(e.entrypoint),calldata:sy.toHex(e.calldata)},block_id:r})}estimateMessageFee(e,t=this.blockIdentifier){const{from_address:r,to_address:n,entry_point_selector:a,payload:i}=e,s={from_address:_m(r),to_address:pb(n),entry_point_selector:Pb(a),payload:Ib(i)},o=new Om(t).identifier;return this.fetchEndpoint("starknet_estimateMessageFee",{message:s,block_id:o})}getSyncingStats(){return this.fetchEndpoint("starknet_syncing")}getEvents(e){return this.fetchEndpoint("starknet_getEvents",{filter:e})}buildTransaction(e,t){const r=Dm(t);let n;if(Xy(e)?(n={signature:sm(e.signature),nonce:pb(e.nonce),resource_bounds:e.resourceBounds,tip:pb(e.tip),paymaster_data:e.paymasterData.map((e=>pb(e))),nonce_data_availability_mode:e.nonceDataAvailabilityMode,fee_data_availability_mode:e.feeDataAvailabilityMode,account_deployment_data:e.accountDeploymentData.map((e=>pb(e)))},nb(!e.maxFee,(()=>{Ip.warn(_p.maxFeeInV3,{type:e.type,versionType:t})}))):(n={signature:sm(e.signature),nonce:pb(e.nonce),max_fee:pb(e.maxFee||0)},Ip.warn(_p.legacyTxWarningMessage,{version:e.version,type:e.type})),e.type===Tp.INVOKE)return{type:Ot.INVOKE,sender_address:e.contractAddress,calldata:sy.toHex(e.calldata),version:pb(e.version||r.v3),...n};if(e.type===Tp.DECLARE)return gm(e.contract)?{type:e.type,contract_class:{...e.contract,sierra_program:rm(e.contract.sierra_program)},compiled_class_hash:e.compiledClassHash||"",sender_address:e.senderAddress,version:pb(e.version||r.v3),...n}:{type:e.type,contract_class:e.contract,sender_address:e.senderAddress,version:pb(e.version||r.v1),...n};if(e.type===Tp.DEPLOY_ACCOUNT){const{account_deployment_data:t,...a}=n;return{type:e.type,constructor_calldata:sy.toHex(e.constructorCalldata||[]),class_hash:pb(e.classHash),contract_address_salt:pb(e.addressSalt||0),version:pb(e.version||r.v3),...a}}throw Error("RPC buildTransaction received unknown TransactionType")}},jm={};Th(jm,{RpcChannel:()=>$m});var Vm={headers:{"Content-Type":"application/json"},blockIdentifier:Rp.PENDING,retries:200},$m=class{id="RPC081";channelSpecVersion=wp.v0_8_1;nodeUrl;headers;requestId;blockIdentifier;retries;waitMode;chainId;specVersion;transactionRetryIntervalFallback;batchClient;baseFetch;constructor(e){const{baseFetch:t,batch:r,blockIdentifier:n,chainId:a,headers:i,nodeUrl:s,retries:o,specVersion:c,transactionRetryIntervalFallback:d,waitMode:f}=e||{};Object.values(gp).includes(s)?this.nodeUrl=Cm(s,e?.default,this.channelSpecVersion):this.nodeUrl=s||Cm(void 0,e?.default,this.channelSpecVersion),this.baseFetch=t||xp.get("fetch")||xm,this.blockIdentifier=n??Vm.blockIdentifier,this.chainId=a,this.headers={...Vm.headers,...i},this.retries=o??Vm.retries,this.specVersion=c,this.transactionRetryIntervalFallback=d,this.waitMode=f??!1,this.requestId=0,"number"==typeof r&&(this.batchClient=new tb({nodeUrl:this.nodeUrl,headers:this.headers,interval:r,baseFetch:this.baseFetch})),Ip.debug("Using Channel",this.id)}readSpecVersion(){return this.specVersion}get transactionRetryIntervalDefault(){return this.transactionRetryIntervalFallback??5e3}setChainId(e){this.chainId=e}fetch(e,t,r=0){const n={id:r,jsonrpc:"2.0",method:e,...t&&{params:t}};return this.baseFetch(this.nodeUrl,{method:"POST",body:eb(n),headers:this.headers})}errorHandler(e,t,r,n){if(r)throw new Em(r,e,t);if(n instanceof vm)throw n;if(n)throw Error(n.message)}async fetchEndpoint(e,t){try{if(this.batchClient){const{error:r,result:n}=await this.batchClient.fetch(e,t,this.requestId+=1);return this.errorHandler(e,t,r),n}const r=await this.fetch(e,t,this.requestId+=1),{error:n,result:a}=await r.json();return this.errorHandler(e,t,n),a}catch(r){throw this.errorHandler(e,t,r?.response?.data,r),r}}async getChainId(){return this.chainId??=await this.fetchEndpoint("starknet_chainId"),this.chainId}getSpecVersion(){return this.fetchEndpoint("starknet_specVersion")}async setUpSpecVersion(){if(!this.specVersion){const e=await this.fetchEndpoint("starknet_specVersion");if(Qy(this.channelSpecVersion,e)||Ip.error(_p.channelVersionMismatch,{channelId:this.id,channelSpecVersion:this.channelSpecVersion,nodeSpecVersion:this.specVersion}),!em(e))throw new vm(`${_p.unsupportedSpecVersion}, channelId: ${this.id}`);this.specVersion=e}return this.specVersion}getMessagesStatus(e){const t=pb(e);return this.fetchEndpoint("starknet_getMessagesStatus",{transaction_hash:t})}getStorageProof(e=[],t=[],r=[],n=this.blockIdentifier){const a=new Om(n).identifier,i=Ab(e),s=Ab(t);return this.fetchEndpoint("starknet_getStorageProof",{block_id:a,class_hashes:i,contract_addresses:s,contracts_storage_keys:r})}getCompiledCasm(e){const t=pb(e);return this.fetchEndpoint("starknet_getCompiledCasm",{class_hash:t})}getNonceForAddress(e,t=this.blockIdentifier){const r=pb(e),n=new Om(t).identifier;return this.fetchEndpoint("starknet_getNonce",{contract_address:r,block_id:n})}getBlockLatestAccepted(){return this.fetchEndpoint("starknet_blockHashAndNumber")}getBlockNumber(){return this.fetchEndpoint("starknet_blockNumber")}getBlockWithTxHashes(e=this.blockIdentifier){const t=new Om(e).identifier;return this.fetchEndpoint("starknet_getBlockWithTxHashes",{block_id:t})}getBlockWithTxs(e=this.blockIdentifier){const t=new Om(e).identifier;return this.fetchEndpoint("starknet_getBlockWithTxs",{block_id:t})}getBlockWithReceipts(e=this.blockIdentifier){const t=new Om(e).identifier;return this.fetchEndpoint("starknet_getBlockWithReceipts",{block_id:t})}getBlockStateUpdate(e=this.blockIdentifier){const t=new Om(e).identifier;return this.fetchEndpoint("starknet_getStateUpdate",{block_id:t})}getBlockTransactionsTraces(e=this.blockIdentifier){const t=new Om(e).identifier;return this.fetchEndpoint("starknet_traceBlockTransactions",{block_id:t})}getBlockTransactionCount(e=this.blockIdentifier){const t=new Om(e).identifier;return this.fetchEndpoint("starknet_getBlockTransactionCount",{block_id:t})}getTransactionByHash(e){const t=pb(e);return this.fetchEndpoint("starknet_getTransactionByHash",{transaction_hash:t})}getTransactionByBlockIdAndIndex(e,t){const r=new Om(e).identifier;return this.fetchEndpoint("starknet_getTransactionByBlockIdAndIndex",{block_id:r,index:t})}getTransactionReceipt(e){const t=pb(e);return this.fetchEndpoint("starknet_getTransactionReceipt",{transaction_hash:t})}getTransactionTrace(e){const t=pb(e);return this.fetchEndpoint("starknet_traceTransaction",{transaction_hash:t})}getTransactionStatus(e){const t=pb(e);return this.fetchEndpoint("starknet_getTransactionStatus",{transaction_hash:t})}simulateTransaction(e,t={}){const{blockIdentifier:r=this.blockIdentifier,skipValidate:n=!0,skipFeeCharge:a=!0}=t,i=new Om(r).identifier,s=[];return n&&s.push(gr.SKIP_VALIDATE),a&&s.push(gr.SKIP_FEE_CHARGE),this.fetchEndpoint("starknet_simulateTransactions",{block_id:i,transactions:e.map((e=>this.buildTransaction(e))),simulation_flags:s})}async waitForTransaction(e,t){const r=pb(e);let{retries:n}=this,a=!1,i=!1;const s=t?.retryInterval??this.transactionRetryIntervalDefault,o=t?.errorStates??[yr.REJECTED],c=t?.successStates??[wr.SUCCEEDED,yr.ACCEPTED_ON_L2,yr.ACCEPTED_ON_L1];let d;for(;!a;){await Sm(s);try{d=await this.getTransactionStatus(r);const e=d.execution_status,t=d.finality_status;if(!t){throw new Error("waiting for transaction status")}if(o.includes(e)||o.includes(t)){const r=`${e}: ${t}`,n=new Error(r);throw n.response=d,i=!0,n}(c.includes(e)||c.includes(t))&&(a=!0)}catch(e){if(e instanceof Error&&i)throw e;if(n<=0)throw new Error(`waitForTransaction timed-out with retries ${this.retries}`)}n-=1}let f=null;for(;null===f;){try{f=await this.getTransactionReceipt(r)}catch(e){if(n<=0)throw new Error(`waitForTransaction timed-out with retries ${this.retries}`)}n-=1,await Sm(s)}return f}getStorageAt(e,t,r=this.blockIdentifier){const n=pb(e),a=gb(t),i=new Om(r).identifier;return this.fetchEndpoint("starknet_getStorageAt",{contract_address:n,key:a,block_id:i})}getClassHashAt(e,t=this.blockIdentifier){const r=pb(e),n=new Om(t).identifier;return this.fetchEndpoint("starknet_getClassHashAt",{block_id:n,contract_address:r})}getClass(e,t=this.blockIdentifier){const r=pb(e),n=new Om(t).identifier;return this.fetchEndpoint("starknet_getClass",{class_hash:r,block_id:n})}getClassAt(e,t=this.blockIdentifier){const r=pb(e),n=new Om(t).identifier;return this.fetchEndpoint("starknet_getClassAt",{block_id:n,contract_address:r})}async getEstimateFee(e,{blockIdentifier:t=this.blockIdentifier,skipValidate:r=!0}){const n=new Om(t).identifier,a={simulation_flags:r?[gr.SKIP_VALIDATE]:[]};return this.fetchEndpoint("starknet_estimateFee",{request:e.map((e=>this.buildTransaction(e,"fee"))),block_id:n,...a})}async invoke(e,t){let r;if(!Xy(t))throw Error(_p.legacyTxRPC08Message);if(!Hp(t.resourceBounds))throw Error(_p.SWOldV3);return r=this.fetchEndpoint("starknet_addInvokeTransaction",{invoke_transaction:{type:br.INVOKE,sender_address:e.contractAddress,calldata:sy.toHex(e.calldata),version:_r.V3,signature:sm(e.signature),nonce:pb(t.nonce),resource_bounds:t.resourceBounds,tip:pb(t.tip),paymaster_data:t.paymasterData.map((e=>pb(e))),account_deployment_data:t.accountDeploymentData.map((e=>pb(e))),nonce_data_availability_mode:t.nonceDataAvailabilityMode,fee_data_availability_mode:t.feeDataAvailabilityMode}}),this.waitMode?this.waitForTransaction((await r).transaction_hash):r}async declare({contract:e,signature:t,senderAddress:r,compiledClassHash:n},a){let i;if(!gm(e)||!Xy(a))throw Error(_p.legacyTxRPC08Message);if(!Hp(a.resourceBounds))throw Error(_p.SWOldV3);return i=this.fetchEndpoint("starknet_addDeclareTransaction",{declare_transaction:{type:br.DECLARE,sender_address:r,compiled_class_hash:n||"",version:_r.V3,signature:sm(t),nonce:pb(a.nonce),contract_class:{sierra_program:rm(e.sierra_program),contract_class_version:e.contract_class_version,entry_points_by_type:e.entry_points_by_type,abi:e.abi},resource_bounds:a.resourceBounds,tip:pb(a.tip),paymaster_data:a.paymasterData.map((e=>pb(e))),account_deployment_data:a.accountDeploymentData.map((e=>pb(e))),nonce_data_availability_mode:a.nonceDataAvailabilityMode,fee_data_availability_mode:a.feeDataAvailabilityMode}}),this.waitMode?this.waitForTransaction((await i).transaction_hash):i}async deployAccount({classHash:e,constructorCalldata:t,addressSalt:r,signature:n},a){let i;if(!Xy(a))throw Error(_p.legacyTxRPC08Message);if(!Hp(a.resourceBounds))throw Error(_p.SWOldV3);return i=this.fetchEndpoint("starknet_addDeployAccountTransaction",{deploy_account_transaction:{type:br.DEPLOY_ACCOUNT,version:_r.V3,signature:sm(n),nonce:pb(a.nonce),contract_address_salt:pb(r||0),constructor_calldata:sy.toHex(t||[]),class_hash:pb(e),resource_bounds:a.resourceBounds,tip:pb(a.tip),paymaster_data:a.paymasterData.map((e=>pb(e))),nonce_data_availability_mode:a.nonceDataAvailabilityMode,fee_data_availability_mode:a.feeDataAvailabilityMode}}),this.waitMode?this.waitForTransaction((await i).transaction_hash):i}callContract(e,t=this.blockIdentifier){const r=new Om(t).identifier;return this.fetchEndpoint("starknet_call",{request:{contract_address:e.contractAddress,entry_point_selector:Nb(e.entrypoint),calldata:sy.toHex(e.calldata)},block_id:r})}estimateMessageFee(e,t=this.blockIdentifier){const{from_address:r,to_address:n,entry_point_selector:a,payload:i}=e,s={from_address:_m(r),to_address:pb(n),entry_point_selector:Pb(a),payload:Ib(i)},o=new Om(t).identifier;return this.fetchEndpoint("starknet_estimateMessageFee",{message:s,block_id:o})}getSyncingStats(){return this.fetchEndpoint("starknet_syncing")}getEvents(e){return this.fetchEndpoint("starknet_getEvents",{filter:e})}buildTransaction(e,t){const r=Dm(t);let n;if(!Xy(e))throw Error("v0,v1,v2 tx are not supported on RPC 0.8");if(n={signature:sm(e.signature),nonce:pb(e.nonce),resource_bounds:e.resourceBounds,tip:pb(e.tip),paymaster_data:e.paymasterData.map((e=>pb(e))),nonce_data_availability_mode:e.nonceDataAvailabilityMode,fee_data_availability_mode:e.feeDataAvailabilityMode,account_deployment_data:e.accountDeploymentData.map((e=>pb(e)))},e.type===Tp.INVOKE)return{type:br.INVOKE,sender_address:e.contractAddress,calldata:sy.toHex(e.calldata),version:pb(e.version||r.v3),...n};if(e.type===Tp.DECLARE){if(!gm(e.contract))throw Ip.error("Cairo 0 - non Sierra v1 tx are not supported"),Error("Declaring non Sierra contract using RPC 0.8");return{type:e.type,contract_class:{...e.contract,sierra_program:rm(e.contract.sierra_program)},compiled_class_hash:e.compiledClassHash||"",sender_address:e.senderAddress,version:pb(e.version||r.v3),...n}}if(e.type===Tp.DEPLOY_ACCOUNT){const{account_deployment_data:t,...a}=n;return{type:e.type,constructor_calldata:sy.toHex(e.constructorCalldata||[]),class_hash:pb(e.classHash),contract_address_salt:pb(e.addressSalt||0),version:pb(e.version||r.v3),...a}}throw Error("RPC buildTransaction received unknown TransactionType")}},zm=("undefined"!=typeof WebSocket&&WebSocket||"undefined"!=typeof globalThis&&globalThis.WebSocket||"undefined"!=typeof window&&window.WebSocket&&window.WebSocket.bind(window)||"undefined"!=typeof global&&global.WebSocket,class{margin;constructor(e){this.margin=e}estimatedFeeToMaxFee(e){return om(e,this.margin?.maxFee)}estimateFeeToBounds(e){return cm(e,this.margin?.bounds)}parseGetBlockResponse(e){return e}parseTransactionReceipt(e){return e}parseFeeEstimateResponse(e){const t=e[0];return{overall_fee:lb(t.overall_fee),unit:t.unit,l1_gas_consumed:hb(t.l1_gas_consumed)??hb(t.gas_consumed)??0n,l1_gas_price:hb(t.l1_gas_price)??hb(t.gas_price)??0n,l2_gas_consumed:hb(t.l2_gas_consumed)??void 0,l2_gas_price:hb(t.l2_gas_price)??void 0,l1_data_gas_consumed:hb(t.l1_data_gas_consumed)??hb(t.data_gas_consumed)??0n,l1_data_gas_price:hb(t.l1_data_gas_price)??hb(t.gas_price)??0n,suggestedMaxFee:this.estimatedFeeToMaxFee(t.overall_fee),resourceBounds:this.estimateFeeToBounds(t)}}parseFeeEstimateBulkResponse(e){return e.map((e=>({overall_fee:lb(e.overall_fee),unit:e.unit,l1_gas_consumed:hb(e.l1_gas_consumed)??hb(e.gas_consumed)??0n,l1_gas_price:hb(e.l1_gas_price)??hb(e.gas_price)??0n,l2_gas_consumed:hb(e.l2_gas_consumed)??void 0,l2_gas_price:hb(e.l2_gas_price)??void 0,l1_data_gas_consumed:hb(e.l1_data_gas_consumed)??hb(e.data_gas_consumed)??0n,l1_data_gas_price:hb(e.l1_data_gas_price)??hb(e.gas_price)??0n,suggestedMaxFee:this.estimatedFeeToMaxFee(e.overall_fee),resourceBounds:this.estimateFeeToBounds(e)})))}parseSimulateTransactionResponse(e){return e.map((e=>({...e,suggestedMaxFee:this.estimatedFeeToMaxFee(e.fee_estimation.overall_fee),resourceBounds:this.estimateFeeToBounds(e.fee_estimation)})))}parseContractClassResponse(e){return{...e,abi:db(e.abi)?JSON.parse(e.abi):e.abi}}parseL1GasPriceResponse(e){return e.l1_gas_price.price_in_wei}}),qm=class e{statusReceipt;value;constructor(t){[this.statusReceipt,this.value]=e.isSuccess(t)?["success",t]:e.isReverted(t)?["reverted",t]:["error",new Error("Unknown response type")];for(const[e]of Object.entries(this))Object.defineProperty(this,e,{enumerable:!1});for(const[e,r]of Object.entries(t))Object.defineProperty(this,e,{enumerable:!0,writable:!1,value:r})}match(e){return this.statusReceipt in e?e[this.statusReceipt](this.value):e._()}isSuccess(){return"success"===this.statusReceipt}isReverted(){return"reverted"===this.statusReceipt}isError(){return"error"===this.statusReceipt}static isSuccess(e){return e.execution_status===Mp.SUCCEEDED}static isReverted(e){return e.execution_status===Mp.REVERTED}},Km={};Th(Km,{encodeData:()=>ow,encodeType:()=>aw,encodeValue:()=>sw,getDependencies:()=>nw,getMessageHash:()=>dw,getStructHash:()=>cw,getTypeHash:()=>iw,isMerkleTreeType:()=>rw,prepareSelector:()=>tw,validateTypedData:()=>ew,verifyMessage:()=>fw});Th({},{MerkleTree:()=>Gm,proofMerklePath:()=>Jm});var Gm=class e{leaves;branches=[];root;hashMethod;constructor(e,t=Py){this.hashMethod=t,this.leaves=e,this.root=this.build(e)}build(t){if(1===t.length)return t[0];t.length!==this.leaves.length&&this.branches.push(t);const r=[];for(let n=0;n<t.length;n+=2)n+1===t.length?r.push(e.hash(t[n],"0x0",this.hashMethod)):r.push(e.hash(t[n],t[n+1],this.hashMethod));return this.build(r)}static hash(e,t,r=Py){const[n,a]=[BigInt(e),BigInt(t)].sort(((e,t)=>e>=t?1:-1));return r(n,a)}getProof(t,r=this.leaves,n=[]){const a=r.indexOf(t);if(-1===a)throw new Error("leaf not found");if(1===r.length)return n;const i=a%2==0,s=(i?r[a+1]:r[a-1])??"0x0",o=[...n,s],c=this.leaves.length===r.length?-1:this.branches.findIndex((e=>e.length===r.length)),d=this.branches[c+1]??[this.root];return this.getProof(e.hash(i?t:s,i?s:t,this.hashMethod),d,o)}};function Jm(e,t,r,n=Py){if(0===r.length)return e===t;const[a,...i]=r;return Jm(e,Gm.hash(t,a,n),i,n)}var Wm={u256:JSON.parse('[{ "name": "low", "type": "u128" }, { "name": "high", "type": "u128" }]'),TokenAmount:JSON.parse('[{ "name": "token_address", "type": "ContractAddress" }, { "name": "amount", "type": "u256" }]'),NftId:JSON.parse('[{ "name": "collection_address", "type": "ContractAddress" }, { "name": "token_id", "type": "u256" }]')},Ym={[zt.ACTIVE]:{domain:"StarknetDomain",hashMethod:Uy,hashMerkleMethod:Ly,escapeTypeString:e=>`"${e}"`,presetTypes:Wm},[zt.LEGACY]:{domain:"StarkNetDomain",hashMethod:Dy,hashMerkleMethod:Py,escapeTypeString:e=>e,presetTypes:{}}};function Zm(e,t,{min:r,max:n}){const a=BigInt(e);rb(a>=r&&a<=n,`${a} (${t}) is out of bounds [${r}, ${n}]`)}function Xm({types:e,domain:t}){return Ym[zt.ACTIVE].domain in e&&t.revision===zt.ACTIVE?zt.ACTIVE:Ym[zt.LEGACY].domain in e&&(t.revision??zt.LEGACY)===zt.LEGACY?zt.LEGACY:void 0}function Qm(e){try{return pb(e)}catch(t){if(db(e))return pb(Kb(e));throw new Error(`Invalid BigNumberish: ${e}`)}}function ew(e){const t=e;return Boolean(t.message&&t.primaryType&&t.types&&Xm(t))}function tw(e){return ub(e)?e:Nb(e)}function rw(e){return"merkletree"===e.type}function nw(e,t,r=[],n="",a=zt.LEGACY){let i=[t];return"*"===t[t.length-1]?i=[t.slice(0,-1)]:a===zt.ACTIVE&&("enum"===t?i=[n]:t.match(/^\(.*\)$/)&&(i=t.slice(1,-1).split(",").map((e=>"*"===e[e.length-1]?e.slice(0,-1):e)))),i.filter((t=>!r.includes(t)&&e[t])).reduce(((t,r)=>[...t,...[r,...e[r].reduce(((t,r)=>[...t,...nw(e,r.type,t,r.contains,a).filter((e=>!t.includes(e)))]),[])].filter((e=>!t.includes(e)))]),[])}function aw(e,t,r=zt.LEGACY){const n=r===zt.ACTIVE?{...e,...Ym[r].presetTypes}:e,[a,...i]=nw(n,t,void 0,void 0,r),s=a?[a,...i.sort()]:[],o=Ym[r].escapeTypeString;return s.map((e=>{const t=n[e].map((e=>{const t="enum"===e.type&&r===zt.ACTIVE?e.contains:e.type,n=t.match(/^\(.*\)$/)?`(${t.slice(1,-1).split(",").map((e=>e?o(e):e)).join(",")})`:o(t);return`${o(e.name)}:${n}`}));return`${o(e)}(${t})`})).join("")}function iw(e,t,r=zt.LEGACY){return Nb(aw(e,t,r))}function sw(e,t,r,n={},a=zt.LEGACY){if(e[t])return[t,cw(e,t,r,a)];if(Ym[a].presetTypes[t])return[t,cw(Ym[a].presetTypes,t,r,a)];if(t.endsWith("*")){const n=r.map((r=>sw(e,t.slice(0,-1),r,void 0,a)[1]));return[t,Ym[a].hashMethod(n)]}switch(t){case"enum":if(a===zt.ACTIVE){const[i,s]=Object.entries(r)[0],o=e[n.parent].find((e=>e.name===n.key)),c=e[o.contains],d=c.find((e=>e.name===i)),f=c.indexOf(d),u=d.type.slice(1,-1).split(",").map(((t,r)=>{if(!t)return t;const n=s[r];return sw(e,t,n,void 0,a)[1]}));return[t,Ym[a].hashMethod([f,...u])]}return[t,Qm(r)];case"merkletree":{const t=function(e,t){if(t.parent&&t.key){const r=e[t.parent].find((e=>e.name===t.key));if(!rw(r))throw new Error(`${t.key} is not a merkle tree`);if(r.contains.endsWith("*"))throw new Error(`Merkle tree contain property must not be an array but was given ${t.key}`);return r.contains}return"raw"}(e,n),i=r.map((r=>sw(e,t,r,void 0,a)[1])),{root:s}=new Gm(i,Ym[a].hashMerkleMethod);return["felt",s]}case"selector":return["felt",tw(r)];case"string":if(a===zt.ACTIVE){const e=Wb(r),n=[e.data.length,...e.data,e.pending_word,e.pending_word_len];return[t,Ym[a].hashMethod(n)]}return[t,Qm(r)];case"i128":if(a===zt.ACTIVE){const e=BigInt(r);return Zm(e,t,op),[t,Qm(e<0n?rp+e:e)]}return[t,Qm(r)];case"timestamp":case"u128":return a===zt.ACTIVE&&Zm(r,t,cp),[t,Qm(r)];case"felt":case"shortstring":return a===zt.ACTIVE&&Zm(Qm(r),t,sp),[t,Qm(r)];case"ClassHash":case"ContractAddress":return a===zt.ACTIVE&&Zm(r,t,sp),[t,Qm(r)];case"bool":return a===zt.ACTIVE&&rb(ob(r),`Type mismatch for ${t} ${r}`),[t,Qm(r)];default:if(a===zt.ACTIVE)throw new Error(`Unsupported type: ${t}`);return[t,Qm(r)]}}function ow(e,t,r,n=zt.LEGACY){const a=e[t]??Ym[n].presetTypes[t],[i,s]=a.reduce((([a,i],s)=>{if(void 0===r[s.name]||null===r[s.name]&&"enum"!==s.type)throw new Error(`Cannot encode data: missing data for '${s.name}'`);const o=r[s.name],c={parent:t,key:s.name},[d,f]=sw(e,s.type,o,c,n);return[[...a,d],[...i,f]]}),[["felt"],[iw(e,t,n)]]);return[i,s]}function cw(e,t,r,n=zt.LEGACY){return Ym[n].hashMethod(ow(e,t,r,n)[1])}function dw(e,t){if(!ew(e))throw new Error("Typed data does not match JSON schema");const r=Xm(e),{domain:n,hashMethod:a}=Ym[r];return a([Kb("StarkNet Message"),cw(e.types,n,e.domain,r),t,cw(e.types,e.primaryType,e.message,r)])}function fw(e,t,r,n){const a=ew(e);if(!Mb(e)&&!a)throw new Error("message has a wrong format.");if(a&&void 0===n)throw new Error("When providing a TypedData in message parameter, the accountAddress parameter has to be provided.");if(a&&!Mb(n))throw new Error("accountAddress shall be a BigNumberish");const i=a?dw(e,n):pb(e);return Bo(Array.isArray(t)?new Ro(BigInt(t[0]),BigInt(t[1])):t,i,pb(r))}var uw=class{responseParser;channel;constructor(e){if(e&&"channel"in e)this.channel=e.channel,this.responseParser="responseParser"in e?e.responseParser:new zm;else{if(e&&e.specVersion)if(Qy("0.8",e.specVersion))this.channel=new jm.RpcChannel({...e,waitMode:!1});else{if(!Qy("0.7",e.specVersion))throw new Error(`unsupported channel for spec version: ${e.specVersion}`);this.channel=new kp.RpcChannel({...e,waitMode:!1})}else if(Qy("0.8",xp.get("rpcVersion")))this.channel=new jm.RpcChannel({...e,waitMode:!1});else{if(!Qy("0.7",xp.get("rpcVersion")))throw new Error("unable to define spec version for channel");this.channel=new kp.RpcChannel({...e,waitMode:!1})}this.responseParser=new zm(e?.feeMarginPercentage)}}static async create(e){const t=new kp.RpcChannel({...e}),r=await t.getSpecVersion();if(em(r)||Ip.warn(`Using incompatible node spec version ${r}`),Qy("0.7",r))return new this({...e,specVersion:wp.v0_7_1});if(Qy("0.8",r))return new this({...e,specVersion:wp.v0_8_1});throw new vm(`Provided RPC node specification version ${r} is not compatible with the SDK. SDK supported RPC versions ${Object.keys(wp).toString()}`)}fetch(e,t,r=0){return this.channel.fetch(e,t,r)}async getChainId(){return this.channel.getChainId()}readSpecVersion(){return this.channel.readSpecVersion()}async getSpecVersion(){return this.channel.getSpecVersion()}setUpSpecVersion(){return this.channel.setUpSpecVersion()}async getNonceForAddress(e,t){return this.channel.getNonceForAddress(e,t)}async getBlock(e){return this.channel.getBlockWithTxHashes(e).then(this.responseParser.parseGetBlockResponse)}async getBlockLatestAccepted(){return this.channel.getBlockLatestAccepted()}async getBlockNumber(){return this.channel.getBlockNumber()}async getBlockWithTxHashes(e){return this.channel.getBlockWithTxHashes(e)}async getBlockWithTxs(e){return this.channel.getBlockWithTxs(e)}async waitForBlock(e="pending",t=5e3){if(e===Rp.LATEST)return;const r=await this.getBlockNumber(),n=e===Rp.PENDING?r+1:Number(pb(e));if(n<=r)return;const{retries:a}=this.channel;let i=a,s=!1;for(;!s;){if(await this.getBlockNumber()===n?s=!0:await Sm(t),i-=1,i<=0)throw new Error(`waitForBlock() timed-out after ${a} tries.`)}}async getL1GasPrice(e){return this.channel.getBlockWithTxHashes(e).then(this.responseParser.parseL1GasPriceResponse)}async getL1MessageHash(e){const t=await this.channel.getTransactionByHash(e);rb("L1_HANDLER"===t.type,"This L2 transaction is not a L1 message.");const{calldata:r,contract_address:n,entry_point_selector:a,nonce:i}=t;return Lb([r[0],n,i,a,r.length-1,...r.slice(1)])}async getBlockWithReceipts(e){return this.channel.getBlockWithReceipts(e)}getStateUpdate=this.getBlockStateUpdate;async getBlockStateUpdate(e){return this.channel.getBlockStateUpdate(e)}async getBlockTransactionsTraces(e){return this.channel.getBlockTransactionsTraces(e)}async getBlockTransactionCount(e){return this.channel.getBlockTransactionCount(e)}async getTransaction(e){return this.channel.getTransactionByHash(e)}async getTransactionByHash(e){return this.channel.getTransactionByHash(e)}async getTransactionByBlockIdAndIndex(e,t){return this.channel.getTransactionByBlockIdAndIndex(e,t)}async getTransactionReceipt(e){const t=await this.channel.getTransactionReceipt(e),r=this.responseParser.parseTransactionReceipt(t);return new qm(r)}async getTransactionTrace(e){return this.channel.getTransactionTrace(e)}async getTransactionStatus(e){return this.channel.getTransactionStatus(e)}async getSimulateTransaction(e,t){return this.channel.simulateTransaction(e,t).then((e=>this.responseParser.parseSimulateTransactionResponse(e)))}async waitForTransaction(e,t){const r=await this.channel.waitForTransaction(e,t);return new qm(r)}async getStorageAt(e,t,r){return this.channel.getStorageAt(e,t,r)}async getClassHashAt(e,t){return this.channel.getClassHashAt(e,t)}async getClassByHash(e){return this.getClass(e)}async getClass(e,t){return this.channel.getClass(e,t).then(this.responseParser.parseContractClassResponse)}async getClassAt(e,t){return this.channel.getClassAt(e,t).then(this.responseParser.parseContractClassResponse)}async getContractVersion(e,t,{blockIdentifier:r=this.channel.blockIdentifier,compiler:n=!0}={}){let a;if(e)a=await this.getClassAt(e,r);else{if(!t)throw Error("getContractVersion require contractAddress or classHash");a=await this.getClass(t,r)}if(gm(a)){if(n){return{cairo:"1",compiler:Ig(a.abi).compiler}}return{cairo:"1",compiler:void 0}}return{cairo:"0",compiler:"0"}}async getInvokeEstimateFee(e,t,r,n){return this.channel.getEstimateFee([{type:Tp.INVOKE,...e,...t}],{blockIdentifier:r,skipValidate:n}).then((e=>this.responseParser.parseFeeEstimateResponse(e)))}async getDeclareEstimateFee(e,t,r,n){return this.channel.getEstimateFee([{type:Tp.DECLARE,...e,...t}],{blockIdentifier:r,skipValidate:n}).then((e=>this.responseParser.parseFeeEstimateResponse(e)))}async getDeployAccountEstimateFee(e,t,r,n){return this.channel.getEstimateFee([{type:Tp.DEPLOY_ACCOUNT,...e,...t}],{blockIdentifier:r,skipValidate:n}).then((e=>this.responseParser.parseFeeEstimateResponse(e)))}async getEstimateFeeBulk(e,t){return this.channel.getEstimateFee(e,t).then((e=>this.responseParser.parseFeeEstimateBulkResponse(e)))}async invokeFunction(e,t){return this.channel.invoke(e,t)}async declareContract(e,t){return this.channel.declare(e,t)}async deployAccountContract(e,t){return this.channel.deployAccount(e,t)}async callContract(e,t){return this.channel.callContract(e,t)}async estimateMessageFee(e,t){return this.channel.estimateMessageFee(e,t)}async getSyncingStats(){return this.channel.getSyncingStats()}async getEvents(e){return this.channel.getEvents(e)}async verifyMessageInStarknet(e,t,r,n,a){const i=ew(e);if(!Mb(e)&&!i)throw new Error("message has a wrong format.");if(!Mb(r))throw new Error("accountAddress shall be a BigNumberish");const s=i?dw(e,r):pb(e),o=n?[n]:["isValidSignature","is_valid_signature"],c=a||{okResponse:[],nokResponse:["0x0","0x00"],error:["argent/invalid-signature","0x617267656e742f696e76616c69642d7369676e6174757265","is invalid, with respect to the public key","0x697320696e76616c6964","INVALID_SIG","0x494e56414c49445f534947"]};let d;for(const e of o)try{const n=await this.callContract({contractAddress:pb(r),entrypoint:e,calldata:sy.compile({hash:lb(s).toString(),signature:am(t)})});if(c.nokResponse.includes(n[0].toString()))return!1;if(0===c.okResponse.length||c.okResponse.includes(n[0].toString()))return!0;throw Error("signatureVerificationResponse Error: response is not part of known responses")}catch(e){if(c.error.some((t=>e.message.includes(t))))return!1;d=e}throw Error(`Signature verification Error: ${d}`)}async isClassDeclared(e,t){let r;if(!e.classHash&&"contract"in e){r=ym(e).classHash}else{if(!e.classHash)throw Error("contractClassIdentifier type not satisfied");r=e.classHash}try{return await this.getClass(r,t)instanceof Object}catch(e){if(e instanceof vm)return!1;throw e}}async prepareInvocations(e){const t=[];for(const r of e)if(r.type===Tp.DECLARE){await this.isClassDeclared("payload"in r?r.payload:r)||t.unshift(r)}else t.push(r);return t}async getL1MessagesStatus(e){if(this.channel instanceof jm.RpcChannel)return this.channel.getMessagesStatus(e);throw new vm("Unsupported method for RPC version")}async getStorageProof(e,t,r,n){if(this.channel instanceof jm.RpcChannel)return this.channel.getStorageProof(e,t,r,n);throw new vm("Unsupported method for RPC version")}async getCompiledCasm(e){if(this.channel instanceof jm.RpcChannel)return this.channel.getCompiledCasm(e);throw new vm("Unsupported method for RPC version")}};Th({},{StarknetIdContract:()=>Ew,StarknetIdIdentityContract:()=>_w,StarknetIdMulticallContract:()=>Sw,StarknetIdPfpContract:()=>Tw,StarknetIdPopContract:()=>Mw,StarknetIdVerifierContract:()=>kw,dynamicCallData:()=>Pw,dynamicFelt:()=>Nw,execution:()=>Rw,getStarknetIdContract:()=>Aw,getStarknetIdIdentityContract:()=>xw,getStarknetIdMulticallContract:()=>Iw,getStarknetIdPfpContract:()=>Bw,getStarknetIdPopContract:()=>Ow,getStarknetIdVerifierContract:()=>Cw,isStarkDomain:()=>Lw,useDecoded:()=>ww,useEncoded:()=>vw});var lw="abcdefghijklmnopqrstuvwxyz0123456789-",hw=BigInt(lw.length+1),pw="这来",bw=BigInt(lw.length),gw=BigInt(pw.length),yw=BigInt(pw.length+1);function mw(e){let t=0;for(;e.endsWith(pw[pw.length-1]);)e=e.substring(0,e.length-1),t+=1;return[e,t]}function ww(e){let t="";return e.forEach((e=>{for(;e!==Xh;){const r=e%hw;if(e/=hw,r===BigInt(lw.length)){const r=e/yw;if(r===Xh){const n=e%yw;e=r,t+=n===Xh?lw[0]:pw[Number(n)-1]}else{t+=pw[Number(e%gw)],e/=gw}}else t+=lw[Number(r)]}const[r,n]=mw(t);n&&(t=r+(n%2==0?pw[pw.length-1].repeat(n/2-1)+pw[0]+lw[1]:pw[pw.length-1].repeat((n-1)/2+1))),t+="."})),t?t.concat("stark"):t}function vw(e){let t=BigInt(0),r=BigInt(1);if(e.endsWith(pw[0]+lw[1])){const[t,r]=mw(e.substring(0,e.length-2));e=t+pw[pw.length-1].repeat(2*(r+1))}else{const[t,r]=mw(e);r&&(e=t+pw[pw.length-1].repeat(1+2*(r-1)))}for(let n=0;n<e.length;n+=1){const a=e[n],i=lw.indexOf(a),s=BigInt(lw.indexOf(a));if(-1!==i)n===e.length-1&&e[n]===lw[0]?(t+=r*bw,r*=hw,r*=hw):(t+=r*s,r*=hw);else if(-1!==pw.indexOf(a)){t+=r*bw,r*=hw;const i=(n===e.length-1?1:0)+pw.indexOf(a);t+=r*BigInt(i),r*=gw}}return t}var Ew={MAINNET:"0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678",TESTNET_SEPOLIA:"0x154bc2e1af9260b9e66af0e9c46fc757ff893b3ff6a85718a810baf1474"};function Aw(e){switch(e){case yp.SN_MAIN:return Ew.MAINNET;case yp.SN_SEPOLIA:return Ew.TESTNET_SEPOLIA;default:throw new Error("Starknet.id is not yet deployed on this network")}}var _w={MAINNET:"0x05dbdedc203e92749e2e746e2d40a768d966bd243df04a6b712e222bc040a9af",TESTNET_SEPOLIA:"0x3697660a0981d734780731949ecb2b4a38d6a58fc41629ed611e8defda"};function xw(e){switch(e){case yp.SN_MAIN:return _w.MAINNET;case yp.SN_SEPOLIA:return _w.TESTNET_SEPOLIA;default:throw new Error("Starknet.id verifier contract is not yet deployed on this network")}}var Sw="0x034ffb8f4452df7a613a0210824d6414dbadcddce6c6e19bf4ddc9e22ce5f970";function Iw(e){switch(e){case yp.SN_MAIN:case yp.SN_SEPOLIA:return Sw;default:throw new Error("Starknet.id multicall contract is not yet deployed on this network")}}var kw={MAINNET:"0x07d14dfd8ee95b41fce179170d88ba1f0d5a512e13aeb232f19cfeec0a88f8bf",TESTNET_SEPOLIA:"0x60B94fEDe525f815AE5E8377A463e121C787cCCf3a36358Aa9B18c12c4D566"};function Cw(e){switch(e){case yp.SN_MAIN:return kw.MAINNET;case yp.SN_SEPOLIA:return kw.TESTNET_SEPOLIA;default:throw new Error("Starknet.id verifier contract is not yet deployed on this network")}}var Tw={MAINNET:"0x070aaa20ec4a46da57c932d9fd89ca5e6bb9ca3188d3df361a32306aff7d59c7",TESTNET_SEPOLIA:"0x9e7bdb8dabd02ea8cfc23b1d1c5278e46490f193f87516ed5ff2dfec02"};function Bw(e){switch(e){case yp.SN_MAIN:return Tw.MAINNET;case yp.SN_SEPOLIA:return Tw.TESTNET_SEPOLIA;default:throw new Error("Starknet.id profile picture verifier contract is not yet deployed on this network")}}var Mw={MAINNET:"0x0293eb2ba9862f762bd3036586d5755a782bd22e6f5028320f1d0405fd47bff4",TESTNET_SEPOLIA:"0x15ae88ae054caa74090b89025c1595683f12edf7a4ed2ad0274de3e1d4a"};function Ow(e){switch(e){case yp.SN_MAIN:return Mw.MAINNET;case yp.SN_SEPOLIA:return Mw.TESTNET_SEPOLIA;default:throw new Error("Starknet.id proof of personhood verifier contract is not yet deployed on this network")}}function Rw(e,t=void 0,r=void 0){return new Mg({Static:e,IfEqual:t?Tg(t[0],t[1],t[2]):void 0,IfNotEqual:r?Tg(r[0],r[1],r[2]):void 0})}function Nw(e,t=void 0){return new Mg({Hardcoded:e,Reference:t?Tg(t[0],t[1]):void 0})}function Pw(e,t=void 0,r=void 0){return new Mg({Hardcoded:e,Reference:t?Tg(t[0],t[1]):void 0,ArrayReference:r?Tg(r[0],r[1]):void 0})}function Lw(e){return/^(?:[a-z0-9-]{1,48}(?:[a-z0-9-]{1,48}[a-z0-9-])?\.)*[a-z0-9-]{1,48}\.stark$/.test(e)}var Fw=class e{async getStarkName(t,r){return e.getStarkName(this,t,r)}async getAddressFromStarkName(t,r){return e.getAddressFromStarkName(this,t,r)}async getStarkProfile(t,r,n,a,i,s,o){return e.getStarkProfile(this,t,r,n,a,i,s,o)}static async getStarkName(e,t,r){const n=await e.getChainId(),a=r??Aw(n);try{const r=await e.callContract({contractAddress:a,entrypoint:"address_to_domain",calldata:sy.compile({address:t,hint:[]})}),n=ww(r.map((e=>BigInt(e))).slice(1));if(!n)throw Error("Starkname not found");return n}catch(e){if(e instanceof Error&&"Starkname not found"===e.message)throw e;throw Error("Could not get stark name")}}static async getAddressFromStarkName(e,t,r){const n=t.endsWith(".stark")?t:`${t}.stark`;if(!Lw(n))throw new Error("Invalid domain, must be a valid .stark domain");const a=await e.getChainId(),i=r??Aw(a);try{const t=n.replace(".stark","").split(".").map((e=>vw(e).toString(10)));return(await e.callContract({contractAddress:i,entrypoint:"domain_to_address",calldata:sy.compile({domain:t,hint:[]})}))[0]}catch{throw Error("Could not get address from stark name")}}static async getStarkProfile(e,t,r,n,a,i,s,o){const c=await e.getChainId(),d=r??Aw(c),f=n??xw(c),u=a??Cw(c),l=i??Bw(c),h=s??Ow(c),p=o??Iw(c);try{const r=[{execution:Rw({}),to:Pw(d),selector:Pw(Nb("address_to_domain")),calldata:[Pw(t),Pw("0")]},{execution:Rw({}),to:Nw(d),selector:Nw(Nb("domain_to_id")),calldata:[Pw(void 0,void 0,[0,0])]},{execution:Rw({}),to:Nw(f),selector:Nw(Nb("get_verifier_data")),calldata:[Pw(void 0,[1,0]),Pw(Kb("twitter")),Pw(u),Pw("0")]},{execution:Rw({}),to:Nw(f),selector:Nw(Nb("get_verifier_data")),calldata:[Pw(void 0,[1,0]),Pw(Kb("github")),Pw(u),Pw("0")]},{execution:Rw({}),to:Nw(f),selector:Nw(Nb("get_verifier_data")),calldata:[Pw(void 0,[1,0]),Pw(Kb("discord")),Pw(u),Pw("0")]},{execution:Rw({}),to:Nw(f),selector:Nw(Nb("get_verifier_data")),calldata:[Pw(void 0,[1,0]),Pw(Kb("proof_of_personhood")),Pw(h),Pw("0")]},{execution:Rw({}),to:Nw(f),selector:Nw(Nb("get_verifier_data")),calldata:[Pw(void 0,[1,0]),Pw(Kb("nft_pp_contract")),Pw(l),Pw("0")]},{execution:Rw({}),to:Nw(f),selector:Nw(Nb("get_extended_verifier_data")),calldata:[Pw(void 0,[1,0]),Pw(Kb("nft_pp_id")),Pw("2"),Pw(l),Pw("0")]},{execution:Rw(void 0,void 0,[6,0,0]),to:Nw(void 0,[6,0]),selector:Nw(Nb("tokenURI")),calldata:[Pw(void 0,[7,1]),Pw(void 0,[7,2])]}],n=await e.callContract({contractAddress:p,entrypoint:"aggregate",calldata:sy.compile({calls:r})});if(Array.isArray(n)){const e=parseInt(n[0],16),t=[];let r=1;for(let a=0;a<e&&r<n.length;a+=1){const e=parseInt(n[r],16);r+=1;const a=n.slice(r,r+e);t.push(a),r+=e}const a=ww(t[0].slice(1).map((e=>BigInt(e)))),i="0x0"!==t[2][0]?BigInt(t[2][0]).toString():void 0,s="0x0"!==t[3][0]?BigInt(t[3][0]).toString():void 0,o="0x0"!==t[4][0]?BigInt(t[4][0]).toString():void 0,c="0x1"===t[5][0],d="0x9"===n[0]?t[8].slice(1).map((e=>Gb(e))).join(""):void 0;return{name:a,twitter:i,github:s,discord:o,proofOfPersonhood:c,profilePicture:d||`https://starknet.id/api/identicons/${BigInt(t[1][0]).toString()}`}}throw Error("Error while calling aggregate function")}catch(e){if(e instanceof Error)throw e;throw Error("Could not get user stark profile data from address")}}},Dw=class extends(_h(uw,Fw)){},Uw=(new uw({default:!0}),class{pk;constructor(e=No.randomPrivateKey()){this.pk=e instanceof Uint8Array?jh(e):pb(e)}async getPubKey(){return Do(this.pk)}async signMessage(e,t){const r=dw(e,t);return this.signRaw(r)}async signTransaction(e,t){const r=Lm(e,t.cairoVersion);let n;if(Object.values(Oh.ETransactionVersion2).includes(t.version)){const e=t;n=Oy({...e,senderAddress:e.walletAddress,compiledCalldata:r,version:e.version})}else{if(!Object.values(Oh.ETransactionVersion3).includes(t.version))throw Error("unsupported signTransaction version");{const e=t;n=Oy({...e,senderAddress:e.walletAddress,compiledCalldata:r,version:e.version,nonceDataAvailabilityMode:fm(e.nonceDataAvailabilityMode),feeDataAvailabilityMode:fm(e.feeDataAvailabilityMode)})}}return this.signRaw(n)}async signDeployAccountTransaction(e){const t=sy.compile(e.constructorCalldata);let r;if(Object.values(Oh.ETransactionVersion2).includes(e.version)){const n=e;r=Ny({...n,salt:n.addressSalt,constructorCalldata:t,version:n.version})}else{if(!Object.values(Oh.ETransactionVersion3).includes(e.version))throw Error("unsupported signDeployAccountTransaction version");{const n=e;r=Ny({...n,salt:n.addressSalt,compiledConstructorCalldata:t,version:n.version,nonceDataAvailabilityMode:fm(n.nonceDataAvailabilityMode),feeDataAvailabilityMode:fm(n.feeDataAvailabilityMode)})}}return this.signRaw(r)}async signDeclareTransaction(e){let t;if(Object.values(Oh.ETransactionVersion2).includes(e.version)){const r=e;t=Ry({...r,version:r.version})}else{if(!Object.values(Oh.ETransactionVersion3).includes(e.version))throw Error("unsupported signDeclareTransaction version");{const r=e;t=Ry({...r,version:r.version,nonceDataAvailabilityMode:fm(r.nonceDataAvailabilityMode),feeDataAvailabilityMode:fm(r.feeDataAvailabilityMode)})}}return this.signRaw(t)}async signRaw(e){return To(e,this.pk)}});function Hw(e){return new eg(e).toBigInt()}function jw(e){return eg.is(e)}function Vw(e){return new eg(e).toUint256HexString()}Th({},{bnToUint256:()=>Vw,isUint256:()=>jw,uint256ToBN:()=>Hw});function $w(e){const t=pb(db(e)?$h(e):e);return $h(Vh(t).padStart(64,"0"))}function zw(e){const t=$w(e);if(!t.match(/^(0x)?[0-9a-fA-F]{64}$/))throw new Error("Invalid Address Format");return vb(t,Xh,ap-1n,"Starknet Address"),t}function qw(e){return"event"===e.type}function Kw(e){const t=e.filter((e=>qw(e)&&"struct"===e.kind)),r=e.filter((e=>qw(e)&&"enum"===e.kind));return t.reduce(((e,t)=>{let n=[],{name:a}=t,i=!1;const s=e=>e.type===a;for(;;){const e=r.find((e=>e.variants.some(s)));if(ib(e))break;const t=e.variants.find(s);n.unshift(t.name),"flat"===t.kind&&(i=!0),a=e.name}if(0===n.length)throw new Error("inconsistency in ABI events definition.");i&&(n=[n[n.length-1]]);const o=n.pop();let c={[$h(Yo(Dh(o)).toString(16))]:t};for(;n.length>0;)c={[$h(Yo(Dh(n.pop())).toString(16))]:c};return c={...c},Jw(e,c)}),{})}function Gw(e){return xg(e)?Kw(e):function(e){return e.filter((e=>"event"===e.type)).reduce(((e,t)=>{const r=t.name,n={...t};return n.name=r,{...e,[$h(Yo(Dh(r)).toString(16))]:n}}),{})}(e)}function Jw(e,t){const r={...e};return fb(e)&&fb(t)&&Object.keys(t).forEach((n=>{fb(t[n])?n in e?r[n]=Jw(e[n],t[n]):Object.assign(r,{[n]:t[n]}):Object.assign(r,{[n]:t[n]})})),r}function Ww(e,t,r,n){return e.flat().reduce(((e,a)=>{const i=JSON.parse(JSON.stringify(a));let s=t[i.keys.shift()??0];if(!s)return e;for(;!s.name;){const e=i.keys.shift();rb(!!e,'Not enough data in "keys" property of this event.'),s=s[e]}const o={};o[s.name]={};const c=i.keys[Symbol.iterator](),d=i.data[Symbol.iterator](),f=s.members?.filter((e=>"key"===e.kind))||s.keys,u=s.members?.filter((e=>"data"===e.kind))||s.data;return f.forEach((e=>{o[s.name][e.name]=Zg(c,e,r,n,o[s.name])})),u.forEach((e=>{o[s.name][e.name]=Zg(d,e,r,n,o[s.name])})),"block_hash"in i&&(o.block_hash=i.block_hash),"block_number"in i&&(o.block_number=i.block_number),"transaction_hash"in i&&(o.transaction_hash=i.transaction_hash),e.push(o),e}),[])}function Yw(e){if(!e.events?.length)throw new Error("UDC emitted event is empty");const t=e.events.find((e=>wb(e.from_address)===wb(dp.ADDRESS)))||{data:[]};return{transaction_hash:e.transaction_hash,contract_address:t.data[0],address:t.data[0],deployer:t.data[1],unique:t.data[2],classHash:t.data[3],calldata_len:t.data[4],calldata:t.data.slice(5,5+parseInt(t.data[4],16)),salt:t.data[t.data.length-1]}}Th({},{getAbiEvents:()=>Gw,isAbiEvent:()=>qw,parseEvents:()=>Ww,parseUDCEvent:()=>Yw});function Zw(e){return"calldata_len"in e?{To:e.to,Selector:e.selector,Calldata:e.calldata}:e}function Xw(e){const t=e.calldata??[],r=Array.isArray(t)?t:sy.compile(t);return{to:e.contractAddress,selector:Nb(e.entrypoint),calldata:r}}function Qw(e,t){const r=Xw(e);return"1"===t?{...r,calldata_len:r.calldata.length,calldata:r.calldata}:{To:r.to,Selector:r.selector,Calldata:r.calldata}}function ev(e,t){return{name:"Account.execute_from_outside",version:t,chainId:e,..."2"===t?{revision:"1"}:{}}}function tv(e,t,r,n,a){return"1"===a?{types:Jp,primaryType:"OutsideExecution",domain:ev(e,a),message:{...t,nonce:r,calls_len:n.length,calls:n.map((e=>Qw(e,a)))}}:{types:Wp,primaryType:"OutsideExecution",domain:ev(e,a),message:{Caller:t.caller,Nonce:r,"Execute After":t.execute_after,"Execute Before":t.execute_before,Calls:n.map((e=>Qw(e,a)))}}}function rv(e){const t=e.outsideExecution,r=am(e.signature);return sy.compile({outside_execution:t,signature:r})}function nv(e){return(Array.isArray(e)?e:[e]).map((e=>{let t;if(e.version===Yp.V1)t="execute_from_outside";else{if(e.version!==Yp.V2)throw new Error("Unsupported OutsideExecution version");t="execute_from_outside_v2"}return{contractAddress:pb(e.signerAddress),entrypoint:t,calldata:rv(e)}}))}Th({},{buildExecuteFromOutsideCall:()=>nv,buildExecuteFromOutsideCallData:()=>rv,getOutsideCall:()=>Xw,getTypedData:()=>tv,toOutsideCallV2:()=>Zw});async function av(e,t,r){const n={contractAddress:pb(t),entrypoint:"supports_interface",calldata:[pb(r)]};try{const t=await e.callContract(n);return 0n!==BigInt(t[0])}catch{return!1}}Th({},{supportsInterface:()=>av});Th({},{assertCallsAreStrictlyEqual:()=>sv,assertPaymasterTransactionSafety:()=>ov,getDefaultPaymasterNodeUrl:()=>iv});var iv=(e,t=!1)=>{t||Ip.info("Using default public node url, please provide nodeUrl in provider options!");const r=Ap[e??gp.SN_SEPOLIA];return r[Math.floor(Math.random()*r.length)]};function sv(e,t){const r="Provided calls are not strictly equal to the returned calls";rb(t.length-1===e.length,`${r}: Expected ${e.length+1} calls, got ${t.length}`);for(let n=0;n<e.length;n+=1){const a=e[n],i=Zw(t[n]),s=e=>lb(e).toString(16).toLowerCase();rb(s(a.contractAddress)===s(i.To),`${r}: Contract address mismatch at call ${n}. Expected: ${a.contractAddress}, Got: ${i.To}`),rb(Nb(a.entrypoint)===i.Selector,`${r}: Entrypoint mismatch at call ${n}. Expected: ${a.entrypoint}, Got: ${i.Selector}`);const o=sy.toCalldata(a.calldata),c=sy.toCalldata(i.Calldata);rb(o.length===c.length,`${r}: Calldata length mismatch at call ${n}. Expected length: ${o.length}, Got length: ${c.length}`);for(let e=0;e<o.length;e+=1){rb(BigInt(o[e])===BigInt(c[e]),`${r}: Calldata value mismatch at call ${n}, parameter ${e}. Expected: ${o[e]}, Got: ${c[e]}`)}}}var ov=(e,t,r,n)=>{if("sponsored"!==r.feeMode.mode&&("invoke"===e.type||"deploy_and_invoke"===e.type)){const a="calls"in e.typed_data.message?e.typed_data.message.calls:e.typed_data.message.Calls;sv(t,a),((e,t)=>{const r=Zw(e[e.length-1]);rb(BigInt(r.To)===BigInt(t),"Gas token address is not equal to the provided gas token")})(a,r.feeMode.gasToken),n&&(rb(e.fee.suggested_max_fee_in_gas_token<=n,"Gas token price is too high"),((e,t)=>{const r=Zw(e[e.length-1]),n=sy.toCalldata(r.Calldata)[1];rb(BigInt(n)===BigInt(t),"Gas token value is not equal to the provided gas fees")})(a,e.fee.suggested_max_fee_in_gas_token))}},cv=e=>e.map((e=>({to:e.contractAddress,selector:Nb(e.entrypoint),calldata:sy.toHex(e.calldata)}))),dv=e=>"sponsored"===e.mode?{mode:"sponsored"}:{mode:"default",gas_token:e.gasToken},fv=e=>e?{execute_after:e.executeAfter||1,execute_before:e.executeBefore}:void 0,uv=e=>{return{version:e.version,feeMode:(r=e.fee_mode,"sponsored"===r.mode?{mode:"sponsored"}:{mode:"default",gasToken:r.gas_token}),timeBounds:(t=e.time_bounds,t?{executeAfter:t.execute_after,executeBefore:t.execute_before}:void 0)};var t,r},lv={"Content-Type":"application/json"},hv=class e{nodeUrl;headers;baseFetch;requestId;constructor(t){if(t instanceof e)return this.nodeUrl=t.nodeUrl,this.headers={...lv,...t.headers},this.baseFetch=t.baseFetch,void(this.requestId=t.requestId);if(t&&"nodeUrl"in t&&"headers"in t&&"baseFetch"in t)return this.nodeUrl=t.nodeUrl??iv(void 0),this.headers={...lv,...t.headers},this.baseFetch=t.baseFetch??xm,void(this.requestId=0);const{nodeUrl:r,headers:n,baseFetch:a}=t||{};r&&Object.values(gp).includes(r)?this.nodeUrl=iv(r,t?.default):this.nodeUrl=r||iv(void 0,t?.default),this.baseFetch=a??xm,this.headers={...lv,...n},this.requestId=0}fetch(e,t,r=0){const n={id:r,jsonrpc:"2.0",method:e,...t&&{params:t}};return this.baseFetch(this.nodeUrl,{method:"POST",body:eb(n),headers:this.headers})}errorHandler(e,t,r,n){if(r)throw new Em(r,e,t);if(n instanceof vm)throw n;if(n)throw Error(n.message)}async fetchEndpoint(e,t){try{this.requestId+=1;const r=await this.fetch(e,t,this.requestId),{error:n,result:a}=await r.json();return this.errorHandler(e,t,n),a}catch(r){throw this.errorHandler(e,t,r?.response?.data,r),r}}async isAvailable(){return this.fetchEndpoint("paymaster_isAvailable")}async buildTransaction(e,t){let r;switch(e.type){case"invoke":case"deploy_and_invoke":r={...e,invoke:{user_address:e.invoke.userAddress,calls:cv(e.invoke.calls)}};break;default:r=e}const n={version:t.version,fee_mode:dv(t.feeMode),time_bounds:fv(t.timeBounds)},a=await this.fetchEndpoint("paymaster_buildTransaction",{transaction:r,parameters:n}),i={gas_token_price_in_strk:BigInt(a.fee.gas_token_price_in_strk),estimated_fee_in_strk:BigInt(a.fee.estimated_fee_in_strk),estimated_fee_in_gas_token:BigInt(a.fee.estimated_fee_in_gas_token),suggested_max_fee_in_strk:BigInt(a.fee.suggested_max_fee_in_strk),suggested_max_fee_in_gas_token:BigInt(a.fee.suggested_max_fee_in_gas_token)};switch(a.type){case"invoke":return{type:"invoke",typed_data:a.typed_data,parameters:uv(a.parameters),fee:i};case"deploy_and_invoke":return{type:"deploy_and_invoke",deployment:a.deployment,typed_data:a.typed_data,parameters:uv(a.parameters),fee:i};default:return{type:"deploy",deployment:a.deployment,parameters:uv(a.parameters),fee:i}}}async executeTransaction(e,t){let r;switch(e.type){case"invoke":case"deploy_and_invoke":r={...e,invoke:{user_address:e.invoke.userAddress,typed_data:e.invoke.typedData,signature:sm(e.invoke.signature)}};break;default:r=e}const n={version:t.version,fee_mode:dv(t.feeMode),time_bounds:fv(t.timeBounds)};return this.fetchEndpoint("paymaster_executeTransaction",{transaction:r,parameters:n})}async getSupportedTokens(){return this.fetchEndpoint("paymaster_getSupportedTokens").then((e=>e.map((e=>({token_address:e.token_address,decimals:e.decimals,priceInStrk:BigInt(e.price_in_strk)})))))}},pv=new hv({default:!0}),bv=class extends Dw{signer;address;cairoVersion;transactionVersion;paymaster;constructor(e,t,r,n,a=xp.get("transactionVersion"),i){super(e),this.address=t.toLowerCase(),this.signer=db(r)||r instanceof Uint8Array?new Uw(r):r,n&&(this.cairoVersion=n.toString()),this.transactionVersion=a,this.paymaster=i?new hv(i):pv,Ip.debug("Account setup",{transactionVersion:this.transactionVersion,cairoVersion:this.cairoVersion,channel:this.channel.id})}static async create(){throw new vm("Not supported")}getPreferredVersion(e,t){return this.transactionVersion===Np.V3?t:this.transactionVersion===Np.V2?e:Np.V3}async getNonce(e){return super.getNonceForAddress(this.address,e)}async getNonceSafe(e){try{return lb(e??await this.getNonce())}catch(e){return 0n}}async getCairoVersion(e){if(!this.cairoVersion){const{cairo:t}=e?await super.getContractVersion(void 0,e):await super.getContractVersion(this.address);this.cairoVersion=t}return this.cairoVersion}async estimateFee(e,t={}){return this.estimateInvokeFee(e,t)}async estimateInvokeFee(e,t={}){const{nonce:r,blockIdentifier:n,version:a,skipValidate:i=!0}=t,s=Array.isArray(e)?e:[e],o=lb(r??await this.getNonce()),c=um(this.getPreferredVersion(Np.F1,Np.F3),lm(a)),d=await this.getChainId(),f={...hm(t,await this.channel.setUpSpecVersion()),walletAddress:this.address,nonce:o,maxFee:Xh,version:c,chainId:d,cairoVersion:await this.getCairoVersion(),skipValidate:i},u=await this.buildInvocation(s,f);return super.getInvokeEstimateFee({...u},{...hm(t,await this.channel.setUpSpecVersion()),version:c,nonce:o},n,t.skipValidate)}async estimateDeclareFee(e,t={}){const{blockIdentifier:r,nonce:n,version:a,skipValidate:i=!0}=t,s=lb(n??await this.getNonce()),o=um(gm(e.contract)?this.getPreferredVersion(Np.F2,Np.F3):Np.F1,lm(a)),c=await this.getChainId(),d=await this.buildDeclarePayload(e,{...hm(t,await this.channel.setUpSpecVersion()),nonce:s,chainId:c,version:o,walletAddress:this.address,maxFee:Xh,cairoVersion:void 0,skipValidate:i});return super.getDeclareEstimateFee(d,{...hm(t,await this.channel.setUpSpecVersion()),version:o,nonce:s},r,t.skipValidate)}async estimateAccountDeployFee({classHash:e,addressSalt:t=0,constructorCalldata:r=[],contractAddress:n},a={}){const{blockIdentifier:i,version:s,skipValidate:o=!0}=a,c=um(this.getPreferredVersion(Np.F1,Np.F3),lm(s)),d=Xh,f=await this.getChainId(),u=await this.buildAccountDeployPayload({classHash:e,addressSalt:t,constructorCalldata:r,contractAddress:n},{...hm(a,await this.channel.setUpSpecVersion()),nonce:d,chainId:f,version:c,walletAddress:this.address,maxFee:Xh,cairoVersion:void 0,skipValidate:o});return super.getDeployAccountEstimateFee({...u},{...hm(a,await this.channel.setUpSpecVersion()),version:c,nonce:d},i,a.skipValidate)}async estimateDeployFee(e,t={}){const r=this.buildUDCContractPayload(e);return this.estimateInvokeFee(r,t)}async estimateFeeBulk(e,t={}){if(!e.length)throw TypeError("Invocations should be non-empty array");const{nonce:r,blockIdentifier:n,version:a,skipValidate:i}=t,s=await this.accountInvocationsFactory(e,{...hm(t,await this.channel.setUpSpecVersion()),versions:[Np.F1,um(this.getPreferredVersion(Np.F2,Np.F3),a)],nonce:r,blockIdentifier:n,skipValidate:i});return super.getEstimateFeeBulk(s,{blockIdentifier:n,skipValidate:i})}async simulateTransaction(e,t={}){if(!e.length)throw TypeError("Invocations should be non-empty array");const{nonce:r,blockIdentifier:n,skipValidate:a=!0,skipExecute:i,version:s}=t,o=await this.accountInvocationsFactory(e,{...hm(t,await this.channel.setUpSpecVersion()),versions:[Np.V1,um(this.getPreferredVersion(Np.V2,Np.V3),s)],nonce:r,blockIdentifier:n,skipValidate:a});return super.getSimulateTransaction(o,{blockIdentifier:n,skipValidate:a,skipExecute:i})}async execute(e,t={}){const r=Array.isArray(e)?e:[e],n=lb(t.nonce??await this.getNonce()),a=um(this.getPreferredVersion(Np.V1,Np.V3),t.version),i=await this.getUniversalSuggestedFee(a,{type:Tp.INVOKE,payload:e},{...t,version:a}),s=await this.getChainId(),o={...hm(t,await this.channel.setUpSpecVersion()),resourceBounds:i.resourceBounds,walletAddress:this.address,nonce:n,maxFee:i.maxFee,version:a,chainId:s,cairoVersion:await this.getCairoVersion()},c=await this.signer.signTransaction(r,o),d=Lm(r,await this.getCairoVersion());return this.invokeFunction({contractAddress:this.address,calldata:d,signature:c},{...hm(t,await this.channel.setUpSpecVersion()),resourceBounds:i.resourceBounds,nonce:n,maxFee:i.maxFee,version:a})}async buildPaymasterTransaction(e,t){if(!t.deploymentData){if(await this.getSnip9Version()===Yp.UNSUPPORTED)throw Error("Account is not compatible with SNIP-9")}const r={version:"0x1",feeMode:t.feeMode,timeBounds:t.timeBounds};let n;return n=t.deploymentData?e.length>0?{type:"deploy_and_invoke",invoke:{userAddress:this.address,calls:e},deployment:t.deploymentData}:{type:"deploy",deployment:t.deploymentData}:{type:"invoke",invoke:{userAddress:this.address,calls:e}},this.paymaster.buildTransaction(n,r)}async estimatePaymasterTransactionFee(e,t){return(await this.buildPaymasterTransaction(e,t)).fee}async preparePaymasterTransaction(e){let t;switch(e.type){case"deploy_and_invoke":{const r=await this.signMessage(e.typed_data);t={type:"deploy_and_invoke",invoke:{userAddress:this.address,typedData:e.typed_data,signature:sm(r)},deployment:e.deployment};break}case"invoke":{const r=await this.signMessage(e.typed_data);t={type:"invoke",invoke:{userAddress:this.address,typedData:e.typed_data,signature:sm(r)}};break}case"deploy":t={type:"deploy",deployment:e.deployment};break;default:throw Error("Invalid transaction type")}return t}async executePaymasterTransaction(e,t,r){const n=await this.buildPaymasterTransaction(e,t);ov(n,e,t,r);const a=await this.preparePaymasterTransaction(n);return this.paymaster.executeTransaction(a,n.parameters).then((e=>({transaction_hash:e.transaction_hash})))}async declareIfNot(e,t={}){const r=ym(e);try{await this.getClassByHash(r.classHash)}catch(r){return this.declare(e,t)}return{transaction_hash:"",class_hash:r.classHash}}async declare(e,t={}){const r=ym(e),{nonce:n,version:a}=t,i=um(gm(e.contract)?this.getPreferredVersion(Np.V2,Np.V3):Np.V1,a),s=await this.getUniversalSuggestedFee(i,{type:Tp.DECLARE,payload:r},{...t,version:i}),o={...hm(t,await this.channel.setUpSpecVersion()),resourceBounds:s.resourceBounds,maxFee:s.maxFee,nonce:lb(n??await this.getNonce()),version:i,chainId:await this.getChainId(),walletAddress:this.address,cairoVersion:void 0},c=await this.buildDeclarePayload(r,o);return this.declareContract(c,o)}async deploy(e,t={}){const{calls:r,addresses:n}=Fm(e,this.address);return{...await this.execute(r,t),contract_address:n}}async deployContract(e,t={}){const r=await this.deploy(e,t);return Yw(await this.waitForTransaction(r.transaction_hash))}async declareAndDeploy(e,t={}){const{constructorCalldata:r,salt:n,unique:a}=e;let i=await this.declareIfNot(e,t);if(""!==i.transaction_hash){const e=await this.waitForTransaction(i.transaction_hash);i={...i,...e}}const s=await this.deployContract({classHash:i.class_hash,salt:n,unique:a,constructorCalldata:r},t);return{declare:{...i},deploy:s}}deploySelf=this.deployAccount;async deployAccount({classHash:e,constructorCalldata:t=[],addressSalt:r=0,contractAddress:n},a={}){const i=um(this.getPreferredVersion(Np.V1,Np.V3),a.version),s=Xh,o=await this.getChainId(),c=sy.compile(t),d=n??Hy(r,e,c,0),f=await this.getUniversalSuggestedFee(i,{type:Tp.DEPLOY_ACCOUNT,payload:{classHash:e,constructorCalldata:c,addressSalt:r,contractAddress:d}},a),u=await this.signer.signDeployAccountTransaction({...hm(a,await this.channel.setUpSpecVersion()),classHash:e,constructorCalldata:c,contractAddress:d,addressSalt:r,chainId:o,resourceBounds:f.resourceBounds,maxFee:f.maxFee,version:i,nonce:s});return this.deployAccountContract({classHash:e,addressSalt:r,constructorCalldata:t,signature:u},{...hm(a,await this.channel.setUpSpecVersion()),nonce:s,resourceBounds:f.resourceBounds,maxFee:f.maxFee,version:i})}async signMessage(e){return this.signer.signMessage(e,this.address)}async hashMessage(e){return dw(e,this.address)}async getSnip9Version(){return await av(this,this.address,lp)?Yp.V2:await av(this,this.address,up)?Yp.V1:Yp.UNSUPPORTED}async isValidSnip9Nonce(e){try{const t={contractAddress:this.address,entrypoint:"is_valid_outside_execution_nonce",calldata:[pb(e)]},r=await this.callContract(t);return 0n!==BigInt(r[0])}catch(e){throw new Error(`Failed to check if nonce is valid: ${e}`)}}async getSnip9Nonce(){const e=nm();return await this.isValidSnip9Nonce(e)?e:this.getSnip9Nonce()}async getOutsideTransaction(e,t,r,n){if(!ub(e.caller)&&"ANY_CALLER"!==e.caller)throw new Error(`The caller ${e.caller} is not valid.`);const a=ub(e.caller)?e.caller:fp,i=Array.isArray(t)?t:[t],s=r??await this.getSnip9Version();if(!s)throw new Error("This account is not handling outside transactions.");const o=n?pb(n):await this.getSnip9Nonce(),c=tv(await this.getChainId(),{caller:a,execute_after:e.execute_after,execute_before:e.execute_before},o,i,s),d=await this.signMessage(c);return{outsideExecution:{caller:a,nonce:o,execute_after:e.execute_after,execute_before:e.execute_before,calls:i.map(Xw)},signature:d,signerAddress:this.address,version:s}}async executeFromOutside(e,t){const r=nv(e);return this.execute(r,t)}async getUniversalSuggestedFee(e,{type:t,payload:r},n){let a=0,i=cm(Xh,void 0,await this.channel.setUpSpecVersion());return e===Np.V3?i=n.resourceBounds??(await this.getSuggestedFee({type:t,payload:r},n)).resourceBounds:a=n.maxFee??(await this.getSuggestedFee({type:t,payload:r},n)).suggestedMaxFee,{maxFee:a,resourceBounds:i}}async getSuggestedFee({type:e,payload:t},r){switch(e){case Tp.INVOKE:return this.estimateInvokeFee(t,r);case Tp.DECLARE:return this.estimateDeclareFee(t,r);case Tp.DEPLOY_ACCOUNT:return this.estimateAccountDeployFee(t,r);case Tp.DEPLOY:return this.estimateDeployFee(t,r);default:return dm(await this.channel.setUpSpecVersion())}}async buildInvocation(e,t){const r=Lm(e,await this.getCairoVersion()),n=t.skipValidate?[]:await this.signer.signTransaction(e,t);return{...hm(t,await this.channel.setUpSpecVersion()),contractAddress:this.address,calldata:r,signature:n}}async buildDeclarePayload(e,t){const{classHash:r,contract:n,compiledClassHash:a}=ym(e),i=km(n);if(ib(a)&&(t.version===Lp.F3||t.version===Lp.V3))throw Error("V3 Transaction work with Cairo1 Contracts and require compiledClassHash");const s=t.skipValidate?[]:await this.signer.signDeclareTransaction({...t,...hm(t,await this.channel.setUpSpecVersion()),classHash:r,compiledClassHash:a,senderAddress:t.walletAddress});return{senderAddress:t.walletAddress,signature:s,contract:i,compiledClassHash:a}}async buildAccountDeployPayload({classHash:e,addressSalt:t=0,constructorCalldata:r=[],contractAddress:n},a){const i=sy.compile(r),s=n??Hy(t,e,i,0),o=a.skipValidate?[]:await this.signer.signDeployAccountTransaction({...a,...hm(a,await this.channel.setUpSpecVersion()),classHash:e,contractAddress:s,addressSalt:t,constructorCalldata:i});return{...hm(a,await this.channel.setUpSpecVersion()),classHash:e,addressSalt:t,constructorCalldata:i,signature:o}}buildUDCContractPayload(e){const t=[].concat(e).map((e=>{const{classHash:t,salt:r="0",unique:n=!0,constructorCalldata:a=[]}=e,i=sy.compile(a);return{contractAddress:dp.ADDRESS,entrypoint:dp.ENTRYPOINT,calldata:[t,r,kb(n),i.length,...i]}}));return t}async accountInvocationsFactory(e,t){const{nonce:r,blockIdentifier:n,skipValidate:a=!0}=t,i=await this.getNonceSafe(r),s=await this.getChainId(),o=t.versions.map((e=>um(e))),c="payload"in e[0]?e[0].payload:e[0],d=e[0].type===Tp.DEPLOY_ACCOUNT?await this.getCairoVersion(c.classHash):await this.getCairoVersion();return Promise.all([].concat(e).map((async(e,r)=>{const c="payload"in e?e.payload:e,f={...hm(t,await this.channel.setUpSpecVersion()),walletAddress:this.address,nonce:lb(Number(i)+r),maxFee:Xh,chainId:s,cairoVersion:d,version:"",skipValidate:a},u={type:e.type,nonce:lb(Number(i)+r),blockIdentifier:n,version:""};if(e.type===Tp.INVOKE){const e=pm(o[1]);f.version=e,u.version=e;const t=await this.buildInvocation([].concat(c),f);return{...u,...t,...f}}if(e.type===Tp.DEPLOY){const e=pm(o[1]);f.version=e,u.version=e;const t=this.buildUDCContractPayload(c),r=await this.buildInvocation(t,f);return{...u,...r,...f,type:Tp.INVOKE}}if(e.type===Tp.DECLARE){const e=gm(c.contract)?o[1]:o[0];f.version=e,u.version=e;const t=await this.buildDeclarePayload(c,f);return{...u,...t,...f}}if(e.type===Tp.DEPLOY_ACCOUNT){const e=pm(o[1]);f.version=e,u.version=e;const t=await this.buildAccountDeployPayload(c,f);return{...u,...t,...f}}throw Error(`accountInvocationsFactory: unsupported transaction type: ${e}`)})))}async getStarkName(e=this.address,t){return super.getStarkName(e,t)}};function gv(e,t=!1){return e.request({type:"wallet_requestAccounts",params:{silent_mode:t}})}function yv(e){return e.request({type:"wallet_getPermissions"})}function mv(e,t){return e.request({type:"wallet_watchAsset",params:t})}function wv(e,t){return e.request({type:"wallet_addStarknetChain",params:t})}function vv(e,t){return e.request({type:"wallet_switchStarknetChain",params:{chainId:t}})}function Ev(e){return e.request({type:"wallet_requestChainId"})}function Av(e){return e.request({type:"wallet_deploymentData"})}function _v(e,t){return e.request({type:"wallet_addInvokeTransaction",params:t})}function xv(e,t){return e.request({type:"wallet_addDeclareTransaction",params:t})}function Sv(e,t){return e.request({type:"wallet_signTypedData",params:t})}function Iv(e){return e.request({type:"wallet_supportedSpecs"})}function kv(e,t){e.on("accountsChanged",t)}function Cv(e,t){e.on("networkChanged",t)}Th({},{addDeclareTransaction:()=>xv,addInvokeTransaction:()=>_v,addStarknetChain:()=>wv,deploymentData:()=>Av,getPermissions:()=>yv,onAccountChange:()=>kv,onNetworkChanged:()=>Cv,requestAccounts:()=>gv,requestChainId:()=>Ev,signMessage:()=>Sv,supportedSpecs:()=>Iv,switchStarknetChain:()=>vv,watchAsset:()=>mv});const Tv="0x033434ad846cdd5f23eb73ff09fe6fddd568284a0fb7d1be20ee482f044dabe2",Bv="0x29927c8af6bccf3f6fda035981e765a7bdbf18a2dc0d630494f8758aa908e2b",Mv={name:"Canton Mainnet",chainId:Mh.StarknetChainId.SN_MAIN,baseUrl:"https://ccexplorer.io",nodeUrl:"",accountClassHash:""},Ov={name:"Goerli Testnet (deprecated)",chainId:"0x534e5f474f45524c49",baseUrl:"",nodeUrl:"",accountClassHash:""},Rv={id:"Amulet",name:"Canton Coin",symbol:"CC",decimals:10,instrumentAdmin:"DSO::1220be58c29e65de40bf273be1dc2b266d43a9a002ea5b18955aeef7aac881bb471a",chainId:Mv.chainId},Nv=[Rv],Pv="0x25ec026985a3bf9d0cc1fe17326b245dfdc3ff89b8fde106542a3ea56c5a918",Lv=[0,3,0],Fv="1",Dv="0";var Uv,Hv,jv;!function(e){e.Latest="latest",e.Pending="pending"}(Uv||(Uv={})),function(e){e.Dev="dev",e.Staging="staging",e.Prod="prod"}(Hv||(Hv={})),function(e){e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e[e.TRACE=5]="TRACE",e[e.ALL=6]="ALL",e[e.OFF=0]="OFF"}(jv||(jv={}));const Vv=(e,...t)=>{};const $v=new class{log;warn;error;debug;info;trace;#e=jv.OFF;set logLevel(e){this.#e=e,this.init()}get logLevel(){return this.#e}init(){this.error=console.error.bind(console),this.warn=console.warn.bind(console),this.info=console.info.bind(console),this.debug=console.debug.bind(console),this.trace=console.trace.bind(console),this.log=console.log.bind(console),this.#e<jv.ERROR&&(this.error=Vv),this.#e<jv.WARN&&(this.warn=Vv),this.#e<jv.INFO&&(this.info=Vv),this.#e<jv.DEBUG&&(this.debug=Vv),this.#e<jv.TRACE&&(this.trace=Vv),this.#e<jv.ALL&&(this.log=Vv)}};var zv;!function(e){e.STARKSCAN="starkscan"}(zv||(zv={}));const qv={logLevel:"6",snapEnv:"dev",defaultNetwork:Mv,availableNetworks:[Mv],walletApiBase:"https://wallet-api.canton.devnet.nodefortress.io",transaction:{list:{txnsInLastNumOfDays:10}},rpcApiKey:"e7ee79ecbdc144c38192cda1207e2e42",explorer:{[Mh.StarknetChainId.SN_MAIN]:"https://ccexplorer.io/parties/${address}"},enableRPCV8:{[Mh.StarknetChainId.SN_MAIN]:!0},dataClient:{[zv.STARKSCAN]:{apiKey:""}},preloadTokens:[Rv],account:{defaultAccountIndex:0}},Kv=(e,t=void 0)=>JSON.stringify(e,((e,t)=>"bigint"==typeof t?t.toString():t),t);function Gv(e,t,r=[]){return(...n)=>{if(1===n.length&&C(n[0])){const r={...n[0],type:e};return ie(r,t,`Invalid ${e} component`),r}const a=r.reduce(((e,t,r)=>void 0!==n[r]?{...e,[t]:n[r]}:e),{type:e});return ie(a,t,`Invalid ${e} component`),a}}var Jv;!function(e){e.Copyable="copyable",e.Divider="divider",e.Heading="heading",e.Panel="panel",e.Spinner="spinner",e.Text="text",e.Image="image",e.Row="row",e.Address="address",e.Button="button",e.Input="input",e.Form="form"}(Jv||(Jv={}));const Wv=W({type:X()}),Yv=j(Wv,W({value:ee()})),Zv=j(Yv,W({type:q(Jv.Text),value:X(),markdown:Y(z())})),Xv=Gv(Jv.Text,Zv,["value","markdown"]),Qv=j(Yv,W({type:q(Jv.Copyable),value:X(),sensitive:Y(z())})),eE=Gv(Jv.Copyable,Qv,["value","sensitive"]),tE=j(Yv,W({type:q(Jv.Heading),value:X()})),rE=Gv(Jv.Heading,tE,["value"]);var nE,aE,iE,sE,oE,cE,dE,fE,uE;function lE(e,t){return{walletRpcError:{...t,code:e}}}!function(e){e.DEPLOY="DEPLOY",e.DEPLOY_ACCOUNT="DEPLOY_ACCOUNT",e.INVOKE_FUNCTION="INVOKE_FUNCTION"}(nE||(nE={})),function(e){e.DEPLOY="deploy",e.DEPLOY_ACCOUNT="deploy_account",e.INVOKE="invoke"}(aE||(aE={})),function(e){e.RECEIVED="RECEIVED",e.PENDING="PENDING",e.ACCEPTED_ON_L2="ACCEPTED_ON_L2",e.ACCEPTED_ON_L1="ACCEPTED_ON_L1",e.NOT_RECEIVED="NOT_RECEIVED",e.REJECTED="REJECTED",e.REVERTED="REVERTED"}(iE||(iE={})),function(e){e.PENDING="PENDING",e.ACCEPTED_ON_L2="ACCEPTED_ON_L2",e.ACCEPTED_ON_L1="ACCEPTED_ON_L1",e.NOT_RECEIVED="NOT_RECEIVED"}(sE||(sE={})),function(e){e.SUCCEEDED="SUCCEEDED",e.REVERTED="REVERTED",e.REJECTED="REJECTED"}(oE||(oE={})),function(e){e.FINALITY="finalityStatus",e.EXECUTION="executionStatus",e.DEPRECATION="status"}(cE||(cE={})),function(e){e.V2="V2"}(dE||(dE={})),function(e){e.Upgrade="upgrade",e.Transfer="transfer"}(fE||(fE={})),function(e){e[e.InvalidErc20=111]="InvalidErc20",e[e.InvalidNetwork=112]="InvalidNetwork",e[e.UserDeny=113]="UserDeny",e[e.InvalidRequest=114]="InvalidRequest",e[e.AccountAlreadyDeployed=115]="AccountAlreadyDeployed",e[e.Unknown=163]="Unknown"}(uE||(uE={}));class hE extends it{constructor(e){super(e??"Upgrade required")}}class pE extends it{constructor(e){super(e??"Cairo 0 contract address balance is not empty, deploy required")}}class bE extends it{constructor(e){super(e??"Network not Supported",lE(uE.InvalidNetwork))}}class gE extends it{constructor(e){super(e??"Account not found",lE(uE.Unknown))}}class yE extends it{constructor(e){super(e,lE(uE.Unknown))}}const mE="Contract not found";class wE extends it{constructor(e){super(e??mE,lE(uE.Unknown))}}class vE extends At{constructor(e){super(e,lE(uE.UserDeny))}}class EE extends dt{constructor(e){super(e,lE(uE.InvalidRequest))}}class AE extends it{constructor(e){super(e??"Unknown Error",lE(uE.Unknown))}}class _E extends it{constructor(e){super(e??"Account already deployed",lE(uE.AccountAlreadyDeployed))}}class xE extends it{constructor(e){super(e??"Token address, name, or symbol is the same as one of the preloaded tokens")}}class SE extends it{constructor(e){super(e??"Insufficient Funds")}}class IE extends it{constructor(e){super(e??"Account address does not match the address in the state")}}new Error("timeout while waiting for mutex to become available"),new Error("mutex already locked");const kE=new Error("request for lock canceled");var CE=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function o(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}c((n=n.apply(e,t||[])).next())}))};class TE{constructor(e,t=kE){if(this._maxConcurrency=e,this._cancelError=t,this._queue=[],this._waiters=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}acquire(){const e=this.isLocked(),t=new Promise(((e,t)=>this._queue.push({resolve:e,reject:t})));return e||this._dispatch(),t}runExclusive(e){return CE(this,void 0,void 0,(function*(){const[t,r]=yield this.acquire();try{return yield e(t)}finally{r()}}))}waitForUnlock(){return CE(this,void 0,void 0,(function*(){if(!this.isLocked())return Promise.resolve();return new Promise((e=>this._waiters.push({resolve:e})))}))}isLocked(){return this._value<=0}release(){if(this._maxConcurrency>1)throw new Error("this method is unavailable on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){const e=this._currentReleaser;this._currentReleaser=void 0,e()}}cancel(){this._queue.forEach((e=>e.reject(this._cancelError))),this._queue=[]}_dispatch(){const e=this._queue.shift();if(!e)return;let t=!1;this._currentReleaser=()=>{t||(t=!0,this._value++,this._resolveWaiters(),this._dispatch())},e.resolve([this._value--,this._currentReleaser])}_resolveWaiters(){this._waiters.forEach((e=>e.resolve())),this._waiters=[]}}var BE=function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function s(e){try{c(n.next(e))}catch(e){i(e)}}function o(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}c((n=n.apply(e,t||[])).next())}))};class ME{constructor(e){this._semaphore=new TE(1,e)}acquire(){return BE(this,void 0,void 0,(function*(){const[,e]=yield this._semaphore.acquire();return e}))}runExclusive(e){return this._semaphore.runExclusive((()=>e()))}isLocked(){return this._semaphore.isLocked()}waitForUnlock(){return this._semaphore.waitForUnlock()}release(){this._semaphore.release()}cancel(){return this._semaphore.cancel()}}const OE=new ME;function RE(e=!1){return e?new ME:OE}const NE=RE(!0);let PE;async function LE(){await NE.runExclusive((async()=>{PE=await async function(){try{const{locale:e}=await snap.request({method:"snap_getPreferences"});return(await a(967)(`./${e}.json`)).messages}catch{return(await Promise.resolve().then(a.t.bind(a,517,19))).messages}}()}))}function FE(){return PE}function DE(){const e=FE();return(t,...r)=>{var n;return((null===(n=e[t])||void 0===n?void 0:n.message)??`{${t}}`).replace(/\{(\d+)\}/gu,((e,t)=>{const n=parseInt(t,10)-1;return r[n]??`{${t}}`}))}}var UE=a(1642);const HE=32,jE=0,VE=4294967295,$E="bip32:44'",zE=/^\d+$/u,qE=(RegExp("^(?<index>\\d+)'?$","u"),/^bip32:\d+'?$/u),KE=/^slip10:\d+'?$/u,GE=/^bip39:([a-z]+){1}( [a-z]+){11,23}$/u,JE=2147483648;var WE=a(4976),YE=a.t(WE,2);const ZE=BigInt(0),XE=BigInt(1),QE=BigInt(2),eA=BigInt(3),tA=BigInt(8),rA=Object.freeze({a:ZE,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:XE,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")}),nA=(e,t)=>(e+t/QE)/t,aA={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar(e){const{n:t}=rA,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-XE*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),a=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=r,s=BigInt("0x100000000000000000000000000000000"),o=nA(i*e,t),c=nA(-n*e,t);let d=OA(e-o*r-c*a,t),f=OA(-o*n-c*i,t);const u=d>s,l=f>s;if(u&&(d=t-d),l&&(f=t-f),d>s||f>s)throw new Error("splitScalarEndo: Endomorphism failed, k="+e);return{k1neg:u,k1:d,k2neg:l,k2:f}}},iA=32,sA=32,oA=iA+1,cA=2*iA+1;function dA(e){const{a:t,b:r}=rA,n=OA(e*e),a=OA(n*e);return OA(a+t*e+r)}const fA=rA.a===ZE;class uA extends Error{constructor(e){super(e)}}function lA(e){if(!(e instanceof hA))throw new TypeError("JacobianPoint expected")}class hA{constructor(e,t,r){this.x=e,this.y=t,this.z=r}static fromAffine(e){if(!(e instanceof gA))throw new TypeError("JacobianPoint#fromAffine: expected Point");return e.equals(gA.ZERO)?hA.ZERO:new hA(e.x,e.y,XE)}static toAffineBatch(e){const t=function(e,t=rA.P){const r=new Array(e.length),n=e.reduce(((e,n,a)=>n===ZE?e:(r[a]=e,OA(e*n,t))),XE),a=NA(n,t);return e.reduceRight(((e,n,a)=>n===ZE?e:(r[a]=OA(e*r[a],t),OA(e*n,t))),a),r}(e.map((e=>e.z)));return e.map(((e,r)=>e.toAffine(t[r])))}static normalizeZ(e){return hA.toAffineBatch(e).map(hA.fromAffine)}equals(e){lA(e);const{x:t,y:r,z:n}=this,{x:a,y:i,z:s}=e,o=OA(n*n),c=OA(s*s),d=OA(t*c),f=OA(a*o),u=OA(OA(r*s)*c),l=OA(OA(i*n)*o);return d===f&&u===l}negate(){return new hA(this.x,OA(-this.y),this.z)}double(){const{x:e,y:t,z:r}=this,n=OA(e*e),a=OA(t*t),i=OA(a*a),s=e+a,o=OA(QE*(OA(s*s)-n-i)),c=OA(eA*n),d=OA(c*c),f=OA(d-QE*o),u=OA(c*(o-f)-tA*i),l=OA(QE*t*r);return new hA(f,u,l)}add(e){lA(e);const{x:t,y:r,z:n}=this,{x:a,y:i,z:s}=e;if(a===ZE||i===ZE)return this;if(t===ZE||r===ZE)return e;const o=OA(n*n),c=OA(s*s),d=OA(t*c),f=OA(a*o),u=OA(OA(r*s)*c),l=OA(OA(i*n)*o),h=OA(f-d),p=OA(l-u);if(h===ZE)return p===ZE?this.double():hA.ZERO;const b=OA(h*h),g=OA(h*b),y=OA(d*b),m=OA(p*p-g-QE*y),w=OA(p*(y-m)-u*g),v=OA(n*s*h);return new hA(m,w,v)}subtract(e){return this.add(e.negate())}multiplyUnsafe(e){const t=hA.ZERO;if("bigint"==typeof e&&e===ZE)return t;let r=MA(e);if(r===XE)return this;if(!fA){let e=t,n=this;for(;r>ZE;)r&XE&&(e=e.add(n)),n=n.double(),r>>=XE;return e}let{k1neg:n,k1:a,k2neg:i,k2:s}=aA.splitScalar(r),o=t,c=t,d=this;for(;a>ZE||s>ZE;)a&XE&&(o=o.add(d)),s&XE&&(c=c.add(d)),d=d.double(),a>>=XE,s>>=XE;return n&&(o=o.negate()),i&&(c=c.negate()),c=new hA(OA(c.x*aA.beta),c.y,c.z),o.add(c)}precomputeWindow(e){const t=fA?128/e+1:256/e+1,r=[];let n=this,a=n;for(let i=0;i<t;i++){a=n,r.push(a);for(let t=1;t<2**(e-1);t++)a=a.add(n),r.push(a);n=a.double()}return r}wNAF(e,t){!t&&this.equals(hA.BASE)&&(t=gA.BASE);const r=t&&t._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=t&&bA.get(t);n||(n=this.precomputeWindow(r),t&&1!==r&&(n=hA.normalizeZ(n),bA.set(t,n)));let a=hA.ZERO,i=hA.BASE;const s=1+(fA?128/r:256/r),o=2**(r-1),c=BigInt(2**r-1),d=2**r,f=BigInt(r);for(let t=0;t<s;t++){const r=t*o;let s=Number(e&c);e>>=f,s>o&&(s-=d,e+=XE);const u=r,l=r+Math.abs(s)-1,h=t%2!=0,p=s<0;0===s?i=i.add(pA(h,n[u])):a=a.add(pA(p,n[l]))}return{p:a,f:i}}multiply(e,t){let r,n,a=MA(e);if(fA){const{k1neg:e,k1:i,k2neg:s,k2:o}=aA.splitScalar(a);let{p:c,f:d}=this.wNAF(i,t),{p:f,f:u}=this.wNAF(o,t);c=pA(e,c),f=pA(s,f),f=new hA(OA(f.x*aA.beta),f.y,f.z),r=c.add(f),n=d.add(u)}else{const{p:e,f:i}=this.wNAF(a,t);r=e,n=i}return hA.normalizeZ([r,n])[0]}toAffine(e){const{x:t,y:r,z:n}=this,a=this.equals(hA.ZERO);null==e&&(e=a?tA:NA(n));const i=e,s=OA(i*i),o=OA(s*i),c=OA(t*s),d=OA(r*o),f=OA(n*i);if(a)return gA.ZERO;if(f!==XE)throw new Error("invZ was invalid");return new gA(c,d)}}function pA(e,t){const r=t.negate();return e?r:t}hA.BASE=new hA(rA.Gx,rA.Gy,XE),hA.ZERO=new hA(ZE,XE,ZE);const bA=new WeakMap;class gA{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,bA.delete(this)}hasEvenY(){return this.y%QE===ZE}static fromCompressedHex(e){const t=32===e.length,r=TA(t?e:e.subarray(1));if(!UA(r))throw new Error("Point is not on curve");let n=function(e){const{P:t}=rA,r=BigInt(6),n=BigInt(11),a=BigInt(22),i=BigInt(23),s=BigInt(44),o=BigInt(88),c=e*e*e%t,d=c*c*e%t,f=RA(d,eA)*d%t,u=RA(f,eA)*d%t,l=RA(u,QE)*c%t,h=RA(l,n)*l%t,p=RA(h,a)*h%t,b=RA(p,s)*p%t,g=RA(b,o)*b%t,y=RA(g,s)*p%t,m=RA(y,eA)*d%t,w=RA(m,i)*h%t,v=RA(w,r)*c%t,E=RA(v,QE);if(E*E%t!==e)throw new Error("Cannot find square root");return E}(dA(r));const a=(n&XE)===XE;if(t)a&&(n=OA(-n));else{!(1&~e[0])!==a&&(n=OA(-n))}const i=new gA(r,n);return i.assertValidity(),i}static fromUncompressedHex(e){const t=TA(e.subarray(1,iA+1)),r=TA(e.subarray(iA+1,2*iA+1)),n=new gA(t,r);return n.assertValidity(),n}static fromHex(e){const t=BA(e),r=t.length,n=t[0];if(r===iA)return this.fromCompressedHex(t);if(r===oA&&(2===n||3===n))return this.fromCompressedHex(t);if(r===cA&&4===n)return this.fromUncompressedHex(t);throw new Error(`Point.fromHex: received invalid point. Expected 32-${oA} compressed bytes or ${cA} uncompressed bytes, not ${r}`)}static fromPrivateKey(e){return gA.BASE.multiply(HA(e))}static fromSignature(e,t,r){const{r:n,s:a}=jA(t);if(![0,1,2,3].includes(r))throw new Error("Cannot recover: invalid recovery bit");const i=PA(BA(e)),{n:s}=rA,o=2===r||3===r?n+s:n,c=NA(o,s),d=OA(-i*c,s),f=OA(a*c,s),u=1&r?"03":"02",l=gA.fromHex(u+xA(o)),h=gA.BASE.multiplyAndAddUnsafe(l,d,f);if(!h)throw new Error("Cannot recover signature: point at infinify");return h.assertValidity(),h}toRawBytes(e=!1){return CA(this.toHex(e))}toHex(e=!1){const t=xA(this.x);if(e){return`${this.hasEvenY()?"02":"03"}${t}`}return`04${t}${xA(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const e="Point is not on elliptic curve",{x:t,y:r}=this;if(!UA(t)||!UA(r))throw new Error(e);const n=OA(r*r);if(OA(n-dA(t))!==ZE)throw new Error(e)}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new gA(this.x,OA(-this.y))}double(){return hA.fromAffine(this).double().toAffine()}add(e){return hA.fromAffine(this).add(hA.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return hA.fromAffine(this).multiply(e,this).toAffine()}multiplyAndAddUnsafe(e,t,r){const n=hA.fromAffine(this),a=t===ZE||t===XE||this!==gA.BASE?n.multiplyUnsafe(t):n.multiply(t),i=hA.fromAffine(e).multiplyUnsafe(r),s=a.add(i);return s.equals(hA.ZERO)?void 0:s.toAffine()}}function yA(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function mA(e){if(e.length<2||2!==e[0])throw new Error(`Invalid signature integer tag: ${AA(e)}`);const t=e[1],r=e.subarray(2,t+2);if(!t||r.length!==t)throw new Error("Invalid signature integer: wrong length");if(0===r[0]&&r[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:TA(r),left:e.subarray(t+2)}}gA.BASE=new gA(rA.Gx,rA.Gy),gA.ZERO=new gA(ZE,ZE);class wA{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromCompact(e){const t=e instanceof Uint8Array,r="Signature.fromCompact";if("string"!=typeof e&&!t)throw new TypeError(`${r}: Expected string or Uint8Array`);const n=t?AA(e):e;if(128!==n.length)throw new Error(`${r}: Expected 64-byte hex`);return new wA(kA(n.slice(0,64)),kA(n.slice(64,128)))}static fromDER(e){const t=e instanceof Uint8Array;if("string"!=typeof e&&!t)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r,s:n}=function(e){if(e.length<2||48!=e[0])throw new Error(`Invalid signature tag: ${AA(e)}`);if(e[1]!==e.length-2)throw new Error("Invalid signature: incorrect length");const{data:t,left:r}=mA(e.subarray(2)),{data:n,left:a}=mA(r);if(a.length)throw new Error(`Invalid signature: left bytes after parsing: ${AA(a)}`);return{r:t,s:n}}(t?e:CA(e));return new wA(r,n)}static fromHex(e){return this.fromDER(e)}assertValidity(){const{r:e,s:t}=this;if(!DA(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!DA(t))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const e=rA.n>>XE;return this.s>e}normalizeS(){return this.hasHighS()?new wA(this.r,OA(-this.s,rA.n)):this}toDERRawBytes(){return CA(this.toDERHex())}toDERHex(){const e=yA(IA(this.s)),t=yA(IA(this.r)),r=e.length/2,n=t.length/2,a=IA(r),i=IA(n);return`30${IA(n+r+4)}02${i}${t}02${a}${e}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return CA(this.toCompactHex())}toCompactHex(){return xA(this.r)+xA(this.s)}}function vA(...e){if(!e.every((e=>e instanceof Uint8Array)))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const a=e[t];r.set(a,n),n+=a.length}return r}const EA=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function AA(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");let t="";for(let r=0;r<e.length;r++)t+=EA[e[r]];return t}const _A=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000");function xA(e){if("bigint"!=typeof e)throw new Error("Expected bigint");if(!(ZE<=e&&e<_A))throw new Error("Expected number 0 <= n < 2^256");return e.toString(16).padStart(64,"0")}function SA(e){const t=CA(xA(e));if(32!==t.length)throw new Error("Error: expected 32 bytes");return t}function IA(e){const t=e.toString(16);return 1&t.length?`0${t}`:t}function kA(e){if("string"!=typeof e)throw new TypeError("hexToNumber: expected string, got "+typeof e);return BigInt(`0x${e}`)}function CA(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+e.length);const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,a=e.slice(n,n+2),i=Number.parseInt(a,16);if(Number.isNaN(i)||i<0)throw new Error("Invalid byte sequence");t[r]=i}return t}function TA(e){return kA(AA(e))}function BA(e){return e instanceof Uint8Array?Uint8Array.from(e):CA(e)}function MA(e){if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)return BigInt(e);if("bigint"==typeof e&&DA(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function OA(e,t=rA.P){const r=e%t;return r>=ZE?r:t+r}function RA(e,t){const{P:r}=rA;let n=e;for(;t-- >ZE;)n*=n,n%=r;return n}function NA(e,t=rA.P){if(e===ZE||t<=ZE)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=OA(e,t),n=t,a=ZE,i=XE,s=XE,o=ZE;for(;r!==ZE;){const e=n/r,t=n%r,c=a-s*e,d=i-o*e;n=r,r=t,a=s,i=o,s=c,o=d}if(n!==XE)throw new Error("invert: does not exist");return OA(a,t)}function PA(e,t=!1){const r=function(e){const t=8*e.length-8*sA,r=TA(e);return t>0?r>>BigInt(t):r}(e);if(t)return r;const{n}=rA;return r>=n?r-n:r}let LA,FA;function DA(e){return ZE<e&&e<rA.n}function UA(e){return ZE<e&&e<rA.P}function HA(e){let t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"==typeof e){if(e.length!==2*sA)throw new Error("Expected 32 bytes of private key");t=kA(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(e.length!==sA)throw new Error("Expected 32 bytes of private key");t=TA(e)}if(!DA(t))throw new Error("Expected private key: 0 < key < n");return t}function jA(e){if(e instanceof wA)return e.assertValidity(),e;try{return wA.fromDER(e)}catch(t){return wA.fromCompact(e)}}gA.BASE._setWindowSize(8);const VA={node:YE,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0},$A={},zA={bytesToHex:AA,hexToBytes:CA,concatBytes:vA,mod:OA,invert:NA,isValidPrivateKey(e){try{return HA(e),!0}catch(e){return!1}},_bigintTo32Bytes:SA,_normalizePrivateKey:HA,hashToPrivateKey:e=>{e=BA(e);const t=sA+8;if(e.length<t||e.length>1024)throw new Error("Expected valid bytes of private key as per FIPS 186");return SA(OA(TA(e),rA.n-XE)+XE)},randomBytes:(e=32)=>{if(VA.web)return VA.web.getRandomValues(new Uint8Array(e));if(VA.node){const{randomBytes:t}=VA.node;return Uint8Array.from(t(e))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>zA.hashToPrivateKey(zA.randomBytes(sA+8)),precompute(e=8,t=gA.BASE){const r=t===gA.BASE?t:new gA(t.x,t.y);return r._setWindowSize(e),r.multiply(eA),r},sha256:async(...e)=>{if(VA.web){const t=await VA.web.subtle.digest("SHA-256",vA(...e));return new Uint8Array(t)}if(VA.node){const{createHash:t}=VA.node,r=t("sha256");return e.forEach((e=>r.update(e))),Uint8Array.from(r.digest())}throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(e,...t)=>{if(VA.web){const r=await VA.web.subtle.importKey("raw",e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),n=vA(...t),a=await VA.web.subtle.sign("HMAC",r,n);return new Uint8Array(a)}if(VA.node){const{createHmac:r}=VA.node,n=r("sha256",e);return t.forEach((e=>n.update(e))),Uint8Array.from(n.digest())}throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(e,...t)=>{let r=$A[e];if(void 0===r){const t=await zA.sha256(Uint8Array.from(e,(e=>e.charCodeAt(0))));r=vA(t,t),$A[e]=r}return zA.sha256(r,...t)},taggedHashSync:(e,...t)=>{if("function"!=typeof LA)throw new uA("sha256Sync is undefined, you need to set it");let r=$A[e];if(void 0===r){const t=LA(Uint8Array.from(e,(e=>e.charCodeAt(0))));r=vA(t,t),$A[e]=r}return LA(r,...t)},_JacobianPoint:hA};Object.defineProperties(zA,{sha256Sync:{configurable:!1,get:()=>LA,set(e){LA||(LA=e)}},hmacSha256Sync:{configurable:!1,get:()=>FA,set(e){FA||(FA=e)}}});var qA=a(6925);function KA(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`positive integer expected, not ${e}`)}function GA(e,...t){if(!((r=e)instanceof Uint8Array||null!=r&&"object"==typeof r&&"Uint8Array"===r.constructor.name))throw new Error("Uint8Array expected");var r;if(t.length>0&&!t.includes(e.length))throw new Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function JA(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");KA(e.outputLen),KA(e.blockLen)}function WA(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function YA(e,t){GA(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}const ZA=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),XA=(e,t)=>e<<32-t|e>>>t,QA=(e,t)=>e<<t|e>>>32-t>>>0,e_=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],t_=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function r_(e){for(let t=0;t<e.length;t++)e[t]=t_(e[t])}Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function n_(e){return"string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}(e)),GA(e),e}class a_{clone(){return this._cloneInto()}}function i_(e){const t=t=>e().update(n_(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}const s_=(e,t,r)=>e&t^e&r^t&r;class o_ extends a_{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=ZA(this.buffer)}update(e){WA(this);const{view:t,buffer:r,blockLen:n}=this,a=(e=n_(e)).length;for(let i=0;i<a;){const s=Math.min(n-this.pos,a-i);if(s!==n)r.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===n&&(this.process(t,0),this.pos=0);else{const t=ZA(e);for(;n<=a-i;i+=n)this.process(t,i)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){WA(this),YA(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:a}=this;let{pos:i}=this;t[i++]=128,this.buffer.subarray(i).fill(0),this.padOffset>n-i&&(this.process(r,0),i=0);for(let e=i;e<n;e++)t[e]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const a=BigInt(32),i=BigInt(4294967295),s=Number(r>>a&i),o=Number(r&i),c=n?4:0,d=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+d,o,n)}(r,n-8,BigInt(8*this.length),a),this.process(r,0);const s=ZA(e),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=o/4,d=this.get();if(c>d.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)s.setUint32(4*e,d[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:a,destroyed:i,pos:s}=this;return e.length=n,e.pos=s,e.finished=a,e.destroyed=i,n%t&&e.buffer.set(r),e}}const c_=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),d_=new Uint8Array(new Array(16).fill(0).map(((e,t)=>t))),f_=d_.map((e=>(9*e+5)%16));let u_=[d_],l_=[f_];for(let e=0;e<4;e++)for(let t of[u_,l_])t.push(t[e].map((e=>c_[e])));const h_=[[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((e=>new Uint8Array(e))),p_=u_.map(((e,t)=>e.map((e=>h_[t][e])))),b_=l_.map(((e,t)=>e.map((e=>h_[t][e])))),g_=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),y_=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]);function m_(e,t,r,n){return 0===e?t^r^n:1===e?t&r|~t&n:2===e?(t|~r)^n:3===e?t&n|r&~n:t^(r|~n)}const w_=new Uint32Array(16);class v_ extends o_{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:t,h2:r,h3:n,h4:a}=this;return[e,t,r,n,a]}set(e,t,r,n,a){this.h0=0|e,this.h1=0|t,this.h2=0|r,this.h3=0|n,this.h4=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)w_[r]=e.getUint32(t,!0);let r=0|this.h0,n=r,a=0|this.h1,i=a,s=0|this.h2,o=s,c=0|this.h3,d=c,f=0|this.h4,u=f;for(let e=0;e<5;e++){const t=4-e,l=g_[e],h=y_[e],p=u_[e],b=l_[e],g=p_[e],y=b_[e];for(let t=0;t<16;t++){const n=QA(r+m_(e,a,s,c)+w_[p[t]]+l,g[t])+f|0;r=f,f=c,c=0|QA(s,10),s=a,a=n}for(let e=0;e<16;e++){const r=QA(n+m_(t,i,o,d)+w_[b[e]]+h,y[e])+u|0;n=u,u=d,d=0|QA(o,10),o=i,i=r}}this.set(this.h1+s+d|0,this.h2+c+u|0,this.h3+f+n|0,this.h4+r+i|0,this.h0+a+o|0)}roundClean(){w_.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const E_=i_((()=>new v_)),A_=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]),__=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),x_=new Uint32Array(64);class S_ extends o_{constructor(){super(64,32,8,!1),this.A=0|__[0],this.B=0|__[1],this.C=0|__[2],this.D=0|__[3],this.E=0|__[4],this.F=0|__[5],this.G=0|__[6],this.H=0|__[7]}get(){const{A:e,B:t,C:r,D:n,E:a,F:i,G:s,H:o}=this;return[e,t,r,n,a,i,s,o]}set(e,t,r,n,a,i,s,o){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|a,this.F=0|i,this.G=0|s,this.H=0|o}process(e,t){for(let r=0;r<16;r++,t+=4)x_[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=x_[e-15],r=x_[e-2],n=XA(t,7)^XA(t,18)^t>>>3,a=XA(r,17)^XA(r,19)^r>>>10;x_[e]=a+x_[e-7]+n+x_[e-16]|0}let{A:r,B:n,C:a,D:i,E:s,F:o,G:c,H:d}=this;for(let e=0;e<64;e++){const t=d+(XA(s,6)^XA(s,11)^XA(s,25))+((f=s)&o^~f&c)+A_[e]+x_[e]|0,u=(XA(r,2)^XA(r,13)^XA(r,22))+s_(r,n,a)|0;d=c,c=o,o=s,s=i+t|0,i=a,a=n,n=r,r=t+u|0}var f;r=r+this.A|0,n=n+this.B|0,a=a+this.C|0,i=i+this.D|0,s=s+this.E|0,o=o+this.F|0,c=c+this.G|0,d=d+this.H|0,this.set(r,n,a,i,s,o,c,d)}roundClean(){x_.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const I_=i_((()=>new S_));function k_(e){if(!Number.isSafeInteger(e))throw new Error(`Wrong integer: ${e}`)}function C_(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function T_(...e){const t=e=>e,r=(e,t)=>r=>e(t(r));return{encode:e.map((e=>e.encode)).reduceRight(r,t),decode:e.map((e=>e.decode)).reduce(r,t)}}function B_(e){return{encode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("alphabet.encode input should be an array of numbers");return t.map((t=>{if(k_(t),t<0||t>=e.length)throw new Error(`Digit index outside alphabet: ${t} (alphabet: ${e.length})`);return e[t]}))},decode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("alphabet.decode input should be array of strings");return t.map((t=>{if("string"!=typeof t)throw new Error(`alphabet.decode: not string element=${t}`);const r=e.indexOf(t);if(-1===r)throw new Error(`Unknown letter: "${t}". Allowed: ${e}`);return r}))}}}function M_(e=""){if("string"!=typeof e)throw new Error("join separator should be string");return{encode:t=>{if(!Array.isArray(t)||t.length&&"string"!=typeof t[0])throw new Error("join.encode input should be array of strings");for(let e of t)if("string"!=typeof e)throw new Error(`join.encode: non-string input=${e}`);return t.join(e)},decode:t=>{if("string"!=typeof t)throw new Error("join.decode input should be string");return t.split(e)}}}function O_(e,t="="){if(k_(e),"string"!=typeof t)throw new Error("padding chr should be string");return{encode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let e of r)if("string"!=typeof e)throw new Error(`padding.encode: non-string input=${e}`);for(;r.length*e%8;)r.push(t);return r},decode(r){if(!Array.isArray(r)||r.length&&"string"!=typeof r[0])throw new Error("padding.encode input should be array of strings");for(let e of r)if("string"!=typeof e)throw new Error(`padding.decode: non-string input=${e}`);let n=r.length;if(n*e%8)throw new Error("Invalid padding: string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--)if(!((n-1)*e%8))throw new Error("Invalid padding: string has too much padding");return r.slice(0,n)}}}function R_(e){if("function"!=typeof e)throw new Error("normalize fn should be function");return{encode:e=>e,decode:t=>e(t)}}function N_(e,t,r){if(t<2)throw new Error(`convertRadix: wrong from=${t}, base cannot be less than 2`);if(r<2)throw new Error(`convertRadix: wrong to=${r}, base cannot be less than 2`);if(!Array.isArray(e))throw new Error("convertRadix: data should be array");if(!e.length)return[];let n=0;const a=[],i=Array.from(e);for(i.forEach((e=>{if(k_(e),e<0||e>=t)throw new Error(`Wrong integer: ${e}`)}));;){let e=0,s=!0;for(let a=n;a<i.length;a++){const o=i[a],c=t*e+o;if(!Number.isSafeInteger(c)||t*e/t!==e||c-o!=t*e)throw new Error("convertRadix: carry overflow");e=c%r;const d=Math.floor(c/r);if(i[a]=d,!Number.isSafeInteger(d)||d*r+e!==c)throw new Error("convertRadix: carry overflow");s&&(d?s=!1:n=a)}if(a.push(e),s)break}for(let t=0;t<e.length-1&&0===e[t];t++)a.push(0);return a.reverse()}const P_=(e,t)=>t?P_(t,e%t):e,L_=(e,t)=>e+(t-P_(e,t));function F_(e,t,r,n){if(!Array.isArray(e))throw new Error("convertRadix2: data should be array");if(t<=0||t>32)throw new Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw new Error(`convertRadix2: wrong to=${r}`);if(L_(t,r)>32)throw new Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${L_(t,r)}`);let a=0,i=0;const s=2**r-1,o=[];for(const n of e){if(k_(n),n>=2**t)throw new Error(`convertRadix2: invalid data word=${n} from=${t}`);if(a=a<<t|n,i+t>32)throw new Error(`convertRadix2: carry overflow pos=${i} from=${t}`);for(i+=t;i>=r;i-=r)o.push((a>>i-r&s)>>>0);a&=2**i-1}if(a=a<<r-i&s,!n&&i>=t)throw new Error("Excess padding");if(!n&&a)throw new Error(`Non-zero padding: ${a}`);return n&&i>0&&o.push(a>>>0),o}function D_(e){return k_(e),{encode:t=>{if(!C_(t))throw new Error("radix.encode input should be Uint8Array");return N_(Array.from(t),256,e)},decode:t=>{if(!Array.isArray(t)||t.length&&"number"!=typeof t[0])throw new Error("radix.decode input should be array of numbers");return Uint8Array.from(N_(t,e,256))}}}function U_(e,t=!1){if(k_(e),e<=0||e>32)throw new Error("radix2: bits should be in (0..32]");if(L_(8,e)>32||L_(e,8)>32)throw new Error("radix2: carry overflow");return{encode:r=>{if(!C_(r))throw new Error("radix2.encode input should be Uint8Array");return F_(Array.from(r),8,e,!t)},decode:r=>{if(!Array.isArray(r)||r.length&&"number"!=typeof r[0])throw new Error("radix2.decode input should be array of numbers");return Uint8Array.from(F_(r,e,8,t))}}}function H_(e,t){if(k_(e),"function"!=typeof t)throw new Error("checksum fn should be function");return{encode(r){if(!C_(r))throw new Error("checksum.encode: input should be Uint8Array");const n=t(r).slice(0,e),a=new Uint8Array(r.length+e);return a.set(r),a.set(n,r.length),a},decode(r){if(!C_(r))throw new Error("checksum.decode: input should be Uint8Array");const n=r.slice(0,-e),a=t(n).slice(0,e),i=r.slice(-e);for(let t=0;t<e;t++)if(a[t]!==i[t])throw new Error("Invalid checksum");return n}}}const j_=T_(U_(4),B_("0123456789ABCDEF"),M_("")),V_=T_(U_(5),B_("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),O_(5),M_("")),$_=(T_(U_(5),B_("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),M_("")),T_(U_(5),B_("0123456789ABCDEFGHIJKLMNOPQRSTUV"),O_(5),M_("")),T_(U_(5),B_("0123456789ABCDEFGHIJKLMNOPQRSTUV"),M_("")),T_(U_(5),B_("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),M_(""),R_((e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")))),T_(U_(6),B_("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),O_(6),M_(""))),z_=(T_(U_(6),B_("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),M_("")),T_(U_(6),B_("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),O_(6),M_(""))),q_=(T_(U_(6),B_("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),M_("")),e=>T_(D_(58),B_(e),M_(""))),K_=q_("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),G_=[0,2,3,5,6,7,9,10,11],J_={encode(e){let t="";for(let r=0;r<e.length;r+=8){const n=e.subarray(r,r+8);t+=K_.encode(n).padStart(G_[n.length],"1")}return t},decode(e){let t=[];for(let r=0;r<e.length;r+=11){const n=e.slice(r,r+11),a=G_.indexOf(n.length),i=K_.decode(n);for(let e=0;e<i.length-a;e++)if(0!==i[e])throw new Error("base58xmr: wrong padding");t=t.concat(Array.from(i.slice(i.length-a)))}return Uint8Array.from(t)}},W_=e=>T_(H_(4,(t=>e(e(t)))),K_);T_(B_("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),M_(""));const Y_={encode:e=>(new TextDecoder).decode(e),decode:e=>(new TextEncoder).encode(e)};T_(U_(4),B_("0123456789abcdef"),M_(""),R_((e=>{if("string"!=typeof e||e.length%2)throw new TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})));var Z_=a(8993),X_=a.t(Z_,2);const Q_=BigInt(0),ex=BigInt(1),tx=BigInt(2),rx=BigInt(8),nx=BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),ax=Object.freeze({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),P:BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),l:nx,n:nx,h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960")}),ix=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),sx=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),ox=(BigInt("6853475219497561581579357271197624642482790079785650197046958215289687604742"),BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235")),cx=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),dx=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),fx=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");class ux{constructor(e,t,r,n){this.x=e,this.y=t,this.z=r,this.t=n}static fromAffine(e){if(!(e instanceof mx))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return e.equals(mx.ZERO)?ux.ZERO:new ux(e.x,e.y,ex,Tx(e.x*e.y))}static toAffineBatch(e){const t=function(e,t=ax.P){const r=new Array(e.length),n=e.reduce(((e,n,a)=>n===Q_?e:(r[a]=e,Tx(e*n,t))),ex),a=Bx(n,t);return e.reduceRight(((e,n,a)=>n===Q_?e:(r[a]=Tx(e*r[a],t),Tx(e*n,t))),a),r}(e.map((e=>e.z)));return e.map(((e,r)=>e.toAffine(t[r])))}static normalizeZ(e){return this.toAffineBatch(e).map(this.fromAffine)}equals(e){hx(e);const{x:t,y:r,z:n}=this,{x:a,y:i,z:s}=e,o=Tx(t*s),c=Tx(a*n),d=Tx(r*s),f=Tx(i*n);return o===c&&d===f}negate(){return new ux(Tx(-this.x),this.y,this.z,Tx(-this.t))}double(){const{x:e,y:t,z:r}=this,{a:n}=ax,a=Tx(e*e),i=Tx(t*t),s=Tx(tx*Tx(r*r)),o=Tx(n*a),c=e+t,d=Tx(Tx(c*c)-a-i),f=o+i,u=f-s,l=o-i,h=Tx(d*u),p=Tx(f*l),b=Tx(d*l),g=Tx(u*f);return new ux(h,p,g,b)}add(e){hx(e);const{x:t,y:r,z:n,t:a}=this,{x:i,y:s,z:o,t:c}=e,d=Tx((r-t)*(s+i)),f=Tx((r+t)*(s-i)),u=Tx(f-d);if(u===Q_)return this.double();const l=Tx(n*tx*c),h=Tx(a*tx*o),p=h+l,b=f+d,g=h-l,y=Tx(p*u),m=Tx(b*g),w=Tx(p*g),v=Tx(u*b);return new ux(y,m,v,w)}subtract(e){return this.add(e.negate())}precomputeWindow(e){const t=1+256/e,r=[];let n=this,a=n;for(let i=0;i<t;i++){a=n,r.push(a);for(let t=1;t<2**(e-1);t++)a=a.add(n),r.push(a);n=a.double()}return r}wNAF(e,t){!t&&this.equals(ux.BASE)&&(t=mx.BASE);const r=t&&t._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=t&&yx.get(t);n||(n=this.precomputeWindow(r),t&&1!==r&&(n=ux.normalizeZ(n),yx.set(t,n)));let a=ux.ZERO,i=ux.BASE;const s=1+256/r,o=2**(r-1),c=BigInt(2**r-1),d=2**r,f=BigInt(r);for(let t=0;t<s;t++){const r=t*o;let s=Number(e&c);e>>=f,s>o&&(s-=d,e+=ex);const u=r,l=r+Math.abs(s)-1,h=t%2!=0,p=s<0;0===s?i=i.add(lx(h,n[u])):a=a.add(lx(p,n[l]))}return ux.normalizeZ([a,i])[0]}multiply(e,t){return this.wNAF(Fx(e,ax.l),t)}multiplyUnsafe(e){let t=Fx(e,ax.l,!1);const r=ux.BASE,n=ux.ZERO;if(t===Q_)return n;if(this.equals(n)||t===ex)return this;if(this.equals(r))return this.wNAF(t);let a=n,i=this;for(;t>Q_;)t&ex&&(a=a.add(i)),i=i.double(),t>>=ex;return a}isSmallOrder(){return this.multiplyUnsafe(ax.h).equals(ux.ZERO)}isTorsionFree(){let e=this.multiplyUnsafe(ax.l/tx).double();return ax.l%tx&&(e=e.add(this)),e.equals(ux.ZERO)}toAffine(e){const{x:t,y:r,z:n}=this,a=this.equals(ux.ZERO);null==e&&(e=a?rx:Bx(n));const i=Tx(t*e),s=Tx(r*e),o=Tx(n*e);if(a)return mx.ZERO;if(o!==ex)throw new Error("invZ was invalid");return new mx(i,s)}fromRistrettoBytes(){bx()}toRistrettoBytes(){bx()}fromRistrettoHash(){bx()}}function lx(e,t){const r=t.negate();return e?r:t}function hx(e){if(!(e instanceof ux))throw new TypeError("ExtendedPoint expected")}function px(e){if(!(e instanceof gx))throw new TypeError("RistrettoPoint expected")}function bx(){throw new Error("Legacy method: switch to RistrettoPoint")}ux.BASE=new ux(ax.Gx,ax.Gy,ex,Tx(ax.Gx*ax.Gy)),ux.ZERO=new ux(Q_,ex,ex,Q_);class gx{constructor(e){this.ep=e}static calcElligatorRistrettoMap(e){const{d:t}=ax,r=Tx(sx*e*e),n=Tx((r+ex)*dx);let a=BigInt(-1);const i=Tx((a-t*r)*Tx(r+t));let{isValid:s,value:o}=Rx(n,i),c=Tx(o*e);Sx(c)||(c=Tx(-c)),s||(o=c),s||(a=r);const d=Tx(a*(r-ex)*fx-i),f=o*o,u=Tx((o+o)*i),l=Tx(d*ox),h=Tx(ex-f),p=Tx(ex+f);return new ux(Tx(u*p),Tx(h*l),Tx(l*p),Tx(u*h))}static hashToCurve(e){const t=Cx((e=Lx(e,64)).slice(0,32)),r=this.calcElligatorRistrettoMap(t),n=Cx(e.slice(32,64)),a=this.calcElligatorRistrettoMap(n);return new gx(r.add(a))}static fromHex(e){e=Lx(e,32);const{a:t,d:r}=ax,n="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",a=Cx(e);if(!function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}(xx(a),e)||Sx(a))throw new Error(n);const i=Tx(a*a),s=Tx(ex+t*i),o=Tx(ex-t*i),c=Tx(s*s),d=Tx(o*o),f=Tx(t*r*c-d),{isValid:u,value:l}=Nx(Tx(f*d)),h=Tx(l*o),p=Tx(l*h*f);let b=Tx((a+a)*h);Sx(b)&&(b=Tx(-b));const g=Tx(s*p),y=Tx(b*g);if(!u||Sx(y)||g===Q_)throw new Error(n);return new gx(new ux(b,g,ex,y))}toRawBytes(){let{x:e,y:t,z:r,t:n}=this.ep;const a=Tx(Tx(r+t)*Tx(r-t)),i=Tx(e*t),s=Tx(i*i),{value:o}=Nx(Tx(a*s)),c=Tx(o*a),d=Tx(o*i),f=Tx(c*d*n);let u;if(Sx(n*f)){let r=Tx(t*sx),n=Tx(e*sx);e=r,t=n,u=Tx(c*cx)}else u=d;Sx(e*f)&&(t=Tx(-t));let l=Tx((r-t)*u);return Sx(l)&&(l=Tx(-l)),xx(l)}toHex(){return Ex(this.toRawBytes())}toString(){return this.toHex()}equals(e){px(e);const t=this.ep,r=e.ep,n=Tx(t.x*r.y)===Tx(t.y*r.x),a=Tx(t.y*r.y)===Tx(t.x*r.x);return n||a}add(e){return px(e),new gx(this.ep.add(e.ep))}subtract(e){return px(e),new gx(this.ep.subtract(e.ep))}multiply(e){return new gx(this.ep.multiply(e))}multiplyUnsafe(e){return new gx(this.ep.multiplyUnsafe(e))}}gx.BASE=new gx(ux.BASE),gx.ZERO=new gx(ux.ZERO);const yx=new WeakMap;class mx{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,yx.delete(this)}static fromHex(e,t=!0){const{d:r,P:n}=ax,a=(e=Lx(e,32)).slice();a[31]=-129&e[31];const i=Ix(a);if(t&&i>=n)throw new Error("Expected 0 < hex < P");if(!t&&i>=ix)throw new Error("Expected 0 < hex < 2**256");const s=Tx(i*i),o=Tx(s-ex),c=Tx(r*s+ex);let{isValid:d,value:f}=Rx(o,c);if(!d)throw new Error("Point.fromHex: invalid y coordinate");const u=(f&ex)===ex;return!!(128&e[31])!==u&&(f=Tx(-f)),new mx(f,i)}static async fromPrivateKey(e){return(await Vx(e)).point}toRawBytes(){const e=xx(this.y);return e[31]|=this.x&ex?128:0,e}toHex(){return Ex(this.toRawBytes())}toX25519(){const{y:e}=this;return xx(Tx((ex+e)*Bx(ex-e)))}isTorsionFree(){return ux.fromAffine(this).isTorsionFree()}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new mx(Tx(-this.x),this.y)}add(e){return ux.fromAffine(this).add(ux.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return ux.fromAffine(this).multiply(e,this).toAffine()}}mx.BASE=new mx(ax.Gx,ax.Gy),mx.ZERO=new mx(Q_,ex);function wx(...e){if(!e.every((e=>e instanceof Uint8Array)))throw new Error("Expected Uint8Array list");if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const a=e[t];r.set(a,n),n+=a.length}return r}const vx=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function Ex(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=vx[e[r]];return t}function Ax(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,a=e.slice(n,n+2),i=Number.parseInt(a,16);if(Number.isNaN(i)||i<0)throw new Error("Invalid byte sequence");t[r]=i}return t}function _x(e){return Ax(e.toString(16).padStart(64,"0"))}function xx(e){return _x(e).reverse()}function Sx(e){return(Tx(e)&ex)===ex}function Ix(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");return BigInt("0x"+Ex(Uint8Array.from(e).reverse()))}const kx=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Cx(e){return Tx(Ix(e)&kx)}function Tx(e,t=ax.P){const r=e%t;return r>=Q_?r:t+r}function Bx(e,t=ax.P){if(e===Q_||t<=Q_)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=Tx(e,t),n=t,a=Q_,i=ex,s=ex,o=Q_;for(;r!==Q_;){const e=n/r,t=n%r,c=a-s*e,d=i-o*e;n=r,r=t,a=s,i=o,s=c,o=d}if(n!==ex)throw new Error("invert: does not exist");return Tx(a,t)}function Mx(e,t){const{P:r}=ax;let n=e;for(;t-- >Q_;)n*=n,n%=r;return n}function Ox(e){const{P:t}=ax,r=BigInt(5),n=BigInt(10),a=BigInt(20),i=BigInt(40),s=BigInt(80),o=e*e%t*e%t,c=Mx(o,tx)*o%t,d=Mx(c,ex)*e%t,f=Mx(d,r)*d%t,u=Mx(f,n)*f%t,l=Mx(u,a)*u%t,h=Mx(l,i)*l%t,p=Mx(h,s)*h%t,b=Mx(p,s)*h%t,g=Mx(b,n)*f%t;return{pow_p_5_8:Mx(g,tx)*e%t,b2:o}}function Rx(e,t){const r=Tx(t*t*t),n=Tx(r*r*t);let a=Tx(e*r*Ox(e*n).pow_p_5_8);const i=Tx(t*a*a),s=a,o=Tx(a*sx),c=i===e,d=i===Tx(-e),f=i===Tx(-e*sx);return c&&(a=s),(d||f)&&(a=o),Sx(a)&&(a=Tx(-a)),{isValid:c||d,value:a}}function Nx(e){return Rx(ex,e)}function Px(e){return Tx(Ix(e),ax.l)}function Lx(e,t){const r=e instanceof Uint8Array?Uint8Array.from(e):Ax(e);if("number"==typeof t&&r.length!==t)throw new Error(`Expected ${t} bytes`);return r}function Fx(e,t,r=!0){if(!t)throw new TypeError("Specify max value");if("number"==typeof e&&Number.isSafeInteger(e)&&(e=BigInt(e)),"bigint"==typeof e&&e<t)if(r){if(Q_<e)return e}else if(Q_<=e)return e;throw new TypeError("Expected valid scalar: 0 < scalar < max")}function Dx(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function Ux(e){if(32!==(e="bigint"==typeof e||"number"==typeof e?_x(Fx(e,ix)):Lx(e)).length)throw new Error("Expected 32 bytes");return e}function Hx(e){const t=Dx(e.slice(0,32)),r=e.slice(32,64),n=Px(t),a=mx.BASE.multiply(n),i=a.toRawBytes();return{head:t,prefix:r,scalar:n,point:a,pointBytes:i}}let jx;async function Vx(e){return Hx(await qx.sha512(Ux(e)))}async function $x(e){return(await Vx(e)).pointBytes}mx.BASE._setWindowSize(8);const zx={node:X_,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0},qx={bytesToHex:Ex,hexToBytes:Ax,concatBytes:wx,getExtendedPublicKey:Vx,mod:Tx,invert:Bx,TORSION_SUBGROUP:["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],hashToPrivateScalar:e=>{if((e=Lx(e)).length<40||e.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return Tx(Ix(e),ax.l-ex)+ex},randomBytes:(e=32)=>{if(zx.web)return zx.web.getRandomValues(new Uint8Array(e));if(zx.node){const{randomBytes:t}=zx.node;return new Uint8Array(t(e).buffer)}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>qx.randomBytes(32),sha512:async(...e)=>{const t=wx(...e);if(zx.web){const e=await zx.web.subtle.digest("SHA-512",t.buffer);return new Uint8Array(e)}if(zx.node)return Uint8Array.from(zx.node.createHash("sha512").update(t).digest());throw new Error("The environment doesn't have sha512 function")},precompute(e=8,t=mx.BASE){const r=t.equals(mx.BASE)?t:new mx(t.x,t.y);return r._setWindowSize(e),r.multiply(tx),r},sha512Sync:void 0};Object.defineProperties(qx,{sha512Sync:{configurable:!1,get:()=>jx,set(e){jx||(jx=e)}}});const Kx="ed25519",Gx=(0,UE.stringToBytes)("ed25519 seed"),Jx=e=>!0,Wx=!1,Yx=33,Zx=async(e,t)=>{const r=await $x(e);return(0,UE.concatBytes)([new Uint8Array([0]),r])},Xx=(e,t)=>{throw new Error("Ed25519 does not support public key derivation.")},Qx=e=>e,eS=e=>e,tS={secp256k1:m,ed25519:y};function rS(e){return tS[e]}const{mod:nS}=zA;function aS(e){return oS(e),`${iS(e)}'`}function iS(e){return oS(e),`bip32:${e}`}function sS(e){if("number"==typeof e)return iS(e);if(!e||!Number.isInteger(e.index)||"boolean"!=typeof e.hardened)throw new Error("Invalid BIP-32 index: Must be an object containing the index and whether it is hardened.");return e.hardened?aS(e.index):iS(e.index)}function oS(e){if(!(lS(t=e)&&t<=VE))throw new Error("Invalid BIP-32 index: Must be a non-negative integer.");var t}function cS(e){return e.endsWith("'")}function dS(e){return e instanceof Uint8Array?e:(0,UE.hexToBytes)(e)}function fS(e){if(void 0!==e)return dS(e)}function uS(e,t){if(e.length!==t)return!1;for(const t of e)if(0!==t)return!0;return!1}function lS(e){return"number"==typeof e&&Number.isInteger(e)&&e>=0}function hS(e,t){if(e instanceof Uint8Array)return bS(e,t),e;if("string"==typeof e){const r=(0,UE.hexToBytes)(e);return bS(r,t),r}throw new Error("Invalid value: Expected an instance of Uint8Array or hexadecimal string.")}function pS(e,t){if(e instanceof Uint8Array)return(0,UE.assert)(e.length===t,`Invalid value: Must be a ${t}-byte byte array.`),e;if("string"==typeof e)return pS((0,UE.hexToBytes)(e),t);throw new Error("Invalid value: Expected an instance of Uint8Array or hexadecimal string.")}function bS(e,t){if(!uS(e,t))throw new Error(`Invalid value: Must be a non-zero ${t}-byte byte array.`)}const gS=e=>{if(!uS(e,33))throw new Error("Invalid public key: The key must be a 33-byte, non-zero byte array.");const t=E_(I_(e));return(0,UE.createDataView)(t).getUint32(0,!1)};function yS(e){if(!e||"string"!=typeof e)throw new Error("Invalid curve: Must specify a curve.");if(!Object.keys(tS).includes(e))throw new Error(`Invalid curve: Only the following curves are supported: ${Object.keys(tS).join(", ")}.`)}function mS(e){const t=new Uint8Array(4);return(0,UE.createDataView)(t).setUint32(0,e,!1),t}const wS="secp256k1",vS=(0,UE.stringToBytes)("Bitcoin seed"),ES=!0,AS=65,_S=e=>zA.isValidPrivateKey(e),xS=(e,t)=>function(e,t=!1){return gA.fromPrivateKey(e).toRawBytes(t)}(e,t),SS=(e,t)=>{(0,UE.assert)(uS(t,32),"Invalid tweak: Tweak must be a non-zero 32-byte Uint8Array.");const r=gA.fromHex(e).add(gA.fromPrivateKey(t));return r.assertValidity(),r.toRawBytes(!1)},IS=e=>gA.fromHex(e).toRawBytes(!0),kS=e=>gA.fromHex(e).toRawBytes(!1),CS=76067358,TS=76066276,BS=e=>{const t=(e=>{const t=W_(I_);try{return t.decode(e)}catch{throw new Error("Invalid extended key: Value is not base58-encoded, or the checksum is invalid.")}})(e);if(78!==t.length)throw new Error(`Invalid extended key: Expected a length of 78, got ${t.length}.`);const r=(0,UE.createDataView)(t),n=r.getUint32(0,!1),a=r.getUint8(4);ek(a);const i=r.getUint32(5,!1),s=r.getUint32(9,!1),o=t.slice(13,45);if(!uS(o,32))throw new Error("Invalid extended key: Chain code must be a 32-byte non-zero byte array.");const c=t.slice(45,78);if(!uS(c,33))throw new Error("Invalid extended key: Key must be a 33-byte non-zero byte array.");const d=(0,UE.createDataView)(c);if(n===CS){if(2!==d.getUint8(0)&&3!==d.getUint8(0))throw new Error("Invalid extended key: Public key must start with 0x02 or 0x03.");return{version:n,depth:a,parentFingerprint:i,index:s,chainCode:o,publicKey:kS(c)}}if(n===TS){if(0!==d.getUint8(0))throw new Error("Invalid extended key: Private key must start with 0x00.");return{version:n,depth:a,parentFingerprint:i,index:s,chainCode:o,privateKey:c.slice(1)}}throw new Error("Invalid extended key: Expected a public (xpub) or private key (xprv) version.")},MS=e=>{const{version:t,depth:r,parentFingerprint:n,index:a,chainCode:i}=e,s=new Uint8Array(78),o=(0,UE.createDataView)(s);if(o.setUint32(0,t,!1),o.setUint8(4,r),o.setUint32(5,n,!1),o.setUint32(9,a,!1),s.set(i,13),e.version===CS){const{publicKey:t}=e,r=IS(t);s.set(r,45)}if(e.version===TS){const{privateKey:t}=e;s.set(t,46)}return c=s,W_(I_).encode(c);var c};function OS(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function RS(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,OS(e,t,"get"))}function NS(e,t,r){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,r)}function PS(e,t,r){return function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,OS(e,t,"set"),r),r}function LS(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const FS=2;var DS=new WeakMap;class US{static async fromJSON(e,t){jS(t),HS(e.depth);const r=await QI.fromExtendedKey({depth:e.depth,index:e.index,parentFingerprint:e.parentFingerprint,chainCode:dS(e.chainCode),privateKey:fS(e.privateKey),publicKey:dS(e.publicKey)});return new US(r,t)}static async fromDerivationPath(e){HS(e.length-1);const t=await QI.fromDerivationPath({derivationPath:e}),r=e[FS].split(":")[1]?.replace("'","");(0,UE.assert)(r,"Invalid derivation path.");const n=Number.parseInt(r,10);return new US(t,n)}static async fromNode(e,t){if(!(e instanceof QI))throw new Error("Invalid node: Expected an instance of BIP44Node.");return jS(t),HS(e.depth),Promise.resolve(new US(e,t))}get depth(){return RS(this,DS).depth}get privateKeyBytes(){return RS(this,DS).privateKeyBytes}get publicKeyBytes(){return RS(this,DS).publicKeyBytes}get chainCodeBytes(){return RS(this,DS).chainCodeBytes}get privateKey(){return RS(this,DS).privateKey}get publicKey(){return RS(this,DS).publicKey}get compressedPublicKey(){return RS(this,DS).compressedPublicKey}get compressedPublicKeyBytes(){return RS(this,DS).compressedPublicKeyBytes}get chainCode(){return RS(this,DS).chainCode}get address(){return RS(this,DS).address}get masterFingerprint(){return RS(this,DS).masterFingerprint}get parentFingerprint(){return RS(this,DS).parentFingerprint}get fingerprint(){return RS(this,DS).fingerprint}get index(){return RS(this,DS).index}get curve(){return RS(this,DS).curve}get extendedKey(){return RS(this,DS).extendedKey}async deriveBIP44AddressKey({account:e=0,change:t=0,address_index:r}){return await RS(this,DS).derive(function({account:e=0,change:t=0,address_index:r}){return[aS(e),sS(t),sS(r)]}({account:e,change:t,address_index:r}))}toJSON(){return{...RS(this,DS).toJSON(),coin_type:this.coin_type,path:this.path}}constructor(e,t){NS(this,DS,{writable:!0,value:void 0}),LS(this,"path",void 0),LS(this,"coin_type",void 0),PS(this,DS,e),this.coin_type=t,this.path=function(e){return`m / ${$E} / ${aS(e)}`}(t),Object.freeze(this)}}function HS(e){if(e!==FS)throw new Error(`Invalid depth: Coin type nodes must be of depth ${FS}. Received: "${e}"`)}function jS(e){if("number"!=typeof e||!Number.isInteger(e)||e<0)throw new Error("Invalid coin type: The specified coin type must be a non-negative integer number.")}async function VS(e,t){const{account:r=0,change:n=0}=t??{},a=await $S(e),i=aS(r),s=sS(n),o=async(e,t=!1)=>{const r=await KI({path:[i,s,t?aS(e):iS(e)],node:a});return new QI(r)};var c;return o.coin_type=a.coin_type,o.path=`${a.path} / ${aS((c={account:r,change:n}).account??0)} / ${sS(c.change??0)}`,Object.freeze(o),o}async function $S(e){if(e instanceof US)return HS(e.depth),e;if("string"==typeof e){const t=await QI.fromExtendedKey(e),r=await US.fromNode(t,t.index-JE);return HS(r.depth),r}return US.fromJSON(e,e.coin_type)}const zS=BigInt(2**32-1),qS=BigInt(32);function KS(e,t=!1){return t?{h:Number(e&zS),l:Number(e>>qS&zS)}:{h:0|Number(e>>qS&zS),l:0|Number(e&zS)}}function GS(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let a=0;a<e.length;a++){const{h:i,l:s}=KS(e[a],t);[r[a],n[a]]=[i,s]}return[r,n]}const JS=(e,t,r)=>e<<r|t>>>32-r,WS=(e,t,r)=>t<<r|e>>>32-r,YS=(e,t,r)=>t<<r-32|e>>>64-r,ZS=(e,t,r)=>e<<r-32|t>>>64-r;const XS={fromBig:KS,split:GS,toBig:(e,t)=>BigInt(e>>>0)<<qS|BigInt(t>>>0),shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,rotr32H:(e,t)=>t,rotr32L:(e,t)=>e,rotlSH:JS,rotlSL:WS,rotlBH:YS,rotlBL:ZS,add:function(e,t,r,n){const a=(t>>>0)+(n>>>0);return{h:e+r+(a/2**32|0)|0,l:0|a}},add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/2**32|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,a)=>t+r+n+a+(e/2**32|0)|0,add5H:(e,t,r,n,a,i)=>t+r+n+a+i+(e/2**32|0)|0,add5L:(e,t,r,n,a)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(a>>>0)},QS=[],eI=[],tI=[],rI=BigInt(0),nI=BigInt(1),aI=BigInt(2),iI=BigInt(7),sI=BigInt(256),oI=BigInt(113);for(let e=0,t=nI,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],QS.push(2*(5*n+r)),eI.push((e+1)*(e+2)/2%64);let a=rI;for(let e=0;e<7;e++)t=(t<<nI^(t>>iI)*oI)%sI,t&aI&&(a^=nI<<(nI<<BigInt(e))-nI);tI.push(a)}const[cI,dI]=GS(tI,!0),fI=(e,t,r)=>r>32?YS(e,t,r):JS(e,t,r),uI=(e,t,r)=>r>32?ZS(e,t,r):WS(e,t,r);class lI extends a_{constructor(e,t,r,n=!1,a=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,KA(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");var i;this.state=new Uint8Array(200),this.state32=(i=this.state,new Uint32Array(i.buffer,i.byteOffset,Math.floor(i.byteLength/4)))}keccak(){e_||r_(this.state32),function(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,a=(t+2)%10,i=r[a],s=r[a+1],o=fI(i,s,1)^r[n],c=uI(i,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=o,e[t+r+1]^=c}let t=e[2],a=e[3];for(let r=0;r<24;r++){const n=eI[r],i=fI(t,a,n),s=uI(t,a,n),o=QS[r];t=e[o],a=e[o+1],e[o]=i,e[o+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=cI[n],e[1]^=dI[n]}r.fill(0)}(this.state32,this.rounds),e_||r_(this.state32),this.posOut=0,this.pos=0}update(e){WA(this);const{blockLen:t,state:r}=this,n=(e=n_(e)).length;for(let a=0;a<n;){const i=Math.min(t-this.pos,n-a);for(let t=0;t<i;t++)r[this.pos++]^=e[a++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,128&t&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){WA(this,!1),GA(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,a=e.length;n<a;){this.posOut>=r&&this.keccak();const i=Math.min(r-this.posOut,a-n);e.set(t.subarray(this.posOut,this.posOut+i),n),this.posOut+=i,n+=i}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return KA(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(YA(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){const{blockLen:t,suffix:r,outputLen:n,rounds:a,enableXOF:i}=this;return e||(e=new lI(t,r,n,i,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=r,e.outputLen=n,e.enableXOF=i,e.destroyed=this.destroyed,e}}const hI=(e,t,r)=>i_((()=>new lI(t,e,r))),pI=hI(1,136,32);class bI extends a_{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,JA(e);const r=n_(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const n=this.blockLen,a=new Uint8Array(n);a.set(r.length>n?e.create().update(r).digest():r);for(let e=0;e<a.length;e++)a[e]^=54;this.iHash.update(a),this.oHash=e.create();for(let e=0;e<a.length;e++)a[e]^=106;this.oHash.update(a),a.fill(0)}update(e){return WA(this),this.iHash.update(e),this}digestInto(e){WA(this),GA(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:a,blockLen:i,outputLen:s}=this;return e.finished=n,e.destroyed=a,e.blockLen=i,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const gI=(e,t,r)=>new bI(e,t).update(r).digest();gI.create=(e,t)=>new bI(e,t);const[yI,mI]=XS.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((e=>BigInt(e)))),wI=new Uint32Array(80),vI=new Uint32Array(80);class EI extends o_{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(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:a,Cl:i,Dh:s,Dl:o,Eh:c,El:d,Fh:f,Fl:u,Gh:l,Gl:h,Hh:p,Hl:b}=this;return[e,t,r,n,a,i,s,o,c,d,f,u,l,h,p,b]}set(e,t,r,n,a,i,s,o,c,d,f,u,l,h,p,b){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|a,this.Cl=0|i,this.Dh=0|s,this.Dl=0|o,this.Eh=0|c,this.El=0|d,this.Fh=0|f,this.Fl=0|u,this.Gh=0|l,this.Gl=0|h,this.Hh=0|p,this.Hl=0|b}process(e,t){for(let r=0;r<16;r++,t+=4)wI[r]=e.getUint32(t),vI[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|wI[e-15],r=0|vI[e-15],n=XS.rotrSH(t,r,1)^XS.rotrSH(t,r,8)^XS.shrSH(t,r,7),a=XS.rotrSL(t,r,1)^XS.rotrSL(t,r,8)^XS.shrSL(t,r,7),i=0|wI[e-2],s=0|vI[e-2],o=XS.rotrSH(i,s,19)^XS.rotrBH(i,s,61)^XS.shrSH(i,s,6),c=XS.rotrSL(i,s,19)^XS.rotrBL(i,s,61)^XS.shrSL(i,s,6),d=XS.add4L(a,c,vI[e-7],vI[e-16]),f=XS.add4H(d,n,o,wI[e-7],wI[e-16]);wI[e]=0|f,vI[e]=0|d}let{Ah:r,Al:n,Bh:a,Bl:i,Ch:s,Cl:o,Dh:c,Dl:d,Eh:f,El:u,Fh:l,Fl:h,Gh:p,Gl:b,Hh:g,Hl:y}=this;for(let e=0;e<80;e++){const t=XS.rotrSH(f,u,14)^XS.rotrSH(f,u,18)^XS.rotrBH(f,u,41),m=XS.rotrSL(f,u,14)^XS.rotrSL(f,u,18)^XS.rotrBL(f,u,41),w=f&l^~f&p,v=u&h^~u&b,E=XS.add5L(y,m,v,mI[e],vI[e]),A=XS.add5H(E,g,t,w,yI[e],wI[e]),_=0|E,x=XS.rotrSH(r,n,28)^XS.rotrBH(r,n,34)^XS.rotrBH(r,n,39),S=XS.rotrSL(r,n,28)^XS.rotrBL(r,n,34)^XS.rotrBL(r,n,39),I=r&a^r&s^a&s,k=n&i^n&o^i&o;g=0|p,y=0|b,p=0|l,b=0|h,l=0|f,h=0|u,({h:f,l:u}=XS.add(0|c,0|d,0|A,0|_)),c=0|s,d=0|o,s=0|a,o=0|i,a=0|r,i=0|n;const C=XS.add3L(_,S,k);r=XS.add3H(C,A,x,I),n=0|C}({h:r,l:n}=XS.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:a,l:i}=XS.add(0|this.Bh,0|this.Bl,0|a,0|i)),({h:s,l:o}=XS.add(0|this.Ch,0|this.Cl,0|s,0|o)),({h:c,l:d}=XS.add(0|this.Dh,0|this.Dl,0|c,0|d)),({h:f,l:u}=XS.add(0|this.Eh,0|this.El,0|f,0|u)),({h:l,l:h}=XS.add(0|this.Fh,0|this.Fl,0|l,0|h)),({h:p,l:b}=XS.add(0|this.Gh,0|this.Gl,0|p,0|b)),({h:g,l:y}=XS.add(0|this.Hh,0|this.Hl,0|g,0|y)),this.set(r,n,a,i,s,o,c,d,f,u,l,h,p,b,g,y)}roundClean(){wI.fill(0),vI.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)}}const AI=i_((()=>new EI));async function _I({path:e,node:t,curve:r},n){!function(e){(0,UE.assert)(e,"Invalid parameters: Must specify a node to derive from.")}(t);const{childIndex:a,isHardened:i}=function(e,t,r){!function(e,t,r){(0,UE.assert)("string"==typeof e,"Invalid path: Must be a string.");const n=e.endsWith("'");(0,UE.assert)(!n||t.privateKey,"Invalid parameters: Cannot derive hardened child keys without a private key."),(0,UE.assert)(n||r.deriveUnhardenedKeys,`Invalid path: Cannot derive unhardened child keys with ${r.name}.`)}(e,t,r);const n=e.split("'")[0];(0,UE.assert)(n);const a=parseInt(n,10);if(!zE.test(n)||!Number.isInteger(a)||a<0||a>=JE)throw new Error(`Invalid path: The index must be a non-negative decimal integer less than ${JE}.`);return{childIndex:a,isHardened:e.includes("'")}}(e,t,r),s={chainCode:t.chainCodeBytes,childIndex:a,isHardened:i,depth:t.depth,parentFingerprint:t.fingerprint,masterFingerprint:t.masterFingerprint,curve:r};if(t.privateKeyBytes){const e=await SI({privateKey:t.privateKeyBytes,childIndex:a,isHardened:i,curve:r}),o=kI({chainCode:t.chainCodeBytes,extension:e});return await xI({privateKey:t.privateKeyBytes,entropy:o,...s},n)}const o=II({parentPublicKey:t.compressedPublicKeyBytes,childIndex:a}),c=kI({chainCode:t.chainCodeBytes,extension:o});return await xI({publicKey:t.compressedPublicKeyBytes,entropy:c,...s},n)}async function xI(e,t){const{privateKey:r,publicKey:n,entropy:a,childIndex:i,isHardened:s,depth:o,parentFingerprint:c,masterFingerprint:d,curve:f}=e;try{return r?await async function({entropy:e,privateKey:t,depth:r,masterFingerprint:n,parentFingerprint:a,childIndex:i,isHardened:s,curve:o}){const c=i+(s?JE:0),{privateKey:d,chainCode:f}=await async function({privateKey:e,entropy:t,curve:r}){const n=t.slice(0,32),a=t.slice(32);if("ed25519"===r.name){return{privateKey:n,publicKey:await r.getPublicKey(n),chainCode:a}}const i=function(e,t,r){(0,UE.assert)(uS(t,32),"Invalid tweak: Tweak must be a non-zero 32-byte Uint8Array.");const n=(0,UE.bytesToBigInt)(e),a=(0,UE.bytesToBigInt)(t);if(a>=r.curve.n)throw new Error("Invalid tweak: Tweak is larger than the curve order.");const i=nS(n+a,r.curve.n),s=(0,UE.hexToBytes)(i.toString(16).padStart(64,"0"));if(!r.isValidPrivateKey(s))throw new Error("Invalid private key or tweak: The resulting private key is invalid.");return s}(e,n,r),s=await r.getPublicKey(i);return{privateKey:i,publicKey:s,chainCode:a}}({privateKey:t,entropy:e,curve:o});return await $I.fromExtendedKey({privateKey:d,chainCode:f,depth:r+1,masterFingerprint:n,parentFingerprint:a,index:c,curve:o.name})}({entropy:a,privateKey:r,depth:o,masterFingerprint:d,parentFingerprint:c,childIndex:i,isHardened:s,curve:f}):await async function({entropy:e,publicKey:t,depth:r,masterFingerprint:n,parentFingerprint:a,childIndex:i,curve:s}){const{publicKey:o,chainCode:c}=function({publicKey:e,entropy:t,curve:r}){const n=t.slice(0,32),a=t.slice(32),i=r.publicAdd(e,n);return{publicKey:i,chainCode:a}}({publicKey:t,entropy:e,curve:s});return await $I.fromExtendedKey({publicKey:o,chainCode:c,depth:r+1,masterFingerprint:n,parentFingerprint:a,index:i,curve:s.name})}({entropy:a,publicKey:n,depth:o,masterFingerprint:d,parentFingerprint:c,childIndex:i,curve:f})}catch(r){return await xI(await t(r,e),t)}}async function SI({privateKey:e,childIndex:t,isHardened:r,curve:n}){if(r)return(0,UE.concatBytes)([new Uint8Array([0]),e,mS(t+JE)]);return II({parentPublicKey:await n.getPublicKey(e,!0),childIndex:t})}function II({parentPublicKey:e,childIndex:t}){return(0,UE.concatBytes)([e,mS(t)])}function kI({chainCode:e,extension:t}){return gI(AI,e,t)}function CI(e){(0,UE.assert)(e instanceof Uint8Array&&uS(e,HE),"Invalid key: The key must be a 32-byte, non-zero Uint8Array.");return TI(xS(e,!1))}function TI(e){return(0,UE.assert)(e instanceof Uint8Array&&uS(e,AS),"Invalid key: The key must be a 65-byte, non-zero Uint8Array."),pI(e.slice(1)).slice(-20)}async function BI(e){return(0,UE.assert)("secp256k1"===e.curve.name,"Invalid curve: Only secp256k1 is supported by BIP-32."),_I(e,MI)}async function MI(e,t){const{childIndex:r,privateKey:n,publicKey:a,isHardened:i,curve:s,chainCode:o}=t;if(oS(r+1),n){const e=kI({chainCode:o,extension:await SI({privateKey:n,childIndex:r+1,isHardened:i,curve:s})});return{...t,childIndex:r+1,entropy:e}}const c=kI({chainCode:o,extension:II({parentPublicKey:a,childIndex:r+1})});return{...t,childIndex:r+1,entropy:c}}var OI=a(2091);function RI(e){return`bip39:${e.toLowerCase().trim()}`}async function NI({path:e,curve:t}){return PI(await(0,OI.nl)(e,qA.p),t)}async function PI(e,t){(0,UE.assert)(e.length>=16&&e.length<=64,"Invalid seed: The seed must be between 16 and 64 bytes long.");const r=gI(AI,t.secret,e),n=r.slice(0,HE),a=r.slice(HE);(0,UE.assert)(t.isValidPrivateKey(n),"Invalid private key: The private key must greater than 0 and less than the curve order.");const i=gS(await t.getPublicKey(n,!0));return $I.fromExtendedKey({privateKey:n,chainCode:a,masterFingerprint:i,depth:0,parentFingerprint:0,index:0,curve:t.name})}async function LI(e){return await _I(e,FI)}async function FI(e,t){const{curve:r,isHardened:n,childIndex:a,entropy:i,chainCode:s}=t;if("ed25519"===r.name)throw e;const o=n?a+JE:a,c=kI({chainCode:s,extension:(0,UE.concatBytes)([1,i.slice(32,64),mS(o)])});return{...t,entropy:c}}const DI={bip32:w,bip39:v,slip10:E};async function UI(e){const{path:t,depth:r=t.length}=e,n="node"in e?e.node:void 0,a="curve"in e?e.curve:n?.curve;if(n&&!(n instanceof $I)&&!(n instanceof QI)&&!(n instanceof US))throw new Error("Invalid arguments: Node must be a SLIP-10 node or a BIP-44 node when provided.");if(!a)throw new Error("Invalid arguments: Must specify either a parent node or curve.");return function(e,t,r){if(0===e.length)throw new Error("Invalid HD path segment: The segment must not be empty.");let n=!1;if(e.forEach(((e,t)=>{if(0===t){if(n=e instanceof Uint8Array||GE.test(e),!(e instanceof Uint8Array||n||qE.test(e)||KE.test(e)))throw HI()}else if(e instanceof Uint8Array||!qE.test(e)&&!KE.test(e))throw HI()})),r===jE&&(!n||1!==e.length))throw new Error(`Invalid HD path segment: The segment must consist of a single BIP-39 node for depths of ${jE}. Received: "${String(e)}".`);if(!t&&!n)throw new Error("Invalid derivation parameters: Must specify parent key if the first node of the path segment is not a BIP-39 node.");if(t&&n)throw new Error("Invalid derivation parameters: May not specify parent key if the path segment starts with a BIP-39 node.");const a=n?e.slice(1):e;if(a.length>0){const e=a[0]?.split(":")[0];(0,UE.assert)(e),(0,UE.assert)(a.every((t=>t.startsWith(`${e}:`))),"Invalid HD path segment: Cannot mix 'bip32' and 'slip10' path segments.")}}(t,Boolean(n?.privateKey)||Boolean(n?.publicKey),r),await t.reduce((async(e,t,r)=>{const n=await e;if("string"==typeof t){const[e,r]=t.split(":");(0,UE.assert)(e),(0,UE.assert)(r),(0,UE.assert)(function(e){return e in DI}(e),`Unknown derivation type: "${e}".`);const i=DI[e];return await i.deriveChildKey({path:r,node:n,curve:rS(a)})}return(0,UE.assert)(0===r,HI()),await DI.bip39.deriveChildKey({path:t,node:n,curve:rS(a)})}),Promise.resolve(n))}function HI(){return new Error("Invalid HD path segment: The path segment is malformed.")}function jI(e,t,r){return function(e,t){if(e!==t)throw new TypeError("Private static access of wrong provenance")}(e,t),function(e,t){if(void 0===e)throw new TypeError("attempted to "+t+" private static field before its declaration")}(r,"get"),function(e,t){return t.get?t.get.call(e):t.value}(e,r)}function VI(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class $I{static async fromJSON(e){return $I.fromExtendedKey(e)}static async fromExtendedKey({depth:e,masterFingerprint:t,parentFingerprint:r,index:n,privateKey:a,publicKey:i,chainCode:s,curve:o}){const c=hS(s,HE);yS(o),qI(e),oS(n),function(e,t){if(0===t&&0!==e)throw new Error(`Invalid index: The index of the root node must be 0. Received: "${String(e)}".`)}(n,e),function(e,t){if(!lS(e))throw new Error(`Invalid parent fingerprint: The fingerprint must be a positive integer. Received: "${String(e)}".`);if(0===t&&0!==e)throw new Error(`Invalid parent fingerprint: The fingerprint of the root node must be 0. Received: "${String(e)}".`);if(t>0&&0===e)throw new Error(`Invalid parent fingerprint: The fingerprint of a child node must not be 0. Received: "${String(e)}".`)}(r,e),function(e,t,r){if(!e)return;if(r>=2&&e===t)throw new Error(`Invalid parent fingerprint: The fingerprint of a child node cannot be equal to the master fingerprint. Received: "${String(t)}".`)}(t,r,e);const d=rS(o);if(a){const i=pS(a,HE);return(0,UE.assert)(d.isValidPrivateKey(i),`Invalid private key: Value is not a valid ${o} private key.`),new $I({depth:e,masterFingerprint:t,parentFingerprint:r,index:n,chainCode:c,privateKey:i,publicKey:await d.getPublicKey(i),curve:o},jI(this,$I,zI))}if(i){const a=hS(i,d.publicKeyLength);return new $I({depth:e,masterFingerprint:t,parentFingerprint:r,index:n,chainCode:c,publicKey:a,curve:o},jI(this,$I,zI))}throw new Error("Invalid options: Must provide either a private key or a public key.")}static async fromDerivationPath({derivationPath:e,curve:t}){if(yS(t),!e)throw new Error("Invalid options: Must provide a derivation path.");if(0===e.length)throw new Error("Invalid derivation path: May not specify an empty derivation path.");return await UI({path:e,depth:e.length-1,curve:t})}get chainCode(){return(0,UE.bytesToHex)(this.chainCodeBytes)}get privateKey(){if(this.privateKeyBytes)return(0,UE.bytesToHex)(this.privateKeyBytes)}get publicKey(){return(0,UE.bytesToHex)(this.publicKeyBytes)}get compressedPublicKeyBytes(){return rS(this.curve).compressPublicKey(this.publicKeyBytes)}get compressedPublicKey(){return(0,UE.bytesToHex)(this.compressedPublicKeyBytes)}get address(){if("secp256k1"!==this.curve)throw new Error("Unable to get address for this node: Only secp256k1 is supported.");return(0,UE.bytesToHex)(TI(this.publicKeyBytes))}get fingerprint(){return gS(this.compressedPublicKeyBytes)}neuter(){return new $I({depth:this.depth,masterFingerprint:this.masterFingerprint,parentFingerprint:this.parentFingerprint,index:this.index,chainCode:this.chainCodeBytes,publicKey:this.publicKeyBytes,curve:this.curve},jI($I,$I,zI))}async derive(e){return await KI({path:e,node:this})}toJSON(){return{depth:this.depth,masterFingerprint:this.masterFingerprint,parentFingerprint:this.parentFingerprint,index:this.index,curve:this.curve,privateKey:this.privateKey,publicKey:this.publicKey,chainCode:this.chainCode}}constructor({depth:e,masterFingerprint:t,parentFingerprint:r,index:n,chainCode:a,privateKey:i,publicKey:s,curve:o},c){VI(this,"curve",void 0),VI(this,"depth",void 0),VI(this,"masterFingerprint",void 0),VI(this,"parentFingerprint",void 0),VI(this,"index",void 0),VI(this,"chainCodeBytes",void 0),VI(this,"privateKeyBytes",void 0),VI(this,"publicKeyBytes",void 0),(0,UE.assert)(c===jI($I,$I,zI),"SLIP10Node can only be constructed using `SLIP10Node.fromJSON`, `SLIP10Node.fromExtendedKey`, or `SLIP10Node.fromDerivationPath`."),this.depth=e,this.masterFingerprint=t,this.parentFingerprint=r,this.index=n,this.chainCodeBytes=a,this.privateKeyBytes=i,this.publicKeyBytes=s,this.curve=o,Object.freeze(this)}}var zI={writable:!0,value:Symbol("SLIP10Node.constructor")};function qI(e){if(!lS(e))throw new Error(`Invalid HD tree path depth: The depth must be a positive integer. Received: "${String(e)}".`)}async function KI({path:e,node:t}){if(0===e.length)throw new Error("Invalid HD tree derivation path: Deriving a path of length 0 is not defined.");const r=t.depth+e.length;return qI(r),await UI({path:e,node:t,depth:r})}function GI(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function JI(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,GI(e,t,"get"))}function WI(e,t,r){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,r)}function YI(e,t,r){return function(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}(e,GI(e,t,"set"),r),r}var ZI,XI=new WeakMap;class QI{static async fromJSON(e){return QI.fromExtendedKey(e)}static async fromExtendedKey(e){if("string"==typeof e){const t=BS(e),{chainCode:r,depth:n,parentFingerprint:a,index:i}=t;if(t.version===TS){const{privateKey:e}=t;return QI.fromExtendedKey({depth:n,parentFingerprint:a,index:i,privateKey:e,chainCode:r})}const{publicKey:s}=t;return QI.fromExtendedKey({depth:n,parentFingerprint:a,index:i,publicKey:s,chainCode:r})}const{privateKey:t,publicKey:r,chainCode:n,depth:a,parentFingerprint:i,index:s}=e;ek(a);const o=await $I.fromExtendedKey({privateKey:t,publicKey:r,chainCode:n,depth:a,parentFingerprint:i,index:s,curve:"secp256k1"});return new QI(o)}static async fromDerivationPath({derivationPath:e}){ek(e.length-1),tk(e,jE);const t=await $I.fromDerivationPath({derivationPath:e,curve:"secp256k1"});return new QI(t)}get depth(){return JI(this,XI).depth}get privateKeyBytes(){return JI(this,XI).privateKeyBytes}get publicKeyBytes(){return JI(this,XI).publicKeyBytes}get chainCodeBytes(){return JI(this,XI).chainCodeBytes}get privateKey(){return JI(this,XI).privateKey}get publicKey(){return JI(this,XI).publicKey}get compressedPublicKey(){return JI(this,XI).compressedPublicKey}get compressedPublicKeyBytes(){return JI(this,XI).compressedPublicKeyBytes}get chainCode(){return JI(this,XI).chainCode}get address(){return JI(this,XI).address}get masterFingerprint(){return JI(this,XI).masterFingerprint}get parentFingerprint(){return JI(this,XI).parentFingerprint}get fingerprint(){return JI(this,XI).fingerprint}get index(){return JI(this,XI).index}get extendedKey(){const e={depth:this.depth,parentFingerprint:this.parentFingerprint,index:this.index,chainCode:this.chainCodeBytes};return this.privateKeyBytes?MS({...e,version:TS,privateKey:this.privateKeyBytes}):MS({...e,version:CS,publicKey:this.publicKeyBytes})}get curve(){return JI(this,XI).curve}neuter(){const e=JI(this,XI).neuter();return new QI(e)}async derive(e){if(5===this.depth)throw new Error("Illegal operation: This HD tree node is already a leaf node.");ek(this.depth+e.length),tk(e,this.depth+1);const t=await JI(this,XI).derive(e);return new QI(t)}toJSON(){return{depth:this.depth,masterFingerprint:this.masterFingerprint,parentFingerprint:this.parentFingerprint,index:this.index,privateKey:this.privateKey,publicKey:this.publicKey,chainCode:this.chainCode}}constructor(e){WI(this,XI,{writable:!0,value:void 0}),YI(this,XI,e),Object.freeze(this)}}function ek(e){if(qI(e),e<jE||e>5)throw new Error(`Invalid HD tree path depth: The depth must be a positive integer N such that 0 <= N <= 5. Received: "${e}"`)}function tk(e,t){e.forEach(((e,r)=>{const n=t+r;if(n!==jE)switch((0,UE.assert)("string"==typeof e),n){case 1:if(e!==$E)throw new Error(`Invalid derivation path: The "purpose" node (depth 1) must be the string "${$E}".`);break;case 2:if(!qE.test(e)||!cS(e))throw new Error('Invalid derivation path: The "coin_type" node (depth 2) must be a hardened BIP-32 node.');break;case 3:if(!qE.test(e)||!cS(e))throw new Error('Invalid derivation path: The "account" node (depth 3) must be a hardened BIP-32 node.');break;case 4:if(!qE.test(e))throw new Error('Invalid derivation path: The "change" node (depth 4) must be a BIP-32 node.');break;case 5:if(!qE.test(e))throw new Error('Invalid derivation path: The "address_index" node (depth 5) must be a BIP-32 node.')}else if(!(e instanceof Uint8Array||GE.test(e)))throw new Error('Invalid derivation path: The "m" / seed node (depth 0) must be a BIP-39 node.')}))}function rk([e,...t]){const r=Q([e,...t]);return new L({...r,schema:[e,...t]})}function nk(e){return t=e,V(JSON.stringify(t),q(t).validator);var t}function ak(e,t){return ik(e,"pattern",(r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`))}function ik(e,t,r){return new L({...e,*refiner(n,a){yield*e.refiner(n,a);const i=N(r(n,a),a,e,n);for(const e of i)yield{...e,refinement:t}}})}!function(e){e.Alert="alert",e.Confirmation="confirmation",e.Prompt="prompt"}(ZI||(ZI={}));ak(X(),/^(?:0x)?[0-9a-f]+$/iu),ak(X(),/^0x[0-9a-f]+$/iu),ak(X(),/^0x[0-9a-f]{40}$/u);const sk=ak(X(),/^0x[0-9a-fA-F]{40}$/u);const ok=j(Yv,W({type:q(Jv.Address),value:sk}));Gv(Jv.Address,ok,["value"]);var ck,dk;!function(e){e.Primary="primary",e.Secondary="secondary"}(ck||(ck={})),function(e){e.Button="button",e.Submit="submit"}(dk||(dk={}));const fk=j(Yv,W({type:q(Jv.Button),value:X(),variant:Y(Q([nk(ck.Primary),nk(ck.Secondary)])),buttonType:Y(Q([nk(dk.Button),nk(dk.Submit)])),name:Y(X())})),uk=(Gv(Jv.Button,fk,["value","buttonType","name","variant"]),j(Wv,W({type:q(Jv.Divider)}))),lk=Gv(Jv.Divider,uk);var hk;!function(e){e.Text="text",e.Number="number",e.Password="password"}(hk||(hk={}));const pk=j(Yv,W({type:q(Jv.Input),value:Y(X()),name:X(),inputType:Y(Q([nk(hk.Text),nk(hk.Password),nk(hk.Number)])),placeholder:Y(X()),label:Y(X()),error:Y(X())})),bk=(Gv(Jv.Input,pk,["name","inputType","placeholder","value","label"]),Q([pk,fk])),gk=j(Wv,W({type:q(Jv.Form),children:$(bk),name:X()}));Gv(Jv.Form,gk,["name","children"]);const yk=j(Wv,W({type:q(Jv.Image),value:ik(X(),"SVG",(e=>!!e.includes("<svg")||"Value is not a valid SVG."))}));Gv(Jv.Image,yk,["value"]);var mk;!function(e){e.Default="default",e.Critical="critical",e.Warning="warning"}(mk||(mk={}));const wk=Q([yk,Zv,ok]),vk=j(Yv,W({type:q(Jv.Row),variant:Y(Q([nk(mk.Default),nk(mk.Critical),nk(mk.Warning)])),label:X(),value:wk})),Ek=Gv(Jv.Row,vk,["label","value","variant"]),Ak=j(Wv,W({type:q(Jv.Spinner)})),_k=(Gv(Jv.Spinner,Ak),j(Wv,W({children:$(function(e){let t;return new L({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator:(r,n)=>(t??(t=e()),t.validator(r,n)),coercer:(r,n)=>(t??(t=e()),t.coercer(r,n)),refiner:(r,n)=>(t??(t=e()),t.refiner(r,n))})}((()=>Ik)))}))),xk=j(_k,W({type:q(Jv.Panel)})),Sk=Gv(Jv.Panel,xk,["children"]),Ik=function(e){const t=e.map((e=>"union"===e.type&&Array.isArray(e.schema)?e.schema:e)).flat(1/0),r=t.map((({schema:e})=>e.type.type));return new L({type:"union",schema:t,*entries(e,r){if(!C(e)||!I(e,"type"))return;const{type:n}=e,a=t.find((({schema:e})=>U(n,e.type)));if(a)for(const t of a.entries(e,r))yield t},coercer(e,r){if(!C(e)||!I(e,"type"))return e;const{type:n}=e,a=t.find((({schema:e})=>U(n,e.type)));return a?a.coercer(e,r):e},*refiner(e,r){const n=t.find((({schema:t})=>U(e.type,t.type)));yield*n.refiner(e,r)},validator(e,n){if(!C(e)||!I(e,"type")||"string"!=typeof e.type)return`Expected type to be one of: ${r.join(", ")}, but received: undefined`;const{type:a}=e,i=t.find((({schema:e})=>U(a,e.type)));return i?i.validator(e,n):`Expected type to be one of: ${r.join(", ")}, but received: "${a}"`}})}([Qv,uk,tE,yk,xk,Ak,Zv,vk,ok,pk,gk,fk]);async function kk(){return console.log("[Canton Snap] getEd25519Deriver()"),async e=>{const t=["m","44'","6767'","0'","0'",`${e}'`];console.log("[Canton Snap] Deriving key for index",e,"path",t.join("/"));const r=(e=>{e.startsWith("0x")&&(e=e.slice(2));const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++)t[r]=parseInt(e.slice(2*r,2*r+2),16);return t})((await snap.request({method:"snap_getBip32Entropy",params:{curve:"ed25519",path:t}})).privateKey);return{privateKey:r,publicKey:await $x(r),path:t,curve:"ed25519"}}}async function Ck(e){return snap.request({method:"snap_dialog",params:{type:ZI.Alert,content:Sk(e)}})}async function Tk(){return await snap.request({method:"snap_manageState",params:{operation:"get"}})}async function Bk(e){await snap.request({method:"snap_manageState",params:{operation:"update",newState:e}})}var Mk=a(7784),Ok=a(3493),Rk=a(6729),Nk=a(8470),Pk=a(2823),Lk=a(3360),Fk=a(9499),Dk=a(4352);function Uk(e,t){void 0===t&&(t=e.constructor);var r=Error.captureStackTrace;r&&r(e,t)}var Hk,jk=(Hk=function(e,t){return Hk=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},Hk(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}Hk(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Vk=function(e){function t(t,r){var n,a,i,s=this.constructor,o=e.call(this,t,r)||this;return Object.defineProperty(o,"name",{value:s.name,enumerable:!1,configurable:!0}),n=o,a=s.prototype,(i=Object.setPrototypeOf)?i(n,a):n.__proto__=a,Uk(o),o}return jk(t,e),t}(Error);var $k=a(8667),zk=a(1048).hp,qk=Object.defineProperty,Kk=(e,t)=>{for(var r in t)qk(e,r,{get:t[r],enumerable:!0})},Gk="undefined"!=typeof window&&window.fetch||"undefined"!=typeof global&&global.fetch||Ok;Kk({},{calculateContractAddressFromHash:()=>dT,calculateDeclareTransactionHash:()=>sT,calculateDeployAccountTransactionHash:()=>oT,calculateDeployTransactionHash:()=>iT,calculateTransactionHash:()=>cT,calculateTransactionHashCommon:()=>aT,computeHashOnElements:()=>nT,feeTransactionVersion:()=>YC,getSelector:()=>eT,getSelectorFromName:()=>QC,keccakBn:()=>ZC,pedersen:()=>rT,starknetKeccak:()=>XC,transactionVersion:()=>WC});Kk({},{ALPHA:()=>PC,BETA:()=>LC,CONSTANT_POINTS:()=>DC,EC_ORDER:()=>NC,FIELD_GEN:()=>OC,FIELD_PRIME:()=>MC,FIELD_SIZE:()=>RC,IS_BROWSER:()=>Jk,MASK_250:()=>IC,MASK_251:()=>kC,MAX_ECDSA_VAL:()=>FC,ONE:()=>xC,StarknetChainId:()=>CC,TWO:()=>SC,TransactionHashPrefix:()=>TC,UDC:()=>BC,ZERO:()=>_C});Kk({},{assertInRange:()=>lC,bigNumberishArrayToDecimalStringArray:()=>hC,bigNumberishArrayToHexadecimalStringArray:()=>pC,cleanHex:()=>uC,getDecimalString:()=>yC,getHexString:()=>mC,getHexStringArray:()=>wC,hexToDecimalString:()=>dC,isHex:()=>sC,isStringWholeNumber:()=>bC,toBN:()=>oC,toCairoBool:()=>AC,toFelt:()=>fC,toHex:()=>cC,toHexString:()=>gC});Kk({},{IS_BROWSER:()=>Jk,addHexPrefix:()=>eC,arrayBufferToString:()=>Yk,btoaUniversal:()=>Zk,buf2hex:()=>Xk,calcByteLength:()=>rC,padLeft:()=>tC,removeHexPrefix:()=>Qk,sanitizeBytes:()=>nC,sanitizeHex:()=>aC,utf8ToArray:()=>iC});var Jk="undefined"!=typeof window,Wk="0";function Yk(e){return new Uint8Array(e).reduce(((e,t)=>e+String.fromCharCode(t)),"")}function Zk(e){return Jk?btoa(Yk(e)):zk.from(e).toString("base64")}function Xk(e){return[...e].map((e=>e.toString(16).padStart(2,"0"))).join("")}function Qk(e){return e.replace(/^0x/i,"")}function eC(e){return`0x${Qk(e)}`}function tC(e,t,r=Wk){return function(e,t,r,n=Wk){const a=t-e.length;let i=e;if(a>0){const t=n.repeat(a);i=r?t+e:e+t}return i}(e,t,!0,r)}function rC(e,t=8){const r=e%t;return r?(e-r)/t*t+t:e}function nC(e,t=8,r=Wk){return tC(e,rC(e.length,t),r)}function aC(e){return(e=nC(e=Qk(e),2))&&(e=eC(e)),e}function iC(e){return(new TextEncoder).encode(e)}function sC(e){return/^0x[0-9a-f]*$/i.test(e)}function oC(e,t){return"string"==typeof e&&(e=e.toLowerCase()),"string"==typeof e&&sC(e)&&!t?new Pk(Qk(e),"hex"):new Pk(e,t)}function cC(e){return eC(e.toString("hex"))}function dC(e){return oC(`0x${e.replace(/^0x/,"")}`).toString()}function fC(e){return Pk.isBN(e)?e.toString():oC(e).toString()}var uC=e=>e.toLowerCase().replace(/^(0x)0+/,"$1");function lC(e,t,r,n=""){const a=""===n?"invalid length":`invalid ${n} length`,i=oC(e);Mk(i.gte(oC(t))&&i.lt(oC(r)),`Message not signable, ${a}.`)}function hC(e){return e.map((e=>oC(e).toString(10)))}function pC(e){return e.map((e=>cC(oC(e))))}var bC=e=>/^\d+$/.test(e),gC=e=>cC(oC(e));function yC(e){if(sC(e))return dC(e);if(bC(e))return e;throw new Error(`${e} need to be hex-string or whole-number-string`)}function mC(e){if(sC(e))return e;if(bC(e))return gC(e);throw new Error(`${e} need to be hex-string or whole-number-string`)}function wC(e){return e.map((e=>mC(e)))}var vC,EC,AC=e=>(+e).toString(),_C=oC(0),xC=oC(1),SC=oC(2),IC=SC.pow(oC(250)).sub(xC),kC=SC.pow(oC(251)),CC=((vC=CC||{}).MAINNET="0x534e5f4d41494e",vC.TESTNET="0x534e5f474f45524c49",vC.TESTNET2="0x534e5f474f45524c4932",vC),TC=((EC=TC||{}).DECLARE="0x6465636c617265",EC.DEPLOY="0x6465706c6f79",EC.DEPLOY_ACCOUNT="0x6465706c6f795f6163636f756e74",EC.INVOKE="0x696e766f6b65",EC.L1_HANDLER="0x6c315f68616e646c6572",EC),BC={ADDRESS:"0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf",ENTRYPOINT:"deployContract"},MC="800000000000011000000000000000000000000000000000000000000000001",OC="3",RC=251,NC="800000000000010FFFFFFFFFFFFFFFFB781126DCAE7B2321E66A241ADC64D2F",PC="1",LC="6F21413EFBE40DE150E596D72F7A8C5609AD26C15C915C1F4CDFCB99CEE9E89",FC="800000000000000000000000000000000000000000000000000000000000000",DC=[["49ee3eba8c1600700ee1b87eb599f16716b0b1022947733551fde4050ca6804","3ca0cfe4b3bc6ddf346d49d06ea0ed34e621062c0e056c1d0405d266e10268a"],["1ef15c18599971b7beced415a40f0c7deacfd9b0d1819e03d723d8bc943cfca","5668060aa49730b7be4801df46ec62de53ecd11abe43a32873000c36e8dc1f"],["234287dcbaffe7f969c748655fca9e58fa8120b6d56eb0c1080d17957ebe47b","3b056f100f96fb21e889527d41f4e39940135dd7a6c94cc6ed0268ee89e5615"],["3909690e1123c80678a7ba0fde0e8447f6f02b3f6b960034d1e93524f8b476","7122e9063d239d89d4e336753845b76f2b33ca0d7f0c1acd4b9fe974994cc19"],["40fd002e38ea01a01b2702eb7c643e9decc2894cbf31765922e281939ab542c","109f720a79e2a41471f054ca885efd90c8cfbbec37991d1b6343991e0a3e740"],["2f52066635c139fc2f64eb0bd5e3fd7a705f576854ec4f00aa60361fddb981b","6d78a24d8a5f97fc600318ce16b3c840315979c3273078ec1a285f217ee6a26"],["6a0767a1fd60d5b9027a35af1b68e57a1c366ebcde2006cdd07af27043ef674","606b72c0ca0498b8c1817ed7922d550894c324f5efdfc85a19a1ae382411ca2"],["7fa463ee2a2d6a585d5c3358918270f6c28c66df1f86803374d1edf3819cc62","a996edf01598832e644e1cae9a37288865ad80e2787f9bf958aceccc99afae"],["3d4da70d1540da597dbae1651d28487604a4e66a4a1823b97e8e9639393dbec","45cdef70c35d3b6f0a2273a9886ccb6306d813e8204bdfd30b4efee63c8a3f9"],["1e448fdbcd9896c6fbf5f36cb7e7fcb77a751ff2d942593cae023363cc7750e","30c81da0f3a8cb64468eaa491c7ae7b4842b62cb4148820da211afc4caffb3a"],["6531acf1a7cb90a4eb27de0b7f915e387a3b0fd063ba6e1289b91f48411be26","31330f5daa091889981a3ea782ae997f5f171336ed0487a03f051551a2cafa2"],["54be016394d5662d67d7e82f5e889ed2f97ccf95d911f57dd2362c4040ed4f4","c6cb184053f054d6a59c1bf0986d17090d25089b3fdcdaf185edc87ef113e5"],["35b9ecd0499ca1d5d42dcbb0c6b4042b3733c64b607ca711e706e786ef2afc6","5624b476a5b21c3a544f0712d4817b06ad380a5a6529d323bf64da8ef862d8d"],["4ce0378e3ee8f77ed58f2ddbd8bb7676c8a38bfb1d3694c275254bd8ca38e23","5a16fcbff0769c9cf2b02c31621878ec819fff4b8231bff82c6183db2746820"],["648d5c6f98680a1b926bfeb01c00224c56fdcf751b251c4449c8a94f425cfcf","72c05ac793cd1620a833fbe2214d36900ebe446e095c62fcb740937f98cca8c"],["bd09be3e4e1af8a14189977e334f097c18e4a8bf42577ef5aafa0f807bd89b","6e0e72ed7eb65c86cee29c411fb4761122558ee81013344ba8509c49de9f9b6"],["35ea4e339b44ae7724419bdfbe07022253137a4afb7cbaffad341ea61249357","3665d676a026a174f367bb4417780e53a7803cb02d0db32eb4545c267c42f14"],["36457bc744f42e697b825c2d1afd8f4029d696a4514710f81da52d88e178643","7c93715896735492a68c7969a024b3a8fd538bffc1521538107de1a5f13ce9c"],["5b3a08ebcf9c109cc9082f70d9df2b9c11b5428ee23917b4e790c4c10f6e661","9d7b42ab0c20f5510df7ea5e196eec99342739077e9a168198c89da859753"],["21883ef8580fc06e59481955d52ece3aca6e82c8c9fc58e216dcf46f96990c6","51a6423543e6e8a43e71da34cd90f5b520b8d33b67c4bf857573ab9e301aa4c"],["19e86b77f9b581e81092b305c852faf53940a8f15f0a6990c414f04c0fa7ef9","515630e35d4398c9c79fc4ee08e1023fa47d8e03c6e7819c6d2ccef45398fa"],["888ab8eb4c31bb2ac5b54aa320dbe1a69c96b864e8a5f54d89c1d1a6b86c24","730e148467f6a55ce22c5296f5380df88f38de76ef0b2de844cd3094aaaf3ea"],["75e79ff13a894e7120dac17b7429c0c32ce7828f726c9973728c0977a5f5977","4960526e59c1c736561a201bc56f7d762641b39f609d273cc996f5d9197cfb8"],["640fe009249115d7254f72ecafb3006139e4bed7e9041af51458c737282d1d5","3cc6c978a575246e2ce4f7ef1fcc7f63085db9ff98a1b1f3fe374087c0332c"],["6d6fd09ccab7c26de9b3906191235deb5c34685580c488275356a05e209ca96","7157f81a34213dd8f91dea4f6df1bcfabc4ee091a3049eeeb3b7923d39b8645"],["5531ca1d00f151d71da820918f74caf2985b24dca20e124721fff507b5a5876","518529643d3f25e47f72c322223ba60a63d6bfe78cf3f612215d9c19bf29200"],["6192d454e4f8fe212bdfccd5b15dd5056d7622ffe456c6c67e5a7265aea49c4","2377a45dc630017ae863cb968ddb38333a70c7946d8684e6d7a6213f634b7bc"],["542fb44b4ef3640a64fdb22a2560fb26668065c069cf31d1df424819a39ff18","5dbae9b0948e0361aea443503840341c322aa1a1366ce5390e71bf161f78f8c"],["299ff3e3412a7eb4cb4a3051b07b1be2e7b1c4b789f39ffb52cba3d048b71de","1951d3175c02761b291d86b6c0a08387ad5e2a2130ccc33c852530572cb3958"],["628ce3f5367dadc1411133e55eb25e2e3c2880d6e28754a5cb1c5d109627e73","ae3e9b7d50964e28bd15380400b7659b87affdef5d2586cbefcd9be7d67c0d"],["6ea54aff064895eccf9db2283225d62044ae67621192b3346338948382f5933","6431507e51aadacfaf39f102a8ff387756e9b5e1bc8323d44acae55130d93db"],["28097d50d175a6235320fe8cfe138dd9e46895d189582e472c38ad7a67d923a","7f9eab4133d7d09a7ff63368d6135c26262b62336eca1b5ca33f2096ce388ba"],["619fd09cdd6ff4323973f256c2cbdcb224f7f25b8aef623af2d4a0105e62e02","2c95f0ae11d47eeae1bc7f1350f75f9185c5bc840382ceb38a797cae9c40308"],["641c18982ced304512a3f2395942a38add0d6a7156229c2a7c8b8dfbe9beb96","6f6288c9c659b6af5ac975f4180deffe53d516399b2cc62f31732e9d4ba9837"],["58ab546e51fe49fc5a382e4064a2bd6cfc268904412f86c26de14f28a71d0f2","124b7217943e7e328408e8afdfa7da00dcbc94a2bb85fd8e01fb162d2c2c0a9"],["a82c2fdedbb26c3c762a12f7e86b0e01e65320e0a25a8399d665f6e266bf74","1a1de28e253f3e10f44d0111e8074f882d7f42e5900780ccbdc31da372d3fd8"],["744c725a7455a992e3cf5bd007bc234dd4668dba285f553f38350ad94c1615b","7f721a87f48798bdc4a9c0eb88559e2ad7a74112fd901e70ea159e67a9c33f"],["434df142ddaa60f7881b6348d91687de40457de7ccfb07f0304b9e820705d0c","7fae425e3b53f97dd1f5b20e49ed9fe24ff1efc341ba5e017ac89cf8df0cc39"],["7a1e2b809dff46277021cbc376f79c37e1b683bbd6bca5317014f0dc0e1ae73","56790278a231912c334eff05281e08af1558e85516b4411ef64647c13bea431"],["4931b7990348d41cf8907be79f45bb7991fd18f8a57868351c92fa7a34cbcd7","ca35091815cdf0837d396e25aad6052ad32d497a33b123256cffdc008bc50e"],["250b815d352fd89f8210b624b147ea7d0a4f47bcac49f3ac9b777840da93ebe","1173f10e9691948b7da7632f328520455aadcba46e017f891e0a1d7da2bef04"],["2223b85032fa67292f6e1f822628e6756e5c3cc08fc252ab88d63d624e4dfb2","55619ba96a7dcec77832fcb22cd5c21c7dcebc0280d730cba0002b67e0a8c63"],["249b131e04de73af9820d3e22492d9ec51bdc0c4c4f34d95352fa44dd61f245","7576d3b5d136368ff01170a77d8286d0d1c7c40688862fb40813b4af3c6065e"],["6777915d9b4769027eb7e04733f8a2d669c84fe06080f55e8a55674dfbf9efb","640d0ff384c9635e1af364760f104e058e3c86209fa9d2320aeac887b2e02d8"],["2abe3f237681052f002414399111cf07f8421535af41251edc427a36b5b19c9","636ce4deaf468a503ab20ccb2f7e5bdc98551656ebf53e9c7786b11dd9090be"],["4d5cc5414758ea1be55be779bd7da296c7e11f1564d9e8797ceea347c16f8ea","1a680c4c410cf5ddc74e95ff2897c193edaaecce5b2cde4e96bbae5c0054eff"],["46c375c684b30adf4d51de81e92afee52b1a3847e177403372c82109373edca","1eaadc5783c90a0261306423d52009e991126b3f620e9cb6cffca41ca096f4f"],["2ddfb71f51205888118cbabba8fd07d460a810289bfdeeb7118707e310cb152","1fd905d07b3933be886f2518246bdafa6f33259a174668808223cd7c28183c7"],["386f3879960713d41fdb3b1e41bbebf26b1c0e27a9a75bb1adcc1a0d3e8547b","2b21498c0f34ec6f17c720334dc0f36021c2f87afbbbc8847d0bd536eb265e5"],["407eae62c6c4de3b942195afec3f45efec71ddb5e6edee3d427631bcdbf9b90","436e7f2d78268ef62c4172d2ff1469028bad1f1d0f97ab007064418e61caa8f"],["1b881175e21201d17e095e9b3966b354f47de8c1acee5177f5909e0fd72328f","69954b1a9b8bfccf8ec384d32924518a935758f3d3662ef754bcc88f1f6f3ec"],["7d545a82bff003b8115be32a0c437f7c0a98f776bcf7fddb0392822844f3c5e","34b6e53a9565a7daa010711f5bf72254a4e61da3e6a562210a9abc9e8b66d69"],["299b9fcd4fadfc4b6141457a3036aaa68501c23df579de26df69d4def89b913","b95bf2c2bb303c38bb396382edc798ca6a4847e573ce19b7b08533d1912675"],["551f5a4dae4a341a3e20336a7d2f365ddd45849351ec6dd4fcbedfe4806d5d5","5865c977a0ecf13ce85ae14c5c316872080bd36f0f614f56b6dfc7ece83792e"],["7a1d69c08e68c80ad8b310736e6247a53bcba0183b9b8798833bc696a0fb6e2","3ce803a20ebb3b120d5eaf0ad64bed0522fad1a0f2ce39a5c5cbae98c4438f6"],["28acacc0bc41d84e83663f02b36981a2c8272ecd72d3901164be2affb09c504","7a5aee0b160eaff5b5968ab1a0304ce58c3d5ae0148d9191c39e87668229e5b"],["1f78cfdbcc767b68e69a224a077468cdfcb0afd6952b85bccbdb96d1fb8500b","4772ba173c6b583284eb001cfc2a124104833f464ff9df096443e10ef3e9dd4"],["2774108962ca9897e7f22c064d2ccedac4fef5fc9569331c27cdc336c95774b","9e13d79b68e8dc8091c019618f5b07283a710ddf1733dc674a99fc32c12911"],["770d116415cd2c4ace0d8b721dd77e4a2ef766591f9ec9fa0b61304548994ed","42165d93c82f687635aa2b68492b3adffd516beb4baa94520efa11467a209fd"],["5e6e4ece6621e2275415e1fda1e7c4f496de498b77c0b913073c6a6099394b9","3d92ce044fc77fa227adc31f6fc17ef8b4ec1c5aafc44630c0d9195075bf56d"],["6e69c717b5d98807ff1e404a5187a9ceaf0110b83aa15a84f930928b1171825","1ee7cfc3a9744d7fa380ba28604af9df33ac077724374c04588bd71fa16b177"],["404318f2d2ceb44f549c80f9d7de9879d8f7da4b81e7350c00e974ebf2daef1","3934831b5af70d17a3f1da9d2931bd757e6acf2893236264fc7e0d92ff1a1cb"],["20dcb6f394fea6d549b2e75748f61b7ec03b6e52319cb14163373a9c22bb9dc","106a8c96cfb95a331618b7416d1498554730499e194a58fbf63019890480fc7"],["119000f277ccee013e6bb121194ec1ab5460fb6a96eb702a14079865f4170aa","1737a32f5415e8720a5606ec1dd4756f02e7c6817e3723b453d091f2d192773"],["45d0fb5cd95db76d05dec3faa12e467a308eabaad363a062353db3cd2d9b749","ae08691b5b0cdd19ec499132421638f470f493320e4003d123ab1da761b965"],["1257b3e65cdfb6367c6d0942327e799bc66eb221e70c6573a9862889eb51c38","593309fd45755dd2cc4afd2b9316bc4638b0c5ddb3009694fcb7b250d0c8a2f"],["186dcf9950f72e868014a8accf14aa36e82a7a2a29f86ba37f6632da4189db3","55684c9f7a043fc523ed78f756f834b4db823d5e4161bd79602c17d55a5cd8c"],["58791d5569f282f5c3b01ecdc9388df7ba3ca223a2dc1eed5edaf2a1d302fb9","6298d7dd51561a045bb4089deda9f40b2865589ed433e56d54554f8b45e79f0"],["13fd87144aa5aa4b24d5a7bf907d8280d15937fed262d41084898cb688fc28b","3fa54367770cc4479a857411ddcabe86627b405ce1cd14ad3b2863bde13abe4"],["48118139445415f0c1879224e2dee744ed35280ff00537260402a1741ec3676","4dfa39dadaabecfc54ecb7a25319444f8e952782d863790e42a9887064fc0c1"],["4ad031bb9eda84f2fe5d354c7948d41558ca657a04508654721810ee72ef158","620ebd5d0086b92c6009a42777b946a351c2c7ba852b57d3c9905fc337459ef"],["4a34abb016ad8cb4575ea5bd28385d2348e5bcc0cbba90059f90f9c71f86e8b","4f781829ad83f9ed1e1b6de0e5f4ac60dfdfe7f23cb4411e815817e705e52c8"],["7fc632d7512aab5356b7915dca854c8b12b369ab54f524fbce352f00eb9b9f9","2ce80b944fc9158005f630b34385d50c3ad84450a9e1e529925b3211dd2a1de"],["65ed10347503cbc0216ca03f7536cca16b6abd18d332a9258685907f2e5c23f","3be1a18c6bfa6f2f4898ebefad5a8e844c74626d5baa04a820d407fe28bbca6"],["1a8abba1be2e276cdd1f28c912280833a5ede1ec121738fcca47dc070dcc71d","21b724378bc029a5199799df005922590d4e59cae52976f8e437bf6693eec4a"],["3a99c22dafcfe9004ebb674805736a26aeed7ed5d465ae37226dcbe270a972b","5bf67552af08e1e6e2a24bf562c23225e89869cab9bef8becb3669175a3c94f"],["4a6a5e4b3501f2b7bbdd8da73ea81ffca347170bdfb6776a037cdd74c560fb4","5af167ebb259c2da88740ec559ee04052bb66480b836cadd0e2590c32d7111b"],["6890d95308525f0bac9dc25cc1189eb92d29d4b3fe61bc8aee1c716ac17b1e8","e6f23f78e882026b53ea4fac6950e56e3da461e52339eb43d2fdb2dade7ca9"],["748f4cf4f027efdeaed7c7f91ef3730ff2f2bb0bfc2db8f27aadde947f7d4d5","3a1cbc550699411052c76293b8c41a3a8a1ecf12cbbc029a1b2b6ea986fca93"],["7321f3f581690922cd0dec40c9c352aae412ec2ccdf718f137f7786ab452cd3","5be5130c9277cdb76d7409452438ec15d246b211dd1e276ee58e82a81c98fd4"],["6c4d6cb7e7ae70955224b8a912ff57ca218635a2436b36cee25dce8a5cdf51f","32f8c03c6db3246946e432e4148e69f5628b200c6d7d72449df6eeac0998039"],["1dad5f2e795ea6fa5177f110989516eacf8fb37bd6a091c7c93f1d73a2fe309","56b2298c538180e99dea3e171dbb5c6fba0bd0a9ed40537277c0c2373a8e2c4"],["1610605baacc9bc62c4cc923dc943347cfece7ae241e746fbe6c2c878221dbd","431a82d657e0d109d00dea88cf3fa9b999845221b7b5590a20c40fc71368c1c"],["6a4f5c787fb09a5be2b04d2eafa1e6f3d3c863ee22960eb0b64f6eaf6659162","14dbc3eaea6146ee7eaace5a91ed9430dad3a47e9ca2f68b455171f8fe6a7b3"],["738415b73e55412b0e582e45ff0d7bf4b1bf2922db581783fdcc75559f40e","33825aeb3fd8459999eb418d15102ba5864b069c6ea517f0c6e9eab8d9aca47"],["2603e72ce53985c70782774057a17944f7b4ce224a809be4e2b5af3606aa1d8","92822921809c42318f42dac4d773325f41c43069e990adac7818a45e2554dc"],["181cd967ab4615357cc96c82eae9152ce7598c1a1dfdd91a458bddb016ae9fe","5d562fdaeb0e12647e230e50eaf216bed52fa73c6b7378821a3bfc4cd66d4ff"],["1121726069b9ef5954ba6490100b226e0be53fef3e071b7c58a1286174b789a","4b25594cf4e9eb2d14b3f52f2661a9992234fc222c0a0d44517cb77deb9c16f"],["e543663969b915337f105f80995a77b356f1a51d8b4a4fb12d44364130e873","34b2e3c009fdab4cb7349a580df2e64c0098a123280078e5da6623a9ec6b44f"],["4e2f8909bb62de5ef65600e61bbf969293815296b6e23702875e049b3ce5c45","3cb81f2c21f22a7add26fa38a9ce5d9cce1bb251bd2698f90c34ff0a84f7af"],["37b546e403a1ba970c17b67c2f1361ab9c803f8d2b5cd93803014faa08861ed","37079184ea46272f5809b523d060686633f7995167897a153be1772fd6566f6"],["27bddca77f7bd7f66b3693567a4238f2e6751d95b0bcb409f6b24d08f84798c","6417a85cbfd6fc02df560d3963a241a986baacdfa423f65d7227ce49a96c57d"],["2de71a39aa043057d1bc66e45f804542acddf18f7a6d88c0d7fb0ca240debdf","306c1ce39ab46300f7cca0f3a2fbfa77296a27e24bc66b0b8044968ec0ee413"],["307c877154364c0c03534e7327d5a88e1380ceef6481567ade37a14ee7c1a72","3404bc7dbfb33b95d922d0693aaf9358f77888d7d95e773c38d83dbe2e5f995"],["79f09ff7c60850e5f5ea020722659a1ed27db4c95dca131f99552f785c8afbc","40429528c099349b426ddbf129497176951a64a53db5f9d8bd2be0252cb22b2"],["4027dc6b56d446e5972f35464eeac85c5254ef377c902d9fe37aea841bb5292","7c3ea37689ef679fa2f5c7e031a78e23d484a8317990fd34d44d95cc1db3717"],["645dbf78a3c228c4b7151450b5e65edb58e71f37e1e4bc5f471e0f1abd6d9c2","15cfe7850f327b256e23b00627451560c5c6ab60db78d45b7ab286afb6f13ab"],["1503ca373757677ad1d911a2b599d01c46eb879d1ce21ae171c7e439846a85f","583eb269b7030da6a0c324026919de3f9489d2ff6ae0e6320c36f05469ad66c"],["66e1819ba3ec4ad4ae9f7d7588d23baa004e29d3aad2393d52af204a81626ca","505249980cbe6273b82ad5038fe04a981896f4117345ac1abcc67e2525c0ee4"],["5ec20dbb290254545f9292c0a8e4fbbfb80ad9aab0a0e0e9e9923f784d70ed1","bdb1ca3a859227cf5d00eaae1f22584e826ed83b7ccdb65483ed5213dc4323"],["a5c1a5011f4b81c5c01ef0b07c0fbf0a166de77280f0ae241f2db6cba15194","4444521fb9b33d7dfeb1247d0ee1a2b854ad166cb663d9dd2e686909362a689"],["1f35335de40e00c62642dac2fda8b30f071986ce4f11db849df11bc45ad4e0c","7801a2c761b90fd4477ba0be9a775003d5dfcd959b1ed198b4681f15e7acbf"],["48db4798cf6821c1ffb8178b1d3bb6020e04186c96aaf4670972d367f4ed5f","781019494df95b888f1578f1b4a3f8e125ea60eca47ef9207a10630671217a3"],["17f653d904210148a8e74d8e719a3061683c164aa6d79c902a19f185ab437bd","6780e97985932c3860d810af1e065d454b1cb4be0e7ffe2d8cea7d52526e223"],["5c4d0c7432f9b0070436240f9855adae1467cdc9826952ae01b68cd52a3ad89","1c5747f968ed91261b7ae9bf1023c999da9816e37de602d6a1a50d397752bff"],["6fedd7639fdaa2f7bad4ca0b391710f6f8a7e890250ae8ae4252bb8b39a1e58","436a215f655a3fd3778b2335ffdc9aca6b98474e43d764c1f8362830b084f0e"],["7fbd45a889c5e9d127bb4f8474d6be7cb9796bbfff923b75e42a1ad4cae37d6","484bd12622a6ba81cd53049c550d9ed682a8e765b656b1cbff9bbea637bd1f4"],["17d984d47937263f7966a3e7b1eea04071e678494bd749c9e02b48b3234f06d","7b341ff08722c4e161005d0037204a7a2001fdda7af2cc1a0b04a027f115a0f"],["7f1822045db45ea07e1519c3ee1f7705915f35fe4dd8db1e8921b5d1c740edf","33d41e06b93320ad1b3d9580380ec797a05dac3f1cc8008899110ebefde2f78"],["7b19453ecb74b7d0e2a66b9890ff73bfbbcd61a266abd6d82dbe665bf32f34d","6dba2355420dac582b1f349609ea1c89b89bba2d1a68a0642f1dd12d86e73cb"],["273e82a15f395ddf2489a95685bec8bac62c4b459d1b28987d3cb27e4bc9128","653375b48a4cf5d5b101c9ef533039bedce5dbeef3f59e8f168bdc99b06ca5f"],["3006c9e7fc6a553d8eb4e8a47ce9f10d1a39576ac255ae9e0a4ce3869e76212","65fe9e2ef2aae608be309332d464f57e28f1df5de1a6a519751b056971f932e"],["5e8f384c8a4607fbe9789fcc52d54249d304d698562597d114c1d81452d3dee","3c8bc78066b5d947dc1e405e326ee55ea606c7988f666748d259850fa259a22"],["7841b2102e9aa103fb53a642b3e167b21113ea44751ab38e0b5ef8312654db9","71bf5c8308fcf9c4a7847494cd9bdd946fddf7d3a37e8bb0b201ff2343deb8e"],["40f68027420c11e3ade9aae041978dc18081c4f94943463aac92d887f922a62","499c6062594a6c7e21a3cb91ea451813393bff365a27a08f1a515439b83cf42"],["6ce77a50d038b222634e87948df0590b79d66087b01e42b9b6d8fa30ebb1465","35f5c46bb1be8555a93f155a174d54ec048c2ac8676e7c743054ddc52709d37"],["604f8b9f2dacb13d569262864063c2d4bb2b2cd716db6eeb2b1eeabc57746f6","68c6799e24f3b44eec3049973445174727a66970f1614a782efa2b91ab1e457"],["73d620f3bfe77f672943d448d7dc05327adf64b8e7af50039c469d7f7c994c4","4859deb36eaf0c802f0d1514602368143a33ec6ce8fd55248b59025debc6afb"],["3fd2bcd1c89d706a3647fbd354097f09c76636e93ae504973f944d8fc3bcc1","677ef842cf5eb2444941f527abec567725e469469192354ad509a26ebb3d0e0"],["39222ea924ac17b533c72ffb2c47ffdc11d6a7f7c70fbde3a10fb0b8f35eb2f","20dc4bd1089019bc1d7379b4feb3eae6eb5af59e9f253845da9fd633057e952"],["326f58994e1347f62e4102183215b5db956378d2f61f14aba4dec94577f53c","7a03284c296003bbe05178a1d82efdb7b8125511d63e20e50aed789c2e52e1"],["53aa8939c74d4ee58f03bc88bace5a45c7bfcf27466201da05dc6723a5f5632","2e32535ca7732904a048183247b04b426ecf9b39fc393a9cebe92fb1dc7a7f1"],["6cee1a03145e93b3e826e6067005f09c06099c98198c91c222407ba5c8c132e","beaecad1274e7c6e5476a100c271aa1a6f86ee5a9fa5c2f26124d5886fa63"],["3ec659b8175e1be1bd5a252108714776b813e330393f587814f5f1f32a73332","529a5cf9f8c237ae69a94217d173c8d19c156952041f5c980da557990863fa7"],["3d66ec5963d0c534d4139c8cef2e1ac48b3e7965fafabf58be26f903318af4e","3d3f2de7a95f59b683725ee6283cbaf31f97c4b600df9a4621413223a468740"],["7fb38ace8e0932fac2ea0d3eb676db8d684db1817e2e4d59da7996ce398b4a","68f92bd5768cdd4710249f9d49ef1d5654e497b9a4ba10bd2971366d83fb400"],["1c4a49314d6b4969cdd142c76ceb7682bfb868ace7f7568b0fc8635bda5a9fb","5fc0519f1f4cc10b5771312458748c036313b87707ed0540026ac64a5955aa9"],["3073c95d08d3b97caea5f0be16b2789bee766f76b7e5499f8ce8f96abb0f344","52a8974b4eb9a1f6a0ae2c83cb4715bf18d73f057255fcb3f63b74f7e78f590"],["44485b16d597a5de3604df6f7ed7e00b8aeef9e7e8dea8688255153b8bb16aa","6cccb0ba170123266f24b5d93a744397dc2c44820edc4f8f5b9a0f5c9b3b940"],["7618f77b7b32d512688dd62e0b48231d9574c6361e8be353a7dc04f7c3a115e","78ffcd16d80636381ca231aae70d99c9e20298b4f5388fd823ea9fa2b8ddfd9"],["7dc82fee1ef95cf5b3720fcc07f63246654bfe39762627839da40e51c75654d","4c0ccdd70955da74558de20c88352df8a02aa97e4d5971c500e884740a8cb62"],["7fa5d460dc10cbb418b444d9bde97e92c70a99a222b99f244dccee7e62cc04c","636163901baa5b7576c38c43407af578b8c4607e01e86011ae2dde587a89f84"],["758930d46006623a756c89bd0cc378f6a3c1f43c9a0edbb42274c35e75c16d2","1d74dd9f81c2fec811b8cbd6168a745b0a111932b2a345265ef2853b50b6245"],["7332ee0626b044d664ef228f8cb84df7c643e52f6a2591ae1c9007ad61ec16e","229bd8e630572cbdee54283234cf3e9f060e6382f99943bf234119d47b54470"],["78a16ef803aa20a075bb2f66c61bb2dae5698bebb94a0995fa74c3d53de1614","246d588b68edb6fed96c128349908c42dcd64c46341b205e79f4aed9b5d3675"],["6e1933939bd03b67bba753cc0cbe7d2f25bad68c993887ef8c9e2fcd59b0647","599413f7c204a11a5ce315eab11299ab7326603412bb00bc1c59ff75a37d6b4"],["4a79957a5a1888ad063b51c69565a2b48e8eb917183e220a1c8d3374526d30e","1f092de0e069bba7fc5386e2e9a114c1618f88c4b95e220cd35ffe96f99fcad"],["3148aa3df9ece39aca84f59489f2710522216f14be6055ee0027529d1d55e2d","617e9a52a92975db0ba1977f71116f7058a0d31b869ac7f3ee2fd80b0c5100c"],["5c1188e72384160ae39d07328346cda4f6c12d227448e6236f04dc971625287","1643006eb3a3bc6aafd5f685cf054f2a572e6ca58c0118bcec0b833741f116d"],["3f72efc93c9b71adc4c51d8fc69d3940b20d08733af2b7d05140fdb1d1c1004","7399259987c8f4ebfab46e522380707e58427d3962ee0c2a91760813f76d232"],["3129b34c03c51aa8f611e91d5cfcc9bd3ef108ee66e6d3ee35a0e0e50055bb","563b18b5650085efb4cf179a029e6afff27b1d3091cd28eaa68d24fa1f801c6"],["16eac0f9fb4c67cf89a7fa4ee615bbe731d8edcb709a1b9b50c7d873a530f52","7ff8288b6e199ca8f316192881424a37fb080c29daa76b1f0edaccaf580a80e"],["75f6b6028c43ce832f65d7e8e620d43b16cba215b4b94df5b60fc24e9655ee4","35e9ccfaed2293a8b94b28de03bcb13eb64a26c831e26cc61a39b97969a2ff0"],["3c6152fe093bd6316897917ec56a218640ec1b2148f21db9b14fc7a5ff362e8","6eef2df27ae7d63a28856b07b73e7aad7ca94f317201a1e675ffc6f9a1710dd"],["54e01b5fe4fd96052aad55b3f26b1d254dfc7e2525fffb9ae0a77eb8cc5579","7c3d39232ab333675b219abc766ed9b4782c840e6b046614dedb8a619696eb0"],["d1e63f8ea8a76429cf254a6d3b668761f0dc572d4bfac4fd56d9eaf58fb6c0","2bd0a84d3908a63085824c9329a0983913006ba155b56a58eb3f9becab29c45"],["2d6122f2a702edd4da7385b1580796a71d13bd72be94cfb3fec01149c006c2d","70eb282fae992efa6f5915e578b640653549f23385ef3a29ab29b1b9b8ad63b"],["752fec14beaadb5ddbba6b3a17fcb86579fa588ef407fad0ea07dbb22a640d3","3feb6728eca21a1e84e8f9f23010387a53a96a1cb62d86fb37996150a1299ef"],["63f94a92f27acde8f5ed949b459506f51d70c85bcc61a34d647264ecc53c65e","37e5dce0646ee66f4fdb93b82d54d83a054948fa7d7fa74ab6b36246fc7383e"],["d6aa909287a2f05b9528690c741702c4c5f4d486c19a46c38215f52ef79c7b","5ebe1128dd81093df4aca0df365d58adab848d1be1a94b95eeb649afd66a018"],["12866812b3053e2f7a9572bdaf5ef2b48c6fb62a0eed9ff0356df50e7d05557","6785f7eb2cd1c120e4c7167b46861d10117040a2e9f2ca86a71e9d67df90613"],["46a730d05330b1b13673cb8a1b8f45460035e4a9f1a1751cfba099c4355c1c","76fb0ec6cd16a8141cdcd875c8b2de9fce42d296072643d148ac7e7fa7472df"],["4bd4380a22900bd34835e0a908eacf4b6edb61eda0cf483f9212453b37e7516","5e9551cd20d8d7ddbf4366880b7d5267385afa1966ff30da4baaf273b009d29"],["71f1994ad40baa2922424ae222663a64f93d8b67929e9a10f9e4c1ab19f3833","85320fe68ec0d37cc19fdfd03589d66906ffa4046c80e1b094a85f27676346"],["5a63b1bf5232f28f808765c6be7ce1f81c52145b39f01c879fae0f4303bee61","3bc5d6df68bb6d0577bf9ae2ae59ec0e9b2dc7dd56ea179fb38a41e853db950"],["161ded55ff1087032381e6c1449704f63ad2d88df82dfc44a71890fa09b3941","78a52e0013842037274ea75daaf8eb4afc04ccc4b07bfaf3f5ee47d165e01b"],["1bfce5229c5fbff5c0f452a22317fcfcd9262f23df41840f84fe7d44cfba1a1","66b387872c00e63c73006a955d42cf49c46c5708fc9d1579b9ae38341b24a3d"],["56d47dadc9cbd1dcb2ee3efcd5d4af5e6aea71df10815c68b54a14e81d11b44","47e966ba54df48e9b612a903685e0060a67e4725402e8cb4cf654e54e813a3e"],["4b1c44438afd4ddf20a2cf612df2ee494ce84c7274c5529e857693e73018491","430403bd31d8f0677e06abff7159384560f27b9622943fea1a3192f14bf40d4"],["7f7281728fc2214aa1dbf13176a4624b53814734abd570eb6ef7c7e32379606","312da47be347fb3fa2c9089b38df372560dcace2effeeacab4d96ab11567295"],["16a28884a1be8183e0d3fc0db84a9afbf47126fd3be548c2a584aaafbfa7dfe","7c3f57b3b895564ba562c1cd80b71fda6d2e611665c6ab87744f5390858fe24"],["323339f37b327a731232a9580e79952063c7c232bd1380146d8a83c285f4b8b","4f16be1d983c7232f92cce6b9690695978d42cecc8eeb8c206e125d1098a265"],["624d26cbaa197e104eb83cebf2adeed09a5cdad359993fe5e3529d4d0def21d","261b7da3cfb55c788977e0d8d640e3e93ae5a325d962ce85c816d7d32cfc430"],["f24ecb7ee83a3e28dab54a330dc93d0429a7aea36412e922dce8fbff40d60d","b043e36a258d1df1d21b0cc7be9c4dcae1bd4ed326c110e668ac23d86805a6"],["686cea46b710bde1231483bfdbc700cfa3da6ecd5841c0e0c782f9ea24328ec","7eb7407aa58edd6911c7c7e8d1e03bb52ead4a2415a0c33325872ff3a521dd6"],["3866ee1186264549df3dfcdf8705c0380c9372eef6d4081c2454d3aded1720e","634c6d3e8eb8af652a4be73e3b613452c2213104ca875b66b4b15ee5b1716af"],["484c687cd2969a1d20a58cdfb9a60f280a473284503b1ecff5de514aaf8206b","34d44d26b7427e51a646d1b924084762f5b461685450f21d6a472de565bebd8"],["203561333771fa0fe22c4033349f7b877d15b0542a5598e81e067968768247a","2b6a533aff6e2163a36a2a89cb7415848bef48db40f952ffd380f47676707c2"],["2ffa6cca6233695760251206fc5e34c8d3692498589478cdd3d5b09f0b7c05d","6c57d605478fa9626c4ed769554d075daa53e1a1d0bd4d94174d3bfeeb11ad6"],["5dccf0fa46a5571f204d0b033b45f299cbb3d9f80fded57253ea4f1c64faaef","30a38e131ee8756ee5ea2a3e16618a5dbc28b5b9311308bf037ecc2039dfc7d"],["57b0a2eaebeafd950221facdd24790d7d1ab8883e5c5d55635f0d14a1ee4741","7b41cc478fa6be38417271db8ed12efc0da6982552c1496025d2df0576bf4ad"],["611b5725101f611c387ccaa13889ecf3bb5595071a179ce350029bfca4ad7f1","3129755977abc8995fec7eec1123a1561e429fde37ff36af002d3211831ecf4"],["1c06bbd0c52fdab9fcaf680c7a93fb821e538a2ed79f00f3c34d5afb9ea6b31","3873d3bdfe0be0157bbc141198dc95497823cc222986d24c594b87bd48dc527"],["275cdbabc989c615130d36dabfa55ca9d539ed5f67c187444b0a9a12e5b7234","2b7f723e68e579e551115d56f0ae71a3b787b843cc04a35b9f11084b006521"],["6cc702eb20f8b5940c7da71f8b1801f55c8c2d8e2e4a3c6c983f00bc1ffdd95","5d15b3727bc66f3aba6d589acdd139fae115232eb845abe61fbdfc51341352e"],["44defb418700cee8c9bd696b872adb005490512d8bba081f8f99a9f15cc981c","3b2072cdb1d919b2b65b5cb3557f0a3381d7ca293c267ca4a38f83e77bcc96e"],["fd83ce77b1578b3a9b8c3cbeaddb1504d2fd4a19c901c21ac65961224e4966","110cbe64fc10c6b9c66f15ca406a35f50b723b35d83c5eb9797a57f8395f4f9"],["9dc6ff90e341875e113bbfb507724dc7095a280d2f32cb6ba61a1e0c2d2aef","4aeb622896c852c2747454e8f172c9482955a42ecbe522d6ce07ecde79d0a51"],["71c58b0e47b9dd9107ebd8a8c8fa9f0534e78231bac612c1ddc7a94edf33eb7","7f90edaf4792bf8334adbaa0f4ee7c654312725af188682d75f34874c4eccb9"],["1f6de1f14988778ceb2dfe844f92394f1f1e72fd1581ceb3bf336c95ce50345","4f6007ed4e022d2ee9fe4ca8207c5f6c766c4f3b85260e941fb24ad0dcbf0bc"],["3ddc3ac25ede4a67a97547ed27dc920239b585fb3624177e2e8d59eba678115","a9afd8f8bb759cbd1dff2addc63f47da4ba1291ea34229c09c0637dc5c8d24"],["c56b0269d8431556e471cab9d70edda3a37b391696f107b2dc370631de51d","729c52f6b134f733eb750c14bd9f95c077f0f6f6ff4005701e5bedc6544599d"],["44d32ce19ac6807cb22e4f25fe1486a36a13926f147fbfa054b63ff0446177d","212a21e8c124c9cd37c80d2dd66913ceaa6b6f666522f115c39382b2d5925e8"],["35dfc16f3ae6ccc06a267bf6d931601e52f3e45359ffc513570b65b96adc4f","74311d10f4bece01b5ae65a6affe5c931463aa1b73a3320eeb41bbb7bb1ff62"],["e0acd9d2d907031b319b80121dc90699d003d220ea785d50e5033cdb3b1a03","3911ba78d6e507485d6374b0f7d2e6198f6462a7d6d3cf046404a07af690357"],["3c57918ca254c0cb7dac251ef4e10c7d82327969552eae15d26c4c52660922a","5fd5f5ff3f14e671548074114c72c48409df8a2e71fc8aa3c8acb506e2a88df"],["222ad8b61e219ba2b581f606b7c996516850a46a3db72fe1f72b5a9be6c324c","72015a5e2db648112abd284fd867b59fc5606645177d26cf6e9a655c9912d42"],["3c86d5d774bc614469768ad38f7be9a53e9a233942c5c553b82e49aae684764","480febea8229e130dedffff89c11f3c43e11724e6bd89d5566d78752859d41c"],["adb73bb8352d0c10175df371f7868ef2c9e0c79ac788430c480c0f7d85c187","60b564785248111502e6f39c4994d6293fac22bc25f4d764b2fb1957d3c9bd8"],["3836ab8b46cf4f453a22532c886940b982029b29c42adca90ded5bf77e6bcb9","7b15e91d6355f147b171a90b064a9d8b2d7bf3699bbf4987664c61c950d8996"],["12ed96af1a97c45ec31f1531e96f6fb28a03ba52ab8484545fbe0dddc97bb32","6d1f522b6c6cad0940cff8e23decc72bb8d4164696af031415508b025aa8be1"],["27382994ae5878223ef802e9b4882f481a1b4008f1eec8484483471f7aa742b","c31750d242b3975b0026a0e86ccdd17d0f680a8c6f53f197fc25eb1f777917"],["431677eba3715455bc235557518a74f3b111a88844ef13e159ad44bc16de3e6","30000e1eb6a17d9df776981e65c6e500fded1ac12003adc9446b269812c9197"],["4b563e6f42589671579eabfa2cda5502b361c46a5ac8d45c8ed44741a925b33","627bdb41678443fdd1aa607709e9699b652308615f4bea760a3b79ee0d9ab5c"],["2932fd3f81fc973ca9def6b7f1bb50f980fe589187cfe9e9f52ba4d356cf2c8","1e6bfd00fa976c4770263a227048214c38850fe0f059e7b3d2c7871ef07d68f"],["e44e4f3d96d9dec775b996be57e57fdc28e7c68023109b221c414a244a0dbc","58b1e52fa274812e5184e00e9ad812bec2463140adfb4bea3b2d665867dcc9"],["7fcb89be1f4bec745887bb891e53fefd665c53d00a9e74de16b8a7e1f7adfb5","74af0b06633f779897e199609c71cc5649bbb65bc2c0abd4c678f0480c198d1"],["62a381ffb904ea3ff4d451d4c8459457cdbc3dc2fd2da646a95d8c1e90c0b7b","1ba058658e09db9e319fa73de8ab4a992b71e4efc22c273725bdcab84e2a315"],["1b0fbb7a84c67e668450a54449c7a46261a2d355589f8b84ebfbaf9a77ee938","44f8fffa33dd33a6146c35d196595e22cc4a215f61ee9197cd751400970a1b"],["78fe920bd96a356d4d95ee34adafe8fecf071d3107c36f047b4024ddc4b3eea","6162f29607fdbec10181fbac6e57d5cb41b922c5791fb24bd28bcdd75d16c41"],["5629b849e026e65d119ac11821d7ab7efd9c52226f75c7427505d6818bb0c8d","1539c0f90970ee8b490e45bbe5568170e5708521a0e59f976be680595906feb"],["62bc853f349bac8c6e5921d27ba85dbd9ba20a375d70a7bc008928f3e123b04","6acfeb1de05ba43c3ef1a9110a983a320e77b3ca294abbc04aeca19b194f26f"],["4cf4bed663464418285cbae359b5d84ec76b5997d24f3640984c7663421190f","941f818e3e3e8fb1568da85217d17f9250ebc948379014d900a7b1a848494"],["52ff3d9ffe9a302f6dfaaf74bab57c08027d5cb699a69b30830540c0a2d47a1","987dd8876873778d933fbfed37aab2f7d6f669c37024f926b1edcb2ca55782"],["1109ee32f0bc53de6bfa457060b366e909d7c18061ec9845f46ac715496897f","38f36f172bdfd454b9285f86e6bdece8fdffc95182c7d801b03c671cc55139b"],["4b4482f1d84efe23dadf3bb10df3dcaa251312dcdd604f616f1eb540e1f3232","7c9c149dcae9135f940fb54482f9c3cd8193721643a6e23157b8020410d439c"],["69cb459b9e415b7581ca163611c470d875971d5d7949de732d1f0f200544a73","a7136fa9dd00c0469863b7def3f83a5611ed628810d7e807e7a873da5a9897"],["b66a4e32ac9a4baa8f64780acd94ed3628b2b0ea874ba4dece629af65f9e62","24328ba9996a24389658e3467b8b90dc3927ef8419fe28b3f55b1c1aaa51915"],["5ecc3080062dd451236de0e4eb91c5c75100733364bc5469f5fa76f79021ecb","6da4abb9031a27b5be94529324fad8026e7d871570780081b0f424d4fe543c9"],["1e3146f00880bb22486d5bc73e54367d54251f4002bcf342d0393b05a4b9ce0","23b6fb8e945d3205f633ba724202db5a99305f807137edf942cd60eef867699"],["2e1da8013285598b899f026c6974185db12c97b4c63509769d3d4ad1d18a4e5","1e7e7b668674d1593c39d58bc7bccbf568208732b3519bc2cdf93db34366862"],["d26c3f389d81709506f184b53871497c8d36c5c9eee8e3737358204c1acba3","34649c3d39f3b825947fedbca215ae30c5a5995e93b1c8efca4944cf85a082a"],["91300478a83595d548f32f259033291fc7d083953b0b8bde88c7559660c563","e5d2bff57fc6551e9b80c06ac7314a71907cdcc66ce82f2cce721a670df10a"],["1f7abcb9d462c63ffe92aa56619ae8590089cca4d93ee3e5f34a63882452cc7","7e9f85c7b7ca6e9a4f3a026d1048adbeef69ea9d876c6f647c257b879a81bdd"],["4d2caa1323012e4c83b0ad387308b8aef5637bc35ddd882e7f5e41cf2ca410f","47150e808c81a540b6f8864e9d6636589cacaa516f82caaa96506edfbd6f0e"],["3c10a6083c38351deb3e6d1b386827d0acf48979b66b95249eb8700ec26b069","47e34bfe561d903cffdd1d849b85aa3cbd31cb4a9bbd8cc2e5fd2f95016cabc"],["758bd54868eec045d0b4d3d2bc415d24bce13fee47cefdfda46425c109b657","3392a7c66ea3bd7b044680bbe9f78ae86752097404c067e9d2572f55330df83"],["19e718e0ca1d2d6fadbc6006ee7dda7a385430e29f5e239cdd4bb7c3fdcb2f8","5c68249b7fe03ea2e13481a63b6cd4bf74ce42009a89fee0b3f8f968b3ec709"],["28077f57ea62401806367e6d54fe45d02de5b072db787ffdcc3854e12a3e855","14f3762689072f5fb41d03e94b01808c739f6d42b7b785b0e464100b150efd2"],["3b8a8cefd017363ce867265af3293cec081fa589fe561830f0078778cbd338f","69ccf2383cb7b4f9c806d72535812483e7c5e9a1a5928529d64ca7e085e758d"],["77878f388d22161a2953e5aca6bac1ea480e102f329574b4b201640d44a296b","7eb35706a90a03aff7c2fecca72659136547cee98038746db5aba16fd7178df"],["97332e6da70961f2ef31b7b628f1018d21db8db015922a301fca7d6fc6a8e6","2e37b06f639fc7a82601b744570a2619e543cbfaf60e474107fcaf4686d3223"],["a81518d452d3aac48bf0386c3ff170ef4e684a4def242c964e129c64f4d647","37506e44c85908ec7b7adda9547fbdcc2e3605151fefa77fbf127ce3bc938f2"],["e80336b2220b1d666074f6b0dac85353d0e4c2e8bd0f37055a2236a6a9fadc","1cae76d73eda7a5964c5d9d3ad6748aff51f5543c56441d2fdb7b444a39846a"],["2c01fd8430ecb44e066f352c4f697fc9fda177dbe162f82862d7b9ea8c918de","6e1dfa99640fdf5b30603d34c7c97c1aa6e6b7f3a2c52a21fc64b0fcac7d591"],["744e37b511cd0ddcfe15f3581947014c159de81ed055d15a13c7a2d1fa39f0f","685caa8ff6979a6c63640ac638a3f9c75737f2031bd55322a47384357af164d"],["40e627ff84e1a7a9068b4368770f5956128a4d9e9e33e9cf5e24d9a242149fd","2465bd6cb20bbdf810e2bc5c3c458cecf4f3aa163a7ac99c2579e5f33417f2e"],["5f635af7f554a17bceb6ccb6e637abf89ab6dadd399189b0a0390e87b1896bc","2aa6238a69f89665646c0e3ca2ba5f709cc6e14351cf71e1b00ec45201417a2"],["5edad3063c9fa8305978d7e6a4e037c9fa519b8023c7608dfc3b66e5c1e8985","49f405d07d7d01919da51159ecdad1031a5ac208c026fdfc14d38f633d92183"],["2fdf2e8a45858c12926a1f25a62255fb2d02d0149a15ef669f859806683e649","61cfb686bb31e2524470d4ad2ae09e3cc91b16305a21d748098feb1d8ce3b3d"],["ecdbd7c37f1dffa3943977278da3bb429afdf948b4ea6cdebace3d3be82381","190b67fb34f7f3ad6afd3d6b6427aa327547d8ac0fb4deeb0feeba1f63d6c60"],["233021b483f578dfa5222f8cccba5766ceee0ac65f6d4a3b1673b302a21fb3c","7d4b6d44d175d4b593f06f5a6dcba2cdbc4eaa2097abaf613123546866cf4ef"],["42db4e953c2a7a743de9fe20c5798f2247f51db4eabc6f40e86c13909a310ce","12c1a0764a0b9f3666e431923ce15e7fcd0ded5ab153f0b48d362cca1604e65"],["30d539e2b545fb957e40e2255f6463b52d227c9808472cee6a3d521aa283a44","5f9eccf747fe6313570f99e845db32b40070acee9ce9e34da7f3c29ca53a07a"],["4bd64e5ade3e2733580a6116b4af328751198e7128f9acfe3a3496b545efb5a","4d584768900dabfc0dbaa086632b8051bb3905ef79b84d96c01514441d0cc93"],["62d6e771f02e591557197d13c3e77dfa2d1794ac1808407bd8227c4be31b466","5c6f5607c1808e899ba36a425911fa8566b7ea9cc80de8a80538c0fceb837c0"],["5ce406218cb2852b1d2fe1836b19462f664631785216e87ffbce26030e2101f","5225f107743c255ab50e7be4a090fe39478d1ef4ff558468559d8cfa87bb94"],["670286486e8dda3dc66b0ed3149be7697d3e06c8279844079daa7e42d5af728","26becabe7430380c56e320f5ae3329569cae7b0af06fd5327ee23979d200eb0"],["3ef448df33a4394c43e93e5850cd0c5a6dcb18ae1cd865d00fe8ede9336a9f5","56711f6ab7e0e4f7365ac34e284ac2879f40208c46f6febcc1dcf7146ecf015"],["4b63fc130288e92f2d6ba238caa7a6364804e29829ac037c57df32fbf762bc3","1eb8c80af55278b4113286c038fff2bfad2da62763bb03426506b869139da0e"],["4e7e998557b29a95f805a6e2e26efc1e970108272d4755738c04f28572295c0","97cfcc2f447bde61bde71049d8200a74a3028b21703bc139143d81a3623f09"],["574b67898f02964c408f68e9470e7b615be037e40b824e6617f89cb56c21219","49392d5f8e6740a1b0b7444f56d7a17363f8656c6e4c628678c86223f2e46c8"],["7e8cb50ea5d5c1b09e219e7305bcb601d99b6d7185b1c388aa8e36fe1e56554","47fefa308645455c12ccb5817da338f0c4f423b341aff4a9d158891a4fd69ba"],["67266dea9e71b4ed2bf24a597a823dd048cf31e725db511edceac72998c9ef6","39babd65850befde1f7c28e41dbdbb4caf82bbcf3bcb5b33161f1c2960b2d8"],["63e99c2cb9c74eb9227d48065e27abb8f606df8fc83b2c44e4ea38b046bad2b","60494a53dd13ecf34e08079d343c88fb655d6d810785af81f08d5aa9bcdcf9"],["3cf0600b0f5a2a4eb78c487cd385350e8c7848e3f6983231881d7f1bbe28543","56dee4288528de609976ef6b903b652127c37b0590e91a2fdbebc3f11df2628"],["758f09245fa4b8b23d290ee2b3bfcede199b4fdb11f3cf2502a8ceedd61b129","622d9baadfde781e985d9722e0a04715666769a4cc7a9bea0b96d6386be1746"],["38e1a45b81492aa95d7abea2b08b8c14dc0b8a41108b036871fb737910ae18c","145c611262656385e5ed6243568cd3f9f59dbfed7a01ba11e22bb8bb272e08e"],["206e54ca53a2f155bd4fc45bf2edb77798ae6623defd4cf22f2dd4a7d119dad","6c94e7f0825ad81680e4cdbcaaaf4df806d57a0d1fb2331926c3fe2b79d22e8"],["56e98d2862893caebf66180e84badf19ffc8b53041eaaa313ae7286a8fac3d","526306f9c01afd6e0c1198ea5de17630f5a39c4ecd02d8e6f0d613c355995c6"],["4fa56f376c83db33f9dab2656558f3399099ec1de5e3018b7a6932dba8aa378","3fa0984c931c9e38113e0c0e47e4401562761f92a7a23b45168f4e80ff5b54d"],["450cfaadfecdb8a2fbd4b95c44cb1db723ee5ac9677c9c188b3d7c8eff4ca58","1a552bdfc0c81be734f1f6ca9a6dd3ab4daa61c11fb53ebb7046eee25d617c7"],["6fe20e5c8a8004e33eafc84d16ef770f2f0b7bace19adaaa150f987d295a34d","28a35040a2ebe9a14a162d3208d5eabc6e2f3a8310f926bd80be65aa71775e2"],["1bd65f45a35bf62ae8f9ffcbd7de2976b90518b6820c219f039c50043bb1edf","fb5f0f8659f9b6ed7cb0ddd7999506d0c20b26bbe69d1915a31842cfac41eb"],["4ba4cc166be8dec764910f75b45f74b40c690c74709e90f3aa372f0bd2d6997","40301cf5c1751f4b971e46c4ede85fcac5c59a5ce5ae7c48151f27b24b219c"],["21cfbc678f5a279ebb6ed124273c8df37eaf12a2d04180403ae6b5ec0b1e1ef","4478ed6a346d899ad7b0b10350270aad39ddd5b68529297e4c91a54357f0a7f"],["350bfefbe3d864eaadac9cc1195c14159bb736be743aed7380d2384cadd2046","5e2a4b3ad0e1d7b9b8ef72b10d68a80e5ee691d7db591fcfbaad6240d41da8b"],["529acd569127f73c8d34345f87e96cebfb48ee12a00a3861cda209337ed94e6","3120671a89b705e5bfd99b0e7fd2118b4914a3ac309b3d74527cacb5ad7491"],["55d3d7956a97d10e65a4d8ffeba40deaf0db0b57f8e022cdb3df6df613f5c6d","159e59a6f92f48fcf85aa96c1a03749a4c4e2cf9e2bc94dd36796daebd9b8b9"],["405f019ee8f2e972a005c549b0884b5051f63d1e78480b73208dc07d8c65a1f","4301a3d0c285ad309ff24a12c100ead7f48ba1368143712f32ac141ab4d9e8d"],["376d59b298d982f02dccad0edd5bbd4e5e8fad7898750675ed0856850a7babe","5233b12bbc50564eb61cc098a17d3d97f06ec7a230380e4c5d3b725cc318eba"],["2f55624af6109ef04b2ed035a44a904ace8627f55889f011f768aabf4de9a38","7f64209ce7dfb63337ccf3d8c14f4093295f86996cabfee23b1655549aca089"],["3b8965e942bed2714bc2e685fb103496e1e3595ac6a343d6df45fb5ef6979ed","5b7cac7a165cb69ae103dd9052fb39c00ed0aad47989005aee53972d82d45b5"],["7abfe3accdec1eae1a50049efdd9a8eb7c2921a08e8bf1fe606e9d5a4039ec4","3af178e7e831f8148244d2d2b284a32991852db6212ad0a9d77540ef648a5fe"],["4983196df6ad7d6f0a8d76f86af3863ad8611374a03fc0fd00793181dbde9d","204c1f91b70f975a21d24a8face664e496f00f602daaafa69a3b56098a4cf89"],["79e2b91c1531a3b16dbd53e72d94e16bf265cbec261658151acfaea3718ea72","3d9bdb47e8b148c1c5e9e694ffbc2cf71aac74ae1a85e8d8c3f77e580f962eb"],["297efceec61b3be17565843cae465c52524b4ecd9331a4170f54f7de8c4556c","6ccef1733624cc8b973ac63dd54e7a53604929affe81c3439525ae5ed6af993"],["44f04b1966264a23ccdc870c8563ad2efcd4c8087b5469b90e792287a5581c7","1c417f0e9829fa3d3cbb7c3cf4dc7aac04c5bf66ff3f86b833a42c533aed1fc"],["6ff83f5d8b51db3be0bda80eed2e2adb7037f2f58f705e88f0f98197431ac26","64f59b8428894c2b7afd740866065ded42e716c7d48accd3f117f22768ed9fd"],["14aa8187c9559f77cd1cf96b2dfc949182529936f2b0b4050ea56e134073b24","5f36508c68b1dc586f3fd3f4e2bd29c6d8258491b8a6aa19ede811ce0d3d0a1"],["95e8882a68c5000d1c2be7c0b43e7f2a6f8de906485241f0285a5c73a27a83","1e4cb67207ab73bc1e5d19fa2146fde6d03021393b77a55df4ddda1fd28f5b1"],["2ae0704dacb3da47d564514b4c3543505b403ba09a248c6e74593cba1867ff5","5a4b5818088dc9ef4066b90a8893ae80fc89584f987ec1928ef9d72cea2bd67"],["61a10898a76fb99989e51c0e823cb60b95ec7ccccb917c42b2b28014f5fd94d","23d8ec1de45366d3b86c64c2da05a2ce3d171adf52ca5522e652ffd0eeee795"],["79884133c879cf07734976fd64de220c5a972e04c2a3afb74c362d6c3beecbf","2aaa0e6d4891b792b5643fdf09873343cd0e3fbba3cbd0601b481a4083f32b6"],["45f73d2fa82be6c5ccd0f62d2237efe8727c479967d27cce28e42b9a44bad5b","2fa4932215f72d56d8be5205c5851c9b3e5f2a14468e4a7acace5437c6b27dd"],["37f53f771850f52f9c8f87b53c6bf0c93c2bed76f5fd1d5697356d0b2325007","50f1a052b79b446fbc7b93ffa1a4515f6c3be3a76a2b0bc5eb8ff327549960c"],["71bd6d23e0d2f312d47582efa609101f15b9ccc571fca8ac4fe3457c67fbc9b","3b3fdf86bd4c7fc26d60540a6439b4d179dcbf7b91efb0ddc60dfbff9a148c6"],["78219ba049438385b829c13a4993874a4a326c4143de0dd581c7b9956f99b06","5505f1268dcdd4ee01b77abac3bfdcbf3f0513ab097c69ff777b4a631aaf256"],["b81e924a86536dcf68bc5a2ca2065a61103ba6c9eb0ae4cf8cce9dbe286f15","653a6dfb51acfe8a844fb8362795e5549d424aed88d3a090366a44f840b5b83"],["441c0d7b7aa705046dc0e07ba5f33a7d9df23f694a05192ff8c2d7be2aa3fdc","4c06568c0902bb99d428bfa0a946ed0f0ca0a51fbf07cad88e06e9c78e38a59"],["2569c8c78b6d6b92533f29f767c95720d377fa63ad5a3b9827ee0a74b0488aa","4b59c81d3cfe08834f946d9d57614f5366e0bcd9349475aaaebe01341196fe0"],["3f2fa285a0471647b214eac652bbad9d58a9f2dd2e812aff0210d0d8a6eb32f","4cdb18e1c2848c2b52c1a6557165bd1a8f55c2f7562f5cc0b326f73c25b696c"],["5bb5141ab4fcc5290ae9151b8045a2cd8391547ce7b3b33cbbb10f8fb538092","5a36bfd52acc6a83a9913b937ec086cc27fed030b5fa70dbc5d3c12c9515f56"],["3f3fed272edf91aa7f8ca5d70005d390fbc67830ffc69c5fa3ae17582d2771","459057e0883c44d8776fa217405f443e5954f08c4a5db68e437becaa664a999"],["5237ca6656237a717a739a4509f70db1b9dedbb6cd232f60c9bd8c4563a6b1f","56c7799dd02896dbe7d69dd8bb9718270549592099569d107b7b49c34bf5a49"],["1cf6b8499ac881e0b2fc7def9bc1a28937033b2fc52de99e75909a620c7a281","5769cf4f735366fa386b6858043dc99a100f86fbc77b16d57d77766197ba27a"],["1b74b8a6b86dbf9638cdb0601e1a332b8d880753423d38c3394902c57f15e40","6bb2dc10d2ecbb913219d0ebdc8d3337d644ed8b6c4e70637ef4c7e50887488"],["61e4da415661bba52a4737e2bcde1a837787c4796b2e1854778534f1582c29b","27c43e632cb7652e8508c9c38e3b4ad0d3dd6ba748d42dc84ec2685e64b9aad"],["7c460a204d23f20ce86596dae6ac9b36734e4a9f7c5b43262c97a36c6a41c6e","481a11f9300ab4c4bf6924c5ca884728cc361247377065920966785d043fbbf"],["124ff5e55e4effa40daa5b9618d75c49c8b6fad95cbe8c0bfdd83cb9bed8316","33a2ea15d0f71f58a00de71acd7f22ccf9002115e49dd1f7631faa0d32f9987"],["61c9f8fc86715e95ff43583a865c5a6515f93381839d557ef884a68637eaf4c","5877daaa42bbab9083b571e12648a9d62ced4470d71653092b6546f4a5acceb"],["70a6b9a9e5d1fcc07dd9ebef6d8f5fcf04c6cb34932d0fe2335330ac6dc8d3d","3f0cbd332ac56922e886656bee74f6e9bb4bb88f7af7bba9098678af1f38fc"],["41db8a0f1ea78443a39e08a54323743c8897eed1ddc28f41aec6f2655040d9f","7d4bf32f8f4719c2e4af8b7889f3b65cfdd033dc2f971798a12170f2b26efce"],["62f035e01acdfe841104942d6c8c07f0fbd618cb85998ea24bcc24cfac1f8","1caa886104b7d753fda93645a746989794cd825c62473b526ea34b3d51b5771"],["441c6f016d270e86c19843727b83b864cec060cafc813b23d7e41e5abb1a60a","29fece4e40400f3acae0586f4fc8ed535e805e472123ec38d662d8a0b01c086"],["2c791ba0fb0b66177815c98191fa6188dba9c795e34a7c3c8a19086215e3cee","11123151389d4b330db6a665a560407e7cd8c3807c749e2b0cffd9c3074ba77"],["5292da4ca71ae75ed0554c267747e39c7a129b3b863e1af3ebb3e368439c4ea","63af6a5016deea8cc674c44f16c63c1db31f09af4fb4d2ea7917c28116661fc"],["3367388d5d1b7758dc3d92e244f227bb8a54e3d9909e7b7dd62ab5965e3efc7","7ffb4833071e4b03ea755ccb9938487a478248fe9b1158a08f1ac298801c092"],["95c863314b7f18090f8eee602403be823a367a1b416d54c32e5f914e67d922","159c2824f899171deee23e0ed520d4825bd667983df0a8d45d3a1f7156d91f9"],["621c6e08b3c57404644ad49ac7629832c141273fa1f323781b3395393fe985c","65d1eb0140652958c4371ebec791e03317d6b2e689d90e304666f1b610783dd"],["54313129bf13993952cd2b31ed06013aba85e74c1b8a00e062031f32188a84e","680129efc9eb8ec07fc180e8f6877e5f0f9f44e3000a2c586ed4ce49d12a313"],["21ea57a1c8286bb45872e78617853c47b89091670ba51c124afa3362e7260d","7087e5c1536df233ec9bfe2f983e8d7622892b9bf64c450c9823898e2cc2fc8"],["3793b05b99e7a57d88db4ed0dbc3b771285abcd9052da50f88595354409f3f3","12164105041c056f127e737c7cd63981e05f246bd2b6b65d1f427019c7c3801"],["befd345cef5fcae22ac37dacd6b9128cc58cbba3e3fd774e11b421c2ba392","6209d25f24f88f7876ca604db23d05f78e6b3b67fb033f2f1bee221f352b8c8"],["15fa536045fda4c65ff74f10b4e669ce88b9996c6772288289d3ad725987fa6","30e0c2124a35e265e931ccc66ce5ac3697d982814beb407144ff6762cb691df"],["38b795bd77ac573576dc204857a488cac2cce19809882631ca2069598c577c8","786ba555d55ebef688b068bb9186a34a08cb00bdfef51619bbf911890ae9a13"],["6c66853592196c3eb8d9526dc155205e2c64097adf8684bb0e15eb460ce1c72","1bb4ebf654f4250c8dd1061a4e1b464b31a8a9999ac9960446ef8108a66871a"],["5b08dfbc87ad9c00b88e78816973ad2f9c10c70f2156908892cc7b7a2a1fd30","1151f407a77e2556073173d8f5c9ff561d8a23742121ca15f7d0ac391af50ea"],["309190eba106aa6ead54b5ca5817969aa68b4b4c627700799a49fc6bdd32ba1","505b6a2bc7b0d78ca6ce2abe7dfb7312369918a4599cccf8a615f6701cfd851"],["89cc205966af08acc8910d563af7443d5dfbb5d88dae79c013c678c65dcecc","1f8cf955694b246a423ac725791231257b88936e00347ecaa1e17045c0ab540"],["480086b61a80c36cf1e1a350baf554e58ee8d9333186b70c9c512fb9e9d5a84","511edfe58f8d36a6170df743731da1ff525cfd5108be20e30ac4183d1281570"],["3caf14fb1d2e90a13ad4eb091250fe37133aabf6029633e905e5a93ead41dbb","49122aff6059dfda19e4b973aba5ebe3804c91728936c6381c1ed1ea9380920"],["66d1b8fb2cabc46cd79741ce1cb7326077ad8ea3227a6427244bdd3806bdadd","4a52eb74f4d5371ba3265dffd61c844f9e68d4ff0b44dc4936182f9280bb66b"],["373330c5afd53c31257fcc9050fef873e15ea9f81d9810f30744309b04e02b3","5889806607b3dc97a9c5b0c8a2f16d1792099a22866b879ca480cb89a11ef5c"],["26840d0ec69a22c6818ff64b8b14633b531508c866e21d1dc9239778ae9e8c7","157971f9a6e3a24d3b307be0e7c8cd352e2eb5cad33cf276270c0f309ee63fc"],["ebb84848f1c38c19a754d1b5d9460e39624dadbb30800987c9419c0f933b9f","517b297cf32f4064e6d6c8e761ba8db89809604a701c7b3aa1a9c6beb370ea7"],["25780380bc0795ed0dca727c55240f1d63593e552d224adb40df2d3721c0f66","10215fb5a893e0275e9f1f66b217dde35addee91ed0e8f7d79531a2ff57b8c8"],["243e1581cd1abfbf18c31c19a4c3d1cedfe69a40bb57b607c9af2717eefc742","1296c27929f14535718c3a4ebe045f00afdc60afc74c7d398d8ce1b6609dc0f"],["48babb8649e054bc8e0b902c89e6940c265f48464520649502ef1064eb94562","3235be7852b0526d1a16f6969ec0e5b0e09cedaadc65863dea4e47f4f398264"],["592db7c27e63489ef4bcef2eafce89f40067cd9a1ba48bc3dc76b5fc62ad9ca","48b7711b570cd9ac65910e75e752f4b751fdbfb4091a28f59b8c046d3d9f8bc"],["31d133456222586ae42a9ec7ce8539ee04afbe0b2ed00a2564dab0798d9b55d","a77c52fa1fd718db5c83e7fda6d7d4d9aafef9ad95cad621470f2b753729e5"],["4651668379883521e7983aafcb93811b4a72ef2975b3277773746708ef3e3fc","512507f3f544d80ba5d47f73b571881e8d70d7b1d305b9704bdad036b7abc47"],["26069e359b2e847affaef604f772f36224608b7642245d0e643889ed231bddc","75ae1ec379f074ebc91270077c74b4d34347ce183b676b4dbe100bfff143b9e"],["3196d01d1fa11dc3803b4813c4bbc6326869f61410f2bd14bc0f570d875aebe","20313217cac79875bd2a503db1e86d1e5559911667a02524759344468d9561d"],["483256607f75f06fb126addc60cadddd602154cc4782bcc08351a48745d0b97","2950a7e500ebbe9775f08be37cc2e62ccf9030de18948d1bab07a4a9173f75d"],["65f07b6050a2fc6eebe2c29ffa62f764060f7f9d3c82d2cb5e4e368aaa442c9","562c9654b646cb84a213b41de203c871b3eae0a05c9c105a66a53c319c06373"],["284870f6181c43f3b01d94baa9c5b6ada0deb861145523ad9169580eb7bed35","5e03e6c40c1cfa3cafb01fd0622349871832a9d35499d06408a83edc1b76d02"],["32229810a52137f0e6c3d37595c46f6132822d4b05f42674b48d7a7ac3ad85","7babde959a0cf2c53ee59fc52c77c3adf899453f077f441965629f9aead30cd"],["1ea8b98a6b85e74e0a2fbc18b206e290f3ed94ce99ca665e8e2351dfade990a","478e93c4724115fb1648c8d5347422adbc1a0bbf962b2312e14aec80e1be742"],["270cbaa08c79140c85b864475a0bf569cc03ac785e57f543dc444f37ce746cf","3a9b8d894016680ae9d1bf3deb931d8987d4d8d8bfed45b81ccc595ec79046b"],["6943922708b8ae5b40dd7031ef2e487abc4ac39a3591368285e83d6c9c51f4d","5f157c37d09634e8cbfbef90ea50af59815d011e419a691c67ca3402b5efc33"],["48ac6a80979fab4912cf0cb557d917a0bd68825d8658ec100496eaae6ff62e1","2b6931350ab183402e39476340eb1177b7006f7a552915581e29a79bd7203a0"],["e3adf9517d92ef22d1e2a787740a292ba32d5ca69faa9e8675f63ed816dce5","36bccf69bb12dadd610145a3399213248d193660d8dc90a2e206f23bf2c7997"],["5e6c8ae5afb2fa470f767581f3d578cf6a49547e4b78665edfd45776948bef8","6cbfc11953dd7e195d2ce74e52a60df524767b44c4608bdd755be4bc85eb74c"],["15a576a1242d39300f0db3ad770983825988da0457718ecd596c63a0a0eb4a6","69a42e5f6f5a63349b57683a4609bba90f556a1680fa1ec3b02ee7d3211f903"],["274cd14e4fbf2ed07402e8ad8075b320c5f76b7ea45ea36af523e95ed63ab50","6ca640f9557c5f2d8b27f6ce95b108880ff4e4816b26b70b6506114389ce656"],["4d8284e132e2fe81c5f71be1e3c79ab51b229e2c56c323e207cda179999d123","116cfc00e9fbee1cf16af6282123cdf20eed13021c2037ef4c86f94eb6e6cba"],["4056194fb5643e97991942ef5b63cadd89080bf57a01489c4398aca03f0980a","2e2cddb434fa6f6da7859c3d518f0ced8795eea043a6c9613fb3e020103339f"],["5d119d5c5ce532afc0875e0ee9b026d878c8773d34237f90a0d0670da6f01b3","4a79fc025ce076b6a4742fbcc8cad313d0a8220c58024a41a5a674c0947e64b"],["11800ce4061d99b9d53fd4138802335258f7798c5a935c9979f5a949ce1d483","36745a4741a5c7290eaa8f2a3f9ec955ccb7ca323272e5d35d35c2a724ffac8"],["4302525bceb97fa642fd5560a4a39fba3d2c06f68e6aff3332ff1854439ebb3","e31edfd081ce82f8177b2d7d96e69851d09e908c2517114ffb37ee12c0ac64"],["2f5fcbb96f0a66fd3bdfbcc78bda361cb812570f50e7c476533d56eee01c0e3","527428a34855b5695c479d8fb7e831a299f7897f36682a74169cc60d160df2d"],["52167df045ad0dc999b98de3d035aced9da4434211149b8cf4bf20e774580cf","19051d2a1ad3fab190c5dfaf45188b49b4e90cca22aae54f0a785562d3d3f41"],["541b5332491dbdb2b6f6bccceb7634970c046963891fae936dd950f4432b961","78fa54da996a51e3a9c06091d58c2405a806649da2bb1f323807c4eec50eda2"],["5f11e973da659b7738f87ca5bd4f3bd02207dd3c8d978f0d3e83fe81030febd","137aba7027069f62d25caed416e13537687bb1428e71e5f0a0c52d52f2e65bc"],["15ec941ee6c2110b819b5541be52981c09d83484c9dc735c43f39f5778718b4","4561826142dc5b56acfcf605a78a4090472bb61235bcd605a765e05d0a7e549"],["68ba398736d659522f484406110b43c68158bf4992094acf797a38979c587a4","7c1d9e1702e28afddf22fed7a7a79df4315c174d0c6c4f4c75bc77d9b56777f"],["67889cea31c81a429fbae643a4fce0ecd690a5c32b99397e39ed6d7a08702df","7ea277c80b671146c9e455b98f42f45b941ac95ca2d15c8fa9ea82ee9b45e01"],["596f2c68390ac26505d3c2eca5c77d46f8f3acbed192a2649d8c525a58d2334","49f3bd8c62c610d5c19c52d970bde24b270c4ff7ae900453b909e72483974a0"],["567779fb8b0afe592cea284629e3621ccfae3c4d7d3dc559c9fed750591a395","6010bdc33f1cdb374facefff537e7910b72a1120502f312a7ce41df0d552ddd"],["cebed0233e810aa6a29a8b0829d28f1c92f303d14dd73d6b12da98117dfc7","4bdd51e1192a00df23aa8d0673e4915877ca41ddb8c9eaf21d39dd167fde7b7"],["4c7085f066adeb6781596771972b188177e63f2e2b3788d03e033cdd5af1f06","2929ee89f525862b0cedb3ab9b5166e1680cb77fb4668f10a6a3d76b5434566"],["760e341bd836899c226176f47685f69438270c150c6fe7744cd723cd1e72359","1bf09f2f1aac1a10ce8bdf20d5d178db747f01a4aa0aa8a5e4bfeef562cd94e"],["6016b94c00b54920027ef64902c61478244b1936337d2ad41d9a8d43dd6a4b2","3bf3dd9bce7f6d6f120de87fcbce6219340b59c2c1d75ee0d45105d33aab1cd"],["4929e44ff692eb944d1045bee96e750219cda3bda0500029f0df49a1db30b5b","2e138dcbd092242699004b4ce98764ffe4e892841f56830af298581cd1e523f"],["5972d0e526311bacb70a04e88969b6c63c7399b578f0dc28bbd00d65ef01da7","76b22bca9ac12d26530e7b0757e646beb3bbc5680d0f3f82fb8ee57ed4b5e39"],["2ca0a42a26e26934ca2d48db960b4719113d87c5e57fb437d557c5eb4e03ac7","62778c02561d4ec5d83a132afd7763a8349207c6b5d01fba70b56ba660cba2e"],["5137ee53f076e21a2c23da09f63c0d275408c31e4634a6b6373be5cf13e6c00","14fb446c077beb78e04de3282a63bfde12f9af85caaca4ddfab506cee31c0c1"],["7d944853d1627b63f560aeda33acf640d35a4ee4d23a744957a2dae9d5b7c6c","bcb411a210710acbcb9ea12680d89e3e4e652228b6786d3886e95f4d9e6970"],["37d412c2ffb173a728477446b60b2b702d07a5243cb5fc8963e623a5ee75843","672c79968908f92cd0cb0b4c65ba86e8f359b015623a89441e1bf859bba84cb"],["5b37f472aa80398bff12cc74c8ee784c4fc89757292580d3a498bff17e9f114","7d79da1aab9cfef58a5f3d1c9ec466956a45f8d2af0c1da6dd4c93f720fae6e"],["25c09b3f1188c562571536202eb0f5fc4b9a7590417b8ea58b4343685d88a63","3d5b817c73b37e9a1d24ca923351359b42ced2f3cafbcac8c2d6322dc767bb"],["32e60904e73f9756f71e0a918d302aeca17cad4acacc81bab15702ab5ff78f0","bcf4c0204f8275072f98a65b09ac58b87cdc9c70c4edfe99fe18870a3a5459"],["49c35575996c1517d2daed90d2fe4a58e674d6b4aaa7288d0642c8bf59e562f","57eeee00adea4ca80eeabab57852cbf03f1a57e21872cd44221e0550b9193b8"],["10e1776b4c2a867bf1b028c6edec224cc6616c747e272f49e69b67b02a893dd","8d45d62ec8e627b56950f2f7622a0438647f9e9f28e723e4a37cebc039a1b0"],["79a93a75ecbe943acc964fd39ecfc971dc6555b2bc335e7b53f52f4eb16cd36","146132a68ce2ca8b48363612226771ac547eb3cf52b6eb7981718faac08aa3c"],["6b22d32e0590e169504e7f19864fd646d0994e7ed3e578a5b88f6e095913439","68c3b22d859fb85e5c8fa0a8aea932285945b230957e603394333e9ad5acd82"],["71ce5ec8286eb8c93b8481c6d19cf0a288ef4da4397e9c80f65023e516bc097","54470babc742780cd8a05499026e738ccbf81d4170d1731734de68a8e5b402c"],["27beb13a43bc6a1f6ce046da438b0beac5899ff4d57962dcfb6476b563f74b","14074e9e93ee45394dfbe833998b9d1691961f8ba3166224b36404448c61bb3"],["6b1de6c8f161aa6509a1dcacf2c0aa1bcf6ee9d9b40e032a9d72f77a6fa298c","5e9312eb5b59d6cbadd7d3dcbc39f1b5bd9a8346fdcfdf1107bada6f9cc048"],["32670fc3fa43bf39974ba72ea51f0d045d92d084a81fe5282dfc8309aa900b9","518fee521bf1af62356aac3b7e53fdbf57121e030c6e9572b3de69912ca4eb4"],["4b9ca363eabed9c66091a347375f7065cd28f49f914447de7cc1461f1375f1e","3a1a3a2e5e7e72476befe2571ece708052d740d02cbe6fed58740968ae609c4"],["4cc6da42863a3deca62fa218b7a3b50e034eb4bafd393eccba3f4cbe192ef10","20bfa683c884f203713953b26d2821287ecd305fa2cb70570474533fc07f918"],["87705353c44a5ccec8de65cf5433be6b3d9bd21eea49b60e6c907cf1a67a6a","112804b13eee56e3b01aff75fa08fa8374c44fc461aed8a30ad54acd09c24eb"],["6cf6eeeb9d339c0a05f72fd5af73fc7588e6d957100ee8999109437bc126cae","54fa257cea22032eac272fcd034dadf2e00d602ef9e519cf7072023c130aad1"],["19b32925048c5519d929650c833661b452ef7be7963fab0b6b328ab7dd7a28a","1bd0c14a10bf9b88ea61011c0b2e64d07da151c6203800d5a5d12063838a510"],["12a5fc5559428bc3b4eff97b21b63668b866e0722807f1db1f19696bacd9b0d","4c2eb07f0c24047a3d73b560144f3fd32c99d6dbd9fc7cd2fd2a72a6e4b24c7"],["13662b7a7d390aa76eb86a7c3bff6d9913eb28db6bd1a7c42de5cdad2e35ce2","40626aded7f56f82cc431ae30527b096f57fbfbc04d3e12a5abae3edf301cf1"],["255825bd49b8a2cce114360bd9c8fe8c641af64c8e7710107213cfcb006f43d","3619cce4482335232f9e76a1460be9d296f2d468d26e4f95a78c71524fe59cc"],["7f83009eeed4f12f54d341bbf06066480cfcdf51dda103ac54d4bcecf6b3b31","4269519d28faafd7fd68bebfd8404d71ba05d62c4bb6d65d24aa6802fb84ab6"],["2f325650eb316646b4eec903fe44828fcb11054f1bd42ca3a77f7e734110b35","44f976082271016f9048e22c507d97d628722bb431f8d5cc1890524e6c386bf"],["750b166bb6edc0ee80fae39c7c106879036738df2d79fb2294e1c21e9a24d6b","54f8aa297a1afafe2a17a3254f45861167414327e918d17003c6aad01d0b24c"],["3aedb10db9cf3285cdeee375879396fac1fb50dd259e1716f8c01e66f67ca72","7feb9400f621f58c21601f23b7ec7c94a9b6b193c1cd74a8a60846aedadd359"],["4ab7151702de76faa493e7a0b1ac20ee4d10c33b83fec9477547cb1236973eb","63f1f122e3ef3acc46b0915ac69c3f5772879799cad889a817f55f5853d1235"],["1675ead0d20e5bc3a7a7331999a87ac4c916ae29669e54197bb02aa6364520f","4d1122da90d49e491922d9b533a6a668e2f65a2737ebb391ebb29fb7c1f8a9d"],["2f7148111ef53c613157aeec12e16a20f13481da4390b6ce18a85d1d8547087","2eeda779ab395597651d2a0b833ccf53b10280750139916ae2baf4ec57c633d"],["4439c7810e7b2ba772b701ec3acdca0b80c9df23047710b87f7dc3f13b337d3","5029cfe704c602a8a4662af0a5860ec03fb88f046d0e3400f2ce7638014c621"],["2248eec40b5732a6a488b681f093643af7937071bc73118acae295a32b51b05","1577e4aec30a97b648de4d0b19cf8891151b4eb11f8de9c6d7312f091552e19"],["4738424e558d4e0d87a3124ca02ea24f0adc6b7a9768b0d3945ed2a6104857c","33576f92aca3f0c8ae689c3c274c2de6b918940d86a6852e02fc99e35d1614"],["7829edd8b866ebf7baaf604ed13d19a9797578f44bbc51b1cd67ca53803e96b","5559040a6083f2af1f9133ccaf5bc2ce06e56ddfc7dd410e9635c0116b62722"],["7f927b881f2cdc05e1a69e40bb714af47b630d1425f08ab5d574ee698f33d51","26a465288e96572de303203bd38f4a03031e8158da0591cb037c0a5111d1056"],["36a65598552f8753580d1655417d645a140966e10a1e1663015f9fdfae44881","33d5bbfaebf59eae72b89b1aea12ab2ba3c9617f8c3baed1ec16bdf668381b5"],["403becfa545c826782026ff409cc16c9d4fe428f1b5b6e630c92439d2fa5fd","47bd6f2bf5d74f710ecb479c79b01fb774fbdad590e683a415cdedf33f71dc5"],["3a747826d241b877d3d56b16e0b810cf088eda4fd6048da174c9991a942a5eb","2c7ba19b0a3486a2cdb84d4a388d34beb077a0e467ba44590166f93f6a09d2e"],["3d60cd375842714b37bda89dd1f13a7e0f3ff133b522209617d031bce05a537","f77f216451ab01ad5226844d2162a7f32744688bcb4325445539e2ce5cec4"],["235bf66f67c9100e7f0e22bb299cdfaa603644b240e0770aec7e7fd163e2a65","37110b3fa83ece3990afca2bea8d5ebb3c7aace60a0147f8e6ab733e2f2b4d5"],["3b796d4eb69a55471fa86108f787b3604874e92b6887a7667a6c2bfbbd9a42b","4912d6dc0419732ef82cb3278415851d4e2d7ca89e0f4d7128cc9de51b810fe"],["48d53516dd51e49faa7ab46c8c10db1befd10f23c6a9d9bc3640a2f0da44518","73a2fb3d064adadf21aa1362c04affc660598f38a9e069b3afb74d0a99ae9ee"],["48c32cff161ed145da0d5b73084897647abb777adf65738559ceab6939cf3e0","3d99308978e828f857c382df32b472bda81e8ec8e30c8844077ba6d6d2ba903"],["2947ff091a8ec9684affbc9a62e09e598841c4a6dc638088492aa47dea57097","19a2cc97975e547f97a4d02e42f89e6ced6f5a953cfccdec347867d26926541"],["1960d85f30475615f82484eba0bdafb7ea7cac3809f0518a757d66f02b01676","36c8f77baabf0cc8805d993bbe62041fcf4e3239cf9d53278a4fbd91e75eeb7"],["2765f28074d21d5a055340b6d40092d2bbef807e02009fabfa08ec0b9bdf38b","7fb189e0553d5df52b6843661814824b3f3cbebbd54988f042fb256c6bf30b"],["348836cb2aaa00212f4b1a4e2d7fc5417f246bf2fe5c9a16ebabda449e2e08a","3f7276fd7d69e0d55ce5ee1d2d830534a27227fe0b6d8a36c93f9a78b872969"],["7afb9d34b6a42ea8c6d870e4b8191c274201dc1f93a1a2219a2392b7e345a31","42bbc20dc7115e0758b364a110227b16b64ec58fc535ce5ff1a9ad8b8a09fdd"],["2cae0c2afee1767fd4c66f52e1f176d217e92e89cc19eb36d5a6c1715f641a","5335efe2d9bc3667d25ea88bf76438a4d6ab9ba5c512f9da7d0529b79b62d83"],["1cc5fde334707723c3a06f00c106db88664284a2df47bb6b144d9f960aea3e2","dbbf610d100316938bcd8bcd078513512ecb50d4579690dbefaa419c05980d"],["54e90cb8f3a2998d2675c5780679e06c0556b1e618f8fdf07f9a4b2466fbf1e","16248676b6f06ec5e34994bc3115f85c8147b54f34d8500928f2fdc051e2089"],["525c70a2ba0dbdd68d75640f47f13d0d415ea595f7030f533f4625c2a46523b","58292c8675e5e1a438f49e0c05648d9a7aa997f2f1fd77d5de1944afe5d7eea"],["54726d78d099007393348787a03107ab492e59690a46c87fb02ec554f2353bd","53b54b77184ba75a3391e0ebfa6d6974db028f3f8e34bbd5460759a5848dd76"],["4ac81a66903537769d3aac6c483ccc08535cb767b6b5e1ec8017a7393ab70ae","2cb22b77a8a05d26f11a4dec80eff292633aa05553a889c5ab16b6ac6e2ab17"],["21d0175349e21114988a2930b9a607d43245783cb4a0c984ce27f4c4206708","59f1f49342cc5496213d3329bf4ca7fb0044337449c579bf53147a1dac9e67c"],["167f821b381f4c8adcc39789475fb55ba639e5124fe75f26dd61be396dd5e66","22002c87d4cafb47ac9d27286d5cf5ff7a6715d69814118269b0729be9e4b3a"],["31010666c6db83a9f9e4db4c48173afd405783ac53852a6e38a8ff925528843","1f466dc9b5d9094107c741dbf380f9fd98d8549cd50f67169901516f8cce74c"],["1ad3875769a5053388a86edc85dd80fdffbbda6a456aea497ff81a0f1f6707b","2de7cdec5e2bad56a71bd2f33a4ae4c874e1ad4210a6ac32b443cfa34e85b1b"],["c489650fb7f459ce09cd05a456fc5a46b849b38a671298ed645bcdaab168b0","45610d092b8af1c43ceed474cd17f7bbee65120aa6fa4d37f949e7e41f25327"],["394256a5ef4d7af5459587a0bd2edb8acaf5ecfef2563c9a04daf34a4abe4c6","1ebee390dae1403c0c53994e1d064fa64e20fcb45392e209b2b99486a559ffd"],["410a1511fead6151e9bedb089b9832d0fe01fab76d3f8459929f767525aeb27","361f0a5ffe09fcc3ad4eff3f5e89508ac247af80267100b69de3c59df561cfa"],["38cd437c9f659e110a869605c182ee9fdc26de36baf559d9229e258267bb734","624b1128ea7739bf1cbd0e423af92a4884323c868d2ba0ee9d362946edee2d1"],["78b126e50b7042d2a019f95cb87a3213c664ca1bafe345999b1e9e2dac1e608","19e398196b22f4488cbe854c614ad8c353839abc5ab3a4f3f5c03c16ba8a198"],["6d3a5ce91132f385a91823c5c8046c4b638f5fe63357424410d901457cdb867","7b80bae16d2d487e122495174f7a70992bc5dafbed72bf84127ead7c57302bb"],["32d053a904dc4d88fbe7d0b96e0cbeca22a00aa5c79c753d52b0b60abf31602","3af6a02e5cae6d6490354ae51185149e3fdb6d0d9caab90e95ff58aa0c40377"],["49b1fbff5bdb0aa6938b066dde0ed772c0d81f9eff52e7fe038b0ccbd78adb5","1c6e57834eb14d507eed8b36c81ddf92fa91c242467061927a742fafa82b43d"],["2f28b8994ca6f234d9293d26196b43b9d1d5306844348c4a638102c05de85f5","759cfb172eab065d477248b3569f4ff5791055f01e95fe71b94b8e615d73c96"],["3c2ee954ff534f856f59188fa0f29ed8a022aee0cac52d634f6dc58cd514d70","22bd162e74925f0a876bd8a206b8767dfdd7c898576a73a490f138d9a7f99c6"],["5763a7cab001e1aaeabf9ab5b9b2fffe6cc2b299ab04ec4933da74d960e1ab","715ee4f8ee93ab5a1dba00f0a6abc4eec47d49b61254cc27fc36a031e32f0f8"],["19976ad8d7b7f47c785408243a227401996b36e47c7a78a7bc7d4256233ba9a","896b713c5d7777b0703821a73c1d9a4c3755501042120534ff13990975e1f5"],["61674b992c29827186cab5ff454758dbbed8e89bc23d0bd33193afccc3a04bc","38e1020744c13903809ea30a0662fdb5226ae760cdcf10800faabec452e00f8"],["2ea2d48bcb83c0c9cda4efe11f07165cfcbc9ccd26526e5fb12556316d4b1df","1d2d68b74ad384c5c4a9c85453104216357bfcdf635680b40215f0f800974cb"],["7881212050264c40c336ed3a15dd2cd868ec9a558f5b728869eab66e8b8ed54","21aaefcc8ad8a161b8971d6880321781dbd939570c540da4c330922b8c81e9b"],["b6be88ce0461d20f59c5199573cda0170b61decf6e8e69a6d32f1695adc4ed","5536e4808370716f2bb3423a9a49a38ddbfe91faf3b7a35eb53d3519238b6cf"],["e5972af1655eb6dde2e8c77cc58044299922441b5ee41ceaf5cafedc765bcc","550282f37a4783dd60801c237045992d6fbe82a5902e7d837ea25f6f98c7b3a"],["7efc1aad1f580d8f50274f1c114c40056be19a8c96fa8c4cb5bf85e1e7f3e4","2689f1c3898b114d668be6413643ee9f879913d40c262541fd0316264c60a4f"],["7939db98037f59b0113e9d60051f75ac9c3cfd1a3eb535c73e2d945068c6c5c","410914ca8bbf3c65cdf3e9772ca790c19131c50068d34b7346c10260a578a8e"],["225b77ad00a2b83d26690190b74867326eca4f55bfbc3a13be036225ca3b1b5","411faafef89042ce6beb64309fdaff70fa53e9d32d79a21e7f82f80e79ff05e"],["1501e64c99c8b6658b0479f2c05c9142d246eaabfccf2fcec8dc4399539d8e1","3bab1e3339e42c9ee66c65b0b20236fdd9362d3ce786ad3a9779ab578af50a8"],["59b907b941f24fb8ea2458153e55f07534b388e835af7b69f3c9f54392a335","1d5438c4f2f68a417f3d56f916d899a6ffe910f5f2989ca31687f1b10f60db8"],["2887d08a26f484546f360e33abbf7a998b7170a5b30070938b84f072c676bf3","62a78e8d00e5d3a59e2fc424ffa08961567ba1ef24c8531cd7bceee6074a535"],["6e3cc8076b3d45377929033af35aab0c6d19ae4fd47c0daf844079ca04c46eb","7b90f338e4d848aa8f19d0b5c3bca916a2a9024acbf14bddb278bca2aa39e5f"],["34844dacdd3ec54a3af328bb9d67715ab33425e194ac9977ca02ef22e8f7a88","3c1affc6372f32a1634748124f9e1a03c4f0c993971da0dc28888b0801279d"],["436b192e03a49796cf9bc5e93c88268b71c9c24f9c3a85322bba634ebea309d","67a8091ef69d62abcb28ce5df4dc7d53f8dc2b9690344f75ecd03a6d9386044"],["592d25b68baff87a6d7fd41ff0dadbddc1bd1316683de3b2d677501c0eb14e4","27ad1e1099683f54589010faeefb19e38569ace43653be8787a42b0591e7bc5"],["89a5111ae911512ba62e87b97f643c0219702f235c70f62c6678a129302009","557fa3d98e9ce7b83b47545013a4498f3de43787fb66b1a54521222242f7c1b"],["1c9b5e53377e72da5066cb08566bbf9ec31ec1877f455d932cd9b1aa375d34e","72f79555a8bc207863f32d482fca54692825449fd8963fcea3de3a8183a739a"],["574a6e05eb14591729515be239ea8c1fa9e12d4049d42876f76c8ff37bca03","5f99b3af43ca68c1c73e8190d5f73c8de162ba643d7d5f0cd73cfa8135db6d3"],["513fc5c2e16505b2b25a2f284e167d5401194bcac0dc3ecf8b7c9acb560daa1","687ee7a1a8954d08d3856e1a16ded808e419e789736d3f55f79f7693bad69f5"],["53d48bd1205274b1c2b0a0ceb3d21c5fcd7c8892a784931603240b288a598b9","35387abd7ea59c9b956de44d36533cad1f6668c438d666651695ff3862159be"],["213eb1ea99e08825110dd61094eb6e8145119dc1c507636f068730b1e086d44","744f6853f4f02f4f042468d0739e0c9f64df720b87ed77d1979547084ef7a89"],["735ef017d091ca23264ad0aa7bb9b2be3309b4539605e79ed4a652ccb2fbe3c","7f0ccc7a5747c4e921fff97d431169f690763427e2cfd1ad74d7a0308d7faa9"],["3f36babc5a30070b610ed97db44997e6d9115c9c0579ad8f75d295a17130001","79047908a2474e32d5c712a07bf5c4ad522590bb5d6cefda410d30528e12ca8"],["51c04907ae88a5926b242fb2862cb1f2c651a94e6caad5bff8601c079fded74","10a585a269f460aed43f54c7de13cdf623fc8de5957526997278be939ef32ad"],["c1e1bd626a735aa2c065831317217ecce68e377eb1f67e54ce2e97bc2ef2dc","53c5af23a9b482f420be6dfd37b6886154cfd130794098e1f51c1885ac2556a"],["5aff3b30775ae4758e604a4a6262803a545f5ef4e7855fa245ac6a6431a9ece","39a4799e5519047f29333bee9c86c99bfa8056d4aa381c396c4a44331fe795f"],["3d753e9723701a8e9d99b91bb93dee2eda7ffa5072fb2cd5c5fd99aebcdb299","15798bf5c17d6d5880fed1553af32dd8d8baf2888c715a886575448a24c7975"],["6593e5078466b07a4222d2e544da826d2c583c9cc5f2eaea148b129b00d4aa0","11b352b08a0a61d3cd67d1dc08069dec3bde907b3da0f56de5011b956bf8744"],["7a6eb353c5be9ff03fe4a06c01fb71aad2b38144179a291ebcbb2c2417cca65","3de3ecb12f2fa699b46a9d399abf77ca17bebc3e491bfb2542dd0fba991e2bb"],["2c7ead583d6c32162091034a9eddfa775b4e84b8bdbea939edb2a80dcf64f6","461790ce40d9c276d962b2a1e9a74d66e9d7335962e234e8a2fc6963d31722d"],["34285af023d9b4c2c2b88e8704bf2c05a9b553b00b2e70ff05f8c2970cb134f","33fe678e7671760a83836107428dbade68c3593fbe568f3f8f1b2c568099c44"],["6222f720a24466263db6a11842f117fc4bb78da6705f140e48869db3e087441","6eff5b9bf3aeedc962bc5a24b66e7bdad2153450ed53a058bf2c8dbf2907693"],["17c6ec5ea206eb97cbf53851e37ce391080e0d2bf1e5395610f79ab0503f7ce","3adb71ca3523d88ceb1e365f12dfb24895453c14daf0046b2626cddadfdf5f7"],["70859f9771a713e54974ce11cdaf44b0dcc3e9befa0c0834908d877eeaafd27","d18f794bf0cc0623b711e7450030424e52326c45ba9b03341883ae4828a5f8"],["2a820cfd0fd4ab0871e7b303cd545a3086caf8fa818c087a4017197da74efbf","5f992683ff37f6c041b84bfc01503d333ac9763505cc8f69473da01812969d1"],["5b0526de2c07fe7cd73e3884f642d57a0ac5e13c68590ed03a14e530616e8c1","eec69d0cbd92c9fca31ec967dba848bec368e792d6678797946a5e34fe3487"],["6cf6b3efee707210cb3a72f1e885c3d0953aefb43e5e148c740aa1641725c61","911cb630b898e2c1a9115f9e45bafe3b819edfb1eab6e15612d14289939984"],["74e913de55f1e46143cb2ecfc580f8d3d3908f200281322b84e21c989cda293","761d2736c9ac7670ba905bc2629c6c0dbe988820a4454ff415ba68710f7df92"],["44084305e0c911a40b7cbefe5f13cffe9a99375d1a584c4a2200958050af7a9","249c83877371564708ea525b64b1e7e12785460d83364446531c9adcacba5f0"],["2bf71ad4d1bee1a67fb300477029f54bdb0e09f78bf2ac2e8afc7465a7adbcc","6244dd6cad282539049be57487bfd9900bb0d5da805d02b535096368fcb4cd5"],["3a62d8f763b62def36e4089458046a49c5ecb91b861549530773e0548ff2bb","6a10a03ba61e6ac657270465c09aa9526cf1ebe96bdecdf0e7000476a47b9eb"],["284eed3a17c51e0677d4fe897f056abe9def8af07a4630e6ca5723e2aa6677","516a06ac1d5626ed03d2eee9de6f60f0311eca703a99b0fb31b9c66b01c27c7"],["2a2c63b16cccd685f731d06fe93ce2cffb358d34d03dda9a7368185c1eb0c32","7180baca0ba81284809f92eca1654cd76b925a9242e5d5e0f18d0a55d13c6ec"],["5f9466017ec09769611389ea5370ad68dda936d3f5816c9e928ff9574abf9a7","6619b5b145bb5f4f29deb7a4cd68ef4da3995312fa6537f0d01684da4267ece"],["74f229babe01b4962b3307589c1a13019134b1db6822698388bebb55d21c30f","156ae857ab3279f754facba0db36398dffec8c31e5e160473198f2f891b7531"],["334b9fe3a5fd99bc966ddd1309698fd32afd1f235062f2c275b6616a185de45","221a60053583cc0607f6f2e6966b62fc9dac00538bb7eb1148e007a92116d2"],["7ad710ba002a67c731efbaba2149d16fec5d2f7aa3d126fd9886172e9f4ea30","3a10f8e902a7a13aec94d66415347e1314f9bac83a7db176096b809b25ffb86"],["4306dd0a184a3283c3097ff8f7434cec80912e9dc04b7df21ba73fda9f8e6d8","6d42bd3d1a8dbddafd09e872e2aa3891ae79ec939dc1b382196bc21c4ab749"],["1c3f2124e1135c32a426d1d14e471edd9e0f2c7bd703ee123cbbd608e8c4be7","3cc607a3c3f1ab68dd5fa56c65996002721b8ad8ad4b0dd9e5b1467d316583"],["294af33272ffcee0b56a436de1b73759cbddebef4c07888b42c2f92b0b68e1","d837164311d5dca8d37b99ef9eb22708643c83d1cbdfe852f63ea07b06fbad"],["753bdb5439a19bbffdfa02b1dc24e8368f22d0a8276b109c11e6feb26f56f39","6ed396231af93647633eab467f1a034f38e76823eb85baf97cae56e2dcd9f75"],["5674f0cb892b733fc0b50e121d8679afed0a925c32594cc65ffe83bebe7748e","7fbf0325dd38dd94905adab2c52758552292a6a103d9edfcb11938828e828c8"],["4a8f053573a0a74251059d0229d89b6660407ba0b491779fd10f87a5117c81f","21b70112485398bf67ec9d733df24a1df30dea718a93b786f41ed04e3ae3c5e"],["726c01ec4a08df8fc8de173311f50d4f3b97c5a9cf68c1536146f827db95ae8","15013cafadefa7f1c4e4dfdd70bd4d3979dd18bd7f0332572ce2a3fd8773d12"],["38ac0fbfa98937257460db7e6645d7e5112b6fce7234813fc8a704e8ade8da2","73c0109f86048aad08c443f781ae60ad13b99f7b9cfdf3128fe6d6eeb799a7b"],["6f6d3a38621582ace092eb50ecfe9eff265df141ebdcab8653299116fcea291","4a1bf3f39bc919c8f1b720a0b1ce952cad17f2ba98308ee6b76dd9b6f3d7b75"],["6a307fc28e1df8d9ad01766419e097797d65cb674436fa1c8f012d3de2c2a1f","26911a635ba824db004875d79dd84834a97ac12643e42829015bf88c1fd6f05"],["2a74860e3336d6db916555894cc8028f41508812925db1925457afe40257155","5f8da573f4c39816ce2dba8a20224223a7cfec53117ec78973930c0e9b60244"],["4d2b49e1ed0799f719b8269f092cb489a466a645bc0ccabafdc678864c176d7","5410083df7d256f18cbf5697ae5e52c31e075d8a3b27e21d6f5177ca882f6c1"],["110ecb9fbf6c333d168cee473cc5ad98809b6cb9eb5d1f6cd28ab5fab504fd3","7e3c54d7533d9f8c3310f219dab0cc3ea4d39b418a748eeffd6bae2b8637a43"],["5be4d711b80da70e6d3ac493250bbfd16f20b25f31919b3a91cf14ffbac1096","7f55a0919f082e8885f1515e83c5b39b6022404503507498e1b4422d79c43e2"],["2605125b95ca4ba93a21cbbba5762898a7cf9e988f07ab9e64cb3868e3b139d","62f0ccf55b9fc0eaf9736fc8ee484e2acdbe259813af9803cf815829a5e9d3b"],["1092bbbf206f2a3068167c3dd99a72de31e206f6c504c071c8214d105ff814d","309f489f68a62089f53b96df5d4fbc3ecc5a1a42eb7ece0e49bad17ad490ff4"],["2abdee9409d9c92559ca3f4e6bddd649c31aa09b90bfcb4a612af491241e18d","3ffa8eac180a29de3f8a69efca84bac046f921f5725e96a6ff0530be1436aaf"],["376313f27d00bb1aae7ec991745efe6ee28c6b50de0c6cd9845cc4bb4f83543","6a8e0a9389ba528b156fa94ac090a895d7b795818d4941c29415d9e2984c547"],["a80380c71bd466a696b3f0fbf02817c9459d9798f4f3899cf32edf647fe066","6a09805e814e7cdfc76eba4b79f1df5ae559e0f0aba9f728d3cba4ea5c57471"],["223694b921d247d989a79b9b2b2f07496036c40cb043eab074a9d6a2cd2ffed","c247217f1b1df35e30d9e15fdaadf42d6fb0edd3a5a7e265d4cdc426c120aa"],["102333620df278c6714bbc880fc087db58c1b9b4d77ed4d61b32a74bfc7c3e2","6a77d37727ccf71c2caeb151faf4404d4b94e9047f9f0a7c3966367f3b53c65"],["891626f466536929ee7eadcd18b41925706dedab7528ed5f0f7abf039eb9d2","5f73d11c141c933a35b2d0d06e5cbae614a20d17dc3b439f8bcdc3413c5ea37"],["215c23fd3f073f870e5e80303967391bf173f8adcdbeec72d131c557babc203","10634332e9d9439a321597dc5b0fac9ff478834c3d6e281735f21a4a5e13266"],["21ea0bdc1332bc36e6aeb43be9071651c27e4ea2eadec636c8d818d4af72a36","3a523d9643dccc6bb9c7c58413312caa3e60ba9c7c7f0177e0f3f469a3241e3"],["60deaed1bffb6190beed40caaf2bfab5e43d3707aff7ad3f278d571aa247eae","e41f71ff254c1418e6a66992af307789fe04d6606fb2670900bb1a089fd879"],["1e1fac4a1646253fb1332fadc21fbdd3e3a24a840d129400f520ae4116a4cf5","69c406f9f46576afad68808de0ab7e8922b6226af748e721d9097e21f1800f3"],["5db0ddcdf79ffe74d6454c12d2bc60b06776db03c75dc413f5be42ea9a91b5e","134c3d6c699841f17306835bb193785228ffe7ab212a01a861c56b086a18cec"],["626814e320fb5bea505b248fd1c1389ad586c1cfe04923fe2f83173e915f4f8","7ae407a926e887206a8b85cf485f1f327c9bb8ccbb6897024e2d122877d8ee0"],["23186237dc7d3b570cea645282ad4c359731bbfa54e7f036426bf6493812cd","7d1fbab7e61a22d3b00993290d9f4cd5d820061573e787f66c2cff9a18e1eaf"],["54302dcb0e6cc1c6e44cca8f61a63bb2ca65048d53fb325d36ff12c49a58202","1b77b3e37d13504b348046268d8ae25ce98ad783c25561a879dcc77e99c2426"],["13961b56b9fc0e412e468c385c22bd0680a25624ec211ffbb6bc877b2a6926c","62f7f7792c77cd981fad13cb6863fe099c4d971c1374109185eae99943f16e9"],["47abd7308c70659af3f00fafe6837298af3cb530b6c2ba710ffd07a6bc1ae98","75d0c8a7377aa9f0663d0c124a5659750847afabc29e39893fd27534a4a03cb"],["2c6276b764fb398fa555857dbe0ce0ec18fab7a233bf23851295739801f0585","5d8f4897ce44007ec5bfcb9aeb78b8f6e1d40a514f72d213c9300d2770d2b8c"]];Kk({},{ec:()=>jC,genKeyPair:()=>$C,getKeyPair:()=>zC,getKeyPairFromPublicKey:()=>KC,getStarkKey:()=>qC,sign:()=>GC,verify:()=>JC});var{ec:UC,curves:HC}=Lk,jC=new UC(new HC.PresetCurve({type:"short",prime:null,p:MC,a:"00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001",b:"06f21413 efbe40de 150e596d 72f7a8c5 609ad26c 15c915c1 f4cdfcb9 9cee9e89",n:NC,hash:Fk.sha256,gRed:!1,g:DC[1]}));function VC(e){const t=e.replace(/^0x0*/,"");return t.length<=62?t:(Mk(63===t.length),`${t}0`)}var $C=jC.genKeyPair.bind(jC);function zC(e){const t=oC(e);return jC.keyFromPrivate(Qk(cC(t)),"hex")}function qC(e){return e.getPublic(!0,"hex"),eC(nC(e.pub.getX().toString(16),2))}function KC(e){const t=oC(e);return jC.keyFromPublic(Qk(cC(t)),"hex")}function GC(e,t){lC(oC(eC(t)),_C,oC(eC(FC)),"msgHash");const r=e.sign(VC(t)),{r:n,s:a}=r,i=a.invm(jC.n);return lC(n,xC,oC(eC(FC)),"r"),lC(a,xC,oC(eC(NC)),"s"),lC(i,xC,oC(eC(FC)),"w"),[n.toString(),a.toString()]}function JC(e,t,r){const n=Array.isArray(e)?e:[e],a=oC(eC(t));return Mk(r.length%2==0,"Signature must be an array of length dividable by 2"),lC(a,_C,oC(eC(FC)),"msgHash"),Mk(n.length===r.length/2,"Signature and keyPair length must be equal"),(i=r,s=2,Array(Math.ceil(i.length/s)).fill("").map(((e,t)=>i.slice(t*s,t*s+s)))).every((([e,r],a)=>{const i=oC(e),s=oC(r),o=s.invm(jC.n);return lC(i,xC,oC(eC(FC)),"r"),lC(s,xC,oC(eC(NC)),"s"),lC(o,xC,oC(eC(FC)),"w"),jC.verify(VC(t),{r:i,s},n[a])??!1}));var i,s}var WC=1,YC=oC(2).pow(oC(128)).add(oC(WC));function ZC(e){const t=Qk(cC(oC(e))),r=t.length%2==0?t:`0${t}`;return eC(Xk((0,Rk.So)((0,Nk.hexToBytes)(r))))}function XC(e){return oC(function(e){return eC(Xk((0,Rk.So)(iC(e))))}(e)).and(IC)}function QC(e){return cC(XC(e))}function eT(e){return sC(e)?e:bC(e)?gC(e):QC(e)}var tT=DC.map((e=>jC.curve.point(e[0],e[1])));function rT(e){let t=tT[0];for(let r=0;r<e.length;r+=1){let n=oC(e[r]);if(Mk(n.gte(_C)&&n.lt(oC(eC(MC))),`Invalid input: ${e[r]}`),!n.isZero())for(let e=0;e<252;e+=1){const a=tT[2+252*r+e];Mk(!t.getX().eq(a.getX())),0!==n.and(xC).toNumber()&&(t=t.add(a)),n=n.shrn(1)}}return eC(t.getX().toString(16))}function nT(e){return[...e,e.length].reduce(((e,t)=>rT([e,t])),0).toString()}function aT(e,t,r,n,a,i,s,o=[]){const c=nT(a);return nT([e,t,r,n,c,i,s,...o])}function iT(e,t,r,n){return aT("0x6465706c6f79",r,e,QC("constructor"),t,_C,n)}function sT(e,t,r,n,a,i){return aT("0x6465636c617265",r,t,0,[e],n,a,[i])}function oT(e,t,r,n,a,i,s,o){return aT("0x6465706c6f795f6163636f756e74",a,e,0,[t,n,...r],i,s,[o])}function cT(e,t,r,n,a,i){return aT("0x696e766f6b65",t,e,0,r,n,a,[i])}function dT(e,t,r,n){const a=nT(r);return nT([fC("0x535441524b4e45545f434f4e54524143545f41444452455353"),n,e,t,a])}Kk({},{default:()=>bT,parse:()=>uT,parseAlwaysAsBig:()=>hT,stringify:()=>lT,stringifyAlwaysAsBig:()=>pT});var fT=e=>Dk({alwaysParseAsBig:e,useNativeBigInt:!0,protoAction:"preserve",constructorAction:"preserve"}),{parse:uT,stringify:lT}=fT(!1),{parse:hT,stringify:pT}=fT(!0),bT={parse:uT,stringify:lT};function gT(e){const t="string"==typeof e?e:lT(e);return Zk(Kl(t))}function yT(){return qC($C())}function mT(e){return eC(e).toLowerCase()}function wT(e){if(!e)return[];try{return e.map((e=>oC(e))).map((e=>e.toString()))}catch(e){return[]}}function vT(e){return Object.values(e).flatMap((e=>Array.isArray(e)?[oC(e.length).toString(),...e.map((e=>oC(e).toString()))]:"object"==typeof e&&"type"in e?Object.entries(e).filter((([e])=>"type"!==e)).map((([,e])=>oC(e).toString())):oC(e).toString()))}function ET(e,t=.5){const r=Math.round(100*(1+t));return oC(e).mul(oC(r)).div(oC(100))}function AT(e){return new Promise((t=>{setTimeout(t,e)}))}function _T(e=[]){return e.map((e=>"string"==typeof e&&sC(e)?e:cC(oC(e))))}function xT(e){const t="string"==typeof e?uT(e):e;return{...t,program:gT(t.program)}}Kk({},{compileCalldata:()=>vT,compressProgram:()=>gT,estimatedFeeToMaxFee:()=>ET,formatSignature:()=>wT,makeAddress:()=>mT,randomAddress:()=>yT});var ST=class{parseGetBlockResponse(e){return{timestamp:e.timestamp,block_hash:e.block_hash,block_number:e.block_number,new_root:e.new_root,parent_hash:e.parent_hash,status:e.status,transactions:e.transactions}}parseGetTransactionResponse(e){return{calldata:e.calldata||[],contract_address:e.contract_address,max_fee:e.max_fee,nonce:e.nonce,signature:e.signature||[],transaction_hash:e.transaction_hash,version:e.version}}parseFeeEstimateResponse(e){return{overall_fee:oC(e.overall_fee),gas_consumed:oC(e.gas_consumed),gas_price:oC(e.gas_price)}}parseCallContractResponse(e){return{result:e}}},IT=class extends Vk{},kT=class extends IT{constructor(e,t){super(e),this.errorCode=t}},CT=class extends IT{constructor(e,t){super(e),this.errorCode=t}},TT="abcdefghijklmnopqrstuvwxyz0123456789-",BT=new Pk(TT.length+1),MT="这来",OT=new Pk(TT.length),RT=new Pk(MT.length),NT=new Pk(MT.length+1);function PT(e){let t=0;for(;e.endsWith(MT[MT.length-1]);)e=e.substring(0,e.length-1),t+=1;return[e,t]}function LT(e){let t=new Pk(0),r=new Pk(1);if(e.endsWith(MT[0]+TT[1])){const[t,r]=PT(e.substring(0,e.length-2));e=t+MT[MT.length-1].repeat(2*(r+1))}else{const[t,r]=PT(e);r&&(e=t+MT[MT.length-1].repeat(1+2*(r-1)))}for(let n=0;n<e.length;n+=1){const a=e[n],i=TT.indexOf(a),s=new Pk(TT.indexOf(a));if(-1!==i)n===e.length-1&&e[n]===TT[0]?(t=t.add(r.mul(OT)),r=r.mul(BT),r=r.mul(BT)):(t=t.add(r.mul(s)),r=r.mul(BT));else if(-1!==MT.indexOf(a)){t=t.add(r.mul(OT)),r=r.mul(BT);const i=(n===e.length-1?1:0)+MT.indexOf(a);t=t.add(r.mul(new Pk(i))),r=r.mul(RT)}}return t}function FT(e){switch(e){case"0x534e5f4d41494e":return"0x6ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678";case"0x534e5f474f45524c49":return"0x05cf267a0af6101667013fc6bd3f6c11116a14cda9b8c4b1198520d59f900b17";default:throw new Error("Starknet.id is not yet deployed on this network")}}async function DT(e,t,r){const n=await e.getChainId(),a=r??FT(n);try{const r=await e.callContract({contractAddress:a,entrypoint:"address_to_domain",calldata:vT({address:cC(oC(t))})}),n=function(e){let t="";return e.forEach((e=>{for(;!e.isZero();){const r=e.mod(BT).toNumber();if(e=e.div(BT),r===TT.length){const r=e.div(NT);if(r.isZero()){const n=e.mod(NT).toNumber();e=r,t+=0===n?TT[0]:MT[n-1]}else{const r=e.mod(RT).toNumber();t+=MT[r],e=e.div(RT)}}else t+=TT[r]}const[r,n]=PT(t);n&&(t=r+(n%2==0?MT[MT.length-1].repeat(n/2-1)+MT[0]+TT[1]:MT[MT.length-1].repeat((n-1)/2+1))),t+="."})),t?t.concat("stark"):t}(r.result.map((e=>new Pk.BN(dC(e)))).slice(1));if(!n)throw Error("Starkname not found");return n}catch(e){if(e instanceof Error&&"Starkname not found"===e.message)throw e;throw Error("Could not get stark name")}}async function UT(e,t,r){const n=await e.getChainId(),a=r??FT(n);try{return(await e.callContract({contractAddress:a,entrypoint:"domain_to_address",calldata:vT({domain:[LT(t.replace(".stark","")).toString(10)]})})).result[0]}catch{throw Error("Could not get address from stark name")}}var HT=["latest","pending"],jT=class{constructor(e){this.hash=null,this.number=null,this.tag=null,this.valueOf=()=>this.number,this.toString=()=>this.hash,this.setIdentifier(e)}setIdentifier(e){"string"==typeof e&&sC(e)?this.hash=e:Pk.BN.isBN(e)?this.hash=cC(e):"number"==typeof e?this.number=e:"string"==typeof e&&HT.includes(e)?this.tag=e:this.tag="pending"}get queryIdentifier(){return null!==this.number?`blockNumber=${this.number}`:null!==this.hash?`blockHash=${this.hash}`:`blockNumber=${this.tag}`}get identifier(){return null!==this.number?{block_number:this.number}:null!==this.hash?{block_hash:this.hash}:this.tag}set identifier(e){this.setIdentifier(e)}get sequencerIdentifier(){return null!==this.hash?{blockHash:this.hash}:{blockNumber:this.number??this.tag}}},VT={"Content-Type":"application/json"},$T="latest",zT=200,qT=class{constructor(e){this.responseParser=new ST;const{nodeUrl:t,retries:r,headers:n,blockIdentifier:a}=e;this.nodeUrl=t,this.retries=r||zT,this.headers={...VT,...n},this.blockIdentifier=a||$T,this.getChainId().then((e=>{this.chainId=e}))}fetch(e,t){return Gk(this.nodeUrl,{method:"POST",body:lT({method:e,jsonrpc:"2.0",params:t,id:0}),headers:this.headers})}errorHandler(e){if(e){const{code:t,message:r}=e;throw new IT(`${t}: ${r}`)}}async fetchEndpoint(e,t){var r;try{const r=await this.fetch(e,t),{error:n,result:a}=await r.json();return this.errorHandler(n),a}catch(e){throw this.errorHandler(null==(r=null==e?void 0:e.response)?void 0:r.data),e}}async getChainId(){return this.fetchEndpoint("starknet_chainId")}async getBlock(e=this.blockIdentifier){return this.getBlockWithTxHashes(e).then(this.responseParser.parseGetBlockResponse)}async getBlockHashAndNumber(){return this.fetchEndpoint("starknet_blockHashAndNumber")}async getBlockWithTxHashes(e=this.blockIdentifier){const t=new jT(e).identifier;return this.fetchEndpoint("starknet_getBlockWithTxHashes",{block_id:t})}async getBlockWithTxs(e=this.blockIdentifier){const t=new jT(e).identifier;return this.fetchEndpoint("starknet_getBlockWithTxs",{block_id:t})}async getClassHashAt(e,t=this.blockIdentifier){const r=new jT(t).identifier;return this.fetchEndpoint("starknet_getClassHashAt",{block_id:r,contract_address:e})}async getNonceForAddress(e,t=this.blockIdentifier){const r=new jT(t).identifier;return this.fetchEndpoint("starknet_getNonce",{contract_address:e,block_id:r})}async getPendingTransactions(){return this.fetchEndpoint("starknet_pendingTransactions")}async getProtocolVersion(){throw new Error("Pathfinder does not implement this rpc 0.1.0 method")}async getStateUpdate(e=this.blockIdentifier){const t=new jT(e).identifier;return this.fetchEndpoint("starknet_getStateUpdate",{block_id:t})}async getStorageAt(e,t,r=this.blockIdentifier){const n=cC(oC(t)),a=new jT(r).identifier;return this.fetchEndpoint("starknet_getStorageAt",{contract_address:e,key:n,block_id:a})}async getTransaction(e){return this.getTransactionByHash(e).then(this.responseParser.parseGetTransactionResponse)}async getTransactionByHash(e){return this.fetchEndpoint("starknet_getTransactionByHash",{transaction_hash:e})}async getTransactionByBlockIdAndIndex(e,t){const r=new jT(e).identifier;return this.fetchEndpoint("starknet_getTransactionByBlockIdAndIndex",{block_id:r,index:t})}async getTransactionReceipt(e){return this.fetchEndpoint("starknet_getTransactionReceipt",{transaction_hash:e})}async getClassByHash(e){return this.getClass(e)}async getClass(e,t=this.blockIdentifier){const r=new jT(t).identifier;return this.fetchEndpoint("starknet_getClass",{class_hash:e,block_id:r})}async getClassAt(e,t=this.blockIdentifier){const r=new jT(t).identifier;return this.fetchEndpoint("starknet_getClassAt",{block_id:r,contract_address:e})}async getCode(e,t){throw new Error("RPC does not implement getCode function")}async getEstimateFee(e,t,r=this.blockIdentifier){return this.getInvokeEstimateFee(e,t,r)}async getInvokeEstimateFee(e,t,r=this.blockIdentifier){const n=new jT(r).identifier;return this.fetchEndpoint("starknet_estimateFee",{request:{type:"INVOKE",sender_address:e.contractAddress,calldata:_T(e.calldata),signature:pC(e.signature||[]),version:cC(oC((null==t?void 0:t.version)||0)),nonce:cC(oC(t.nonce)),max_fee:cC(oC((null==t?void 0:t.maxFee)||0))},block_id:n}).then(this.responseParser.parseFeeEstimateResponse)}async getDeclareEstimateFee({senderAddress:e,contractDefinition:t,signature:r},n,a=this.blockIdentifier){const i=new jT(a).identifier;return this.fetchEndpoint("starknet_estimateFee",{request:{type:"DECLARE",contract_class:{program:t.program,entry_points_by_type:t.entry_points_by_type,abi:t.abi},sender_address:e,signature:pC(r||[]),version:cC(oC((null==n?void 0:n.version)||0)),nonce:cC(oC(n.nonce)),max_fee:cC(oC((null==n?void 0:n.maxFee)||0))},block_id:i}).then(this.responseParser.parseFeeEstimateResponse)}async getDeployAccountEstimateFee({classHash:e,constructorCalldata:t,addressSalt:r,signature:n},a,i=this.blockIdentifier){const s=new jT(i).identifier;return this.fetchEndpoint("starknet_estimateFee",{request:{type:"DEPLOY_ACCOUNT",constructor_calldata:pC(t||[]),class_hash:cC(oC(e)),contract_address_salt:cC(oC(r||0)),signature:pC(n||[]),version:cC(oC((null==a?void 0:a.version)||0)),nonce:cC(oC(a.nonce)),max_fee:cC(oC((null==a?void 0:a.maxFee)||0))},block_id:s}).then(this.responseParser.parseFeeEstimateResponse)}async getEstimateFeeBulk(e,t=this.blockIdentifier){throw new Error("RPC does not implement getInvokeEstimateFeeBulk function")}async declareContract({contractDefinition:e,signature:t,senderAddress:r},n){return this.fetchEndpoint("starknet_addDeclareTransaction",{declare_transaction:{contract_class:{program:e.program,entry_points_by_type:e.entry_points_by_type,abi:e.abi},type:"DECLARE",version:cC(oC(n.version||0)),max_fee:cC(oC(n.maxFee||0)),signature:pC(t||[]),sender_address:r,nonce:cC(oC(n.nonce))}})}async deployAccountContract({classHash:e,constructorCalldata:t,addressSalt:r,signature:n},a){return this.fetchEndpoint("starknet_addDeployAccountTransaction",{deploy_account_transaction:{constructor_calldata:pC(t||[]),class_hash:cC(oC(e)),contract_address_salt:cC(oC(r||0)),type:"DEPLOY_ACCOUNT",max_fee:cC(oC(a.maxFee||0)),version:cC(oC(a.version||0)),signature:pC(n||[]),nonce:cC(oC(a.nonce))}})}async invokeFunction(e,t){return this.fetchEndpoint("starknet_addInvokeTransaction",{invoke_transaction:{sender_address:e.contractAddress,calldata:_T(e.calldata),type:"INVOKE",max_fee:cC(oC(t.maxFee||0)),version:cC(oC(t.version||1)),signature:pC(e.signature||[]),nonce:cC(oC(t.nonce))}})}async callContract(e,t=this.blockIdentifier){const r=new jT(t).identifier,n=await this.fetchEndpoint("starknet_call",{request:{contract_address:e.contractAddress,entry_point_selector:QC(e.entrypoint),calldata:_T(e.calldata)},block_id:r});return this.responseParser.parseCallContractResponse(n)}async traceTransaction(e){return this.fetchEndpoint("starknet_traceTransaction",{transaction_hash:e})}async traceBlockTransactions(e){return this.fetchEndpoint("starknet_traceBlockTransactions",{block_hash:e})}async waitForTransaction(e,t=8e3,r=["ACCEPTED_ON_L1","ACCEPTED_ON_L2","PENDING"]){const n=["REJECTED","NOT_RECEIVED"];let{retries:a}=this,i=!1,s={};for(;!i;){await AT(t);try{if(s=await this.getTransactionReceipt(e),!("status"in s)){throw new Error("pending transaction")}if(s.status&&r.includes(s.status))i=!0;else if(s.status&&n.includes(s.status)){const e=s.status,t=new Error(e);throw t.response=s,t}}catch(e){if(e instanceof Error&&n.includes(e.message))throw e;if(0===a)throw new Error(`waitForTransaction timed-out with retries ${this.retries}`)}a-=1}return await AT(t),s}async getTransactionCount(e=this.blockIdentifier){const t=new jT(e).identifier;return this.fetchEndpoint("starknet_getBlockTransactionCount",{block_id:t})}async getBlockNumber(){return this.fetchEndpoint("starknet_blockNumber")}async getSyncingStats(){return this.fetchEndpoint("starknet_syncing")}async getEvents(e){return this.fetchEndpoint("starknet_getEvents",{filter:e})}async getSimulateTransaction(e,t,r){throw new Error("RPC does not implement simulateTransaction function")}async getStarkName(e,t){return DT(this,e,t)}async getAddressFromStarkName(e,t){return UT(this,e,t)}},KT=class{},GT=class extends KT{parseGetBlockResponse(e){return{...e,new_root:e.state_root,parent_hash:e.parent_block_hash,transactions:Object.values(e.transactions).map((e=>"transaction_hash"in e&&e.transaction_hash)).filter(Boolean)}}parseGetTransactionResponse(e){return{...e,calldata:"calldata"in e.transaction?e.transaction.calldata:[],contract_address:"contract_address"in e.transaction?e.transaction.contract_address:void 0,contract_class:"contract_class"in e.transaction?e.transaction.contract_class:void 0,entry_point_selector:"entry_point_selector"in e.transaction?e.transaction.entry_point_selector:void 0,max_fee:"max_fee"in e.transaction?e.transaction.max_fee:void 0,nonce:e.transaction.nonce,sender_address:"sender_address"in e.transaction?e.transaction.sender_address:void 0,signature:"signature"in e.transaction?e.transaction.signature:void 0,transaction_hash:"transaction_hash"in e.transaction?e.transaction.transaction_hash:void 0,version:"version"in e.transaction?e.transaction.version:void 0}}parseGetTransactionReceiptResponse(e){return{transaction_hash:e.transaction_hash,status:e.status,messages_sent:e.l2_to_l1_messages,events:e.events,..."block_hash"in e&&{block_hash:e.block_hash},..."block_number"in e&&{block_number:e.block_number},..."actual_fee"in e&&{actual_fee:e.actual_fee},..."transaction_index"in e&&{transaction_index:e.transaction_index},..."execution_resources"in e&&{execution_resources:e.execution_resources},..."l1_to_l2_consumed_message"in e&&{l1_to_l2_consumed_message:e.l1_to_l2_consumed_message},..."transaction_failure_reason"in e&&{transaction_failure_reason:e.transaction_failure_reason}}}parseFeeEstimateResponse(e){if("overall_fee"in e){let t={};try{t={gas_consumed:oC(e.gas_usage),gas_price:oC(e.gas_price)}}catch{}return{overall_fee:oC(e.overall_fee),...t}}return{overall_fee:oC(e.amount)}}parseFeeEstimateBulkResponse(e){return[].concat(e).map((e=>{if("overall_fee"in e){let t={};try{t={gas_consumed:oC(e.gas_usage),gas_price:oC(e.gas_price)}}catch{}return{overall_fee:oC(e.overall_fee),...t}}return{overall_fee:oC(e.amount)}}))}parseFeeSimulateTransactionResponse(e){if("overall_fee"in e.fee_estimation){let t={};try{t={gas_consumed:oC(e.fee_estimation.gas_usage),gas_price:oC(e.fee_estimation.gas_price)}}catch{}return{trace:e.trace,fee_estimation:{...t,overall_fee:oC(e.fee_estimation.overall_fee)}}}return{trace:e.trace,fee_estimation:{overall_fee:oC(e.fee_estimation.amount)}}}parseCallContractResponse(e){return{result:e.result}}parseInvokeFunctionResponse(e){return{transaction_hash:e.transaction_hash}}parseDeployContractResponse(e){return{transaction_hash:e.transaction_hash,contract_address:e.address}}parseDeclareContractResponse(e){return{transaction_hash:e.transaction_hash,class_hash:e.class_hash}}parseGetStateUpdateResponse(e){const t=[].concat(e.state_diff.nonces).map((({contract_address:e,nonce:t})=>({contract_address:e,nonce:t}))),r=[].concat(e.state_diff.storage_diffs).map((({address:e,storage_entries:t})=>({address:e,storage_entries:t})));return{...e,state_diff:{storage_diffs:r,declared_contract_hashes:e.state_diff.declared_contract_hashes,deployed_contracts:e.state_diff.deployed_contracts,nonces:t}}}},JT=/^(?:\w+:)?\/\/(\S+)$/,WT=/^localhost[:?\d]*(?:[^:?\d]\S*)?$/,YT=/^[^\s.]+\.\S{2,}$/;function ZT(e,t,r){return function(e){if(!e)return!1;if("string"!=typeof e)return!1;const t=e.match(JT);if(!t)return!1;const r=t[1];return!(!r||!WT.test(r)&&!YT.test(r))}(r)?r:$k(e,r??t)}var XT={network:"goerli-alpha-2",blockIdentifier:"pending"},QT=class{constructor(e=XT){this.responseParser=new GT,"network"in e?(this.baseUrl=QT.getNetworkFromName(e.network),this.feederGatewayUrl=ZT(this.baseUrl,"feeder_gateway"),this.gatewayUrl=ZT(this.baseUrl,"gateway")):(this.baseUrl=e.baseUrl,this.feederGatewayUrl=ZT(this.baseUrl,"feeder_gateway",e.feederGatewayUrl),this.gatewayUrl=ZT(this.baseUrl,"gateway",e.gatewayUrl)),this.chainId=(null==e?void 0:e.chainId)??QT.getChainIdFromBaseUrl(this.baseUrl),this.headers=e.headers,this.blockIdentifier=(null==e?void 0:e.blockIdentifier)||XT.blockIdentifier}static getNetworkFromName(e){switch(e){case"mainnet-alpha":return"https://alpha-mainnet.starknet.io";case"goerli-alpha":default:return"https://alpha4.starknet.io";case"goerli-alpha-2":return"https://alpha4-2.starknet.io"}}static getChainIdFromBaseUrl(e){try{const t=new URL(e);if(t.host.includes("mainnet.starknet.io"))return"0x534e5f4d41494e";if(t.host.includes("alpha4-2.starknet.io"))return"0x534e5f474f45524c4932"}catch{console.error(`Could not parse baseUrl: ${e}`)}return"0x534e5f474f45524c49"}getFetchUrl(e){return["add_transaction"].includes(e)?this.gatewayUrl:this.feederGatewayUrl}getFetchMethod(e){return["add_transaction","call_contract","estimate_fee","estimate_message_fee","estimate_fee_bulk","simulate_transaction"].includes(e)?"POST":"GET"}getQueryString(e){if(void 0===(t=e)||0===Object.keys(t).length||1===Object.keys(t).length&&Object.entries(t).every((([e,t])=>"blockIdentifier"===e&&null===t)))return"";var t;return`?${Object.entries(e).map((([e,t])=>{if("blockIdentifier"===e){return`${new jT(t).queryIdentifier}`}return`${e}=${t}`})).join("&")}`}getHeaders(e){return"POST"===e?{"Content-Type":"application/json",...this.headers}:this.headers}async fetchEndpoint(e,...[t,r]){const n=this.getFetchUrl(e),a=this.getFetchMethod(e),i=this.getQueryString(t),s=this.getHeaders(a),o=$k(n,e,i);try{const t=await Gk(o,{method:a,body:lT(r),headers:s}),n=await t.text();if(!t.ok){let e;try{e=uT(n)}catch{throw new CT(t.statusText,t.status)}const r=e.code||(null==e?void 0:e.status_code);throw new kT(e.message,r)}return"estimate_fee"===e?hT(n,((e,t)=>t&&"bigint"==typeof t?oC(t.toString()):t)):uT(n)}catch(e){if(e instanceof kT||e instanceof CT)throw e;if(e instanceof Error)throw Error(`Could not ${a} from endpoint \`${o}\`: ${e.message}`);throw e}}async getChainId(){return Promise.resolve(this.chainId)}async callContract({contractAddress:e,entrypoint:t,calldata:r=[]},n=this.blockIdentifier){return this.fetchEndpoint("call_contract",{blockIdentifier:n},{signature:[],contract_address:e,entry_point_selector:QC(t),calldata:r}).then(this.responseParser.parseCallContractResponse)}async getBlock(e=this.blockIdentifier){return this.fetchEndpoint("get_block",{blockIdentifier:e}).then(this.responseParser.parseGetBlockResponse)}async getNonceForAddress(e,t=this.blockIdentifier){return this.fetchEndpoint("get_nonce",{contractAddress:e,blockIdentifier:t})}async getStorageAt(e,t,r=this.blockIdentifier){const n=oC(t).toString(10);return this.fetchEndpoint("get_storage_at",{blockIdentifier:r,contractAddress:e,key:n})}async getTransaction(e){const t=cC(oC(e));return this.fetchEndpoint("get_transaction",{transactionHash:t}).then((e=>{if(1===Object.values(e).length)throw new IT(e.status);return this.responseParser.parseGetTransactionResponse(e)}))}async getTransactionReceipt(e){const t=cC(oC(e));return this.fetchEndpoint("get_transaction_receipt",{transactionHash:t}).then(this.responseParser.parseGetTransactionReceiptResponse)}async getClassAt(e,t=this.blockIdentifier){return this.fetchEndpoint("get_full_contract",{blockIdentifier:t,contractAddress:e}).then(xT)}async getClassHashAt(e,t=this.blockIdentifier){return this.fetchEndpoint("get_class_hash_at",{blockIdentifier:t,contractAddress:e})}async getClassByHash(e){return this.fetchEndpoint("get_class_by_hash",{classHash:e}).then(xT)}async invokeFunction(e,t){return this.fetchEndpoint("add_transaction",void 0,{type:"INVOKE_FUNCTION",contract_address:e.contractAddress,calldata:hC(e.calldata??[]),signature:hC(e.signature??[]),nonce:cC(oC(t.nonce)),max_fee:cC(oC(t.maxFee||0)),version:cC(oC(t.version||1))}).then(this.responseParser.parseInvokeFunctionResponse)}async deployAccountContract({classHash:e,constructorCalldata:t,addressSalt:r,signature:n},a){return this.fetchEndpoint("add_transaction",void 0,{type:"DEPLOY_ACCOUNT",contract_address_salt:r??yT(),constructor_calldata:hC(t??[]),class_hash:cC(oC(e)),max_fee:cC(oC(a.maxFee||0)),version:cC(oC(a.version||0)),nonce:cC(oC(a.nonce)),signature:hC(n||[])}).then(this.responseParser.parseDeployContractResponse)}async declareContract({senderAddress:e,contractDefinition:t,signature:r},n){return this.fetchEndpoint("add_transaction",void 0,{type:"DECLARE",contract_class:t,nonce:cC(oC(n.nonce)),signature:hC(r||[]),sender_address:e,max_fee:cC(oC(n.maxFee||0)),version:cC(oC(n.version||1))}).then(this.responseParser.parseDeclareContractResponse)}async getEstimateFee(e,t,r=this.blockIdentifier){return this.getInvokeEstimateFee(e,t,r)}async getInvokeEstimateFee(e,t,r=this.blockIdentifier){return this.fetchEndpoint("estimate_fee",{blockIdentifier:r},{type:"INVOKE_FUNCTION",contract_address:e.contractAddress,calldata:e.calldata??[],signature:hC(e.signature||[]),version:cC(oC((null==t?void 0:t.version)||1)),nonce:cC(oC(t.nonce))}).then(this.responseParser.parseFeeEstimateResponse)}async getDeclareEstimateFee({senderAddress:e,contractDefinition:t,signature:r},n,a=this.blockIdentifier){return this.fetchEndpoint("estimate_fee",{blockIdentifier:a},{type:"DECLARE",sender_address:e,contract_class:t,signature:hC(r||[]),version:cC(oC((null==n?void 0:n.version)||1)),nonce:cC(oC(n.nonce))}).then(this.responseParser.parseFeeEstimateResponse)}async getDeployAccountEstimateFee({classHash:e,addressSalt:t,constructorCalldata:r,signature:n},a,i=this.blockIdentifier){return this.fetchEndpoint("estimate_fee",{blockIdentifier:i},{type:"DEPLOY_ACCOUNT",class_hash:cC(oC(e)),constructor_calldata:hC(r||[]),contract_address_salt:cC(oC(t||0)),signature:hC(n||[]),version:cC(oC((null==a?void 0:a.version)||0)),nonce:cC(oC(a.nonce))}).then(this.responseParser.parseFeeEstimateResponse)}async getEstimateFeeBulk(e,t=this.blockIdentifier){const r=e.map((e=>{let t;return t="INVOKE_FUNCTION"===e.type?{type:e.type,contract_address:e.contractAddress,calldata:e.calldata??[]}:"DECLARE"===e.type?{type:e.type,sender_address:e.senderAddress,contract_class:e.contractDefinition}:{type:e.type,class_hash:cC(oC(e.classHash)),constructor_calldata:hC(e.constructorCalldata||[]),contract_address_salt:cC(oC(e.addressSalt||0))},{...t,signature:hC(e.signature||[]),version:cC(oC((null==e?void 0:e.version)||1)),nonce:cC(oC(e.nonce))}}));return this.fetchEndpoint("estimate_fee_bulk",{blockIdentifier:t},r).then(this.responseParser.parseFeeEstimateBulkResponse)}async getCode(e,t=this.blockIdentifier){return this.fetchEndpoint("get_code",{contractAddress:e,blockIdentifier:t})}async waitForTransaction(e,t=8e3,r=["ACCEPTED_ON_L1","ACCEPTED_ON_L2","PENDING"]){const n=["REJECTED","NOT_RECEIVED"];let a,i=!1;for(;!i;)if(await AT(t),a=await this.getTransactionStatus(e),r.includes(a.tx_status))i=!0;else if(n.includes(a.tx_status)){const e=a.tx_failure_reason?`${a.tx_status}: ${a.tx_failure_reason.code}\n${a.tx_failure_reason.error_message}`:a.tx_status,t=new Error(e);throw t.response=a,t}return await this.getTransactionReceipt(e)}async getTransactionStatus(e){const t=cC(oC(e));return this.fetchEndpoint("get_transaction_status",{transactionHash:t})}async getContractAddresses(){return this.fetchEndpoint("get_contract_addresses")}async getTransactionTrace(e){const t=cC(oC(e));return this.fetchEndpoint("get_transaction_trace",{transactionHash:t})}async estimateMessageFee({from_address:e,to_address:t,entry_point_selector:r,payload:n},a=this.blockIdentifier){const i={from_address:yC(e),to_address:mC(t),entry_point_selector:eT(r),payload:wC(n)};return this.fetchEndpoint("estimate_message_fee",{blockIdentifier:a},i)}async getSimulateTransaction(e,t,r=this.blockIdentifier){return this.fetchEndpoint("simulate_transaction",{blockIdentifier:r},{type:"INVOKE_FUNCTION",contract_address:e.contractAddress,calldata:e.calldata??[],signature:hC(e.signature||[]),version:cC(oC((null==t?void 0:t.version)||1)),nonce:cC(oC(t.nonce))}).then(this.responseParser.parseFeeSimulateTransactionResponse)}async getStateUpdate(e=this.blockIdentifier){const t=new jT(e).sequencerIdentifier;return this.fetchEndpoint("get_state_update",{...t}).then(this.responseParser.parseGetStateUpdateResponse)}async getBlockTraces(e=this.blockIdentifier){const t=new jT(e).sequencerIdentifier;return this.fetchEndpoint("get_block_traces",{...t})}async getStarkName(e,t){return DT(this,e,t)}async getAddressFromStarkName(e,t){return UT(this,e,t)}},eB=class{constructor(e){this.provider=e instanceof eB?e.provider:e instanceof qT||e instanceof QT?e:e&&"rpc"in e?new qT(e.rpc):e&&"sequencer"in e?new QT(e.sequencer):new QT}get chainId(){return this.provider.chainId}async getChainId(){return this.provider.getChainId()}async getBlock(e){return this.provider.getBlock(e)}async getClassAt(e,t){return this.provider.getClassAt(e,t)}async getClassHashAt(e,t){return this.provider.getClassHashAt(e,t)}getClassByHash(e){return this.provider.getClassByHash(e)}async getEstimateFee(e,t,r){return this.provider.getEstimateFee(e,t,r)}async getInvokeEstimateFee(e,t,r){return this.provider.getInvokeEstimateFee(e,t,r)}async getEstimateFeeBulk(e,t){return this.provider.getEstimateFeeBulk(e,t)}async getNonceForAddress(e,t){return this.provider.getNonceForAddress(e,t)}async getStorageAt(e,t,r){return this.provider.getStorageAt(e,t,r)}async getTransaction(e){return this.provider.getTransaction(e)}async getTransactionReceipt(e){return this.provider.getTransactionReceipt(e)}async callContract(e,t){return this.provider.callContract(e,t)}async invokeFunction(e,t){return this.provider.invokeFunction(e,t)}async deployAccountContract(e,t){return this.provider.deployAccountContract(e,t)}async declareContract(e,t){return this.provider.declareContract(e,t)}async getDeclareEstimateFee(e,t,r){return this.provider.getDeclareEstimateFee(e,t,r)}getDeployAccountEstimateFee(e,t,r){return this.provider.getDeployAccountEstimateFee(e,t,r)}async getCode(e,t){return this.provider.getCode(e,t)}async waitForTransaction(e,t,r){return this.provider.waitForTransaction(e,t,r)}async getSimulateTransaction(e,t,r){return this.provider.getSimulateTransaction(e,t,r)}async getStateUpdate(e){return this.provider.getStateUpdate(e)}async getStarkName(e,t){return DT(this,e,t)}async getAddressFromStarkName(e,t){return UT(this,e,t)}};new eB;Kk({},{fromCallsToExecuteCalldata:()=>rB,fromCallsToExecuteCalldataWithNonce:()=>nB,transformCallsToMulticallArrays:()=>tB});var tB=e=>{const t=[],r=[];return e.forEach((e=>{const n=e.calldata||[];t.push({to:oC(e.contractAddress).toString(10),selector:oC(QC(e.entrypoint)).toString(10),data_offset:r.length.toString(),data_len:n.length.toString()}),r.push(...n)})),{callArray:t,calldata:hC(r)}},rB=e=>{const{callArray:t,calldata:r}=tB(e);return[t.length.toString(),...t.map((({to:e,selector:t,data_offset:r,data_len:n})=>[e,t,r,n])).flat(),r.length.toString(),...r]},nB=(e,t)=>[...rB(e),oC(t).toString()];Kk({},{encodeData:()=>mB,encodeType:()=>bB,encodeValue:()=>yB,getDependencies:()=>pB,getMessageHash:()=>vB,getStructHash:()=>wB,getTypeHash:()=>gB,isMerkleTreeType:()=>hB,prepareSelector:()=>lB});Kk({},{MerkleTree:()=>aB,proofMerklePath:()=>iB});var aB=class{constructor(e){this.branches=[],this.leaves=e,this.root=this.build(e)}build(e){if(1===e.length)return e[0];e.length!==this.leaves.length&&this.branches.push(e);const t=[];for(let r=0;r<e.length;r+=2)r+1===e.length?t.push(aB.hash(e[r],"0x0")):t.push(aB.hash(e[r],e[r+1]));return this.build(t)}static hash(e,t){const[r,n]=[oC(e),oC(t)].sort(((e,t)=>e.gte(t)?1:-1));return rT([r,n])}getProof(e,t=this.leaves,r=[]){const n=t.indexOf(e);if(-1===n)throw new Error("leaf not found");if(1===t.length)return r;const a=n%2==0,i=(a?t[n+1]:t[n-1])??"0x0",s=[...r,i],o=this.leaves.length===t.length?-1:this.branches.findIndex((e=>e.length===t.length)),c=this.branches[o+1]??[this.root];return this.getProof(aB.hash(a?e:i,a?i:e),c,s)}};function iB(e,t,r){if(0===r.length)return e===t;const[n,...a]=r;return iB(e,aB.hash(t,n),a)}function sB(e){return/^[\x00-\x7F]*$/.test(e)}function oB(e){return e.length<=31}function cB(e){return/^[0-9]*$/i.test(e)}function dB(e){if(!sB(e))throw new Error(`${e} is not an ASCII string`);if(!oB(e))throw new Error(`${e} is too long`);return eC(e.replace(/./g,(e=>e.charCodeAt(0).toString(16))))}function fB(e){if(!sB(e))throw new Error(`${e} is not an ASCII string`);if(sC(e))return Qk(e).replace(/.{2}/g,(e=>String.fromCharCode(parseInt(e,16))));if(cB(e))return fB("0X".concat(BigInt(e).toString(16)));throw new Error(`${e} is not Hex or decimal`)}Kk({},{decodeShortString:()=>fB,encodeShortString:()=>dB,isASCII:()=>sB,isDecimalString:()=>cB,isShortString:()=>oB});function uB(e){try{return cC(oC(e))}catch(t){if("string"==typeof e)return cC(oC(dB(e)));throw new Error(`Invalid BigNumberish: ${e}`)}}function lB(e){return sC(e)?e:QC(e)}function hB(e){return"merkletree"===e.type}var pB=(e,t,r=[])=>("*"===t[t.length-1]&&(t=t.slice(0,-1)),r.includes(t)?r:e[t]?[t,...e[t].reduce(((t,r)=>[...t,...pB(e,r.type,t).filter((e=>!t.includes(e)))]),[])]:r);var bB=(e,t)=>{const[r,...n]=pB(e,t);return(r?[r,...n.sort()]:[]).map((t=>`${t}(${e[t].map((e=>`${e.name}:${e.type}`))})`)).join("")},gB=(e,t)=>QC(bB(e,t)),yB=(e,t,r,n={})=>{if(e[t])return[t,wB(e,t,r)];if(Object.keys(e).map((e=>`${e}*`)).includes(t)){const n=r.map((r=>wB(e,t.slice(0,-1),r)));return[t,nT(n)]}if("merkletree"===t){const t=function(e,t){if(t.parent&&t.key){const r=e[t.parent].find((e=>e.name===t.key));if(!hB(r))throw new Error(`${t.key} is not a merkle tree`);if(r.contains.endsWith("*"))throw new Error(`Merkle tree contain property must not be an array but was given ${t.key}`);return r.contains}return"raw"}(e,n),a=r.map((r=>yB(e,t,r)[1])),{root:i}=new aB(a);return["felt",i]}return"felt*"===t?["felt*",nT(r)]:"selector"===t?["felt",lB(r)]:[t,uB(r)]},mB=(e,t,r)=>{const[n,a]=e[t].reduce((([n,a],i)=>{if(void 0===r[i.name]||null===r[i.name])throw new Error(`Cannot encode data: missing data for '${i.name}'`);const s=r[i.name],[o,c]=yB(e,i.type,s,{parent:t,key:i.name});return[[...n,o],[...a,c]]}),[["felt"],[gB(e,t)]]);return[n,a]},wB=(e,t,r)=>nT(mB(e,t,r)[1]),vB=(e,t)=>{if(!(e=>{const t=e;return Boolean(t.types&&t.primaryType&&t.message)})(e))throw new Error("Typed data does not match JSON schema");return nT([dB("StarkNet Message"),wB(e.types,"StarkNetDomain",e.domain),t,wB(e.types,e.primaryType,e.message)])};function EB(e){return oC(e.high).shln(128).add(oC(e.low))}Kk({},{UINT_128_MAX:()=>AB,UINT_256_MAX:()=>_B,bnToUint256:()=>SB,isUint256:()=>xB,uint256ToBN:()=>EB});var AB=oC(1).shln(128).sub(oC(1)),_B=oC(1).shln(256).sub(oC(1));function xB(e){return oC(e).lte(_B)}function SB(e){const t=oC(e);if(!xB(t))throw new Error("Number is too large");return{low:eC(t.maskn(128).toString(16)),high:eC(t.shrn(128).toString(16))}}const IB=(e,t)=>{const r=Mt().decodeBase64(t);return Mt().encodeBase64(Tt().sign.detached(Mt().decodeBase64(e),r))};async function kB(e,t=0){console.log("getAddressKey() addressIndex",t),console.log("getAddressKey() keyDeriver",e);const{publicKey:r,privateKey:n}=await e(t);return console.log("privateKey",n),{publicKey:r,privateKey:n,derivationPath:e.path}}class CB{static async getParty(e){const t=await fetch(`${qv.walletApiBase}/party/${e}`);return await t.json()}static async isDeployed(e){const t=await fetch(`${qv.walletApiBase}/party/${e}`),r=await t.json();return console.log("body",r),!0===r.isDeployed&&!0===r.transferPreapproved}static async prepareParty(e){const t=await fetch(`${qv.walletApiBase}/party/prepare`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicKey:e})});return await t.json()}static async allocateParty(e,t){const r=await fetch(`${qv.walletApiBase}/party/allocate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({signedHash:e,preparedParty:t})});return await r.json()}static async preapproveTransfers(e){const t=await fetch(`${qv.walletApiBase}/party/preapprove-transfers`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({partyId:e})});return await t.json()}static async submitTransaction(e,t,r,n){const a=await fetch(`${qv.walletApiBase}/transaction/submit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({partyId:e,publicKey:t,preparedTx:r,signedHash:n})});return await a.json()}static async getBalance(e,t,r){const n=await fetch(`${qv.walletApiBase}/token/balance/${t}/${e}`);return await n.json()}static async getAllBalances(e,t){const r=await fetch(`${qv.walletApiBase}/token/balances/${e}`);return await r.json()}static async getTrafficEstimate(e,t,r){const n=await fetch(`${qv.walletApiBase}/transaction/estimate-traffic`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({partyId:e,invocations:t,details:r})});return await n.json()}static async createTransfer(e,t,r,n,a,i){const s=await fetch(`${qv.walletApiBase}/token/create-transfer`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({partyId:e,recipient:t,amount:r,memo:n,instrumentAdmin:a,instrumentId:i})});return await s.json()}static async getOffers(e){const t=await fetch(`${qv.walletApiBase}/token/offers/${e}`);return await t.json()}}var TB,BB;!function(e){e.ETH="ETH",e.STRK="STRK"}(TB||(TB={})),function(e){e.ETH="wei",e.STRK="fri"}(BB||(BB={}));class MB{fees;overallFee;suggestedMaxFee;resourceBounds;constructor(e){this.fees=e;const{overallFee:t,suggestedMaxFee:r,resourceBounds:n}=this.consolidateFee();this.overallFee=t,this.suggestedMaxFee=r,this.resourceBounds=n}consolidateFee(){const e=this.fees.reduce(((e,t)=>{var r,n;return e.overallFee+=t.overall_fee,e.suggestedMaxFee+=t.suggestedMaxFee,e.resourceBounds.l1_gas.max_amount+=BigInt(t.resourceBounds.l1_gas.max_amount??"0"),e.resourceBounds.l1_gas.max_price_per_unit+=BigInt(t.resourceBounds.l1_gas.max_price_per_unit??"0"),e.resourceBounds.l2_gas.max_amount+=BigInt((null===(r=t.resourceBounds.l2_gas)||void 0===r?void 0:r.max_amount)??"0"),e.resourceBounds.l2_gas.max_price_per_unit+=BigInt((null===(n=t.resourceBounds.l2_gas)||void 0===n?void 0:n.max_price_per_unit)??"0"),t.resourceBounds.l1_data_gas&&(e.resourceBounds.l1_data_gas||(e.resourceBounds.l1_data_gas={max_amount:BigInt(0),max_price_per_unit:BigInt(0)}),e.resourceBounds.l1_data_gas.max_amount+=BigInt(t.resourceBounds.l1_data_gas.max_amount??"0"),e.resourceBounds.l1_data_gas.max_price_per_unit+=BigInt(t.resourceBounds.l1_data_gas.max_price_per_unit??"0")),e}),{overallFee:BigInt(0),suggestedMaxFee:BigInt(0),resourceBounds:{l1_gas:{max_amount:BigInt(0),max_price_per_unit:BigInt(0)},l2_gas:{max_amount:BigInt(0),max_price_per_unit:BigInt(0)}}});return{overallFee:e.overallFee,suggestedMaxFee:e.suggestedMaxFee,resourceBounds:e.resourceBounds}}serializate(){var e,t;const r={l1_gas:{max_amount:ab.toHexString(this.resourceBounds.l1_gas.max_amount),max_price_per_unit:ab.toHexString(this.resourceBounds.l1_gas.max_price_per_unit)},l2_gas:{max_amount:ab.toHexString(this.resourceBounds.l2_gas.max_amount),max_price_per_unit:ab.toHexString(this.resourceBounds.l2_gas.max_price_per_unit)},l1_data_gas:{max_amount:ab.toHexString((null===(e=this.resourceBounds.l1_data_gas)||void 0===e?void 0:e.max_amount)??BigInt(0)),max_price_per_unit:ab.toHexString((null===(t=this.resourceBounds.l1_data_gas)||void 0===t?void 0:t.max_price_per_unit)??BigInt(0))}};return{suggestedMaxFee:this.suggestedMaxFee.toString(10),overallFee:this.overallFee.toString(10),resourceBounds:r}}}const OB=ak(X(),/^(?:0x)?[0-9a-f]+$/iu);ak(X(),/^0x[0-9a-f]+$/iu),ak(X(),/^0x[0-9a-f]{40}$/u),ak(X(),/^0x[0-9a-fA-F]{40}$/u);class RB extends TypeError{constructor(e,t){let r;const{message:n,explanation:a,...i}=e,{path:s}=e,o=0===s.length?n:`At path: ${s.join(".")} -- ${n}`;super(a??o),null!=a&&(this.cause=o),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>r??(r=[e,...t()])}}function NB(e){return"object"==typeof e&&null!=e}function PB(e){return NB(e)&&!Array.isArray(e)}function LB(e){return"symbol"==typeof e?e.toString():"string"==typeof e?JSON.stringify(e):`${e}`}function FB(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:a,branch:i}=t,{type:s}=r,{refinement:o,message:c=`Expected a value of type \`${s}\`${o?` with refinement \`${o}\``:""}, but received: \`${LB(n)}\``}=e;return{value:n,type:s,refinement:o,key:a[a.length-1],path:a,branch:i,...e,message:c}}function*DB(e,t,r,n){var a;NB(a=e)&&"function"==typeof a[Symbol.iterator]||(e=[e]);for(const a of e){const e=FB(a,t,r,n);e&&(yield e)}}function*UB(e,t,r={}){const{path:n=[],branch:a=[e],coerce:i=!1,mask:s=!1}=r,o={path:n,branch:a,mask:s};i&&(e=t.coercer(e,o));let c="valid";for(const n of t.validator(e,o))n.explanation=r.message,c="not_valid",yield[n,void 0];for(let[d,f,u]of t.entries(e,o)){const t=UB(f,u,{path:void 0===d?n:[...n,d],branch:void 0===d?a:[...a,f],coerce:i,mask:s,message:r.message});for(const r of t)r[0]?(c=null!=r[0].refinement?"not_refined":"not_valid",yield[r[0],void 0]):i&&(f=r[1],void 0===d?e=f:e instanceof Map?e.set(d,f):e instanceof Set?e.add(f):NB(e)&&(void 0!==f||d in e)&&(e[d]=f))}if("not_valid"!==c)for(const n of t.refiner(e,o))n.explanation=r.message,c="not_refined",yield[n,void 0];"valid"===c&&(yield[void 0,e])}class HB{constructor(e){const{type:t,schema:r,validator:n,refiner:a,coercer:i=(e=>e),entries:s=function*(){}}=e;this.type=t,this.schema=r,this.entries=s,this.coercer=i,this.validator=n?(e,t)=>DB(n(e,t),t,this,e):()=>[],this.refiner=a?(e,t)=>DB(a(e,t),t,this,e):()=>[]}assert(e,t){return jB(e,this,t)}create(e,t){return function(e,t,r){const n=zB(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}(e,this,t)}is(e){return $B(e,this)}mask(e,t){return VB(e,this,t)}validate(e,t={}){return zB(e,this,t)}}function jB(e,t,r){const n=zB(e,t,{message:r});if(n[0])throw n[0]}function VB(e,t,r){const n=zB(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function $B(e,t){return!zB(e,t)[0]}function zB(e,t,r={}){const n=UB(e,t,r),a=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);if(a[0]){return[new RB(a[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]}return[void 0,a[1]]}function qB(...e){const t="type"===e[0].type,r=e.map((e=>e.schema)),n=Object.assign({},...r);return t?aM(n):eM(n)}function KB(e,t){return new HB({type:e,schema:null,validator:t})}function GB(){return KB("any",(()=>!0))}function JB(e){return new HB({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||`Expected an array value, but received: ${LB(e)}`})}function WB(){return KB("boolean",(e=>"boolean"==typeof e))}function YB(e){const t={},r=e.map((e=>LB(e))).join();for(const r of e)t[r]=r;return new HB({type:"enums",schema:t,validator:t=>e.includes(t)||`Expected one of \`${r}\`, but received: ${LB(t)}`})}function ZB(){return KB("never",(()=>!1))}function XB(e){return new HB({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})}function QB(){return KB("number",(e=>"number"==typeof e&&!isNaN(e)||`Expected a number, but received: ${LB(e)}`))}function eM(e){const t=e?Object.keys(e):[],r=ZB();return new HB({type:"object",schema:e||null,*entries(n){if(e&&NB(n)){const a=new Set(Object.keys(n));for(const r of t)a.delete(r),yield[r,n[r],e[r]];for(const e of a)yield[e,n[e],r]}},validator:e=>PB(e)||`Expected an object, but received: ${LB(e)}`,coercer(t,r){if(!PB(t))return t;const n={...t};if(r.mask&&e)for(const t in n)void 0===e[t]&&delete n[t];return n}})}function tM(e){return new HB({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})}function rM(e,t){return new HB({type:"record",schema:null,*entries(r){if(NB(r))for(const n in r){const a=r[n];yield[n,n,e],yield[n,a,t]}},validator:e=>PB(e)||`Expected an object, but received: ${LB(e)}`,coercer:e=>PB(e)?{...e}:e})}function nM(){return KB("string",(e=>"string"==typeof e||`Expected a string, but received: ${LB(e)}`))}function aM(e){const t=Object.keys(e);return new HB({type:"type",schema:e,*entries(r){if(NB(r))for(const n of t)yield[n,r[n],e[n]]},validator:e=>PB(e)||`Expected an object, but received: ${LB(e)}`,coercer:e=>PB(e)?{...e}:e})}function iM(){return KB("unknown",(()=>!0))}function sM(e){return fM(e,"empty",(t=>{const r=oM(t);return 0===r||`Expected an empty ${e.type} but received one with a size of \`${r}\``}))}function oM(e){return e instanceof Map||e instanceof Set?e.size:e.length}function cM(e,t,r={}){const{exclusive:n}=r;return fM(e,"min",(r=>n?r>t:r>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${r}\``))}function dM(e){return fM(e,"nonempty",(t=>oM(t)>0||`Expected a nonempty ${e.type} but received an empty one`))}function fM(e,t,r){return new HB({...e,*refiner(n,a){yield*e.refiner(n,a);const i=DB(r(n,a),a,e,n);for(const e of i)yield{...e,refinement:t}}})}function uM(e,t){return function(e){return/^[ -~]+$/u.test(e)}(e)&&e.trim().length>0&&e.length<=t}function lM(e){return function(e,t,r,n="..."){if(!e)return e;if(t<0||r<0)throw new Error("Indexes must be positives");if(t+r>e.length)throw new Error("Indexes out of bounds");return`${e.substring(0,t)}${n}${e.substring(e.length-r)}`}(e,5,4)}const hM=fM(nM(),"TokenNameStruct",(e=>!!uM(e,64)||"The given token name is invalid")),pM=fM(nM(),"TokenSymbolStruct",(e=>!!uM(e,16)||"The given token symbol is invalid")),bM=fM(nM(),"AddressStruct",(e=>{try{const t=e.toString().replace(/^0x0?/u,"");if(63!==t.length)return"Invalid address format";zw(t)}catch(e){return"Invalid address format"}return!0})),gM=YB(Object.values(Bp)),yM=YB(Object.values(Mp)),mM=YB(Object.values(Tp)),wM=YB(Object.values(Mh.StarknetChainId)),vM=rk([eM({name:nM(),type:YB(["enum"]),contains:nM()}),eM({name:nM(),type:YB(["merkletree"]),contains:nM()}),eM({name:nM(),type:nM()})]),EM=eM({name:tM(nM()),version:tM(nM()),chainId:tM(rk([nM(),QB()])),revision:tM(rk([nM(),QB()]))}),AM=eM({types:rM(nM(),JB(vM)),primaryType:nM(),domain:EM,message:rM(nM(),GB())}),_M=eM({enableAuthorize:tM(WB())}),xM=eM({chainId:wM}),SM=rk([JB(nM()),rM(nM(),GB())]),IM=eM({entrypoint:dM(nM()),contractAddress:dM(nM()),calldata:tM(SM)}),kM=rk([QB(),OB]),CM=YB([Mh.TRANSACTION_VERSION.V1,Mh.TRANSACTION_VERSION.V2,Mh.TRANSACTION_VERSION.V3]),TM=(YB([Mh.TRANSACTION_VERSION.V1]),YB([Mh.TRANSACTION_VERSION.V3])),BM=YB(["L1","L2"]),MM=eM({max_amount:tM(nM()),max_price_per_unit:tM(nM())}),OM=eM({l1_gas:tM(MM),l2_gas:tM(MM),l1_data_gas:tM(MM)}),RM=eM({nonce:tM(kM),version:tM(TM),resourceBounds:tM(OM),tip:tM(kM),paymasterData:tM(JB(kM)),accountDeploymentData:tM(JB(kM)),nonceDataAvailabilityMode:tM(BM),feeDataAvailabilityMode:tM(BM)}),NM=qB(eM({nonce:tM(kM),maxFee:tM(kM)}),RM,eM({classHash:dM(nM()),compiledClassHash:tM(nM()),senderAddress:bM,chainId:wM,version:CM})),PM=fM(nM(),"StarkNameStruct",(e=>!!RO(e)||"The given stark name is invalid")),LM=fM(nM(),"AccountNameStruct",(e=>e.length>=1&&e.length<=20||"The given account name is invalid")),FM=eM({selector:nM(),function_idx:QB()}),DM=eM({selector:nM(),offset:rk([nM(),QB()]),builtins:tM(JB(nM()))}),UM=eM({CONSTRUCTOR:JB(DM),EXTERNAL:JB(DM),L1_HANDLER:JB(DM)}),HM=eM({CONSTRUCTOR:JB(FM),EXTERNAL:JB(FM),L1_HANDLER:JB(FM)}),jM=eM({sierra_program:JB(nM()),contract_class_version:dM(nM()),entry_points_by_type:HM,sierra_program_debug_info:tM(GB()),abi:GB()}),VM=eM({prime:nM(),compiler_version:nM(),bytecode:JB(nM()),hints:JB(GB()),pythonic_hints:tM(JB(GB())),bytecode_segment_lengths:tM(JB(QB())),entry_points_by_type:UM}),$M=eM({program:rM(nM(),GB()),entry_points_by_type:UM,abi:GB()}),zM=eM({contract:KB("CompiledContractStruct",(e=>Object.prototype.hasOwnProperty.call(e,"sierra_program")?zB(e,jM)[0]??!0:zB(e,$M)[0]??!0)),classHash:tM(nM()),casm:tM(VM),compiledClassHash:tM(nM())}),qM=eM({classHash:dM(nM()),constructorCalldata:tM(SM),addressSalt:tM(kM),contractAddress:tM(nM())}),KM=eM({classHash:kM,salt:tM(nM()),unique:tM(WB()),constructorCalldata:tM(SM)}),GM=eM({payload:iM(),type:mM}),JM=(KB("CallsStruct",(e=>zB(Array.isArray(e)?e:[e],JB(IM))[0]??!0)),KB("InvocationsStruct",(e=>{for(const t of e){const e=VB(t,GM),r=Array.isArray(e.payload);let n;switch(t.type){case Tp.DECLARE:if(n=zM,r)throw new Error("Declare payload does not accept mutiple items");break;case Tp.DEPLOY:n=KM;break;case Tp.DEPLOY_ACCOUNT:if(n=qM,r)throw new Error("Deploy account payload does not accept mutiple items");break;case Tp.INVOKE:n=IM;break;default:throw new Error("Invalid transaction type")}const[a]=zB(e.payload,r?JB(n):n);if(void 0!==a)return a}return!0}))),WM=KB("UniversalDetailsStruct",(e=>zB(e,qB(RM,eM({blockIdentifier:tM(nM()),maxFee:tM(kM),skipValidate:tM(WB()),version:tM(CM)})))[0]??!0)),YM=eM({txnHash:OB,txnType:mM,chainId:nM(),senderAddress:rk([nM(),sM(nM())]),contractAddress:rk([bM,sM(nM())]),executionStatus:rk([yM,nM()]),finalityStatus:rk([gM,nM()]),failureReason:nM(),timestamp:QB(),maxFee:XB(nM()),actualFee:XB(nM()),accountCalls:XB(GB()),version:QB(),dataVersion:YB(Object.values(dE))}),ZM=aM({address:nM(),chainId:wM,publicKey:nM(),addressSalt:nM(),addressIndex:QB(),upgradeRequired:WB(),deployRequired:WB(),accountName:tM(nM()),isDeployed:tM(WB())}),XM=e=>{let t="";for(let r=0;r<e.length;r+=2){const n=e.substr(r,2),a=parseInt(n,16);t+=String.fromCharCode(a)}return t},QM=(e,t)=>{Object.keys(t).forEach((r=>{const n=t[r];Object.prototype.hasOwnProperty.call(e,r)&&(e[n]=e[r],delete e[r])}))};function eO(e){return Math.floor(e/1e3)}function tO(e){switch(console.log("getRPCUrl"),console.log("chainId",e),e){case Mh.StarknetChainId.SN_MAIN:return`https://starknet-mainnet.infura.io/v3/${qv.rpcApiKey}`;default:case Mh.StarknetChainId.SN_SEPOLIA:return`https://starknet-sepolia.infura.io/v3/${qv.rpcApiKey}`}}const rO=e=>(e??"").split(",").map((e=>e.trim())).filter((e=>e.length>0)),nO=(e,t)=>{let r={};var n;return r={nodeUrl:tO(e.chainId)},t&&(r.blockIdentifier=t),n=e.chainId,qv.enableRPCV8[n]?r.specVersion="0.8.1":r.specVersion="0.7.1",new Dw(r)},aO=(e,t,r,n)=>{console.log("getAccountInstance()");const a=nO(e,n);return console.log("getAccountInstance() provider",a),new bv(a,t,r)},iO=async(e,t,r,n=[],a=Uv.Latest)=>nO(e).callContract({contractAddress:t,entrypoint:r,calldata:n},a),sO=async(e,t,r,n,a,i)=>{var s;return aO(e,t,r,i,null===(s=a)||void 0===s||s.version).declare(n,{...a,skipValidate:!1,blockIdentifier:Uv.Latest})},oO=async(e,t,r,n,a,i)=>{var s;return await aO(e,t,r,a,null===(s=i)||void 0===s||s.version,Uv.Latest).estimateInvokeFee(n,{...i,skipValidate:!1,blockIdentifier:Uv.Latest})},cO=async(e,t,r,n,a,i)=>{var s;return await aO(e,t,r,i,null===(s=a)||void 0===s||s.version,Uv.Latest).estimateFeeBulk(n,{...a,skipValidate:!1,blockIdentifier:Uv.Latest})},dO=async(e,t,r,n,a)=>{console.log("utils executeTxn()");const i=jO(t,e,n,a),s=await snap.request({method:"snap_dialog",params:{type:ZI.Confirmation,content:Sk([rE("Do you want to sign this transaction ?"),...i])}});if(console.log("response",s),s){console.log(t);const e=Tt().sign.keyPair.fromSecretKey(Mt().decodeBase64(r)),n=Mt().encodeBase64(e.publicKey),i=IB(a.preparedTransactionHash,r);console.log("signedHash",i);const s=await CB.submitTransaction(t,n,a,i);return console.log("executeTxResponse",s),s}throw new Error("User rejected the transaction")},fO=async(e,t)=>(await iO(t,e,"getVersion"))[0],uO=async(e,t,r)=>"0"===r?(async(e,t)=>(await iO(t,e,"getSigner"))[0])(e,t):(async(e,t)=>(await iO(t,e,"get_owner"))[0])(e,t),lO=async(e,t,r=Mh.ZERO)=>{const n=Rv.address;return ab.toBigInt(await getBalance(t,n,e)??ab.toBigInt(Mh.ZERO))<=r},hO=async(e,t)=>{const r=nO(t),n=await r.getTransactionReceipt(e);return{executionStatus:n.execution_status,finalityStatus:n.finality_status}};const pO=(e,t,r,n)=>{const a=function(e){return Nh.addHexPrefix(Nh.buf2hex(cy.starkCurve.getPublicKey(e,!1)))}(t),i=new cy.starkCurve.Signature(BigInt(n[0]),BigInt(n[1])),s=Km.getMessageHash(r,e);return cy.starkCurve.verify(i,s,a)},bO=(e,t,r)=>{var n;console.log("getNextAddressIndex()");const a=function(e,t){return e.accContracts.filter((e=>DO(e.chainId,t))).sort(((e,t)=>e.addressIndex-t.addressIndex))}(t,e).filter((e=>e.derivationPath===r&&e.addressIndex>=0));console.log("getNextAddressIndex() acccounts",a);const i=a.find((e=>!1===e.isDeployed));return console.log("getNextAddressIndex() uninitializedAccount",i),$v.log(`getNextAddressIndex:\nUninitialized account found from state:\n${Kv(i??"None")}`),(null===(n=i)||void 0===n?void 0:n.addressIndex)??a.length},gO=e=>{const t=mO(e,Fv);let r=oy.calculateContractAddressFromHash(e,Bv,t,0);return r=zw(r),{address:r,callData:t}},yO=e=>{const t=mO(e,Dv);let r=oy.calculateContractAddressFromHash(e,Pv,t,0);return r=zw(r),{address:r,callData:t}};const mO=(e,t)=>{switch(t){case"1":return sy.compile({signer:e,guardian:"0"});case"0":return sy.compile({implementation:Tv,selector:oy.getSelectorFromName("initialize"),calldata:sy.compile({signer:e,guardian:"0"})});default:throw new Error(`Unsupported Cairo version: ${t}`)}},wO=e=>{const{address:t}=gO(e),{address:r}=yO(e);return{address:t,addressLegacy:r}},vO=async(e,t,r,n)=>{console.log("getKeysFromAddressIndex()");let a=n;console.log("getKeysFromAddressIndex() addressIndex",a),(void 0===a||isNaN(a)||a<0)&&(a=bO(t,r,e.path),$v.log(`getKeysFromAddressIndex: addressIndex found: ${a}`)),console.log("getKeysFromAddressIndex() addressIndex",a);const{privateKey:i,publicKey:s,derivationPath:o}=await kB(e,a);return console.log("getKeysFromAddressIndex() publicKey",s),{privateKey:i,publicKey:s,addressIndex:a,derivationPath:o}},EO=async(e,t,r,n,a=20)=>{let i;const s=VO(r,n,t.chainId);if(s)i=s.addressIndex,$v.log(`getNextAddressIndex:\nFound address in state: ${i} ${n}`);else{const s=await(async(e,t,r,n,a=20)=>{const i=ab.toBigInt(t);for(let s=0;s<a;s++){const{publicKey:a}=await vO(r,e,n,s),{address:o,addressLegacy:c}=wO(a);if(ab.toBigInt(o)===i||ab.toBigInt(c)===i)return $v.log(`findAddressIndex:\nFound address in scan: ${s} ${t}`),{index:s,cairoVersion:ab.toBigInt(o)===i?1:0}}throw new Error(`Address not found: ${t}`)})(t.chainId,n,e,r,a);i=s.index}return vO(e,t.chainId,r,i)},AO=async(e,t)=>{try{return await fO(t,e),!0}catch(e){if(!e.message.includes("Contract not found"))throw e;return!1}};async function _O(e,t,r,n,a,i){var s;const o=await AO(e,t);if(!o){const e=function(e,t){const{callData:r}=gO(t);return{classHash:Bv,contractAddress:e,constructorCalldata:r,addressSalt:t}}(t,n);a.unshift({type:Tp.DEPLOY_ACCOUNT,payload:e})}const c=await cO(e,t,r,a,i),d=new MB(c).serializate();return{suggestedMaxFee:d.suggestedMaxFee,overallFee:d.overallFee,resourceBounds:d.resourceBounds,unit:(null===(s=i)||void 0===s?void 0:s.version)===Mh.TRANSACTION_VERSION.V3?BB.STRK:BB.ETH,includeDeploy:!o,estimateResults:c}}const xO=async(e,t)=>{try{$v.log(`isUpgradeRequired: address = ${t}`);const r=await fO(t,e);return!SO(XM(r))}catch(e){if(!e.message.includes("Contract not found"))throw e;return!1}},SO=e=>{$v.log(`isGTEMinVersion: version = ${e}`);const t=e.split(".");return Number(t[1])>=Lv[1]};const IO=async(e,t,r=Mh.ZERO)=>{const{address:n,addressLegacy:a}=wO(t);$v.log(`getContractAddressByKey: contractAddress = ${n}\ncontractAddressLegacy = ${a}\npublicKey = ${t}`);let i=n,s=!1,o=!1,c="";try{await fO(n,e),c=await uO(i,e,Fv)}catch(t){if(!t.message.includes("Contract not found"))throw t;$v.log(`getContractAddressByKey: cairo ${Fv} contract not found, try cairo ${Dv}`);try{i=a;const t=await fO(a,e);s=!SO(XM(t)),c=await uO(a,e,s?Dv:Fv)}catch(t){if(!t.message.includes("Contract not found"))throw t;try{await lO(e,i,r)?(i=n,$v.log(`getContractAddressByKey: no deployed contract found, fallback to cairo ${Fv}`)):(s=!0,o=!0,$v.log(`getContractAddressByKey: non deployed cairo0 contract found with non-zero balance, force cairo ${Dv}`))}catch(e){throw $v.log(`getContractAddressByKey: balance check failed with error ${e}`),e}}}return{address:i,signerPubKey:c,upgradeRequired:s,deployRequired:o}},kO=async(e,t,r)=>{const n=new Uw(e),a=await n.signTransaction(t,r);return Zy.signatureToDecimalArray(a)},CO=async(e,t)=>{const r=new Uw(e),n=await r.signDeployAccountTransaction(t);return Zy.signatureToDecimalArray(n)},TO=async(e,t,r)=>{const n=new Uw(e),a=await n.signMessage(t,r);return Zy.signatureToDecimalArray(a)},BO=async(e,t)=>{const r=new Uw(e),n=await r.signDeclareTransaction(t);return Zy.signatureToDecimalArray(n)},MO=async(e,t,r)=>{if(await xO(e,t))throw new hE;if(await(async(e,t,r)=>{$v.log(`isDeployRequired: address = ${t}`);const{address:n}=yO(r);try{return t===n&&await fO(t,e),!1}catch(r){if(!r.message.includes("Contract not found"))throw r;return!await lO(e,t)}})(e,t,r))throw new pE},OO=async(e,t)=>{const r=nO(e);return bv.getAddressFromStarkName(r,t)},RO=e=>/^(?:[a-z0-9-]{1,48}(?:[a-z0-9-]{1,48}[a-z0-9-])?\.)*[a-z0-9-]{1,48}\.stark$/.test(e);const NO={[Hv.Dev]:"https://ccsnap.io",[Hv.Staging]:"https://ccsnap.io",[Hv.Prod]:"https://ccsnap.io"};function PO(){return function(e){switch(e){case Hv.Dev:return NO.dev;case Hv.Staging:return NO.staging;case Hv.Prod:default:return NO.prod}}(qv.snapEnv)}async function LO(e){return await e.request({method:"snap_manageState",params:{operation:"get"}})}async function FO(e,t){await e.request({method:"snap_manageState",params:{operation:"update",newState:t}})}function DO(e,t){return e===t}const UO=(e,t,r=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER)=>{const a=Number(e);return""===e||isNaN(a)||a>n||a<r?t:a};function HO(e,t,r){e.push(Xv(`**${t}:**`)),e.push(eE(r))}function jO(e,t,r,n){const a=DE(),i=[];return HO(i,a("signerAddress"),e),HO(i,"Command",`[${JSON.stringify(r,null,2)}]`),HO(i,a("network"),t.name),i}function VO(e,t,r){var n;return null===(n=e.accContracts)||void 0===n?void 0:n.find((e=>e.address===t&&DO(e.chainId,r)))}async function $O(e,t,r,n){return r.runExclusive((async()=>{console.log("upsertAccount()"),n||(console.log("no state passed, getting state..."),n=await LO(t)),console.log("upsertAccount() state",n);const r=VO(n,e.address,e.chainId);if(console.log("upsertAccount() storedAccount",r),void 0===r)n.accContracts||(n.accContracts=[]),n.accContracts.push(e);else{if(Kv(r)===Kv(e))return void $v.log(`upsertAccount: same account and hence skip calling snap state update: ${Kv(r)}`);r.addressSalt=e.addressSalt,r.addressIndex=e.addressIndex,r.derivationPath=e.derivationPath,r.publicKey=e.publicKey,r.deployTxnHash=e.deployTxnHash??r.deployTxnHash,r.upgradeRequired=e.upgradeRequired,r.deployRequired=e.deployRequired}console.log("upsertAccount() setting state...",n),await FO(t,n)}))}function zO(e,t){var r;return null===(r=e.networks)||void 0===r?void 0:r.find((e=>{var r;return DO(e.chainId,t)&&!(null===(r=e)||void 0===r?void 0:r.useOldAccounts)}))}async function qO(e,t,r,n){return console.log("upsertErc20Token()",e),r.runExclusive((async()=>{n||(n=await LO(t)),console.log("upsertErc20Token() state",n);const r=function(e,t,r){var n;return null===(n=e.erc20Tokens)||void 0===n?void 0:n.find((e=>e.instrumentAdmin===t&&e.id===r))}(n,e.instrumentAdmin,e.id);if(console.log("upsertErc20Token() storedErc20Token",r),void 0===r)n.erc20Tokens||(n.erc20Tokens=[]),n.erc20Tokens.push(e);else{if(Kv(r)===Kv(e))return void $v.log(`upsertErc20Token: same Erc20 token and hence skip calling snap state update: ${Kv(r)}`);r.name=e.name,r.symbol=e.symbol,r.decimals=e.decimals}console.log("upsertErc20Token() setting state...",n),await FO(t,n)}))}function KO(e,t){const r=t??qv.defaultNetwork.chainId,n=zO(e,r);if(void 0===n)throw new Error(`can'translate find the network in snap state with chainId: ${r}`);return $v.log(`getNetworkFromChainId: From ${t}:\n${Kv(n)}`),n}function GO(e,t,r){var n;const a=ab.toBigInt(t);return null===(n=e.transactions)||void 0===n?void 0:n.find((e=>ab.toBigInt(e.txnHash)===a&&DO(e.chainId,r)))}async function JO(){const e=DE();await Ck([rE(e("accountUpgradeMandatory")),Xv(e("visitCompanionDappAndUpgrade",PO()))])}async function WO(){const e=DE();await Ck([rE(e("accountDeploymentMandatory")),Xv(e("visitCompanionDappAndDeploy",PO()))])}async function YO(e,t,r,n=!0){try{await MO(e,t,r)}catch(e){throw e instanceof pE?n&&await WO():e instanceof hE?n&&await JO():$v.warn("Unexpected Error, neither DeployRequiredError or UpgradeRequiredError",e),e}}async function ZO(e,t,r){console.log("createAccount() preapproving transfers",e);const n=await CB.preapproveTransfers(e);console.log("createAccount() preparedPreapproveCommand",n);const a=IB(n.preparedTransactionHash,r);return await CB.submitTransaction(e,t,n,a)}async function XO(e,t=!1,r=!1){console.log("createAccount()"),console.log("createAccount() params",e),console.log(t,r);try{const{state:r,wallet:n,saveMutex:a,keyDeriver:i,requestParams:s}=e,o=s;console.log("requestParamsObj",JSON.stringify(o));const c=UO(o.addressIndex,-1,0);console.log("addressIndex",c);const d=KO(r,o.chainId);console.log("network",d);const f=Boolean(o.deploy);console.log("deploy",f);const u=await vO(i,d.chainId,r,c);console.log("createAccount() account",u);const l=Tt().sign.keyPair.fromSeed(u.privateKey);console.log("createAccount() keypair",l);const h=Mt().encodeBase64(l.publicKey),p=Mt().encodeBase64(l.secretKey);console.log("createAccount() publicKey",h),console.log("createAccount() silentMode",t);const b=await CB.getParty(s.partyId);if(!b.isDeployed){const e=await CB.prepareParty(h);console.log("createAccount() preparedParty",e);const t=IB(e.multiHash,p),r=await CB.allocateParty(t,e);console.log("createAccount() deployResp",r),$v.log(`createAccount:\ndeployResp: ${Kv(r)}`)}let g,y,m=b.transferPreapproved,w={updateId:""};for(;!m;)if(g=await ZO(s.partyId,h,p),await new Promise((e=>setTimeout(e,1e4))),y=await CB.getParty(s.partyId),y.transferPreapproved){const e={addressSalt:h,publicKey:h,address:s.partyId,addressIndex:u.addressIndex,derivationPath:u.derivationPath,deployTxnHash:g.updateId,chainId:d.chainId,upgradeRequired:!1,deployRequired:!1,isDeployed:!0};await $O(e,n,a),w=g,m=!0}return w}catch(e){throw $v.error("Problem found:",e),e}}async function QO(e){try{const{state:t}=e,r=function(e){return e.currentNetwork??qv.defaultNetwork}(t);return $v.log(`getCurrentNetwork: networks:\n${Kv(r,2)}`),r}catch(e){throw $v.error("Problem found:",e),e}}async function eR(e){try{const{state:t,requestParams:r}=e,n=KO(t,r.chainId);console.log("getStoredErc20Tokens: network:",n);const a=function(e,t){var r;return null===(r=e.erc20Tokens)||void 0===r?void 0:r.filter((e=>DO(e.chainId,t)))}(t,n.chainId);return $v.log(`getStoredErc20Tokens: erc20Tokens:\n${Kv(a,2)}`),a}catch(e){throw $v.error("Problem found:",e),e}}var tR=a(9967),rR=a(9674);class nR{search;constructor(e){this.search=e}apply(e){return this._apply(e)}}class aR{search;dataKey;constructor(e){Array.isArray(e)?this._prepareSearch(e):this.search=e}apply(e){return void 0===this.search||this._apply(e)}}class iR extends aR{_prepareSearch(e){var t;this.search=new Set(null===(t=e)||void 0===t?void 0:t.map((e=>BigInt(e))))}_apply(e){return Object.prototype.hasOwnProperty.call(e,this.dataKey)&&this.search.has(BigInt(e[this.dataKey]))}}class sR extends aR{_prepareSearch(e){this.search=new Set(e)}_apply(e){return Object.prototype.hasOwnProperty.call(e,this.dataKey)&&this.search.has(e[this.dataKey])}}class oR extends aR{_prepareSearch(e){var t;this.search=new Set(null===(t=e)||void 0===t?void 0:t.map((e=>e.toLowerCase())))}_apply(e){return Object.prototype.hasOwnProperty.call(e,this.dataKey)&&this.search.has(e[this.dataKey].toLowerCase())}}class cR extends oR{dataKey="address"}class dR extends iR{dataKey="chainId"}class fR extends oR{dataKey="instrumentAdmin"}class uR extends oR{dataKey="id"}const lR={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var hR,pR=new Uint8Array(16);function bR(){if(!hR&&!(hR="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return hR(pR)}for(var gR=[],yR=0;yR<256;++yR)gR.push((yR+256).toString(16).slice(1));function mR(e,t=0){return(gR[e[t+0]]+gR[e[t+1]]+gR[e[t+2]]+gR[e[t+3]]+"-"+gR[e[t+4]]+gR[e[t+5]]+"-"+gR[e[t+6]]+gR[e[t+7]]+"-"+gR[e[t+8]]+gR[e[t+9]]+"-"+gR[e[t+10]]+gR[e[t+11]]+gR[e[t+12]]+gR[e[t+13]]+gR[e[t+14]]+gR[e[t+15]]).toLowerCase()}const wR=function(e,t,r){if(lR.randomUUID&&!t&&!e)return lR.randomUUID();var n=(e=e||{}).random||(e.rng||bR)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var a=0;a<16;++a)t[r+a]=n[a];return t}return mR(n)};class vR{mtx;#t;constructor(e=!1){this.mtx=RE(e),this.#t={id:void 0,orgState:void 0,current:void 0,isRollingBack:!1,hasCommitted:!1}}async get(){return Tk()}async set(e){return Bk(e)}async update(e){if(this.mtx.isLocked()){if(this.#t.current)return $v.info(`SnapStateManager.update [${this.#t.id}]: transaction is processing, use existing state`),void await e(this.#t.current);$v.info("SnapStateManager.update: transaction is not exist, create lock after prev lock is released")}await this.mtx.runExclusive((async()=>{const t=await this.get();await e(t),await this.set(t)}))}async withTransaction(e){return await this.mtx.runExclusive((async()=>{if(await this.#r(),!this.#t.current||!this.#t.orgState||!this.#t.id)throw new Error("Failed to begin transaction");$v.info(`SnapStateManager.withTransaction [${this.#t.id}]: begin transaction`);try{console.log(`SnapStateManager.withTransaction [${this.#t.id}]: executing callback`,e),console.log(`SnapStateManager.withTransaction [${this.#t.id}]: executing callback`,this.#t.current);const t=await e(this.#t.current);return await this.set(this.#t.current),t}catch(e){throw $v.info(`SnapStateManager.withTransaction [${this.#t.id}]: error : ${JSON.stringify(e.message)}`),await this.#n(),e}finally{this.#a()}}))}async commit(){if(!this.#t.current||!this.#t.orgState)throw new Error("Failed to commit transaction");this.#t.hasCommitted=!0,await this.set(this.#t.current)}async#r(){this.#t={id:wR(),orgState:await this.get(),current:await this.get(),isRollingBack:!1,hasCommitted:!1}}async#n(){try{this.#t.hasCommitted&&!this.#t.isRollingBack&&this.#t.orgState&&($v.info(`SnapStateManager.rollback [${this.#t.id}]: attempt to rollback state`),this.#t.isRollingBack=!0,await this.set(this.#t.orgState))}catch(e){throw $v.info(`SnapStateManager.rollback [${this.#t.id}]: error : ${JSON.stringify(e)}`),new Error("Failed to rollback state")}}#a(){this.#t.orgState=void 0,this.#t.current=void 0,this.#t.id=void 0,this.#t.isRollingBack=!1,this.#t.hasCommitted=!1}}function ER(e,t){switch(t){case Mh.StarknetChainId.SN_MAIN:return qv.explorer[Mh.StarknetChainId.SN_MAIN].replace("${address}",e);case Mh.StarknetChainId.SN_SEPOLIA:return qv.explorer[Mh.StarknetChainId.SN_SEPOLIA].replace("${address}",e);default:throw new Error("Invalid Chain ID")}}const AR=async e=>{try{await snap.request({method:"snap_dialog",params:{type:"alert",content:e}})}catch{await snap.request({method:"snap_dialog",params:{type:"alert",content:Sk([Xv("You need to update your MetaMask to latest version to use this snap.")])}})}};function _R({label:e,value:t}){return Ek(e,Xv({value:t,markdown:!1}))}function xR(){return lk()}function SR({address:e,chainId:t}){return function({label:e,address:t,chainId:r,shortern:n=!0}){let a=t;return n&&(a=lM(t)),r&&(a=`[${a}](${ER(t,r)})`),_R({label:e,value:a})}({label:"Signer Address",address:e,chainId:t,shortern:!0})}class IR{rpcProvider;constructor(e){this.rpcProvider=nO(e)}async callContract({contractAddress:e,entrypoint:t,calldata:r=[],blockIdentifier:n=Rp.LATEST}){try{return await this.rpcProvider.callContract({contractAddress:e,entrypoint:t,calldata:r},n)}catch(e){if(!e.message.includes(mE))throw new yE(e.message);throw new wE}}}class kR extends Error{}class CR extends vR{async get(){return super.get().then((e=>(e||(e={accContracts:[],erc20Tokens:[],networks:[],transactions:[],transactionRequests:[],currentAccount:{}}),e.transactionRequests||(e.transactionRequests=[]),e.accContracts||(e.accContracts=[]),e.erc20Tokens||(e.erc20Tokens=[]),e.networks||(e.networks=[]),e.transactions||(e.transactions=[]),e.currentAccount||(e.currentAccount={}),e)))}async find(e,t){var r;console.log("StateManager.find() called with filters:",e);const n=t??await this.get();return console.log(n),(null===(r=this.getCollection(n))||void 0===r?void 0:r.find((t=>e.every((e=>e.apply(t))))))??null}async list(e,t,r){var n;const a=r??await this.get();return(null===(n=this.getCollection(a))||void 0===n?void 0:n.filter((t=>e.every((e=>e.apply(t))))).sort(t))??[]}}class TR extends dR{}class BR extends CR{getCollection(e){return e.networks}updateEntity(e,t){jB(e.name,nM()),e.name=t.name,e.nodeUrl=t.nodeUrl}async addDefaultNetworks(e){try{await this.update((async t=>{const r=new Map;for(const e of t.networks){const t=BigInt(e.chainId);r.set(t,e)}for(const n of e){const e=r.get(BigInt(n.chainId));void 0===e?t.networks.push(n):this.updateEntity(e,n)}}))}catch(e){throw new kR(e.message)}}async getNetwork({chainId:e},t){const r=[new TR([e])];return await this.find(r,t)??qv.availableNetworks.find((t=>t.chainId===e))??null}async updateNetwork(e){try{await this.update((async t=>{const r=await this.find([new TR([e.chainId])],t);if(!r)throw new Error("Network does not exist");this.updateEntity(r,e)}))}catch(e){throw new kR(e.message)}}async getCurrentNetwork(e){const{currentNetwork:t}=e??await this.get();return t&&qv.availableNetworks.find((e=>e.chainId===t.chainId))?t:qv.defaultNetwork}async setCurrentNetwork(e){try{await this.update((async t=>{t.currentNetwork=e}))}catch(e){throw new kR(e.message)}}}function MR({txnHash:e,senderAddress:t,chainId:r,command:n}){return{txnHash:e,txnType:Tp.INVOKE,chainId:r,senderAddress:t,contractAddress:"",finalityStatus:Bp.RECEIVED,executionStatus:Bp.RECEIVED,failureReason:"",timestamp:eO(Date.now()),dataVersion:dE.V2,version:3,maxFee:null,actualFee:null,accountCalls:[n]}}var OR;!function(e){e.Get="GET",e.Post="POST"}(OR||(OR={}));class RR{async parseResponse(e){try{return await e.json()}catch(e){throw new Error("API response error: response body can not be deserialised.")}}buildHttpRequest({method:e,headers:t={},url:r,body:n}){return{url:r,method:e,headers:{"Content-Type":"application/json",...t},body:e===OR.Post&&n?JSON.stringify(n):void 0}}async sendHttpRequest({requestName:e="",request:t,responseStruct:r}){const n=`[${this.apiClientName}.${e}]`;try{$v.debug(`${n} request: ${t.method}`);const e={method:t.method,headers:t.headers,body:t.body},a=await fetch(t.url,e),i=await this.parseResponse(a);return $v.debug(`${n} response:`,JSON.stringify(i)),VB(i,r,"Unexpected response from API client"),i}catch(e){throw $v.info(`${n} error: ${e.message}`),e}}}const NR=XB(nM()),PR=XB(JB(nM())),LR=eM({contract_address:nM(),calldata:JB(nM()),selector:nM()}),FR=eM({transaction_hash:nM(),transaction_finality_status:YB(Object.values(Bp)),transaction_execution_status:YB(Object.values(Mp)),transaction_type:YB(Object.values(Tp)),version:QB(),max_fee:NR,actual_fee:NR,nonce:NR,contract_address:NR,calldata:PR,sender_address:NR,timestamp:QB(),revert_error:NR,account_calls:JB(LR)}),DR=eM({next_url:XB(nM()),data:JB(FR)});class UR extends RR{apiClientName="StarkScanClient";limit=100;network;options;deploySelectorName="constructor";constructor(e,t){super(),this.network=e,this.options=t}get baseUrl(){switch(this.network.chainId){case Mh.StarknetChainId.SN_SEPOLIA:return"https://api-sepolia.starkscan.co/api/v0";case Mh.StarknetChainId.SN_MAIN:return"https://api.starkscan.co/api/v0";default:throw new bE}}getApiUrl(e){return console.log(`${this.baseUrl}${e}`),`${this.baseUrl}${e}`}getHttpHeaders(){return{"x-api-key":this.options.apiKey}}async sendApiRequest({apiUrl:e,responseStruct:t,requestName:r}){return await super.sendHttpRequest({request:this.buildHttpRequest({method:OR.Get,url:e,headers:this.getHttpHeaders()}),responseStruct:t,requestName:r})}async getTransactions(e,t){let r=this.getApiUrl(`/transactions?contract_address=${e}&order_by=desc&limit=${this.limit}`);const n=[];let a=!1,i=!0,s=0;for(;i&&(0===s||s>=t);){i=!1;const e=await this.sendApiRequest({apiUrl:r,responseStruct:DR,requestName:"getTransactions"});for(const r of e.data){const e=this.toTransaction(r),i=this.isDeployTransaction(r);i&&(a=!0),s=e.timestamp,(s>=t||i)&&n.push(e)}e.next_url&&(r=e.next_url,i=!0)}if(!a){const t=await this.getDeployTransaction(e);t&&n.push(t)}return n}async getDeployTransaction(e){const t=this.getApiUrl(`/transactions?contract_address=${e}&order_by=asc&limit=5`),r=await this.sendApiRequest({apiUrl:t,responseStruct:DR,requestName:"getTransactions"});for(const e of r.data)if(this.isDeployTransaction(e))return this.toTransaction(e);return null}isDeployTransaction(e){return e.transaction_type===Tp.DEPLOY_ACCOUNT}getContractAddress(e){return e.contract_address??""}getSenderAddress(e){let t=e.sender_address;return this.isDeployTransaction(e)&&(t=e.contract_address),t??""}toTransaction(e){const{transaction_hash:t,transaction_type:r,timestamp:n,transaction_finality_status:a,transaction_execution_status:i,max_fee:s,actual_fee:o,revert_error:c,account_calls:d,version:f}=e,{chainId:u}=this.network,l=this.getSenderAddress(e),h=c??"",p=s??"0";let b;return b=this.isDeployTransaction(e)?function({txnHash:e,senderAddress:t,chainId:r,txnVersion:n}){return{txnHash:zw(e),txnType:Tp.DEPLOY_ACCOUNT,chainId:r,senderAddress:t,contractAddress:t,finalityStatus:Bp.RECEIVED,executionStatus:Bp.RECEIVED,failureReason:"",timestamp:eO(Date.now()),dataVersion:dE.V2,version:n,maxFee:null,actualFee:null,accountCalls:null}}({txnHash:t,senderAddress:l,chainId:u,txnVersion:f}):MR({txnHash:t,senderAddress:l,chainId:u,maxFee:p,calls:d.map((e=>({contractAddress:e.contract_address,entrypoint:e.selector,calldata:e.calldata}))),txnVersion:f}),{...b,timestamp:n,finalityStatus:a,executionStatus:i,actualFee:o,maxFee:p,contractAddress:this.getContractAddress(e),failureReason:h,txnType:r}}}class HR extends dR{}class jR extends oR{_apply(e){const t=e,{accountCalls:r}=t;if(!r)return!1;for(const e in r)if(this.search.has(e.toLowerCase()))return!0;return!1}}class VR extends iR{dataKey="senderAddress"}class $R extends oR{dataKey="txnHash"}class zR extends nR{_apply(e){return void 0!==this.search&&1e3*e.timestamp>=this.search}}class qR extends oR{dataKey="txnType"}class KR extends oR{dataKey="dataVersion"}class GR{finalityStatus;executionStatus;constructor(e,t){this.finalityStatus=new Set(e.map((e=>e.toLowerCase()))),this.executionStatus=new Set(t.map((e=>e.toLowerCase())))}apply(e){let t=!1,r=!1;return this.finalityStatus.size>0&&(t=Object.prototype.hasOwnProperty.call(e,cE.FINALITY)&&e[cE.FINALITY]&&this.finalityStatus.has(e[cE.FINALITY].toLowerCase())),this.executionStatus.size>0&&(r=Object.prototype.hasOwnProperty.call(e,cE.EXECUTION)&&e[cE.EXECUTION]&&this.executionStatus.has(e[cE.EXECUTION].toLowerCase())),t||r}}class JR extends CR{getCollection(e){return e.transactions}updateEntity(e,t){jB(t.executionStatus,YB(Object.values(Mp))),jB(t.finalityStatus,YB(Object.values(Bp))),jB(t.timestamp,QB()),e.executionStatus=t.executionStatus,e.finalityStatus=t.finalityStatus,e.timestamp=t.timestamp,e.failureReason=t.failureReason}#i(e){return`${BigInt(e.chainId)}&${BigInt(e.txnHash)}`}async findTransactions({txnHash:e,txnType:t,chainId:r,senderAddress:n,contractAddress:a,executionStatus:i,finalityStatus:s,timestamp:o,dataVersion:c=[dE.V2]},d){const f=[];return void 0!==c&&c.length>0&&f.push(new KR(c)),void 0!==e&&e.length>0&&f.push(new $R(e)),void 0!==r&&r.length>0&&f.push(new HR(r)),void 0!==o&&f.push(new zR(o)),void 0!==n&&n.length>0&&f.push(new VR(n)),void 0!==a&&a.length>0&&f.push(new jR(a)),void 0!==t&&t.length>0&&f.push(new qR(t)),void 0===s&&void 0===i||f.push(new GR(s??[],i??[])),this.list(f,((e,t)=>t.timestamp-e.timestamp),d)}async getTransaction({txnHash:e,chainId:t},r){const n=[new $R([e])];return void 0!==t&&n.push(new HR([t])),this.find(n,r)}async updateTransaction(e){try{await this.update((async t=>{const r=await this.getTransaction({txnHash:e.txnHash,chainId:e.chainId},t);if(!r)throw new Error("Transaction does not exist");this.updateEntity(r,e)}))}catch(e){throw new kR(e.message)}}async addTransaction(e){try{console.log("TransactionStateManager addTransaction()",e),await this.update((async t=>{const r=await this.getTransaction({txnHash:e.txnHash,chainId:e.chainId},t);if(console.log("dataInState",r),r)throw new Error("Transaction already exist");t.transactions.push({...e,txnHash:e.txnHash}),console.log("TransactionStateManager addTransaction() pushed")}))}catch(e){throw new kR(e.message)}}async removeTransactions(e){try{await this.update((async t=>{const r=await this.findTransactions(e,t),n=new Set(r.map((e=>this.#i(e))));t.transactions=t.transactions.filter((e=>!n.has(this.#i(e))))}))}catch(e){throw new kR(e.message)}}}class WR{dataClient;txnStateMgr;network;constructor({dataClient:e,txnStateMgr:t=new JR,network:r}){this.dataClient=e,this.network=r,this.txnStateMgr=t}async*getTransactionsOnChain(e,t,r){const n=eO(Date.now())-24*r*60*60;const a=await this.dataClient.getTransactions(e,n);yield*this.filterTransactionsByContractAddress(a,t)}async*getTransactionsOnState(e,t){const r=await this.txnStateMgr.findTransactions({senderAddress:[e],chainId:[this.network.chainId],finalityStatus:[Bp.RECEIVED],dataVersion:[dE.V2]});yield*this.filterTransactionsByContractAddress(r,t)}async*filterTransactionsByContractAddress(e,t){for(const r of e)(this.hasMatchingContractOrIsDeploy(r,t)||r.failureReason)&&(yield r)}hasMatchingContractOrIsDeploy(e,t){const r=e.txnType===Tp.DEPLOY_ACCOUNT,{accountCalls:n}=e,a=n&&Object.prototype.hasOwnProperty.call(n,t);return r||a}async getTransactions(e,t,r){const n=[],a=[],i=[],s=new Set;for await(const a of this.getTransactionsOnChain(e,t,r))n.push(a),s.add(a.txnHash);for await(const r of this.getTransactionsOnState(e,t))s.has(r.txnHash)?i.push(r.txnHash):a.push(r);return i.length>0&&await this.txnStateMgr.removeTransactions({txnHash:i}),a.concat(n)}}class YR{_version;_balance;_address;publicKey;contractReader;contractMethodMap={getVersion:"getVersion"};constructor(e,t){this.publicKey=e,this.contractReader=t}get callData(){return this.getCallData()}get deployPayload(){return{classHash:this.classhash,contractAddress:this.address,constructorCalldata:this.callData,addressSalt:this.publicKey}}get address(){return void 0===this._address&&(this._address=this.calculateAddress()),this._address}calculateAddress(){return $w(oy.calculateContractAddressFromHash(this.publicKey,this.classhash,this.callData,0))}async getVersion(e=!1){return(e||void 0===this._version)&&(this._version=await this.contractReader.getVersion(this)),this._version}async getEthBalance(e=!1){return(e||void 0===this._balance)&&(this._balance=await this.contractReader.getEthBalance(this)),this._balance}async isDeployed(e=!1){try{return await this.getVersion(e),!0}catch(e){if(e instanceof wE)return!1;throw e}}async isUpgraded(e=!1){const t=await this.getVersion(e);return SO(t)}async isRequireUpgrade(){try{return!await this.isUpgraded()}catch(e){if(e instanceof wE)return!1;throw e}}async isRequireDeploy(){return this.cairoVerion.toString()===Dv&&!await this.isDeployed()&&await this.getEthBalance()>BigInt(0)}static fromAccountContract(e){const t=new this(e.publicKey,e.contractReader);return t.calculateAddress=t.calculateAddress.bind(e),t._balance=e._balance,t._version=e._version,t}}class ZR extends YR{cairoVerion=0;classhash=Pv;getCallData(){return sy.compile({implementation:Tv,selector:oy.getSelectorFromName("initialize"),calldata:sy.compile({signer:this.publicKey,guardian:"0"})})}}class XR extends YR{cairoVerion=1;classhash=Bv;getCallData(){return sy.compile({signer:this.publicKey,guardian:"0"})}}class QR extends IR{async getVersion(e){const t=await this.callContract({contractAddress:e.address,entrypoint:e.contractMethodMap.getVersion});return XM(t[0])}async getEthBalance(e){console.log("getEthBalance");const t=await this.callContract({contractAddress:Rv.address,entrypoint:"balanceOf",calldata:[e.address]});return BigInt(t[0])}}class eN{defaultContractCtor=XR;contractCtors=[XR,ZR];network;constructor(e){this.network=e}async getContract(e){const t=new QR(this.network),r=this.defaultContractCtor,n=await Promise.all(this.contractCtors.map((async n=>{const a=new n(e,t);return await a.isDeployed()?await a.isUpgraded()?r.fromAccountContract(a):a:await a.isRequireDeploy()?a:null})));for(const e of n)if(null!==e)return e;return new r(e,t)}}const tN=(e=0)=>{if(e<0)throw new Error("hdIndex cannot be negative.");return`Account ${e+1}`};class rN extends sR{dataKey="addressIndex"}class nN extends cR{}class aN extends dR{}class iN extends CR{getCollection(e){return e.accContracts}updateEntity(e,t){e.deployTxnHash=t.deployTxnHash,void 0!==t.upgradeRequired&&(e.upgradeRequired=t.upgradeRequired),void 0!==t.deployRequired&&(e.deployRequired=t.deployRequired),void 0!==t.cairoVersion&&(e.cairoVersion=t.cairoVersion),void 0!==t.accountName&&(e.accountName=t.accountName)}async getAccount({address:e,chainId:t,addressIndex:r},n){try{if(console.log("getAccount()",{address:e,addressIndex:r,chainId:t}),void 0===e&&void 0===r)throw new Error("Address or addressIndex must be provided");const a=[new aN([t])];return console.log("filters",a),void 0!==e&&a.push(new nN([e])),console.log("filters after address",a),void 0!==r&&a.push(new rN([r])),console.log("filters after addressIndex",a),this.find(a,n)}catch(e){throw console.error("getAccount error",e),new kR(e.message)}}async findAccounts({chainId:e},t){return(await this.list([new aN([e])],((e,t)=>e.addressIndex-t.addressIndex),t)).map((e=>({...e,accountName:e.accountName??tN(e.addressIndex)})))}async updateAccountByAddress(e){try{await this.update((async t=>{var r;console.log("updateAccountByAddress()",e);const{chainId:n,address:a}=e,i=await this.getAccount({address:a,chainId:n},t);if(console.log("updateAccountByAddress accountInState",i),!i)throw new Error("Account does not exists");const s=null===(r=e.accountName)||void 0===r?void 0:r.trim();if(s&&s!==i.accountName&&await this.isAccountNameExist({accountName:s,chainId:n},t))throw new Error("Account name already exists");console.log("updateAccountByAddress updating entity..."),this.updateEntity(i,{...e,accountName:s}),console.log("updateAccountByAddress entity updated.")}))}catch(e){throw new kR(e.message)}}async addAccount(e){try{await this.update((async t=>{var r;const{chainId:n,address:a,addressIndex:i}=e;if(await this.isAccountExist({address:a,addressIndex:i,chainId:n},t))throw new Error("Account already exists");const s=null===(r=e.accountName)||void 0===r?void 0:r.trim();if(s&&await this.isAccountNameExist({accountName:s,chainId:n},t))throw new Error("Account name already exists");t.accContracts.push({...e,accountName:s})}))}catch(e){throw new kR(e.message)}}async updateAccountAsDeploy({address:e,chainId:t,transactionHash:r}){try{await this.update((async n=>{const a=await this.getAccount({address:e,chainId:t},n);if(!a)throw new kR("Account does not exist");a.upgradeRequired=!1,a.deployRequired=!1,a.deployTxnHash=r}))}catch(e){throw new kR(e.message)}}async getNextIndex(e,t){return(await this.findAccounts({chainId:e},t)).length}async getCurrentAccount({chainId:e},t){var r;return(null===(r=(t??await this.get()).currentAccount)||void 0===r?void 0:r[e])??null}async switchAccount({chainId:e,accountToSwitch:t}){try{await this.update((async r=>{const{chainId:n,address:a}=t;if(e!==n)throw new Error("Account to switch is not in the same chain");if(!await this.getAccount({address:a,chainId:n},r))throw new Error("Account does not exist");this.#s(t,r)}))}catch(e){throw new kR(e.message)}}async isAccountExist({address:e,addressIndex:t,chainId:r},n){const a=n??await this.get();return void 0!==this.getCollection(a).find((n=>(n.address===e||n.addressIndex===t)&&n.chainId===r))}async isAccountNameExist({accountName:e,chainId:t},r){const n=r??await this.get();return void 0!==this.getCollection(n).find((r=>{var n;return(null===(n=r.accountName)||void 0===n?void 0:n.trim())===e&&r.chainId===t}))}#s(e,t){const{chainId:r}=e;t.currentAccount=t.currentAccount??{},t.currentAccount[r]=e}async setCurrentAccount(e){await this.update((async t=>{this.#s(e,t)}))}}const sN={accountName:tN(0)};function oN(e){if(e instanceof Uint8Array)return e;if("string"!=typeof e)throw new Error("Unsupported publicKey type");return/[^0-9a-fA-F]/.test(e.replace(/^0x/,""))?function(e){const t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}(e):function(e){if(e.startsWith("0x")&&(e=e.slice(2)),e.length%2!=0)throw new Error(`Invalid hex string length: ${e.length}`);const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++)t[r]=parseInt(e.slice(2*r,2*r+2),16);return t}(e)}function cN(e,t){const r=function(e,t){const r=new Uint8Array(4+t.length);return r[0]=e>>>24&255,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=255&e,r.set(t,4),r}(e,t),n=I_(r),a=new Uint8Array([18,32]),i=new Uint8Array(a.length+n.length);return i.set(a,0),i.set(n,a.length),function(e){return Array.from(e).map((e=>e.toString(16).padStart(2,"0"))).join("")}(i)}function dN(e){let t;console.log("createPartyIdFromKey",e),t="string"==typeof e||e instanceof Uint8Array?function(e){return{format:3,publicKey:oN(e),scheme:1,keySpec:1,usage:[]}}(e):{...e,publicKey:oN(e.publicKey)};const r=cN(12,t.publicKey);let n="snap";return console.log(qv.snapEnv.toString()),"dev"==qv.snapEnv.toString()&&(n="nodefortress"),n+"::"+r}class fN{privateKey;publicKey;address;chainId;hdIndex;addressSalt;metadata=Object.assign({},sN);constructor(e){console.log("Account constructor",e),this.privateKey=e.privateKey,this.publicKey=e.publicKey,this.chainId=e.chainId,this.hdIndex=e.hdIndex,this.addressSalt=e.addressSalt,this.address=dN(e.publicKey),this.#o(e.jsonData)}#o(e){e?void 0===e.accountName?this.metadata.accountName=tN(this.hdIndex):this.metadata.accountName=e.accountName:this.metadata.accountName=tN(this.hdIndex)}async serialize(){console.log("serialize()");const e=await CB.isDeployed(this.address);return console.log("serialize() isDeployed",e),{addressSalt:this.publicKey,publicKey:this.publicKey,address:this.address,addressIndex:this.hdIndex,chainId:this.chainId,isDeployed:e,deployRequired:!0,upgradeRequired:!1,accountName:this.metadata.accountName}}}class uN{network;accountStateMgr;accountContractDiscoveryService;constructor({network:e,accountStateMgr:t=new iN}){this.network=e,this.accountStateMgr=t,this.accountContractDiscoveryService=new eN(e)}async getNextIndex(){const{chainId:e}=this.network;return await this.accountStateMgr.getNextIndex(e)}async deriveAccountByIndex(e,t){console.log("deriveAccountByIndex()",e);const r=await kk(),n=await r(e),a=Tt().sign.keyPair.fromSeed(n.privateKey),i=Mt().encodeBase64(a.publicKey),s=Mt().encodeBase64(a.secretKey);console.log("getting Account()...");const o=new fN({privateKey:s,publicKey:i,chainId:this.network.chainId,hdIndex:e,addressSalt:i,jsonData:t});return console.log("got Account:",o),o}async deriveAccountByAddress(e){return await this.accountStateMgr.withTransaction((async t=>{console.log("deriveAccountByAddress()",e);const r=await this.accountStateMgr.getAccount({address:e,chainId:this.network.chainId},t);if(console.log("deriveAccountByAddress accountFromState",r),!r)throw new gE;const n=await this.deriveAccountByIndex(r.addressIndex,r);return console.log("deriveAccountByAddress account",n),this.ensureAccountAddressMatch(n,r.address),console.log("deriveAccountByAddress ensured match"),await this.accountStateMgr.updateAccountByAddress(await n.serialize()),console.log("deriveAccountByAddress returning account"),n}))}async getCurrentAccount(){const{chainId:e}=this.network;return console.log("getCurrentAccount()"),await this.accountStateMgr.withTransaction((async t=>{var r;const n=await this.accountStateMgr.getCurrentAccount({chainId:e},t),a=(null===(r=n)||void 0===r?void 0:r.addressIndex)??qv.account.defaultAccountIndex,i=await this.accountStateMgr.getAccount({chainId:e,addressIndex:a},t);if(n&&!i)throw $v.error("Account in state is missing, but current account has been set."),new gE;const s=await this.deriveAccountByIndex(a,i??void 0),o=await s.serialize();return console.log("accountJsonData",o),null===i?(await this.accountStateMgr.addAccount(o),await this.accountStateMgr.setCurrentAccount(o)):this.ensureAccountAddressMatch(s,i.address),console.log("returning account..."),console.log(s),s}))}async switchAccount(e){const{chainId:t}=this.network;await this.accountStateMgr.switchAccount({chainId:t,accountToSwitch:await e.serialize()})}async addAccount(e){const{chainId:t}=this.network;return await this.accountStateMgr.withTransaction((async r=>{const n=await this.accountStateMgr.getNextIndex(t,r),a=await this.deriveAccountByIndex(n,e),i=await a.serialize();return await this.accountStateMgr.addAccount(i),await this.accountStateMgr.setCurrentAccount(i),a}))}ensureAccountAddressMatch(e,t){if(e.address!==t)throw new IE}}function lN(e,t){const r=function(e){const{apiKey:t}=qv.dataClient[zv.STARKSCAN];if(!t)throw new Error("Missing StarkScan API key");return new UR(e,{apiKey:t})}(e);return new WR({dataClient:r,network:e,txnStateMgr:t})}function hN(e,t){return new uN({network:e,accountStateMgr:t})}const pN=new class{networkStateMgr;constructor(){this.networkStateMgr=new BR}async execute(){try{const e=await this.networkStateMgr.getCurrentNetwork(),t=hN(e),r=await t.getCurrentAccount(),n="0";return console.log("building components..."),this.buildComponents(r.address,e,n)}catch(e){throw $v.error("Failed to execute onHomePage",Kv(e)),new it("Failed to initialize Snap HomePage")}}async getBalance(e,t){const r=Rv,n=await(0,A.getBalance)(t,r.address,e,Uv.Pending);return tR.formatUnits(rR.gH.from(n),r.decimals)}buildComponents(e,t,r){const n=DE(),a=[];return a.push(Xv(n("address"))),a.push(eE(`${e}`)),a.push(Ek(n("network"),Xv(`${t.name}`))),a.push(lk()),a.push(Xv(n("visitCompanionDappHomePage",PO()))),{content:Sk(a)}}};const bN=xt("Container"),gN=xt("Section");var yN;!function(e){e.AddSquare="add-square",e.Add="add",e.Arrow2Down="arrow-2-down",e.Arrow2Left="arrow-2-left",e.Arrow2Right="arrow-2-right",e.Arrow2Up="arrow-2-up",e.Arrow2UpRight="arrow-2-up-right",e.ArrowDoubleLeft="arrow-double-left",e.ArrowDoubleRight="arrow-double-right",e.ArrowDown="arrow-down",e.ArrowLeft="arrow-left",e.ArrowRight="arrow-right",e.ArrowUp="arrow-up",e.BankToken="bank-token",e.Bank="bank",e.Book="book",e.Bookmark="bookmark",e.Bridge="bridge",e.Calculator="calculator",e.CardPos="card-pos",e.CardToken="card-token",e.Card="card",e.Category="category",e.Chart="chart",e.CheckBold="check-bold",e.Check="check",e.Clock="clock",e.Close="close",e.CodeCircle="code-circle",e.Coin="coin",e.Confirmation="confirmation",e.Connect="connect",e.CopySuccess="copy-success",e.Copy="copy",e.Customize="customize",e.Danger="danger",e.Dark="dark",e.Data="data",e.Diagram="diagram",e.DocumentCode="document-code",e.DragDrop="drag-drop",e.DraggingAnimation="dragging-animation",e.PinningAnimation="pinning-animation",e.Edit="edit",e.Eraser="eraser",e.Ethereum="ethereum",e.Expand="expand",e.Explore="explore",e.Export="export",e.EyeSlash="eye-slash",e.Eye="eye",e.Filter="filter",e.Flag="flag",e.FlashSlash="flash-slash",e.Flash="flash",e.FullCircle="full-circle",e.Gas="gas",e.GlobalSearch="global-search",e.Global="global",e.Graph="graph",e.Hardware="hardware",e.Heart="heart",e.Hierarchy="hierarchy",e.Home="home",e.Import="import",e.Info="info",e.Key="key",e.Light="light",e.Link="link",e.Loading="loading",e.LockCircle="lock-circle",e.LockSlash="lock-slash",e.Lock="lock",e.Login="login",e.Logout="logout",e.Menu="menu",e.MessageQuestion="message-question",e.Messages="messages",e.MinusBold="minus-bold",e.MinusSquare="minus-square",e.Minus="minus",e.Mobile="mobile",e.Money="money",e.Monitor="monitor",e.MoreHorizontal="more-horizontal",e.MoreVertical="more-vertical",e.NotificationCircle="notification-circle",e.Notification="notification",e.PasswordCheck="password-check",e.People="people",e.Pin="pin",e.ProgrammingArrows="programming-arrows",e.Custody="custody",e.Question="question",e.Received="received",e.Refresh="refresh",e.Save="save",e.ScanBarcode="scan-barcode",e.ScanFocus="scan-focus",e.Scan="scan",e.Scroll="scroll",e.Search="search",e.SecurityCard="security-card",e.SecurityCross="security-cross",e.SecurityKey="security-key",e.SecuritySearch="security-search",e.SecuritySlash="security-slash",e.SecurityTick="security-tick",e.SecurityTime="security-time",e.SecurityUser="security-user",e.Security="security",e.Send1="send-1",e.Send2="send-2",e.Setting="setting",e.Slash="slash",e.SnapsMobile="snaps-mobile",e.SnapsPlus="snaps-plus",e.Snaps="snaps",e.Speedometer="speedometer",e.Star="star",e.Stake="stake",e.Student="student",e.SwapHorizontal="swap-horizontal",e.SwapVertical="swap-vertical",e.Tag="tag",e.Tilde="tilde",e.Timer="timer",e.Trash="trash",e.TrendDown="trend-down",e.TrendUp="trend-up",e.UserCircleAdd="user-circle-add",e.UserCircleLink="user-circle-link",e.UserCircleRemove="user-circle-remove",e.UserCircle="user-circle",e.User="user",e.WalletCard="wallet-card",e.WalletMoney="wallet-money",e.Wallet="wallet",e.Warning="warning",e.Twitter="twitter",e.QrCode="qr-code",e.UserCheck="user-check",e.Unpin="unpin",e.Ban="ban",e.Bold="bold",e.CircleX="circle-x",e.Download="download",e.FileIcon="file",e.Flask="flask",e.Plug="plug",e.Share="share",e.Square="square",e.Tint="tint",e.Upload="upload",e.Usb="usb",e.Wifi="wifi",e.PlusMinus="plus-minus"}(yN||(yN={}));const mN=xt("Icon"),wN=xt("Divider"),vN=xt("Row"),EN=({label:e,data:t})=>_(vN,{label:e,children:_(It,{children:Kv(t)})}),AN=({label:e,address:t,chainId:r,shortern:n=!0})=>{const a=n?lM(t):t;return _(vN,{label:e,children:r?_(kt,{href:ER(t,r),children:a}):_(It,{children:a})})},_N=({networkName:e})=>{const t=DE();return _(vN,{label:t("network"),children:_(It,{children:e})})},xN=({address:e,chainId:t})=>{const r=DE();return _(AN,{label:r("signerAddress"),address:e,chainId:t,shortern:!0})};var SN=a(9454);const IN=({label:e,amount:t,decimals:r,symbol:n})=>_(vN,{label:e,children:_(It,{children:`${(0,SN.formatUnits)(t,r)} ${n}`})}),kN=({signer:e,chainId:t,networkName:r,maxFee:n,calls:a,selectedFeeToken:i,includeDeploy:s})=>{const o=DE(),c=HN(a,n,i);return _(bN,{children:x(St,{children:[x(gN,{children:[_(_N,{networkName:r}),_(xN,{address:e,chainId:t})]}),a.map((e=>x(gN,{children:[_(AN,{label:o("contract"),address:e.contractAddress,chainId:t}),e.tokenTransferData?x(gN,{children:[_(AN,{label:o("recipient"),address:e.tokenTransferData.recipientAddress,chainId:t}),_(IN,{label:o("amount"),amount:e.tokenTransferData.amount,decimals:e.tokenTransferData.decimals,symbol:e.tokenTransferData.symbol})]}):_(EN,{label:o("call"),data:e.calldata})]}))),x(gN,{children:[_(mN,{name:"gas",size:"md"}),_(IN,{label:o("networkFee"),amount:n,decimals:18,symbol:i}),_(wN,{}),_(mN,{name:"money",size:"md"}),_(St,{direction:"vertical",children:Object.entries(c).map((([e,{amount:t,decimals:r}])=>_(IN,{label:`${o("totalFor")} ${e}`,amount:t.toString(),decimals:r,symbol:e})))}),s?_(wN,{}):null,s?x(St,{direction:"horizontal",children:[_(mN,{name:"warning",size:"md"}),_(It,{children:o("accountDeploymentNotice")})]}):null]})]})})},CN=xt("Heading"),TN=xt("Copyable"),BN=()=>{const e=DE();return x(St,{children:[_(CN,{children:"Are you sure you want to reveal your private key?"}),x(St,{direction:"horizontal",children:[_(mN,{name:"warning",size:"md"}),_(It,{children:e("confirmPrivateKeyToDisplay")})]})]})},MN=({privateKey:e})=>{const t=DE();return x(St,{children:[_(CN,{children:t("starknetPrivateKey")}),_(It,{children:t("starknetPrivateKeyConfidential")}),_(TN,{value:e})]})},ON=({senderAddress:e,networkName:t,chainId:r,declareTransactions:n})=>{const a=DE();return x(St,{children:[_(CN,{children:a("signTransactionPrompt")}),x(gN,{children:[_(AN,{label:a("signer"),address:e,chainId:r}),_(_N,{networkName:t}),_(EN,{label:a("declareTransactionDetails"),data:n})]})]})},RN=({address:e,chainId:t,typedDataMessage:r})=>{const n=DE();return x(St,{children:[_(CN,{children:n("signMessagePrompt")}),x(gN,{children:[_(xN,{address:e,chainId:t}),_(EN,{label:n("message"),data:r})]})]})},NN=({senderAddress:e,networkName:t,chainId:r,transactions:n})=>{const a=DE();return x(St,{children:[_(CN,{children:a("signTransactionPrompt")}),x(gN,{children:[_(AN,{label:a("signer"),address:e,chainId:r}),_(_N,{networkName:t}),_(EN,{label:a("transactions"),data:n})]})]})},PN=xt("Bold"),LN=({name:e,chainId:t})=>{const r=DE();return x(St,{children:[_(CN,{children:r("switchNetworkPrompt")}),_(_N,{networkName:e}),x(St,{direction:"horizontal",alignment:"space-between",children:[_(PN,{children:r("chainId")}),_(TN,{value:t})]})]})},FN=({networkName:e,chainId:t,token:r})=>{const n=DE(),{name:a,symbol:i,address:s,decimals:o}=r;return x(St,{children:[_(CN,{children:n("signTransactionPrompt")}),_(wN,{}),_(_N,{networkName:e}),x(gN,{children:[_(AN,{label:n("token"),address:s,chainId:t}),x(gN,{children:[a?_(vN,{label:n("name"),children:_(It,{children:a})}):null,i?_(vN,{label:n("symbol"),children:_(It,{children:i})}):null,null!==o&&_(vN,{label:n("decimals"),children:_(It,{children:o.toString()})})]})]})]})},DN=xt("Spinner"),UN=()=>x(St,{alignment:"space-between",center:!0,children:[_(CN,{children:"please wait..."}),_(DN,{})]});const HN=(e,t,r)=>e.reduce(((e,t)=>{if(t.tokenTransferData){const r=BigInt(t.tokenTransferData.amount);e[t.tokenTransferData.symbol]||(e[t.tokenTransferData.symbol]={amount:BigInt(0),decimals:t.tokenTransferData.decimals}),e[t.tokenTransferData.symbol].amount+=r}return e}),{[r]:{amount:BigInt(t),decimals:18}});async function jN(e,t,r){const{signer:n,chainId:a,networkName:i,maxFee:s,calls:o,selectedFeeToken:c,includeDeploy:d}=t;await snap.request({method:"snap_updateInterface",params:{id:e,ui:_(kN,{signer:n,chainId:a,networkName:i,maxFee:s,calls:o,selectedFeeToken:c,includeDeploy:d,...r})}})}async function VN(e){await async function(e,t){await snap.request({method:"snap_updateInterface",params:{id:e,ui:t}})}(e,_(UN,{}))}class $N{async preExecute(e){$v.info(`preExecute Request: ${JSON.stringify(e)}`),function(e,t){console.log("validateRequest called with params:",e),console.log("validateRequest called with params:",t);try{jB(e,t)}catch(e){throw console.error("validateRequest error",e),new EE(e.message)}}(e,this.requestStruct)}async postExecute(e){$v.info(`postExecute Response: ${JSON.stringify(e)}`),function(e,t){console.log("validateResponse called with response:",e),console.log("validateResponse struct:",t);try{jB(e,t)}catch(e){throw console.error("validateResponse error",e),new AE("Invalid Response")}}(e,this.responseStruct)}async execute(e){await this.preExecute(e);const t=await this.handleRequest(e);return await this.postExecute(t),t}}class zN extends $N{network;networkStateMgr;constructor(){super(),this.networkStateMgr=new BR}async getNetwork(e){const t=await this.networkStateMgr.getNetwork({chainId:e});if(!t)throw new bE;return t}async preExecute(e){await super.preExecute(e);const{chainId:t}=e;this.network=await this.getNetwork(t)}}class qN extends zN{account;options;defaultOptions={showInvalidAccountAlert:!0};constructor(e){super(),this.options=Object.assign({},this.defaultOptions,e)}async preExecute(e){await super.preExecute(e);const{address:t}=e,r=hN(this.network);this.account=await r.deriveAccountByAddress(t)}async displayAlert(e){const{showInvalidAccountAlert:t}=this.options;e instanceof hE?t&&await JO():e instanceof pE&&t&&await WO()}}const KN=qB(eM({address:nM()}),xM),GN=function(e){const t=LB(e),r=typeof e;return new HB({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||`Expected the literal \`${t}\`, but received: ${LB(r)}`})}(null);const JN=new class extends qN{requestStruct=KN;responseStruct=GN;async execute(e){return super.execute(e)}async handleRequest(e){if(console.log("DisplayPrivateKeyRpc() params",e),!await async function(){return await snap.request({method:"snap_dialog",params:{type:ZI.Confirmation,content:_(BN,{})}})}())throw new vE;return console.log("DisplayPrivateKeyRpc() this.account",this.account),await async function(e){await snap.request({method:"snap_dialog",params:{type:ZI.Alert,content:_(MN,{privateKey:e})}})}(this.account.privateKey),null}}({showInvalidAccountAlert:!1}),WN=qB(eM({address:nM(),invocations:JM,details:tM(WM)}),xM),YN=eM({fee:nM()});const ZN=new class extends qN{requestStruct=WN;responseStruct=YN;async execute(e){return console.log("EstimateFeeRpc execute called with params:",e),super.execute(e)}async handleRequest(e){console.log("EstimateFeeRpc handleRequest called with params:",e);const{address:t,invocations:r,details:n}=e,a=await CB.getTrafficEstimate(t,r,n);return console.log("handleRequest returning estimate..."),{fee:a.trafficCostEstimate}}}({showInvalidAccountAlert:!1});class XN extends oR{dataKey="id"}class QN extends oR{dataKey="interfaceId"}class eP extends CR{getCollection(e){return e.transactionRequests??[]}updateEntity(e,t){e.maxFee=t.maxFee,e.selectedFeeToken=t.selectedFeeToken,e.resourceBounds={...t.resourceBounds}}async getTransactionRequest({requestId:e,interfaceId:t},r){const n=[];if(e&&n.push(new XN([e])),t&&n.push(new QN([t])),0===n.length)throw new kR("At least one search condition must be provided");return await this.find(n,r)}async upsertTransactionRequest(e){try{await this.update((async t=>{const r=await this.getTransactionRequest({requestId:e.id},t);var n;null===r?null===(n=this.getCollection(t))||void 0===n||n.push(e):this.updateEntity(r,e)}))}catch(e){throw new kR(e.message)}}async removeTransactionRequest(e){try{await this.update((async t=>{const r=this.getCollection(t).length;t.transactionRequests=this.getCollection(t).filter((t=>t.id!==e)),r===this.getCollection(t).length&&$v.warn(`TransactionRequest with id ${e} does not exist`)}))}catch(e){throw new kR(e.message)}}}class tP extends fR{}class rP extends uR{}class nP extends uR{}class aP extends CR{getCollection(e){return e.erc20Tokens}updateEntity(e,t){jB(t.name,dM(nM())),jB(t.symbol,dM(nM())),jB(t.decimals,cM(QB(),0)),e.name=t.name,e.symbol=t.symbol,e.decimals=t.decimals}#i(e){return`${e.instrumentAdmin}&${e.id}&${e.chainId}`}async addDefaultTokens(e){try{await this.update((async t=>{const r=new Map;for(const e of t.erc20Tokens)r.set(this.#i(e),e);for(const n of e){const e=r.get(this.#i(n));void 0===e?t.erc20Tokens.push(n):this.updateEntity(e,n)}}))}catch(e){throw new kR(e.message)}}async getToken({instrumentAdmin:e,id:t,chainId:r},n){const a=[new tP([e]),new rP([t]),new nP([r])];return await this.find(a,n)}async updateToken(e){try{await this.update((async t=>{const r=await this.getToken({instrumentAdmin:e.instrumentAdmin,id:e.id,chainId:e.chainId},t);if(!r)throw new Error("Token does not exist");this.updateEntity(r,e)}))}catch(e){throw new kR(e.message)}}async addToken(e){try{await this.update((async t=>{if(await this.getToken({instrumentAdmin:e.instrumentAdmin,id:e.id,chainId:e.chainId},t))throw new Error("Token already exist");t.erc20Tokens.push(e)}))}catch(e){throw new kR(e.message)}}async getEthToken({chainId:e},t){const r=this.#c(e);return r?await this.getToken({instrumentAdmin:r,chainId:e,id:"Amulet"},t):null}#c(e){return e===Mh.StarknetChainId.SN_MAIN?Rv.instrumentAdmin:""}async upsertToken(e){try{await this.update((async t=>{const r=await this.getToken({instrumentAdmin:e.instrumentAdmin,chainId:e.chainId,id:e.id},t);r?this.updateEntity(r,e):t.erc20Tokens.push(e)}))}catch(e){throw new kR(e.message)}}}const iP=qB(eM({address:nM(),command:GB(),preparedTx:GB()}),xM),sP=eM({transaction_hash:nM()});const oP=new class extends qN{txnStateManager;reqStateManager;accStateManager;tokenStateManager;requestStruct=iP;responseStruct=sP;constructor(e){super(e),this.txnStateManager=new JR,this.reqStateManager=new eP,this.accStateManager=new iN,this.tokenStateManager=new aP}async execute(e){return console.log("ExecuteTxnRpc execute() called with params:",e),super.execute(e)}async handleRequest(e){console.log("ExecuteTxnRpc handleRequest() called with params:",e);const{address:t,command:r,preparedTx:n}=e,a=await this.sendTransaction({address:t,command:r,preparedTx:n});return console.log("Transaction hash for execute:",a),await this.saveDataToState({txnHashForExecute:a,address:t,command:r}),console.log("Data saved..."),{transaction_hash:a}}async confirmTransaction({command:e,address:t,maxFee:r,resourceBounds:n,includeDeploy:a}){const i=wR(),{chainId:s,name:o}=this.network,{hdIndex:c}=this.account,d={chainId:s,networkName:o,id:i,interfaceId:"",type:Tp.INVOKE,signer:t,addressIndex:c,maxFee:r,calls:[e],selectedFeeToken:TB.STRK,includeDeploy:a},f=await async function(e){const{signer:t,chainId:r,networkName:n,maxFee:a,calls:i,selectedFeeToken:s,includeDeploy:o}=e;return await snap.request({method:"snap_createInterface",params:{ui:_(kN,{signer:t,chainId:r,networkName:n,maxFee:a,calls:i,selectedFeeToken:s,includeDeploy:o}),context:{request:JSON.parse(JSON.stringify(e))}}})}(d);d.interfaceId=f,await this.reqStateManager.upsertTransactionRequest(d);try{if(!await async function(e){return snap.request({method:"snap_dialog",params:{type:ZI.Confirmation,id:e}})}(f))throw new vE;const e=await this.reqStateManager.getTransactionRequest({requestId:i});if(!e)throw new Error("Failed to retrieve the updated transaction request");return e}finally{await this.removeTransactionRequestSafe(i)}}async removeTransactionRequestSafe(e){try{await this.reqStateManager.removeTransactionRequest(e)}catch(e){$v.error("Failed to remove transaction request",e)}}async sendTransaction({address:e,command:t,preparedTx:r}){console.log("ExecuteTxnRpc sendTransaction()");const{privateKey:n}=this.account;try{var a;const i=await dO(this.network,e,n,t,r);if(!(null===(a=i)||void 0===a?void 0:a.updateId))throw new Error("Failed to execute transaction");return i.updateId}catch(e){throw new Error(`Failed to execute transaction: ${e instanceof Error?e.message:"Unknown error"}`)}}async saveDataToState({txnHashForExecute:e,address:t,command:r}){const{chainId:n}=this.network;console.log("ExecuteTxnRpc saveDataToState()"),await this.txnStateManager.addTransaction(MR({senderAddress:t,txnHash:e,chainId:n,command:r}))}}({showInvalidAccountAlert:!0});var cP=a(4890),dP=a.n(cP);const fP=qB(eM({address:bM,payload:zM,details:tM(WM)}),xM),uP=eM({transaction_hash:nM(),class_hash:nM()});const lP=new class extends qN{requestStruct=fP;responseStruct=uP;async preExecute(e){QM(e,{senderAddress:"address",invocationsDetails:"details",contractPayload:"payload"}),await super.preExecute(e)}async execute(e){return super.execute(e)}async handleRequest(e){const{payload:t,details:r,address:n}=e;if(!await this.getDeclareContractConsensus(e))throw new vE;return await sO(this.network,n,this.account.privateKey,t,r)}async getDeclareContractConsensus(e){var t;const r=DE(),{payload:n,details:a,address:i}=e,s=[];var o;s.push((o=r("signTransactionPrompt"),rE(o))),s.push(SR({address:i,chainId:this.network.chainId})),s.push(xR()),s.push(function({networkName:e}){return _R({label:"Network",value:e})}({networkName:this.network.name}));const{compiledClassHash:c,classHash:d}=n;if(c&&(s.push(xR()),s.push(_R({label:r("compiledClassHash"),value:c}))),d&&(s.push(xR()),s.push(_R({label:r("classHash"),value:d}))),null===(t=a)||void 0===t?void 0:t.maxFee){const e=dP()(a.maxFee,"wei","ether");s.push(xR()),s.push(_R({label:r("maxFeeETH"),value:e}))}return await async function(e){return snap.request({method:"snap_dialog",params:{type:ZI.Confirmation,content:Sk(e)}})}(s)}}({showInvalidAccountAlert:!0}),hP=qB(eM({address:bM,typedDataMessage:AM}),_M,xM),pP=JB(nM());const bP=new class extends qN{requestStruct=hP;responseStruct=pP;async preExecute(e){QM(e,{signerAddress:"address"}),await super.preExecute(e)}async execute(e){return super.execute(e)}async handleRequest(e){const{enableAuthorize:t,typedDataMessage:r,address:n}=e;if(t&&!await async function(e){return await snap.request({method:"snap_dialog",params:{type:ZI.Confirmation,content:_(RN,{...e})}})}({address:n,typedDataMessage:r,chainId:this.network.chainId}))throw new vE;return await TO(this.account.privateKey,r,n)}},gP=qB(eM({address:bM,transactions:JB(IM),transactionsDetail:GB()}),_M,xM),yP=JB(nM());const mP=new class extends qN{requestStruct=gP;responseStruct=yP;async preExecute(e){QM(e,{signerAddress:"address"}),await super.preExecute(e)}async execute(e){return super.execute(e)}async handleRequest(e){const{enableAuthorize:t,transactions:r,address:n}=e;if(t&&!await async function(e){return await snap.request({method:"snap_dialog",params:{type:ZI.Confirmation,content:_(NN,{...e})}})}({senderAddress:n,networkName:this.network.name,chainId:this.network.chainId,transactions:r}))throw new vE;return await kO(this.account.privateKey,r,e.transactionsDetail)}},wP=qB(eM({address:bM,details:NM}),xM),vP=JB(nM());const EP=new class extends qN{requestStruct=wP;responseStruct=vP;async preExecute(e){QM(e,{signerAddress:"address",transaction:"details"}),await super.preExecute(e)}async execute(e){return super.execute(e)}async handleRequest(e){const{details:t}=e;if(!await async function(e){return await snap.request({method:"snap_dialog",params:{type:ZI.Confirmation,content:_(ON,{...e})}})}({senderAddress:t.senderAddress,networkName:this.network.name,chainId:this.network.chainId,declareTransactions:t}))throw new vE;return await BO(this.account.privateKey,t)}},AP=qB(eM({address:bM,typedDataMessage:AM,signature:JB(OB)}),xM),_P=WB();const xP=new class extends qN{requestStruct=AP;responseStruct=_P;async execute(e){return super.execute(e)}async handleRequest(e){const{typedDataMessage:t,address:r,signature:n}=e;return pO(r,this.account.privateKey,t,n)}}({showInvalidAccountAlert:!1}),SP=qB(_M,xM),IP=WB();const kP=new class extends $N{requestStruct=SP;responseStruct=IP;async execute(e){return super.execute(e)}async handleRequest(e){const{enableAuthorize:t,chainId:r}=e,n=new BR;return await n.withTransaction((async e=>{if((await n.getCurrentNetwork(e)).chainId===r)return!0;const a=await n.getNetwork({chainId:r},e);if(!a)throw new bE;if(t&&!await async function(e){return await snap.request({method:"snap_dialog",params:{type:ZI.Confirmation,content:_(LN,{...e})}})}({name:a.name,chainId:a.chainId}))throw new vE;return await n.setCurrentNetwork(a),!0}))}},CP=qB(eM({address:bM}),xM),TP=eM({address:bM,class_hash:nM(),salt:nM(),calldata:JB(nM())});const BP=new class extends qN{requestStruct=CP;responseStruct=TP;async execute(e){return super.execute(e)}async handleRequest(e){const{accountContract:t}=this.account,{deployPayload:{contractAddress:r,classHash:n,addressSalt:a,constructorCalldata:i},cairoVerion:s}=t;if(await t.isDeployed())throw new _E;return{address:r,class_hash:n,salt:a,calldata:i,version:s.toString(10)}}},MP=qB(eM({tokenAddress:bM,tokenName:hM,tokenSymbol:pM,tokenDecimals:tM(cM(QB(),0))}),xM),OP=WB();const RP=new class extends $N{requestStruct=MP;responseStruct=OP;tokenStateMgr;networkStateMgr;constructor(){super(),this.tokenStateMgr=new aP,this.networkStateMgr=new BR}async execute(e){return super.execute(e)}async getNetworkFromChainId(e){const t=await this.networkStateMgr.getNetwork({chainId:e});if(!t)throw new bE;return t}buildErc20Token(e){const{chainId:t,tokenAddress:r,tokenName:n,tokenSymbol:a,tokenDecimals:i}=e;if(function({tokenName:e,tokenSymbol:t,tokenAddress:r,chainId:n}){const a=BigInt(r);return Boolean(qv.preloadTokens.find((r=>(r.name.trim()===e.trim()||r.symbol.trim()===t.trim()||BigInt(r.address)===a)&&DO(r.chainId,n))))}({tokenAddress:r,tokenName:n,tokenSymbol:a,chainId:t}))throw new xE;return{address:r,name:n,symbol:a,decimals:UO(i,18,0),chainId:t}}async handleRequest(e){const{chainId:t}=e,r=this.buildErc20Token(e),n=await this.getNetworkFromChainId(t);if(!await async function(e){return await snap.request({method:"snap_dialog",params:{type:ZI.Confirmation,content:_(FN,{...e})}})}({networkName:n.name,chainId:n.chainId,token:r}))throw new vE;return await this.tokenStateMgr.upsertToken(r),!0}},NP=qB(eM({starkName:PM}),xM),PP=bM;const LP=new class extends zN{requestStruct=NP;responseStruct=PP;networkStateMgr;constructor(){super(),this.networkStateMgr=new BR}async execute(e){return super.execute(e)}async handleRequest(e){const{starkName:t}=e;return await OO(this.network,t)}},FP=qB(eM({transactionHash:dM(OB)}),xM),DP=eM({executionStatus:tM(YB(Object.values(Mp))),finalityStatus:tM(YB(Object.values(Bp)))});const UP=new class extends zN{requestStruct=FP;responseStruct=DP;async execute(e){return super.execute(e)}async handleRequest(e){const{transactionHash:t}=e;return await hO(t,this.network)}},HP=qB(aM({txnsInLastNumOfDays:tM(function(e,t,r={}){const{exclusive:n}=r;return fM(e,"max",(r=>n?r<t:r<=t||`Expected a ${e.type} less than ${n?"":"or equal to "}${t} but received \`${r}\``))}(cM(QB(),1),365)),senderAddress:bM,contractAddress:bM}),xM),jP=JB(YM);const VP=new class extends zN{requestStruct=HP;responseStruct=jP;async execute(e){return super.execute(e)}async handleRequest(e){const{senderAddress:t,contractAddress:r,txnsInLastNumOfDays:n}=e,a=n??qv.transaction.list.txnsInLastNumOfDays,i=lN(this.network);return await i.getTransactions(t,r,a)}},$P=qB(xM,eM({accountName:tM(LM)})),zP=ZM;const qP=new class extends zN{requestStruct=$P;responseStruct=zP;async handleRequest(e){const t=hN(this.network),{accountName:r}=e;return(await t.addAccount({accountName:r})).serialize()}},KP=qB(xM,eM({fromState:tM(WB())})),GP=ZM;const JP=new class extends zN{requestStruct=KP;responseStruct=GP;async handleRequest(e){console.log("GetCurrentAccountRpc",e);const t=hN(this.network);if(e.fromState){const e=new iN,t=await e.getCurrentAccount({chainId:this.network.chainId});if(t)return t}const r=await t.getCurrentAccount();return console.log("GetCurrentAccountRpc() account",r),r.serialize()}},WP=xM,YP=JB(aM(qB(ZM,eM({upgradeRequired:tM(WB()),deployRequired:tM(WB())})).schema));const ZP=new class extends zN{requestStruct=WP;responseStruct=YP;async handleRequest(e){const t=new iN;return await t.findAccounts({chainId:e.chainId})}},XP=qB(xM,eM({address:nM()})),QP=ZM;const eL=new class extends qN{requestStruct=XP;responseStruct=QP;async handleRequest(e){const t=hN(this.network);return await t.switchAccount(this.account),await this.account.serialize()}async verifyAccount(){}},tL=qB(xM,eM({address:bM,accountName:LM})),rL=ZM;const nL=new class extends qN{requestStruct=tL;responseStruct=rL;async handleRequest(e){const{accountName:t}=e,r=new iN,n=await this.account.serialize();return await r.updateAccountByAddress({...n,accountName:t}),{...n,accountName:t}}},aL=eM({recipient:nM(),amount:nM(),memo:tM(nM()),chainId:nM(),address:nM(),instrumentAdmin:nM(),instrumentId:nM()}),iL=eM({command:GB(),preparedTx:GB(),disclosedContracts:GB()});const sL=new class extends qN{requestStruct=aL;responseStruct=iL;async execute(e){return console.log("CreateTransferRpc execute called with params:",e),super.execute(e)}async handleRequest(e){console.log("CreateTransferRpc handleRequest called with params:",e);const{address:t,recipient:r,amount:n,memo:a,instrumentAdmin:i,instrumentId:s}=e,o=await CB.createTransfer(t,r,n,a||"",i,s);return console.log("CreateTransferRpc handleRequest returning transfer..."),o}}({showInvalidAccountAlert:!1}),oL=eM({chainId:nM(),address:nM()}),cL=eM({offers:JB(GB())});const dL=new class extends qN{requestStruct=oL;responseStruct=cL;async execute(e){return console.log("GetOffersRpc execute called with params:",e),super.execute(e)}async handleRequest(e){console.log("GetOffersRpc handleRequest called with params:",e);const{address:t}=e,r=await CB.getOffers(t);return console.log("GetOffersRpc handleRequest returning transfer..."),r}}({showInvalidAccountAlert:!1});async function fL(e){try{const{state:t,keyDeriver:r,requestParams:n,wallet:a}=e,i=n,{signerAddress:s}=i,o=KO(t,i.chainId),{privateKey:c,publicKey:d}=await EO(r,o,t,s);await YO(o,s,d),$v.log(`signDeployAccountTransaction params: ${Kv(i.transaction,2)}}`);const f=function(e,t,r){const n=DE(),a=[];return HO(a,n("network"),t.name),HO(a,n("signerAddress"),e),HO(a,n("transaction"),JSON.stringify(r,null,2)),a}(s,o,i.transaction);if(i.enableAuthorize){const e=DE();if(!await a.request({method:"snap_dialog",params:{type:ZI.Confirmation,content:Sk([rE(e("signTransactionPrompt")),...f])}}))return!1}return await CO(c,i.transaction)}catch(e){throw $v.error("Problem found:",e),e}}var uL;!function(e){e.ButtonClickEvent="ButtonClickEvent",e.FormSubmitEvent="FormSubmitEvent",e.InputChangeEvent="InputChangeEvent",e.FileUploadEvent="FileUploadEvent"}(uL||(uL={}));const lL=W({type:X(),name:Y(X())}),hL=j(lL,W({type:q(uL.ButtonClickEvent),name:Y(X())})),pL=W({name:X(),size:J(),contentType:X(),contents:X()}),bL=j(lL,W({type:q(uL.FormSubmitEvent),value:Z(X(),G(Q([X(),pL,z()]))),name:X()})),gL=j(lL,W({type:q(uL.InputChangeEvent),name:X(),value:Q([X(),z()])})),yL=(Q([hL,bL,gL,j(lL,W({type:q(uL.FileUploadEvent),name:X(),file:G(pL)}))]),`feeTokenSelector_${uL.InputChangeEvent}`);class mL{context;event;eventId;reqStateMgr;networkStateMgr;tokenStateMgr;constructor(e,t,r){this.event=t,this.context=r,this.eventId=e,this.reqStateMgr=new eP,this.networkStateMgr=new BR,this.tokenStateMgr=new aP}async handleEvent(){try{var e,t;const r=null===(e=this.context)||void 0===e?void 0:e.request;if(!await this.reqStateMgr.getTransactionRequest({requestId:null===(t=r)||void 0===t?void 0:t.id}))throw new Error("Transaction request not found");await VN(this.eventId);if(`${this.event.name??""}_${this.event.type}`===yL)await this.handleFeeTokenChange()}catch(e){throw $v.error("onUserInput error:",e),e}}async deriveAccount(e){const t=await async function(){return console.log("getBip44Deriver()"),VS(await snap.request({method:"snap_getBip44Entropy",params:{coinType:6767}}))}(),{addressKey:r}=await kB(t,e);return{publicKey:cy.starkCurve.getStarkKey(r),privateKey:ab.toHex(r)}}feeTokenToTransactionVersion(e){return e===TB.STRK?Mh.TRANSACTION_VERSION.V3:void 0}async getNetwork(e){const t=await this.networkStateMgr.getNetwork({chainId:e});if(!t)throw new Error("Network not found");return t}async getTokenAddress(e,t){const r=await this.tokenStateMgr.getEthToken({chainId:e});if(!r)throw new Error("Token not found");return r.instrumentAdmin}createRollbackSnapshot(e){return{...e,maxFee:e.maxFee,selectedFeeToken:e.selectedFeeToken,includeDeploy:e.includeDeploy,resourceBounds:{...e.resourceBounds}}}async handleFeeTokenChange(){var e;const t=null===(e=this.context)||void 0===e?void 0:e.request,r=this.createRollbackSnapshot(t),{addressIndex:n,calls:a,signer:i,chainId:s}=t,o=this.event.value;try{const e=await this.getNetwork(s),{publicKey:r,privateKey:c}=await this.deriveAccount(n),d=this.feeTokenToTransactionVersion(o),{includeDeploy:f,suggestedMaxFee:u,resourceBounds:l}=await _O(e,i,c,r,[{type:Tp.INVOKE,payload:a.map((e=>({calldata:e.calldata,contractAddress:e.contractAddress,entrypoint:e.entrypoint})))}],{version:d});if(!await async function({feeTokenAddress:e,suggestedMaxFee:t,network:r,address:n,calls:a}){const i=BigInt(await(0,A.getBalance)(n,e,r,Uv.Pending));return a.reduce(((t,r)=>{const{tokenTransferData:n,contractAddress:a}=r;return n&&a===e?t+BigInt(n.amount):t}),BigInt(t))<=i}({address:i,network:e,calls:a,feeTokenAddress:await this.getTokenAddress(e.chainId,o),suggestedMaxFee:u}))throw new SE;t.maxFee=u,t.selectedFeeToken=o,t.includeDeploy=f,t.resourceBounds=l,await jN(this.eventId,t),await this.reqStateMgr.upsertTransactionRequest(t)}catch(e){const t=e instanceof SE?`Not enough ${o} to pay for fee, switching back to ${r.selectedFeeToken}`:`Failed to calculate the fees, switching back to ${r.selectedFeeToken}`;await jN(this.eventId,r,{errors:{fees:t}})}}}async function wL(e){try{var t;const{state:r,wallet:n,saveMutex:a,keyDeriver:i,requestParams:s}=e,o=s,{contractAddress:c}=o,{chainId:d}=o;if(!c)throw new Error(`The given contract address need to be non-empty string, got: ${Kv(o)}`);try{(0,A.validateAndParseAddress)(c)}catch(e){throw new Error(`The given contract address is invalid: ${c}`)}const f=KO(r,d);if(!await AO(f,c))throw new Error("Contract has not deployed");if(!await xO(f,c))throw new Error("Upgrade is not required");const{privateKey:u}=await EO(i,f,r,c),l=fE.Upgrade,h=sy.compile({implementation:Bv,calldata:[0]}),p={contractAddress:c,entrypoint:l,calldata:h};let b=o.maxFee?ab.toBigInt(o.maxFee):Mh.ZERO;if(b===Mh.ZERO){const e=await oO(f,c,u,p,Dv);b=ab.toBigInt(e.suggestedMaxFee.toString(10)??"0")}const g=jO(r,c,l,0),y=DE();if(!await n.request({method:"snap_dialog",params:{type:ZI.Confirmation,content:Sk([rE(y("signTransactionPrompt")),...g])}}))return!1;$v.log(`sendTransaction:\ntxnInvocation: ${Kv(p)}\nmaxFee: ${b.toString()}}`);const m=await dO(f,c,u,p,void 0,{maxFee:b},Dv);if($v.log(`sendTransaction:\ntxnResp: ${Kv(m)}`),!(null===(t=m)||void 0===t?void 0:t.transaction_hash))throw new Error("Transaction hash is not found");const w=MR({txnHash:m.transaction_hash,senderAddress:c,chainId:f.chainId,maxFee:b.toString(10),calls:[p],txnVersion:1});return await async function(e,t,r,n){return r.runExclusive((async()=>{n||(n=await LO(t));const r=GO(n,e.txnHash,e.chainId);if(void 0===r)n.transactions||(n.transactions=[]),n.transactions.push(e);else{if(Kv(r)===Kv(e))return void $v.log(`upsertTransaction: same transaction and hence skip calling snap state update: ${Kv(r)}`);r.status=e.status,r.executionStatus=e.executionStatus,r.finalityStatus=e.finalityStatus,r.failureReason=e.failureReason,r.timestamp=e.timestamp}await FO(t,n)}))}(w,n,a),m}catch(e){throw $v.error("Problem found:",e),e}}var vL;!function(e){e.GetPreferences="canton_getPreferences",e.ExtractPublicKey="canton_extractPublicKey",e.GetCurrentNetwork="canton_getCurrentNetwork",e.GetStoredNetworks="canton_getStoredNetworks",e.SwitchNetwork="canton_switchNetwork",e.AddErc20Token="canton_addErc20Token",e.RecoverAccounts="canton_recoverAccounts",e.ExecuteTxn="canton_executeTxn",e.DeclareContract="canton_declareContract",e.GetDeploymentData="canton_getDeploymentData",e.CreateTransfer="canton_createTransfer",e.SignMessage="canton_signMessage",e.SignTransaction="canton_signTransaction",e.SignDeclareTransaction="canton_signDeclareTransaction",e.SignDeployAccountTransaction="canton_signDeployAccountTransaction",e.GetCurrentAccount="canton_getCurrentAccount",e.ListAccounts="canton_listAccounts",e.SetAccountName="canton_setAccountName",e.SwitchAccount="canton_switchAccount",e.AddAccount="canton_addAccount",e.CreateAccount="canton_createAccount",e.DisplayPrivateKey="canton_displayPrivateKey",e.GetErc20TokenBalance="canton_getErc20TokenBalance",e.GetAllBalances="canton_getAllBalances",e.GetTransactionStatus="canton_getTransactionStatus",e.EstimateFee="canton_estimateFee",e.VerifySignedMessage="canton_verifySignedMessage",e.DeployAccount="canton_deployAccount",e.GetTransactions="canton_getTransactions",e.UpgradeAccContract="canton_upgradeAccContract",e.GetAddressByStarkName="canton_getAddrFromStarkName",e.ReadContract="canton_getValue",e.GetStoredErc20Tokens="canton_getStoredErc20Tokens",e.Ping="ping",e.GetOffers="canton_getOffers"}(vL||(vL={}));const EL=[vL.ExtractPublicKey,vL.ListAccounts,vL.GetCurrentNetwork,vL.GetStoredNetworks,vL.SwitchNetwork,vL.AddErc20Token,vL.RecoverAccounts,vL.ExecuteTxn,vL.DeclareContract,vL.GetDeploymentData,vL.SignMessage,vL.SignTransaction,vL.SignDeclareTransaction,vL.SignDeployAccountTransaction,vL.CreateAccount,vL.GetCurrentAccount,vL.DisplayPrivateKey,vL.GetErc20TokenBalance,vL.GetAllBalances,vL.GetTransactionStatus,vL.EstimateFee,vL.VerifySignedMessage,vL.Ping,vL.CreateTransfer,vL.GetOffers],AL=EL.concat([vL.GetPreferences,vL.DeployAccount,vL.GetTransactions,vL.UpgradeAccContract,vL.GetAddressByStarkName,vL.ReadContract,vL.GetStoredErc20Tokens,vL.AddAccount,vL.SwitchAccount,vL.SetAccountName]),_L=new Set(EL),xL=new Set(AL),SL=["http://localhost:3000","https://snaps.consensys.io","https://dev.snaps.consensys.io","https://staging.snaps.consensys.io","http://ccsnap.io.s3-website.us-east-2.amazonaws.com/"],IL=new Map([]);for(const e of SL)IL.set(e,xL);IL.set("*",_L),$v.logLevel=parseInt(qv.logLevel,10);const kL=(e,t)=>{const r=Mt().decodeBase64(t);return Mt().encodeBase64(Tt().sign.detached(Mt().decodeBase64(e),r))},CL=async({origin:e,request:t})=>{var r;await LE(),console.log("onRpcRequest() called with request:",t);const n=null===(r=t)||void 0===r?void 0:r.params;$v.log(`${t.method}:\nrequestParams: ${Kv(n)}`);try{if(function(e,t){var r,n;if(!e)throw new vt("Origin not found");if(!(null===(r=IL.get(e))||void 0===r?void 0:r.has(t))&&!(null===(n=IL.get("*"))||void 0===n?void 0:n.has(t)))throw new vt("Permission denied")}(e,t.method),"ping"===t.method)return $v.log("pong"),"pong";let r=await Tk();r||(r={accContracts:[],erc20Tokens:[],networks:[],transactions:[]},await Bk(r));const a=RE();await async function(e,t,r,n){return r.runExclusive((async()=>{n||(n=await LO(t));const r=zO(n,e.chainId);if(void 0===r)n.networks||(n.networks=[]),n.networks.push(e);else{if(Kv(r)===Kv(e))return void $v.log(`upsertNetwork: same network and hence skip calling snap state update: ${Kv(r)}`);r.name=e.name,r.baseUrl=e.baseUrl,r.nodeUrl=e.nodeUrl,r.voyagerUrl=e.voyagerUrl}await FO(t,n)}))}(Mv,snap,a,r),console.log("onRpcRequest removing networks..."),await async function(e,t,r,n){return r.runExclusive((async()=>{n||(n=await LO(t)),n.currentNetwork&&DO(n.currentNetwork.chainId,e.chainId)&&(n.currentNetwork=void 0),zO(n,e.chainId)&&(n.networks=n.networks.filter((t=>!DO(t.chainId,e.chainId))),await FO(t,n))}))}(Ov,snap,a,r),console.log("onRpcRequest inserting tokens...");for(const e of Nv)await qO(e,snap,a,r);const i={state:r,requestParams:n,wallet:snap,saveMutex:a};switch(console.log("onRpcRequest method",t.method),t.method){case vL.GetPreferences:{const{locale:e}=await snap.request({method:"snap_getPreferences"});return{locale:e}}case vL.CreateAccount:case vL.DeployAccount:return i.keyDeriver=await kk(),await XO(i);case vL.ListAccounts:return await ZP.execute(n);case vL.DisplayPrivateKey:return await JN.execute(i.requestParams);case vL.ExtractPublicKey:return i.keyDeriver=await kk(),await async function(e){try{var t;const{state:r,keyDeriver:n,requestParams:a}=e,i=a,{userAddress:s}=i,o=KO(r,i.chainId);if(!i.userAddress)throw new Error(`The given user address need to be non-empty string, got: ${Kv(i.userAddress)}`);try{(0,A.validateAndParseAddress)(i.userAddress)}catch(e){throw new Error(`The given user address is invalid: ${i.userAddress}`)}const{publicKey:c}=await EO(n,o,r,s);let d;await YO(o,s,c,!1);const f=VO(r,s,o.chainId);return(null===(t=f)||void 0===t?void 0:t.publicKey)&&ab.toBigInt(f.publicKey)!==Mh.ZERO?d=f.publicKey:($v.log(`extractPublicKey: User address cannot be found or the signer public key is 0x0: ${s}`),d=c),$v.log(`extractPublicKey:\nuserPublicKey: ${d}`),d}catch(e){throw $v.error("Problem found:",e),e}}(i);case vL.CreateTransfer:return await sL.execute(i.requestParams);case vL.GetOffers:return await dL.execute(i.requestParams);case vL.SignMessage:return await bP.execute(i.requestParams);case vL.SignTransaction:return i.keyDeriver=await kk(),await mP.execute(i.requestParams);case vL.SignDeclareTransaction:return await EP.execute(i.requestParams);case vL.SignDeployAccountTransaction:return i.keyDeriver=await kk(),await fL(i);case vL.VerifySignedMessage:return await xP.execute(i.requestParams);case vL.GetErc20TokenBalance:return await async function(e){try{const{state:t,requestParams:r}=e,n=r;if(console.log("getErc20TokenBalance() requestParamsObj:",n),!n.tokenAddress||!n.userAddress)throw new Error(`The given token address and user address need to be non-empty string, got: ${Kv(n)}`);const a=n.tokenAddress,{userAddress:i}=n,s=KO(t,n.chainId);$v.log(`getErc20Balance:\nerc20Address: ${a}\nuserAddress: ${i}`);const o={balance:(await CB.getBalance(i,a,s)).balance};return $v.log(`getErc20Balance:\nresp: ${Kv(o)}`),o}catch(e){throw $v.error("Problem found:",e),e}}(i);case vL.GetAllBalances:return await async function(e){try{const{state:t,requestParams:r}=e,n=r;if(console.log("getAllBalances() requestParamsObj:",n),!n.userAddress)throw new Error(`The given user address need to be non-empty string, got: ${Kv(n)}`);const{userAddress:a}=n,i=KO(t,n.chainId);$v.log(`getAllBalances:\nuserAddress: ${a}`);const s=await CB.getAllBalances(a,i);return $v.log(`getAllBalances:\nresp: ${Kv(s)}`),{partyId:s.partyId,balances:s.balances.map((e=>(e.instrument.chainId=n.chainId,{instrument:e.instrument,balance:e.balance.toString()})))}}catch(e){throw $v.error("Problem found:",e),e}}(i);case vL.GetTransactionStatus:return await UP.execute(i.requestParams);case vL.ReadContract:return await async function(e){try{const{state:t,requestParams:r}=e,n=r;if(!n.contractAddress||!n.contractFuncName)throw new Error(`The given contract address and function name need to be non-empty string, got: ${Kv(n)}`);try{(0,A.validateAndParseAddress)(n.contractAddress)}catch(e){throw new Error(`The given contract address is invalid: ${n.contractAddress}`)}const{contractAddress:a}=n,{contractFuncName:i}=n,s=rO(n.contractCallData),o=KO(t,n.chainId),c=await iO(o,a,i,ab.bigNumberishArrayToDecimalStringArray(s));return $v.log(`getValue:\nresp: ${Kv(c)}`),c}catch(e){throw $v.error("Problem found:",e),e}}(i);case vL.EstimateFee:try{return await ZN.execute(i.requestParams)}catch(e){throw console.error("onRpcRequest EstimateFee error",e),e}case vL.AddErc20Token:return await RP.execute(i.requestParams);case vL.GetStoredErc20Tokens:return await eR(i);case vL.SwitchNetwork:return await kP.execute(i.requestParams);case vL.GetCurrentNetwork:return await QO(i);case vL.GetStoredNetworks:return await async function(e){try{const{state:t}=e,r=function(e){return e.networks}(t);return $v.log(`getStoredNetworks: networks:\n${Kv(r,2)}`),r}catch(e){throw $v.error("Problem found:",e),e}}(i);case vL.GetTransactions:return await VP.execute(i.requestParams);case vL.RecoverAccounts:return i.keyDeriver=await kk(),await async function(e){try{const{state:t,wallet:r,saveMutex:n,keyDeriver:a,requestParams:i}=e,s=i,o=UO(s.startScanIndex,0,0),c=UO(s.maxScanned,1,1),d=UO(s.maxMissed,1,1),f=KO(t,s.chainId);$v.log(`recoverAccounts:\nstartIndex: ${o}, maxScanned: ${c}, maxMissed: ${d}`);let u=o,l=0;const h=[];for(;u<o+c&&l<d;){const{publicKey:e,addressIndex:i,derivationPath:s}=await vO(a,f.chainId,t,u),{address:o,signerPubKey:c,upgradeRequired:d,deployRequired:p}=await IO(f,e);$v.log(`recoverAccounts: index ${u}:\ncontractAddress = ${o}\npublicKey = ${e}\nisUpgradeRequired = ${d}`),c?($v.log(`recoverAccounts: index ${u}:\ncontractAddress = ${o}\n`),ab.toBigInt(c)===ab.toBigInt(e)&&$v.log(`recoverAccounts: index ${u} matched\npublicKey: ${e}`),l=0):l+=1;const b={addressSalt:e,publicKey:c,address:o,addressIndex:i,derivationPath:s,deployTxnHash:"",chainId:f.chainId,upgradeRequired:d,deployRequired:p};$v.log(`recoverAccounts: index ${u}\nuserAccount: ${Kv(b)}`),await $O(b,r,n),h.push(b),u+=1}return $v.log(`recoverAccounts:\nscannedAccounts: ${Kv(h,2)}`),h}catch(e){throw $v.error("Problem found:",e),e}}(i);case vL.ExecuteTxn:return await oP.execute(i.requestParams);case vL.UpgradeAccContract:return i.keyDeriver=await kk(),wL(i);case vL.DeclareContract:return await lP.execute(i.requestParams);case vL.GetDeploymentData:return await BP.execute(i.requestParams);case vL.GetAddressByStarkName:return await LP.execute(i.requestParams);case vL.AddAccount:return await qP.execute(n);case vL.GetCurrentAccount:return console.log("RpcMethod.GetCurrentAccount"),await JP.execute(n);case vL.SwitchAccount:return await eL.execute(n);case vL.SetAccountName:return await nL.execute(n);default:throw new lt}}catch(e){let t=e;throw console.error(e),function(e){return[it,lt,At,ht,pt,bt,gt,yt,mt,wt,vt,Et,ot,ct,dt,ft,ut].some((t=>e instanceof t))}(e)||(t=new AE("Unable to execute the rpc request")),$v.error(`onRpcRequest error: ${JSON.stringify(t.toJSON(),null,2)}`),t}},TL=async()=>{await LE();const e=DE();await AR(x(St,{children:[_(It,{children:e("walletIsCompatible")}),x(It,{children:[e("accountManagementIntro")," ",_(kt,{href:PO(),children:e("companionDapp")}),"."]})]}))},BL=async()=>{await LE();const e=DE();await AR(x(St,{children:[_(It,{children:e("snapIsUpToDate")}),x(It,{children:[e("accountManagementReminder")," ",_(kt,{href:PO(),children:e("companionDapp")}),"."]})]}))},ML=async()=>(await LE(),await pN.execute()),OL=async({id:e,event:t,context:r})=>{const n=new mL(e,t,r);await n.handleEvent()}})();var s=exports;for(var o in i)s[o]=i[o];i.__esModule&&Object.defineProperty(s,"__esModule",{value:!0})})();
|
|
2
|
+
//# sourceMappingURL=bundle.js.map
|